Update Autom8 to apply threshold templates

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

jmarshall28@gmail.com
Posts: 25
Joined: Tue Jul 06, 2010 1:28 pm

Update Autom8 to apply threshold templates

Post by jmarshall28@gmail.com »

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: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Update Autom8 to apply threshold templates

Post by gandalf »

Currently, there is no interaction between both plugins. So this is a new feature request
R.
jmarshall28@gmail.com
Posts: 25
Joined: Tue Jul 06, 2010 1:28 pm

Re: Update Autom8 to apply threshold templates

Post by jmarshall28@gmail.com »

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: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Update Autom8 to apply threshold templates

Post by Howie »

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

Re: Update Autom8 to apply threshold templates

Post by Hipska »

Autom8Thold plugin will also be created, I will let know in this topic when it's there.
User avatar
Hipska
Posts: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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

Post by LaurenceM8 »

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: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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

Post by LaurenceM8 »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Update Autom8 to apply threshold templates

Post by Howie »

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.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
Hipska
Posts: 48
Joined: Tue Oct 09, 2012 2:51 am
Location: Belgium

Re: Update Autom8 to apply threshold templates

Post by Hipska »

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

Post by lightenup »

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

Who is online

Users browsing this forum: No registered users and 1 guest