Autom8 Not Greying out

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Autom8 Not Greying out

Post by msw1970 »

Hi

We have 2 cacti servers installed on different networks.... One is running cacti 0.8.7e with PIA 2.5 and the other is 0.8.7g with PIA 2.9.

I have a number of identical autom8 templates configured on both boxes... On the 0.8.7e installation the graph rules work correctly and autom8 creates graphs from the templates and greys out graphs that already exist when showing matching graphs. However, on 0.8.7g they don't grey out and autom8 doesn't appear to create any graphs..

The 0.8.7e box is running autom8 version 0.33 and the 0.8.7g box is running autom8 version 0.35.

Any clues as to why things don't work the same on both boxes??
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Autom8 Not Greying out

Post by gandalf »

I just answered to a similar question with an SVN commit:

Code: Select all

Author: gandalf
Date: 2011-05-23 08:38:32 -0400 (Mon, 23 May 2011)
New Revision: 1587

Modified:
   autom8/trunk/README
   autom8/trunk/autom8_graph_rules.php
   autom8/trunk/autom8_tree_rules.php
   autom8/trunk/autom8_utilities.php
   autom8/trunk/setup.php
Log:
use valid color names to lowlight existing graphs
some warnings fixed

Modified: autom8/trunk/README
===================================================================
--- autom8/trunk/README	2011-05-21 14:20:31 UTC (rev 1586)
+++ autom8/trunk/README	2011-05-23 12:38:32 UTC (rev 1587)
@@ -4,7 +4,7 @@
     Contact ........ gandalf@cacti.net
     Home Site ...... http://www.cacti.net
     Program ........ Cacti Automation
-    Version ........ 0.35
+    Version ........ 0.35-1
     Purpose ........ Perform Rule based Automation Tasks
 
 *******************************************************************************/
@@ -102,6 +102,7 @@
 ----[ Changelog
    --- SVN ---
     - fix:     catch errors in case no datasource is created for a broken graph
+    - fix:     use valid color names to lowlight existing graphs
     
    --- 0.35 ---
     - fix:     change input type='image' to 'button'

Modified: autom8/trunk/autom8_graph_rules.php
===================================================================
--- autom8/trunk/autom8_graph_rules.php	2011-05-21 14:20:31 UTC (rev 1586)
+++ autom8/trunk/autom8_graph_rules.php	2011-05-23 12:38:32 UTC (rev 1587)
@@ -121,7 +121,7 @@
 		input_validate_input_number(get_request_var_post("id"));
 		input_validate_input_number(get_request_var_post("item_id"));
 		/* ==================================================== */
-		unset($save);
+		$save = array();
 		$save["id"] = form_input_validate($_POST["item_id"], "item_id", "^[0-9]+$", false, 3);
 		$save["rule_id"] = form_input_validate($_POST["id"], "id", "^[0-9]+$", false, 3);
 		$save["sequence"] = form_input_validate($_POST["sequence"], "sequence", "^[0-9]+$", false, 3);

Modified: autom8/trunk/autom8_tree_rules.php
===================================================================
--- autom8/trunk/autom8_tree_rules.php	2011-05-21 14:20:31 UTC (rev 1586)
+++ autom8/trunk/autom8_tree_rules.php	2011-05-23 12:38:32 UTC (rev 1587)
@@ -120,7 +120,7 @@
 		input_validate_input_number(get_request_var_post("id"));
 		input_validate_input_number(get_request_var_post("item_id"));
 		/* ==================================================== */
-		unset($save);
+		$save = array();
 		$save["id"] = form_input_validate($_POST["item_id"], "item_id", "^[0-9]+$", false, 3);
 		$save["rule_id"] = form_input_validate($_POST["id"], "id", "^[0-9]+$", false, 3);
 		$save["rule_type"] = AUTOM8_RULE_TYPE_TREE_MATCH;
@@ -196,7 +196,7 @@
 		$selected_items = unserialize(stripslashes($_POST["selected_items"]));
 
 		if ($_POST["drp_action"] == AUTOM8_ACTION_TREE_DELETE) { /* delete */
-			autom8_log("form_actions delete: " . $selected_items[$i], true, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
+			autom8_log("form_actions delete: " . serialize($selected_items), true, "AUTOM8 TRACE", POLLER_VERBOSITY_MEDIUM);
 			db_execute("delete from plugin_autom8_tree_rules where " . array_to_sql_or($selected_items, "id"));
 			db_execute("delete from plugin_autom8_tree_rule_items where " . array_to_sql_or($selected_items, "rule_id"));
 			db_execute("delete from plugin_autom8_match_rule_items where " . array_to_sql_or($selected_items, "rule_id"));

Modified: autom8/trunk/autom8_utilities.php
===================================================================
--- autom8/trunk/autom8_utilities.php	2011-05-21 14:20:31 UTC (rev 1586)
+++ autom8/trunk/autom8_utilities.php	2011-05-23 12:38:32 UTC (rev 1587)
@@ -637,7 +637,7 @@
 	$created_graphs = get_created_graphs($rule);
 	#print "<pre>Created Graphs: <br>"; print_r($created_graphs); print "</pre>";
 
-	unset($total_rows);
+	$total_rows = 0;
 	$num_input_fields = 0;
 	$num_visible_fields = 0;
 	$row_limit = read_config_option("num_rows_device");
@@ -823,9 +823,9 @@
 
 				# mark rows
 				if (isset($created_graphs{$row["host_id"]}{$row["snmp_index"]})) {
-					$style = ' style="color:999999"';
+					$style = ' style="color: grey"';
 				} else {
-					$style = ' style="color:000000"';
+					$style = ' style="color: black"';
 				}
 				$column_counter = 0;
 				reset($xml_array["fields"]);

Modified: autom8/trunk/setup.php
===================================================================
--- autom8/trunk/setup.php	2011-05-21 14:20:31 UTC (rev 1586)
+++ autom8/trunk/setup.php	2011-05-23 12:38:32 UTC (rev 1587)
@@ -184,7 +184,7 @@
 function autom8_version () {
 
 	return array( 'name' 	=> 'autom8',
-				'version' 	=> '0.35',
+				'version' 	=> '0.35-1',
 				'longname'	=> 'Automate Cacti Tasks',
 				'author'	=> 'Reinhard Scheck',
 				'homepage'	=> 'http://docs.cacti.net/plugin:autom8',


The "style" lines are related. Or you're facing a different issue. The patch has not been release yet, only SVN
R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Autom8 Not Greying out

Post by hid3 »

Where can I find the SVN? Could you please post a link to it? Thanks.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Autom8 Not Greying out

Post by gandalf »

See cacti main web page: http://svn.cacti.net
R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Autom8 Not Greying out

Post by hid3 »

Sad but I can't find Autom8 there :(

I have the same problem - already existing graphs are not greying out...
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Autom8 Not Greying out

Post by hid3 »

Nevermind, looks like I fixed the problem by changing the code manually
galco
Cacti User
Posts: 63
Joined: Fri Aug 03, 2007 3:09 am
Location: Barcelona, Catalunya

Re: Autom8 Not Greying out

Post by galco »

Hello,

I'm the other one person who found this problem. Until today, I could try the solution proposed by gandalf

At first I neither couldn't find the svn. For next time:

svn checkout svn://svn.cacti.net/cacti_plugins/autom8/trunk

Thanks gandalf, it works like a charm
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests