Thresholding / Alerting Plugin - Official Q/A Thread

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
lordzik
Posts: 11
Joined: Wed Jan 24, 2007 4:15 am

Post by lordzik »

Did someone found out how to make a threshold in %? E.g. i would like to be notified when disc storage is 90% full.

EDIT: my ugly way to do this: http://forums.cacti.net/viewtopic.php?t=20486
Last edited by lordzik on Wed Apr 04, 2007 5:09 am, edited 1 time in total.
User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

Re: Executing a script when a threshold is breached?

Post by lard »

havok1977 wrote:We have been using Cacti and the Thold plugin in our organization for around two years now, and everything works just fine; and now we want to be rid completely of our old MRTG setup.

And the only pending issue is the execution of scripts (mainly for sending snmp traps) when a threshold is breached; from what we know, the only external command that can be executed from thold is to send an email notification; is there anyway we could configure a script execution to go along with that outgoing email? A drop down box with a list of scripts to execute from a certain file system route would be the best solution.

Anyone can let me know where in the thold plugin the email notification takes please so i may code the necessary changes?

Thanks in advance.
Hi,

Exact same need as you - snmp for alerting - this may be off interest:

http://forums.cacti.net/viewtopic.php?p=96089#96089

HTH

Lard
---- lard007skype ----
temak82
Cacti User
Posts: 59
Joined: Tue May 02, 2006 3:00 pm

Post by temak82 »

I have the same exact question as dennis000 here. Can someone shed some light on this please? I am trying to set something up that will monitor the TOTAL bandwidth used in a month and to alert the user if they are about to go over.
TheFrip
Posts: 2
Joined: Sun Aug 12, 2007 1:22 am

Broken graph in email

Post by TheFrip »

To complete on a previous post, I have been digging around to understand why my graphs were broken when sent as an email attachment and I finally discovered the reason: the file was somehow truncated. After looking at the code, it looks like the reading of the output of rrdtool in lib/rrd.php was done using the fgets function which is not the right one for binary reads. I switched it to fread and it now works like a charm.

Hope this will help someone. Cheers,

TheFrip
lostpckt
Posts: 14
Joined: Wed Sep 12, 2007 1:53 pm

Thold doesn't seem to be 100% working

Post by lostpckt »

New to cacti, but seem to be getting the hang of it.

Installed Cacti 0.8.6j with plugin-arch 1.1 and thold 0.3.5.2.

I now have the Alerting/Thold tab in the settings section of the console, but I have no Threshold tab up top, and none of the threshold options seem to be on my graph/new graph pages.

I installed plugin-arch using the patchfiles (cacti-plugin-0.8.6j.diff) and made sure to update files after checking the .rej files.

I see no errors in either my access_log or error_log and there are no errors in my cacti.log.

This is all running on FC7.

Thanks for any help in advance.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

lostpckt - Have you been into User Management, chosen your user that you are loggedon with, and set the realm permissions for THOLD ? This possibly explains why you do not see the tab.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
lostpckt
Posts: 14
Joined: Wed Sep 12, 2007 1:53 pm

Post by lostpckt »

Wow, I didn't even think to look and see if there was new check boxes in the realm configuration.

That was the ticket; Thanks mcutting.
slech
Cacti User
Posts: 90
Joined: Tue Nov 06, 2007 7:51 am

Post by slech »

Thold and killspike
Apear error
Notice: Undefined index: user_admin.php:user_edit in <cacti path>\lib\functions.php on line 1455

when disable killspike its ok.

whose bag ?
[size=75]
[color=green]|Cacti 0.87|[/color][color=green]|PA 1.3|[/color][color=green]|Poller cmd.php|[/color][color=green]|IIS 6.0|[/color][color=green]|PHP Version 5.2.4|[/color][color=green]|MySQL 5.0.27|[/color][color=green]|RRDtool 1.2.15|[/color][/size]
[color=brown]|Thold 0.3.8 |[/color] [color=red]|Zond 0.34 |[/color]
[url=http://forums.cacti.net/viewtopic.php?t=15067][size=75]Complete List of Cacti Scripts and Templates[/size][/url]
[url=http://forums.cacti.net/viewtopic.php?t=14985][size=75]Currently Known Plugins[/size][/url]
slech
Cacti User
Posts: 90
Joined: Tue Nov 06, 2007 7:51 am

Post by slech »

and why apear error when i activate thold plugin - then error no longer returns


11/13/2007 10:23:45 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1062', SQL:"INSERT INTO `user_auth_realm` VALUES (19, 1);'
11/13/2007 10:23:45 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1062', SQL:"INSERT INTO `user_auth_realm` VALUES (18, 1);'
11/13/2007 10:23:42 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"REPLACE INTO plugin_thold_contacts (user_id, type, data) VALUES (1, 'email', '')'
11/13/2007 10:23:42 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1146', SQL:"SELECT id FROM plugin_thold_contacts WHERE type = 'email' AND user_id = 1"
11/13/2007 10:23:38 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1146', SQL:"SELECT data FROM plugin_thold_contacts WHERE user_id = 1 AND type = 'email'"
[size=75]
[color=green]|Cacti 0.87|[/color][color=green]|PA 1.3|[/color][color=green]|Poller cmd.php|[/color][color=green]|IIS 6.0|[/color][color=green]|PHP Version 5.2.4|[/color][color=green]|MySQL 5.0.27|[/color][color=green]|RRDtool 1.2.15|[/color][/size]
[color=brown]|Thold 0.3.8 |[/color] [color=red]|Zond 0.34 |[/color]
[url=http://forums.cacti.net/viewtopic.php?t=15067][size=75]Complete List of Cacti Scripts and Templates[/size][/url]
[url=http://forums.cacti.net/viewtopic.php?t=14985][size=75]Currently Known Plugins[/size][/url]
joker
Posts: 4
Joined: Wed Nov 28, 2007 7:30 am

Post by joker »

dennis00 wrote:Installed... yet... a question... it says: "Data Source Item [traffic_in] - Current value: [38128.5867]".

What does this actually mean? I want to get a mail when my switch (port 24) is doing 30mbit+ for more than 2 hours...

Yet I have no idea how to set up the treshhold and what "38128.5867" means.
i solved one part of problem:
OS FreeBSD 6.2
Cacti Version 0.8.7a
Plagin thold-0.3.8
model of swtich: zyxel GS-4012F


i calculate current value of threshold:
(last value of snmpget - earlier value of snmpget)/300(s)=current value of threshold (B/s)
(1345635213 - 452294379)/300=2977802,78 (B/s)

And counter in switch is 32bit (you can see it on picture snmpget.jpg). so when counter have value over 4294967295 its go to 0. And with this case last value of counter will be smaller then previous.
Formula looks like this:
((max posible value of counter - previous value of counter) + last value of counter))/300s=curent value of threshold(B/s)


And when i want to trigger of threshold when total bandwidth of channel over 100 Mb/s i insert value in 12500000 B/s.
For now everything work fine but have problem when threshold starting: - i set up higher trheshold by 12500000 but the first time threshold triggered when load of one of channel where only 128 KB/s.
So continue testing....
Attachments
i see in cacti log what OID poller get from switch.
i see in cacti log what OID poller get from switch.
1.JPG (17.89 KiB) Viewed 13843 times
i run snmpget command to get this OID from switch.
i run snmpget command to get this OID from switch.
snmpget.JPG (9.8 KiB) Viewed 13843 times
this is earlier poller request for same OID from swtich
this is earlier poller request for same OID from swtich
2.JPG (16.21 KiB) Viewed 13843 times
and this is current value of threshold after last poller's cheсk
and this is current value of threshold after last poller's cheсk
3.JPG (7.87 KiB) Viewed 13843 times
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

Post by kyosanim »

I have one problem with thold. i have to monitor about 500 routers. for this i created some threshold templates.

e.g. a template to monitor "Interface Queue Drops".
In this template i use a "Trigger Count" of 1 + a High Treshold of 10.

I want to get a email if the interface had more then 10 Queue Drops per minute!

When i create the threshold with the threshold template cacti receives the first countervalue.
for example the value is 100. because thold has no "LAST VALUE" it seams thold uses 0 by default.

-> CURRENT VALUE (100) - LAST VALUE (0) = 100

the point is: if i create a threshold with trigger count 1 + the datasource is a counter - thold alerts after the first polling.

it would be better if thold waits for 2-3 pollings before it starts to check new thresholds.


sorry for my bad english.
karias
Cacti User
Posts: 60
Joined: Wed Oct 25, 2006 10:36 am

Re: Storing Triggered Thold's for future references

Post by karias »

cigamit wrote:
r_chetanjain wrote:Hi,

Gr8 plugin....Can we have a facility to store all the triggered Thold's for future references.....

Any ideas.....
There is a log file, you just have to turn it on manually in the file. Open check-thold.php and change $debug to 1. You can also log to syslog, if that helps any.
I've set the $debug to 1, is there anything else I have to do so that I can see the CactiTholdLog that's supposed to be created for these threshold messages? Do I need to manually create this file somewhere?
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

Post by kyosanim »

check_thold.php is an old file. it is not longer used from thold (exit;).

you have to set "debug = true;" in thold-functions.php and create a writeable file (thold.log) in cactis log/ directory.

it works for me...
karias
Cacti User
Posts: 60
Joined: Wed Oct 25, 2006 10:36 am

Post by karias »

That worked for me kyosanim, thx!
peecee
Cacti User
Posts: 146
Joined: Tue Feb 26, 2008 7:26 am

Bug report

Post by peecee »

This is an annoying bug, and probably one that does not affect the running of thold at all; it is probably only cosmetic.

On the thold tab, the last poll displays the correct last time the poller ran.

However, when selecting the Thresholds menu item from the Management section of the left sidebar menu, it does not update on its own. I can only get it to update if I go to the thold tab first, then go to the left menu item. Then the last poll displays fine, or at least it looks like it.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests