Autom8 V0.31 [Nov, 20 2009]

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I'm sorry, but I just downloaded from 3rd link of my sig and find

Code: Select all

--- host.php	2009-11-20 23:18:46.000000000 +0100
+++ ../cacti-0.8.7e-orig/host.php	2009-06-28 18:07:11.000000000 +0200
@@ -137,7 +137,6 @@
 		/* ==================================================== */
 
 		db_execute("replace into host_graph (host_id,graph_template_id) values (" . $_POST["id"] . "," . $_POST["graph_template_id"] . ")");
-		api_plugin_hook_function('add_graph_template_to_host', array("host_id" => $_POST["id"], "graph_template_id" => $_POST["graph_template_id"]));
 
 		header("Location: host.php?action=edit&id=" . $_POST["id"]);
 		exit;
R.
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

I am sending what I have in my host.php.patch:

Code: Select all

diff -Nabur cacti-0.8.7e/cli/host.php plugin087e/cli/host.php
--- cacti-0.8.7e/cli/host.php   2009-11-20 23:18:46.000000000 +0100
+++ plugin087e/cli/host.php     2009-06-28 18:07:11.000000000 +0200
@@ -137,7 +137,6 @@
                /* ==================================================== */
 
                db_execute("replace into host_graph (host_id,graph_template_id) values (" . $_POST["id"] . "," . $_POST["graph_template_id"] . ")");
-               api_plugin_hook_function('add_graph_template_to_host', array("host_id" => $_POST["id"], "graph_template_id" => $_POST["graph_template_id"]));
 
                header("Location: host.php?action=edit&id=" . $_POST["id"]);
                exit;
I've double checked it.
Cacti user
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The contents I've posted above is correct.
And again, I've downloaded v0.31 from http://docs.cacti.net/plugin:autom8 and verified headers of both versions for 087d and 087e and did not find anything unusual. Is it possible, that your file stems from an older version of the plugin?

I'm out of ideas now
R.
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

Never mind, the important is that everything is OK.
Cacti user
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

explanation

Post by zorrosam »

Hi gandalf,

can i have a quick explanation regarding the procedure for configure an automatic creation of the host in my tree folder?

thanks

zorro
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yes. Read the PDF manual provided
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

terziyski wrote:Gandalf,

I think there is a problem with host.php.patch from paches-087e:
in file header it looks for /cli/host.php , but this file suppose to be in cacti main folder as it is in patches-087d.
Correct me if I am wrong.
Finally, I found the issue and fixed it. Thanks for posting
R.
rinsan
Posts: 9
Joined: Thu Feb 25, 2010 3:38 am

More SQL errors

Post by rinsan »

I got the following errors and it seems that "output_type" needs quotes.

Code: Select all

02/25/2010 09:29:00 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=24 AND data_local.host_id=18 AND data_local.snmp_query_id=11 AND data_local.snmp_index='1'"
02/25/2010 09:28:58 AM - AUTOM8: Poller[0] Host[18] Graph Added - graph-id: (672) - data-source-ids: (675, 675)
02/25/2010 09:28:58 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=23 AND data_local.host_id=18 AND data_local.snmp_query_id=10 AND data_local.snmp_index='2'"
02/25/2010 09:28:58 AM - AUTOM8: Poller[0] Host[18] Graph Added - graph-id: (671) - data-source-ids: (674, 674)
02/25/2010 09:28:58 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=23 AND data_local.host_id=18 AND data_local.snmp_query_id=10 AND data_local.snmp_index='16'"
02/25/2010 09:28:58 AM - AUTOM8: Poller[0] Host[18] Graph Added - graph-id: (670) - data-source-ids: (673, 673)
02/25/2010 09:28:58 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=23 AND data_local.host_id=18 AND data_local.snmp_query_id=10 AND data_local.snmp_index='1'"
02/25/2010 09:28:58 AM - AUTOM8: Poller[0] Host[18] Graph Added - graph-id: (669) - data-source-ids: (672, 672)
02/25/2010 09:28:58 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=14 AND data_local.host_id=18 AND data_local.snmp_query_id=1 AND data_local.snmp_index='10008'"

Code: Select all

--- autom8_functions.php~       2010-02-24 16:01:09.000000000 +0100
+++ autom8_functions.php        2010-02-25 09:34:39.000000000 +0100
@@ -417,7 +417,7 @@
                        . " LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) "
                        . " LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) "
                        . " LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) "
-                       . " WHERE data_input_fields.type_code=output_type "
+                       . " WHERE data_input_fields.type_code='output_type' "
                        . " AND snmp_query_graph.id=" . $rule["graph_type_id"]
                        . " AND data_local.host_id=" . $host_id
                        . " AND data_local.snmp_query_id=" . $rule["snmp_query_id"]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Thanks for posting. This is already in V0.32, unfortunately available via SVN only (atm).
R.
xarses
Posts: 24
Joined: Tue Jan 27, 2009 3:08 pm

Post by xarses »

When trying to apply host.php.patch I was getting asked where the file was, i noted that -p1 was striping the path so it couldn't find hosts.php correctly, when i ran without the -p1 I got this reversed warning

Code: Select all

[root@fio32-01 cacti-0.8.7e]# patch -N --dry-run < plugins/autom8/patches-087e/host.php.patch
patching file host.php
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file host.php.rej
running patch with -R allowed the patch to install.

Code: Select all

[root@fio32-01 cacti-0.8.7e]# patch -R -N --dry-run < plugins/autom8/patches-087e/host.php.patch
patching file host.php
Hunk #1 succeeded at 139 (offset 2 lines).
xarses
Posts: 24
Joined: Tue Jan 27, 2009 3:08 pm

Post by xarses »

I'm running PA 2.6, Cacti 0.8.7e and autom8 0.31 now, I forced the host.php.patch to apply per my previous post and am seeing that functions such as add graph, data source, re-query data source or verbose query on a data source return blank pages (completly void of code).

Can some one help me identify what is broken and or how I might patch host.php correctly since this is most likely the issue?

-- Edit --

I've swapped back the old host.php and it doesn't correct the problem. I've put the patched version back in and instead disabled autom8 from the plugin management and the queries are functioning as expected now.

-- Edit again --

I pulled down 0.32 from SVN and it doesn't have the issue noted here.

~X
xarses
Posts: 24
Joined: Tue Jan 27, 2009 3:08 pm

Post by xarses »

Now that it's working, I enjoy the plugin and it works great.

I was wondering what it might take to either 1) add in multiple graph types per data-source so that in the same rule one could specify 64-Bit interfaces, and error/discards to be created. OR 2) extrapolate the rule components (Host Eligibility, and Index Eligibility) so that they could be added to multiple "Graph rules" so that duplication of these components could be minimized.

~X
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The current concept supports copying of rules to easy such a task. It is not designed to allow for multiple graph creation as of yet.
R.
KyleT
Posts: 16
Joined: Mon Dec 07, 2009 3:52 am

Post by KyleT »

Where can I find the SVN so that I can checkout the latest version?

I tried to use 0.31 from the link in the first post, however, I am unable to force it to run the tree creation script. It only runs when a new graph is actually created (I would post screen shot but I deleted the plugin...).

Regards
Kyle
Cacti 0.8.7g & Spine 0.8.7g on RHEL 5.2 (2.6.18-92.el5)
2x Intel Quad Core Xeon E5345 | 12GB RAM
Graphing 1245 Cisco hosts - 49737 Data Sources
autom8 0.35b7 | Camm 1.6.7 | settings 0.7 | realtime 0.43 | threshold 0.4.2 |
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

:-?
I just can't for the life of me understand why I can't get the patches applied to my Cacti install. Here's some results:
[root@cacti html]# patch -p1 -N --dry-run < plugins/autom8/patches-087e/cli.patch
patching file cli/add_graph_template.php
Hunk #1 FAILED at 145.
1 out of 1 hunk FAILED -- saving rejects to file cli/add_graph_template.php.rej
patching file cli/add_tree.php
Hunk #1 FAILED at 32.
1 out of 1 hunk FAILED -- saving rejects to file cli/add_tree.php.rej
patching file cli/host_update_template.php
Hunk #1 FAILED at 137.
1 out of 1 hunk FAILED -- saving rejects to file cli/host_update_template.php.rej
[root@cacti html]# patch -p1 -N --dry-run < plugins/autom8/patches-087e/host.php.patch
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- host.php 2009-11-20 23:18:46.000000000 +0100
|+++ ../cacti-0.8.7e-orig/host.php 2009-06-28 18:07:11.000000000 +0200
--------------------------
File to patch:
[root@cacti html]#
These are two examples. I'm not sure exactly what I'm doing wrong. I'm using Cacti 0.8.7e with PA 2.6 and v0.31 of the autom8 plugin. I installed cacti via Yum on CentOS 5.4.

I appreciate any help.
Thanks
Locked

Who is online

Users browsing this forum: No registered users and 3 guests