Autom8 V0.31 [Nov, 20 2009]

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am

autom8

Post by gsaray101 »

Howie:

Please let me know if it works for you. I tried to install it on windows cacti but did not work for me.

thanks,
junkiee
Posts: 2
Joined: Fri Sep 04, 2009 10:51 am

Post by junkiee »

can you post pre-patched files as I am running cacti on W2k3 and cannot use the Patch command to patch the current cacti files.

thanks,
User avatar
TheWitness
Developer
Posts: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Install Cygwin and patchutils. Make sure if you are installing cygwin to take the defaults other than this set of utilities. If you install everything, that's quite a bit. The default install is pretty compact.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

junkiee wrote:can you post pre-patched files as I am running cacti on W2k3 and cannot use the Patch command to patch the current cacti files.

thanks,
Quite all patches are very small. So you max simply use your favorite editor to do the work. Only one of them is a bit bigger, moving a block of code to a different file.
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Howie wrote:If only it did thold templates too, then I could take the afternoons off ;-)
I'm not using thold. So can you please elaborate how this should work? I know that there are thold templates as well; I thought they'd do the job
R.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

gandalf wrote:
Howie wrote:If only it did thold templates too, then I could take the afternoons off ;-)
I'm not using thold. So can you please elaborate how this should work? I know that there are thold templates as well; I thought they'd do the job
R.
Yes - but what would be great is if the following worked:

1. I create a new host, appy a host template, and enter SNMP details.
2. Autom8 creates graphs as necessary(DONE)
3. Autom8 assigns the host.graphs to a tree (DONE
4. Autom8 applies appropriate thold templates to the newly created datasources. (WISH!)

I think it might tie in with some thold wishes I have though - my thold (based on an older version) has multiple, named, templates per-DS which I think is different from how newer tholds do it. So maybe it's a very personal wish.

You are correct that thold has templates, but there's no easy way (that I know of) to have it re-apply when new interfaces are enabled, or new hosts created.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

grazog wrote:Hello,
It's an amazing plugin for environments that change a lot.
Still i have an issue when using graph leaf on the tree rules : graph are added at the root tree level instead of being added in a subtree.
Here are the logs i have :

10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - graph: 1172
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=2
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - rule: 4 name: LB-Graph type: 2
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT graph_templates_graph.id, graph_templates_graph.local_graph_id, graph_templates_graph.height, graph_templates_graph.width, graph_templates_graph.title_cache, graph_templates.name, graph_local.host_id FROM (graph_local,graph_templates_graph) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN host ON (graph_local.host_id = host.id) LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE graph_local.id=graph_templates_graph.local_graph_id AND ( host_template.name REGEXP 'BigIP' AND graph_templates.name REGEXP 'VS Traffic') AND graph_local.id=1172
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[1172] create_all_header_nodes - items sql: SELECT * FROM plugin_autom8_tree_rule_items WHERE plugin_autom8_tree_rule_items.rule_id=4 ORDER BY sequence matches: 2
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[1172] create_all_header_nodes - sql: SELECT host.description AS source FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) LEFT JOIN graph_local ON (host.id = graph_local.host_id) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN graph_templates_graph ON (graph_local.id = graph_templates_graph.local_graph_id) WHERE host.id=1172 AND graph_templates_graph.local_graph_id > 0 AND ( host_template.name REGEXP 'BigIP' AND graph_templates.name REGEXP 'VS Traffic') matches:
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[1172] create_all_header_nodes - sql: SELECT graph_templates_graph.title_cache AS source FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) LEFT JOIN graph_local ON (host.id = graph_local.host_id) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN graph_templates_graph ON (graph_local.id = graph_templates_graph.local_graph_id) WHERE host.id=1172 AND graph_templates_graph.local_graph_id > 0 AND ( host_template.name REGEXP 'BigIP' AND graph_templates.name REGEXP 'VS Traffic') matches:
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - parent: 0
10/16/2009 09:31:36 AM - AUTOM8: Poller[0] Host[179] execute_graph_create_tree - node: 757

From what i saw the function create_all_header_nodes is called with the id of the graph (1172) but it's designed to be called with the host id (179) so the SQL queries give an empty result.
Could it be that in line 505 of autom8_functions.php the WHERE statement should be on the graph ID instead of the host ID ?
Regards,
Please show me the complete rule that you've created to do this.
R.

EDIT: This is no longer needed
Last edited by gandalf on Fri Nov 20, 2009 5:45 pm, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Howie wrote:I think it might tie in with some thold wishes I have though - my thold (based on an older version) has multiple, named, templates per-DS which I think is different from how newer tholds do it. So maybe it's a very personal wish.
I asked Jimmy to join our discussion
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I just published V0.31
--- 0.31 ---
- fix: Move all patches to a cacti-version-dependant sub-directory
Add patches for 087e
- fix: sql fix for create_dq_graphs (courtesy: brylant)
- fix: creating tree entries for graphs fixed (coutesy: grazog)
- fix: Tree Rule Items moveup/down fixed
- feature: logging for adding objects (howie): tracing is flagged with AUTOM8 TRACE (to be removed later)
AUTOM8 TRACE is logged at POLLER_VERBOSITY_MEDIUM and higher
adding objects is flagged AUTOM8 and always logged
grazog
Posts: 13
Joined: Fri May 02, 2008 3:11 am

Post by grazog »

Hello,
Thanks for the update.
the host patched file for 0.8.7e didn't work, i added the hook manually.

I still encounter a problem with graph tree rules.
I made a custom rule to add several graph to a tree entry based on the application name.
Here is the tree rule to extract the application name from the graph title.
6 | 4 | 1 | graph_templates_graph.title_cache | 0 | 1 | NULL | ^(.*)\s*-\s*Traffic\s*-\s*VS\s*-\s*([a-zA-Z0-9]*)\s*-(.*) | ${2}
The results in the the show created tree looks ok.
But I have all the graph added to one tree entry only
I made an example with two graphs one Blackberry and one proxy that should be added to a "blackberry" tree and "proxy" tree.
The graph that should be added to Blackberry was instead added to Proxy

Here are the cacti logs :
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - node: 956
11/24/2009 11:45:30 AM - AUTOM8: Poller[0] Graph[1167] Tree Item added - id: (956)
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - parent: 954
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] create_multi_header_node - object: 'LOADBALANCER - Traffic - VS-PROXY-PAC-CLI', Header: 'PROXY', hooked at: 954
11/24/2009 11:45:30 AM - AUTOM8: Poller[0] Parent[0] Tree Item added - id: (954)
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] create_all_header_nodes - sql: SELECT graph_templates_graph.title_cache AS source FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) LEFT JOIN graph_local ON (host.id = graph_local.host_id) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN graph_templates_graph ON (graph_local.id = graph_templates_graph.local_graph_id) WHERE host.id=179 AND graph_templates_graph.local_graph_id > 0 AND ( ( graph_templates_graph.title_cache LIKE '%PROXY%' OR graph_templates_graph.title_cache LIKE '%BLACKBERRY%' ) AND graph_templates.name LIKE '%VS Traffic%') matches: LOADBALANCER - Traffic - VS-PROXY-PAC-CLI
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] create_all_header_nodes - items sql: SELECT * FROM plugin_autom8_tree_rule_items WHERE plugin_autom8_tree_rule_items.rule_id=4 ORDER BY sequence matches: 1
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT graph_templates_graph.id, graph_templates_graph.local_graph_id, graph_templates_graph.height, graph_templates_graph.width, graph_templates_graph.title_cache, graph_templates.name, graph_local.host_id FROM (graph_local,graph_templates_graph) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN host ON (graph_local.host_id = host.id) LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE graph_local.id=graph_templates_graph.local_graph_id AND ( ( graph_templates_graph.title_cache LIKE '%PROXY%' OR graph_templates_graph.title_cache LIKE '%BLACKBERRY%' ) AND graph_templates.name LIKE '%VS Traffic%') AND graph_local.id=1167
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - rule: 4 name: Test F5 graph type: 2
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=2
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - graph: 1167
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_execute graph: 1167
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - node: 955
11/24/2009 11:45:30 AM - AUTOM8: Poller[0] Graph[1172] Tree Item added - id: (955)
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - parent: 954
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] create_multi_header_node - object: 'LOADBALANCER - Traffic - VS-PROXY-PAC-CLI', Header: 'PROXY', hooked at: 954
11/24/2009 11:45:30 AM - AUTOM8: Poller[0] Parent[0] Tree Item added - id: (954)
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] create_all_header_nodes - sql: SELECT graph_templates_graph.title_cache AS source FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) LEFT JOIN graph_local ON (host.id = graph_local.host_id) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN graph_templates_graph ON (graph_local.id = graph_templates_graph.local_graph_id) WHERE host.id=179 AND graph_templates_graph.local_graph_id > 0 AND ( ( graph_templates_graph.title_cache LIKE '%PROXY%' OR graph_templates_graph.title_cache LIKE '%BLACKBERRY%' ) AND graph_templates.name LIKE '%VS Traffic%') matches: LOADBALANCER - Traffic - VS-PROXY-PAC-CLI
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] create_all_header_nodes - items sql: SELECT * FROM plugin_autom8_tree_rule_items WHERE plugin_autom8_tree_rule_items.rule_id=4 ORDER BY sequence matches: 1
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT graph_templates_graph.id, graph_templates_graph.local_graph_id, graph_templates_graph.height, graph_templates_graph.width, graph_templates_graph.title_cache, graph_templates.name, graph_local.host_id FROM (graph_local,graph_templates_graph) LEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id) LEFT JOIN host ON (graph_local.host_id = host.id) LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE graph_local.id=graph_templates_graph.local_graph_id AND ( ( graph_templates_graph.title_cache LIKE '%PROXY%' OR graph_templates_graph.title_cache LIKE '%BLACKBERRY%' ) AND graph_templates.name LIKE '%VS Traffic%') AND graph_local.id=1172
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - rule: 4 name: Test F5 graph type: 2
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - sql: SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=2
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] Host[179] execute_graph_create_tree - graph: 1172
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_execute graph: 1172
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_execute called: plugin_autom8_graph
11/24/2009 11:45:30 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_execute called
11/24/2009 11:45:15 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_prepare called: plugin_autom8_graph
11/24/2009 11:45:15 AM - AUTOM8 TRACE: Poller[0] autom8_graph_action_prepare called


Regards,
Mattza
Posts: 23
Joined: Wed Nov 11, 2009 2:46 am

Error message

Post by Mattza »

Great plugin! I have one problem thou. After I have set my "graph rules" and add a device I get the following error message:

Code: Select all

Fatal error: Cannot redeclare api_tree_item_save() (previously declared in /usr/share/cacti/site/lib/api_tree.php:25) in /usr/share/cacti/site/lib/api_automation_tools.php on line 131
The device is added and the autom8 plugin do its job. But something is obviously wrong. Im not a programmer so unfortunately i can't figure out how to solve this issue. Any ideas?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I'm quite sure that you missed to run at least one of the provided patches.
R.
Mattza
Posts: 23
Joined: Wed Nov 11, 2009 2:46 am

Post by Mattza »

I think you are correct, problem is i skipped the cli.patch because i didn't understand what to do when i got prompet "File to patch:". Im suppose to patch the a number of iles in the "cli" folder right? Problem is i cant find where its located, im not even sure i have it.

I know this topic have been discussed before. But it didn't solve my problem. But now everything works fine for me, except this stupid error...
grazog
Posts: 13
Joined: Fri May 02, 2008 3:11 am

Post by grazog »

Hello,

Had you got spare time to look at the add graph on custom tree problem ?

Regards,
Brice
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Mattza wrote:I think you are correct, problem is i skipped the cli.patch because i didn't understand what to do when i got prompet "File to patch:". Im suppose to patch the a number of iles in the "cli" folder right? Problem is i cant find where its located, im not even sure i have it.

I know this topic have been discussed before. But it didn't solve my problem. But now everything works fine for me, except this stupid error...
The cli folder is in the root cacti folder. BUT, if you use the command line in the README file then patch should not be asking you for a filename - it should know. The filename is in the patch file header.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Locked

Who is online

Users browsing this forum: No registered users and 0 guests