Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hipska committed Oct 29, 2013
2 parents 406aaac + dc05117 commit f69906b
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ In order to get this plugin running, applying patches to the plugins Autom8 and
Run following commands from plugins directory:

```shell
patch --dry-run -d autom8/ < autom8reportit/autom8_v035.patch
patch --dry-run -d reportit/ < autom8reportit/reportit_v075a.patch
patch --dry-run -N -d autom8/ -i autom8reportit/autom8_v035.patch
patch --dry-run -d reportit/ -i autom8reportit/reportit_v075a.patch
```

If everything looks ok, you can omit the `--dry-run` option and run the commands again to actually do the patches.
**Note:** The patch autom8_v035.patch might warn you about reverting patches if you have done this patch already for the plugin [Autom8-Thold](https://github.com/Super-Visions/cacti-plugin-autom8thold/). In this case, you can ignore this patch as it is alread done, you still need to run the patch for Reportit plugin.
**Note:** The patch autom8_v035.patch might warn you about reverting patches if you have done this patch already for the plugin [Autom8-Thold](https://github.com/Super-Visions/cacti-plugin-autom8thold/). In this case, you can ignore this patch as it is already done, you still need to run the patch for Reportit plugin.
7 changes: 5 additions & 2 deletions autom8_utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function display_ds_list($rule) {

$page = (int) get_request_var_request('dspage');
$per_page = (int) read_config_option('num_rows_data_source');
$debug = (int) get_request_var_request('debug_sql', 0);

// extra validation
if($page < 1) $page = 1;
Expand Down Expand Up @@ -69,12 +70,12 @@ function display_ds_list($rule) {
LEFT JOIN reportit_data_items AS rdi
ON( dtd.local_data_id = rdi.id AND rdi.report_id = %d )
JOIN data_local AS dl
ON( dl.id = dtd.local_data_id )
ON( dl.id = dtd.local_data_id AND dl.snmp_query_id = %d )
JOIN ' . $database_idquote . 'host' . $database_idquote .'
ON( host.id = dl.host_id )
JOIN host_template
ON ( host.host_template_id = host_template.id )
', $report['id'] );
', $report['id'], $rule['snmp_query_id'] );

// build SQL query SELECT part
$sql_select = '
Expand Down Expand Up @@ -108,6 +109,8 @@ function display_ds_list($rule) {
$ds_list_sql = 'SELECT ' . $sql_select . 'FROM ' . $sql_from . 'WHERE ' . $sql_where . 'ORDER BY dtd.name_cache ASC LIMIT ' . $per_page . ' OFFSET ' . ($page-1)*$per_page . ';';
$ds_list = db_fetch_assoc($ds_list_sql, false);

if($debug > 0) echo '<pre>'.print_r ($ds_list_sql, true).'</pre>';

// display items
html_start_box('<strong>Data Query</strong> [' . $snmp_query['name'] . ']', '100%', $colors['header'], 3, 'center', '');

Expand Down
66 changes: 57 additions & 9 deletions autom8_v035.patch
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,56 @@ diff -ru v035/autom8_actions.php custom/autom8_actions.php
?>
diff -ru v035/autom8_functions.php custom/autom8_functions.php
--- v035/autom8_functions.php 2010-12-12 11:08:35.000000000 +0100
+++ custom/autom8_functions.php 2013-07-31 14:59:10.000000000 +0200
@@ -176,7 +176,7 @@
+++ custom/autom8_functions.php 2013-10-18 14:43:54.000000000 +0200
@@ -26,9 +26,10 @@

if (read_config_option("autom8_graphs_enabled") == '') {
autom8_log(__FUNCTION__ . " Host[" . $data["host_id"] . "] - skipped: Graph Creation Switch is: " . (read_config_option("autom8_graphs_enabled") == "" ? "off" : "on") . " data query: " . $data["snmp_query_id"], false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
- return;
+ return $data;
}
execute_data_query($data);
+ return $data;
}


@@ -43,9 +44,10 @@

if (read_config_option("autom8_graphs_enabled") == '') {
autom8_log(__FUNCTION__ . " Host[" . $data["host_id"] . "] - skipped: Graph Creation Switch is: " . (read_config_option("autom8_graphs_enabled") == "" ? "off" : "on") . " graph template: " . $data["graph_template_id"], false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
- return;
+ return $data;
}
execute_graph_template($data);
+ return $data;
}


@@ -60,9 +62,10 @@

if (read_config_option("autom8_tree_enabled") == '') {
autom8_log(__FUNCTION__ . " Host[" . $data["id"] . "] - skipped: Tree Creation Switch is: " . (read_config_option("autom8_tree_enabled") == "" ? "off" : "on"), false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
- return;
+ return $data;
}
execute_device_create_tree($data);
+ return $data;
}


@@ -77,9 +80,10 @@

if (read_config_option("autom8_tree_enabled") == '') {
autom8_log(__FUNCTION__ . " Graph[" . $data["id"] . "] - skipped: Tree Creation Switch is: " . (read_config_option("autom8_tree_enabled") == "" ? "off" : "on"), false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
- return;
+ return $data;
}
execute_graph_create_tree($data);
+ return $data;
}

/**
@@ -176,7 +180,7 @@
AND graph_templates_item.task_item_id = data_template_rrd.id
LIMIT 1");

Expand All @@ -112,7 +160,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
return;
}else{
# input fields are not supported
@@ -194,7 +194,7 @@
@@ -194,7 +198,7 @@
}
}

Expand All @@ -121,7 +169,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
}


@@ -408,6 +408,9 @@
@@ -408,6 +412,9 @@
$graph_template_id = db_fetch_cell("SELECT graph_template_id FROM snmp_query_graph WHERE id=" . $rule["graph_type_id"]);
autom8_log(__FUNCTION__ . " Host[" . $host_id . "] - graph template: $graph_template_id", false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);

Expand All @@ -131,7 +179,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
foreach ($snmp_query_indexes as $snmp_index) {
$snmp_query_array["snmp_index"] = $snmp_index["snmp_index"];
autom8_log(__FUNCTION__ . " Host[" . $host_id . "] - checking index: " . $snmp_index["snmp_index"], false, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
@@ -425,7 +428,8 @@
@@ -425,7 +432,8 @@

$existsAlready = db_fetch_cell($sql);
if (isset($existsAlready) && $existsAlready > 0) {
Expand All @@ -141,7 +189,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
continue;
}

@@ -451,11 +455,14 @@
@@ -451,11 +459,14 @@
}
}

Expand All @@ -157,7 +205,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php

}
}
@@ -593,7 +600,7 @@
@@ -593,7 +604,7 @@
$host_id, $rule["host_grouping_type"], $item["sort_type"], $propagate);

if (isset($new_item) && $new_item > 0) {
Expand All @@ -166,7 +214,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
} else {
autom8_log(__FUNCTION__ . " WARNING: Parent[" . $parent_tree_item_id . "] Tree Item not added", false, "AUTOM8");
}
@@ -625,7 +632,7 @@
@@ -625,7 +636,7 @@
$host_id, $rule["host_grouping_type"], $sort_type, $propagate);

if (isset($new_item) && $new_item > 0) {
Expand All @@ -175,7 +223,7 @@ diff -ru v035/autom8_functions.php custom/autom8_functions.php
} else {
autom8_log(__FUNCTION__ . " WARNING: Host[" . $host_id . "] Tree Item not added", false, "AUTOM8");
}
@@ -657,7 +664,7 @@
@@ -657,7 +668,7 @@
$host_id, $rule["host_grouping_type"], $sort_type, $propagate);

if (isset($new_item) && $new_item > 0) {
Expand Down
14 changes: 7 additions & 7 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function plugin_autom8reportit_version() {
function autom8reportit_version() {
return array(
'name' => 'Autom8-Reportit',
'version' => '1.0.2',
'version' => '1.1.0',
'longname' => 'Automate add/remove DS on reports',
'author' => 'Thomas Casteleyn',
'email' => 'thomas.casteleyn@super-visions.com',
Expand Down Expand Up @@ -181,8 +181,8 @@ function autom8reportit_config_form () {
FROM snmp_query sq
JOIN snmp_query_graph sqg
ON (sqg.snmp_query_id = sq.id)
JOIN snmp_query_graph_rrd_sv sqgrs
ON (sqgrs.snmp_query_graph_id = sqg.id )
JOIN snmp_query_graph_rrd sqgr
ON (sqgr.snmp_query_graph_id = sqg.id )
JOIN reportit_templates rt
USING(data_template_id)
JOIN reportit_reports rr
Expand Down Expand Up @@ -305,12 +305,12 @@ function autom8reportit_data_source_action($selected_items){
LEFT JOIN reportit_data_items AS rdi
ON( dtd.local_data_id = rdi.id AND rdi.report_id = %d )
JOIN data_local AS dl
ON( dl.id = dtd.local_data_id )
ON( dl.id = dtd.local_data_id AND dl.snmp_query_id = %d )
JOIN ' . $database_idquote . 'host' . $database_idquote .'
ON( host.id = dl.host_id )
JOIN host_template
ON ( host.host_template_id = host_template.id )
', $report_rule['report_id'] );
', $report_rule['report_id'], $report_rule['snmp_query_id'] );

// build SQL query SELECT part
$sql_select = '
Expand Down Expand Up @@ -433,12 +433,12 @@ function autom8reportit_autorrdlist($report_settings){
LEFT JOIN reportit_data_items AS rdi
ON( dtd.local_data_id = rdi.id AND rdi.report_id = %d )
JOIN data_local AS dl
ON( dl.id = dtd.local_data_id )
ON( dl.id = dtd.local_data_id AND dl.snmp_query_id = %d )
JOIN ' . $database_idquote . 'host' . $database_idquote .'
ON( host.id = dl.host_id )
JOIN host_template
ON ( host.host_template_id = host_template.id )
', $report_rule['report_id'] );
', $report_rule['report_id'], $report_rule['snmp_query_id'] );

// build SQL query SELECT part
$sql_select = '
Expand Down

0 comments on commit f69906b

Please sign in to comment.