Thresholding / Alerting Plugin - Official Q/A Thread

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

chadd wrote:Oh, and do you still need the settings plugin as a prereq to thold? (I am using it, but not sure it is necessary..
Yes - won't install without it.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
archon
Posts: 8
Joined: Tue Feb 12, 2008 4:20 pm

Post by archon »

Hi,
I've installed thold plugin (v0.4.1) but i have a problem with settings plugin (v0.5), in status field it sais "Status: Old Plugin Architecture".
I have PA v2.4 and Cacti v0.8.7d
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

archon wrote:Hi,
I've installed thold plugin (v0.4.1) but i have a problem with settings plugin (v0.5), in status field it sais "Status: Old Plugin Architecture".
I have PA v2.4 and Cacti v0.8.7d
This is correct - you need to have an entry in global.php in the plugins[] section for this, as it's not been moved over to the new PIA config yet.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

chadd wrote:Oh, and do you still need the settings plugin as a prereq to thold? (I am using it, but not sure it is necessary..)
It will always be a requirement.
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

chadd wrote:The "Template Propagation Enabled" check box on the threshold I am creating is grayed out.
This is because you created a threshold without using a template for it. You can not retroactively go back and add it to a template, you had to have auto-created it.
chadd wrote: If I choose the "Apply Thresholds" drop-down on the device page, It will auto create thresholds for each interface, seemingly, based on the template I have - but what if I did not want to create thresholds for all the interfaces, or wanted to use different template(s)? Anyway, looks like I have a lot of catching up to do on this plugin ;-). Anyway help would be appreciated.
Yes, this is by design, it will create it for current graphs of that type. If that is not desired, then create your threshold by selecting the drop down in Graph Management page.
chadd wrote:Also, there does not seem to be a way to see what template a particular threshold is using, or even to assign it to one. Is there an SVN version that has the options you are talking about, or did I just screw up the install some how? Thanks again for your help.
There is no way, since there can only be 1 template of each type it seems a bit unnecessary (especially since you can't change it). You are using the latest version, so the options are there.
pierg75
Posts: 1
Joined: Mon Jun 08, 2009 3:58 am

Post by pierg75 »

Hi.
I'm trying to use th thold plugin, but, even if i get no errors, i see no threshold activated.
I then try to add a template but it tells me that it's already present.
I check the DB and all the tables (thold*) are empty.
What can i do?
I use cacti 0.8.7d, latest plugin settings and latest thold on centos 5.3.
Thanks.

Pier
istein001
Cacti User
Posts: 54
Joined: Fri Feb 22, 2008 4:44 pm
Location: Houston

Post by istein001 »

Is there a way to view the current calculated high/low threasholds? This would be good for t/s the initial install... i noticed you can only view "current" or high/low if you are not baseline monitoring.
iHenrique
Posts: 6
Joined: Tue Jul 14, 2009 10:05 am

Post by iHenrique »

I MAKED THIS:

""Go to Console -> devices
Click the device you want to apply the Threshhold Template
And then click “Create Graphs for this Host”

Create Graphs for this Host -> Auto-create thresholds

17.4 some threshold examples

Create disk usage Thold template
When (used_space/total_space%) > 90%, cacti will send alert mail
4.1.1 Add “VALUE_OF_HDD_TOTAL” at global _arrays.php

vi /opt/www/html/cacti/include/global _arrays.php
add VALUE_OF_HDD_TOTAL

find

$custom_data_source_types = array(

add

“VALUE_OF_HDD_TOTAL” => “Value of hdd_total data source”,

add a new CDEF
Now go to Console -> Graph Management -> CDEFs click “Add” to add a new CDEF
Add new CDEF named like “Used Disk Space Percent”, at this CDEF, add 5 items:

Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 100
Item #3 Operator: *
Item #4 Special Data Source: VALUE_OF_HDD_TOTAL
Item #5 Operator: /

cdef

create new Threshold Templates
Go to Console -> Threshold Templates -> click Add
For linux host, we choose “ucd/net – CPU Usage – user” template;
for windows host, we choose “Host MIB – Hard Drive Space” template
this depends on what templates we used in device graphic:

Data Field: hdd_used
Enabled: yes
Threshold Type: High / Low
High Threshold: 90
Low Threshold: 0
Data Type: CDEF

""

BUT I DON´T RECEIVED ALERT IN MY EMAIL.
I have not received any e-mail.

SOMEONE CAN HELP ME WITH ALERTS BY EMAIL @ CACTI ?!

I need to do this...
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

You created the templates, you now need to use the templates to create the thresholds.
mrvu
Posts: 25
Joined: Tue Dec 30, 2008 3:54 am
Location: Vietnam

Graph with multiple data template

Post by mrvu »

Hi,

In Thold 0.4.1, if a graph use multiple data templates, thold_add wizard can only display datasources for the first data template. Therefore you can't create thold for all datasources.

I modified thold_add.php so that I can select and create thold for all datasources of a graph.

Code: Select all

--- thold_add.php	original
+++ thold_add.php     modified
@@ -493,9 +493,15 @@
                                LEFT JOIN graph_templates_item ON graph_templates_item.task_item_id = data_template_rrd.id
                                LEFT JOIN graph_local ON graph_local.id=graph_templates_item.local_graph_id
                                WHERE graph_local.id = ' . $graph);
+               $dt_sql =       'SELECT DISTINCT data_template_rrd.local_data_id
+                                       FROM data_template_rrd
+                                       LEFT JOIN graph_templates_item ON graph_templates_item.task_item_id = data_template_rrd.id
+                                       LEFT JOIN graph_local ON graph_local.id=graph_templates_item.local_graph_id
+                                       WHERE graph_local.id = ' . $graph;
                $dss = db_fetch_assoc('SELECT DISTINCT id, data_source_name
                                FROM data_template_rrd
-                               WHERE local_data_id = ' . $dt . ' ORDER BY data_source_name');
+                               WHERE local_data_id IN (' . $dt_sql . ') ORDER BY data_source_name');
                /* show the data source options */
                ?>
                <tr>
I posted here in case somebody needs this.
APOBEK
Posts: 4
Joined: Mon Feb 09, 2009 12:25 am

Message From Thold Incorrect

Post by APOBEK »

My Cacti:
quote]Cacti Version - 0.8.7c
Plugin Architecture - 2.3
Poller Type - CMD.php
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.8e DAV/2 PHP/5.2.6 with Suhosin-Patch
PHP - 5.2.6
PHP Extensions - session, Reflection, date, libxml, apache2handler, dbase, ctype, gd, mcrypt, mysql, openssl, pdf, standard, sockets, xml, pcre, SimpleXML, SPL, dom, xmlreader, xmlrpc, xmlwriter, zlib, PDO, pdo_mysql, json, snmp
MySQL - 5.0.45
RRDTool - 1.2.23
SNMP - 5.4.1
Plugins
  • Thresholds (thold - v0.4.1)
    Global Plugin Settings (settings - v0.5)
    Device Monitoring (monitor - v0.8.2)
    Network Tools (tools - v0.3)
    Host Info (hostinfo - v0.2)
    Nagios plugin for Cacti (npc - v2.0.0b)
    PHP Network Weathermap (weathermap - v0.95b)
    Read-only Devices Tab (devices - v0.4)
    Create Aggregate Graphs (aggregate - v0.70 Beta 1)
[/quote]
Attachments
xxxx - Traffic - xxxx   [traffic_in] went below threshold of 20 with 4.2542
xxxx - Traffic - xxxx [traffic_in] went below threshold of 20 with 4.2542
traffic.JPG (35.7 KiB) Viewed 12281 times
boichico
Posts: 1
Joined: Mon Oct 25, 2010 11:21 am

Re: Thresholding / Alerting Plugin - Official Q/A Thread

Post by boichico »

Hi Devs,

My Alerting/Thold is working perfectly but I want to edit the content of the email notification when thold is breached. What should I do if I want to remove the graph that comes with the alert?

Thanks!
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Thresholding / Alerting Plugin - Official Q/A Thread

Post by cigamit »

boichico wrote:Hi Devs,

My Alerting/Thold is working perfectly but I want to edit the content of the email notification when thold is breached. What should I do if I want to remove the graph that comes with the alert?

Thanks!
Check under Settings, there is a field for editing the message.
Skyla
Posts: 2
Joined: Wed Jul 13, 2011 3:34 pm

Re: Thresholding / Alerting Plugin - Official Q/A Thread

Post by Skyla »

I have a question about the notification fields we can use when sending out an alert. It seems that when you use the <THRESHOLDNAME> option in the hi/lo alert, it is not using the threshold name listed. But instead using the Data source name.

For instance, I have a switch named 'CSS NET 10.254' and the data source says 'CSS NET 10.254 - TRAFFIC - 2'. So when I set up the threshold for this port I name it 'CSS NET 10.254 [SM-PHP] - TRAFFIC - 2'

So I enter in the message to be setting in the threshold global setting page and it is

<html><body>An alert has been issued that requires your attention. <br><br><b>Host</b>: <DESCRIPTION> (<HOSTNAME>)<br><b>URL</b>: <URL><br><b>Message</b>: <SUBJECT><br><b>Threshold</b>: <THRESHOLDNAME><br><b>DSNAME</b>: <DSNAME></body></html>

When the message is sent it shows:
Host: CSS Web Net 10.254 (10.10.100.254)
URL: http://10.5.0.75///graph.php?local_grap ... 4&rra_id=1
Message: CSS Web Net 10.254 - Traffic - 2 [traffic_out] is still above threshold of 1 with 3538.4833
Threshold: CSS Web Net 10.254 - Traffic - 2
DSNAME: traffic_out

In investigating, it is pulling the thresholdname from the data_template_data table and using the cache name which is the data source name and not pulling the threshold name from the thold_data. This makes it hard to identify which threshold is sending the notification without looking at the threshold list to see which one has been triggered.

I have found that if I go to the data source option and add the extra information into that name it reports as I expect but it would be more convenient if the thresholdname parameter actually used the name from the threshold setup page.

Is it possible that this can be corrected in a future version?

Darrell

PS Forgot to add this. Using Cacti 8.7g with architecture 2.8 and thold 4.4
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Thresholding / Alerting Plugin - Official Q/A Thread

Post by noname »

Skyla wrote:In investigating, it is pulling the thresholdname from the data_template_data table and using the cache name which is the data source name and not pulling the threshold name from the thold_data. This makes it hard to identify which threshold is sending the notification without looking at the threshold list to see which one has been triggered.

I have found that if I go to the data source option and add the extra information into that name it reports as I expect but it would be more convenient if the thresholdname parameter actually used the name from the threshold setup page.
As a workaround, try to modify 'plugins/thold/thold_functions.php'.
(I'm using thold-0.4.4-41, but not fully tested)

At line 527:
$thold_alert_text = str_replace('<THRESHOLDNAME>', $desc, $thold_alert_text);
to
$thold_alert_text = str_replace('<THRESHOLDNAME>', $item['name'], $thold_alert_text);
At line 561, 592, 631, 649, 694, 622:
$subject = $desc . ($thold_show_datasource ? " [$name]" : '') . ...
to
$subject = $item['name'] . ...
* If you want to know particular datasource name which was triggered, leave "($thold_show_datasource ...)".
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest