Problems adding graphs with autom8

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
galco
Cacti User
Posts: 63
Joined: Fri Aug 03, 2007 3:09 am
Location: Barcelona, Catalunya

Problems adding graphs with autom8

Post by galco »

Hello,

I decide to install a new (Cacti Version: 0.8.7h, Plugin Architecture Version: 3.0) to solve the problems I was having with thold and autom8 plugins in my older cacti installation.
I'm also having problems with this installation. No graphs are added automatically

These are the logs:

Code: Select all

10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - create sql: SELECT host.id AS host_id, host.hostname, host.description, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( host.description LIKE '%Serrabrisa%') AND host.id=2 matches:0
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter returns: host.description LIKE '%Serrabrisa%'
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter returns: host.description LIKE '%Serrabrisa%'
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter called: a:1:{i:0;a:8:{s:2:"id";s:2:"11";s:7:"rule_id";s:1:"6";s:9:"rule_type";s:1:"1";s:8:"sequence";s:1:"1";s:9:"operation";s:1:"0";s:5:"field";s:16:"host.description";s:8:"operator";s:1:"1";s:7:"pattern";s:10:"Serrabrisa";}}, prefix:
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter called rule id: 6
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - rule=6 name: Serrabrisa 100 MB 2
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - create sql: SELECT host.id AS host_id, host.hostname, host.description, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( host.description LIKE '%Serrabrisa%') AND host.id=2 matches:0
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter returns: host.description LIKE '%Serrabrisa%'
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter returns: host.description LIKE '%Serrabrisa%'
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter called: a:1:{i:0;a:8:{s:2:"id";s:1:"9";s:7:"rule_id";s:1:"5";s:9:"rule_type";s:1:"1";s:8:"sequence";s:1:"1";s:9:"operation";s:1:"0";s:5:"field";s:16:"host.description";s:8:"operator";s:1:"1";s:7:"pattern";s:10:"Serrabrisa";}}, prefix:
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter called rule id: 5
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - rule=5 name: Serrabrisa 1GB
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - sql: SELECT plugin_autom8_graph_rules.id, plugin_autom8_graph_rules.name, plugin_autom8_graph_rules.snmp_query_id, plugin_autom8_graph_rules.graph_type_id FROM plugin_autom8_graph_rules WHERE snmp_query_id=1 AND enabled='on' - found: 2
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query Host[2] - start - data query: 1
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] execute_data_query called: a:2:{s:7:"host_id";s:1:"2";s:13:"snmp_query_id";s:1:"1";}
10/18/2011 01:07:08 PM - AUTOM8 TRACE: Poller[0] autom8_hook_data_query called: a:2:{s:7:"host_id";s:1:"2";s:13:"snmp_query_id";s:1:"1";} 
And this the graph rule:
graph_rule.png
graph_rule.png (86.97 KiB) Viewed 1361 times
I can see in the logs: AND host.id=2
I'm not sure may be it would have to be: AND host.id=3 because 3 is the id of device I'm making the rule

What is it wrong?

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

Re: Problems adding graphs with autom8

Post by gandalf »

How did you trigger that rule?
R.
galco
Cacti User
Posts: 63
Joined: Fri Aug 03, 2007 3:09 am
Location: Barcelona, Catalunya

Re: Problems adding graphs with autom8

Post by galco »

Ups! gandalf there is something I'm misunderstanding. I thought that the rule was triggered by the poller, in my case every 5 minutes.

After reading your question, I re-read the autom8 documentation and I've understood that the rule is triggered:

- each time a new host is created
- each time a data query is re-indexed and new indexes are discovered
- each time a new host is added
- each time a new graph is created

Is the rule triggered in every situation I've wrote above or I have to chose one of them? If I have to chose, where can I chose the moment when the rule is evaluated?

In case I have to force when the rule is evaluated, do I need to add a cron entry saying that the graphs have to be re-indexed every day, for example?

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

Re: Problems adding graphs with autom8

Post by gandalf »

Yes, the rules are triggered in ALL those cases, except for "when a graph is created (makes no sense)".

reindexing
But e.g. the poller triggers only on reindexing! That is: in case any reindexing occurs (e.g. a new interface shows up AND the reindex option "Index Count Change" has been chosen on 087h), the rule run s to possibly create a new interface graph.
It does NOT run if nothing has changed for that host as this would cost too many CPU cycles.
So either choose the correct reindexing option to have it reindexed automatically OR
you reindex every day to force discovery of new indexes.

manual
And for a first run you may select a host (or a multitude of them) from the host list screen and select the "AUTOM8" action from the dropdown menu. Usually, you will do this for verification or initial graph creation, not for daily use.

new hosts
For adding a new host, all should run automatically, then. This requires, that the correct host template is chosen to have all required data queries and graph templates associated with your new host. AUTOM8 then does all the data source and graph creation magic.

R.
galco
Cacti User
Posts: 63
Joined: Fri Aug 03, 2007 3:09 am
Location: Barcelona, Catalunya

[SOLVED] Re: Problems adding graphs with autom8

Post by galco »

Thank you gandalf!

In my case the best option is using "Index Count Changed " as a re-index method.
I discovered what I was doing wrong. After creating the "Graphs rules" I didn't apply it. I didn't chose "Apply Autom8 rules to Device(s)". I'm sorry, because that is on the manual but I read it time ago and I supused that I rememberd how autom8 was working.

I've also seen that if I apply autom8 rules and then I add a new rule, I need to re-apply the autom8 rules to device. Is that correct?

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

Re: [SOLVED] Re: Problems adding graphs with autom8

Post by gandalf »

galco wrote:I've also seen that if I apply autom8 rules and then I add a new rule, I need to re-apply the autom8 rules to device. Is that correct?
In case you add or change rules, they are in effect at the moment you "activate" them.
But it may happen that you sit for months until those newly activated rules are "triggered".
This can be done on a reindexing event for that very query the rules applied to (so you may want to run the reindex cli script against all hosts but restrict it to that very query) or by manually triggering it.

R.
galco
Cacti User
Posts: 63
Joined: Fri Aug 03, 2007 3:09 am
Location: Barcelona, Catalunya

Re: Problems adding graphs with autom8

Post by galco »

Ok! Thank you gandalf for your help and for your plugin!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests