Update Autom8 to apply threshold templates

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Author
Message
[email protected]
Posts: 25
Joined: Tue Jul 06, 2010 1:28 pm

Update Autom8 to apply threshold templates

#1 Post by [email protected] » Tue Dec 04, 2012 3:47 pm

Is it possible to automate thold template application to interfaces? If not I would like to ask for a future autom8 feature such that the user would be the ability to select a threshold template to apply in autom8 for interfaces that pass that graph rule on a thold template per graph rule basis.

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

Re: Update Autom8 to apply threshold templates

#2 Post by gandalf » Thu Dec 06, 2012 5:07 pm

Currently, there is no interaction between both plugins. So this is a new feature request
R.

[email protected]
Posts: 25
Joined: Tue Jul 06, 2010 1:28 pm

Re: Update Autom8 to apply threshold templates

#3 Post by [email protected] » Tue Dec 18, 2012 11:34 am

It would greatly simplify large scale use of threshold detection. It doesn't even have to be that smart. Just for a given graph rule, have a drop down that allows you to select what threshold template to apply. Similar to the drop downs for the datay query and/or graph type.

Any idea when this could be added to Autom8?

User avatar
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#4 Post by Hipska » Fri Jun 07, 2013 2:21 am

Is there already some progress on this? I also need to be able to create rules for adding thresholds to graphs automatically.

If not, I will start writing something myself, just let me know.

User avatar
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#5 Post by Hipska » Wed Jul 17, 2013 10:18 am

I am currently making a plugin like Autom8, but for Data Items on Reportit reports. This is currently a separate plugin and I'm also planning to create something like this for Thold also.

Gandalf, one big question: Keep this as a separate plugin, or do you want me to integrate it completely into Autom8?

User avatar
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#6 Post by Hipska » Wed Jul 31, 2013 3:27 am

Since we receive no answer, I created something myself.

With this plugin, you will be able to specify rules for DS to be added on reportit reports.
https://github.com/Super-Visions/cacti- ... m8reportit

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

Re: Update Autom8 to apply threshold templates

#7 Post by Howie » Wed Jul 31, 2013 5:53 am

Awesome! Autom8 integration with thold has been on my wishlist for years (along with different threshold templates for different customers).
Weathermap 0.98 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
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#8 Post by Hipska » Wed Jul 31, 2013 5:56 am

Autom8Thold plugin will also be created, I will let know in this topic when it's there.

User avatar
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#9 Post by Hipska » Tue Oct 29, 2013 6:14 am

It's ready: http://docs.cacti.net/userplugin:autom8thold

Feel free to try it out and let me know if you want changes.

LaurenceM8
Posts: 15
Joined: Mon Dec 16, 2013 6:52 am

Re: Update Autom8 to apply threshold templates

#10 Post by LaurenceM8 » Mon Mar 03, 2014 6:14 am

Hello
I've installed with success autom8reportit but i've got an error when i try to define the rules :
the field "field name" is empty, his only choice is "none"

and in front of the page i've got this text :
Warning: reset() [function.reset]: Passed variable is not an array or object in D:\www\cacti\plugins\autom8reportit\autom8_report_rules.php on line 373

Warning: Invalid argument supplied for foreach() in D:\www\cacti\plugins\autom8reportit\autom8_report_rules.php on line 376
in the file autom8_report_rules.php, the lines 365 to 385 are

Code: Select all

case AUTOM8_RULE_TYPE_REPORT_ACTION:
			$title = 'Create Report Data Source Rule';
			$tables = array(AUTOM8_RULE_TABLE_XML);
			$item_table = 'plugin_autom8_report_rule_items';
			$sql_and = '';
			$autom8_rule = db_fetch_row(sprintf('SELECT * FROM plugin_autom8_report_rules WHERE id = %d LIMIT 1;', $rule_id));
			$_fields_rule_item_edit = $fields_autom8_graph_rule_item_edit;
			$xml_array = get_data_query_array($autom8_rule['snmp_query_id']);
			reset($xml_array['fields']);
			$fields = array();
			if(sizeof($xml_array)) {
				foreach($xml_array['fields'] as $key => $value) {
					# ... work on all input fields
					if(isset($value['direction']) && (strtolower($value['direction']) == 'input')) {
						$fields[$key] = $key . ' - ' . $value['name'];
					}
				}
				$_fields_rule_item_edit['field']['array'] = $fields;
			}
			break;
I thinks there's an error in the code "reset($xml_array['fields']);"

thank you

User avatar
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#11 Post by Hipska » Wed Mar 05, 2014 6:18 am

That happens when no Data Query is defined in the rule settings.

I made a change in the code that fixes these PHP warnings: https://github.com/Super-Visions/cacti- ... ad12b631d9

LaurenceM8
Posts: 15
Joined: Mon Dec 16, 2013 6:52 am

Re: Update Autom8 to apply threshold templates

#12 Post by LaurenceM8 » Fri Apr 11, 2014 3:39 am

I've just forget that in cacti, you have to save before each time you go in an other page. sorry

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

Re: Update Autom8 to apply threshold templates

#13 Post by Howie » Tue Jun 24, 2014 12:20 pm

I'm testing this on a new 0.8.8b install with the latest thold, autom8 etc.

I've created a threshold template, and then a threshold rule... my graph rule creates the graphs (interface error counts for oper-up/ethernet interfaces), but I don't see any new thresholds. Do I need to apply that rule somewhere? The rule is enabled, and it looks OK. The list of affected interfaces is what I would expect, on the rules page...
Weathermap 0.98 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
Hipska
Posts: 47
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

#14 Post by Hipska » Thu Jun 26, 2014 9:58 am

Howie: Is "Settings > Misc > Enable Autom8 Threshold creation" enabled?

You can test also by choosing action "Apply Autom8 Rules to Data Source(s)" on data sources page.

lightenup
Posts: 19
Joined: Mon Dec 06, 2010 10:09 am

Re: Update Autom8 to apply threshold templates

#15 Post by lightenup » Thu Aug 14, 2014 11:54 am

Same issue here, I applied the patch, activated the plugin, created a threshold rule but it will not trigger the creation of the thresholds. If you would like any information from my system I would be more than happy to supply it as I would love this feature to come to life!

Post Reply