Thold 2.x - Thresholding/Alerting module for cacti 8.6
Moderators: Developers, Moderators
Hey guys I think I have a fix if you have problems with thold showing a 0 or nothing in your Threshold column when you view your thresholds.
I believe the problem has something to do with the way RRDTool reports the last entry time. In the [cacti-root]/lib directory the thold-functions.php file has a function called get_current_value() that uses the an "rrdtool last" call to figure out when the last time the RRA had anything stored in it. But it appears that the actual time of the last record and whats reported by the "rrdtool LAST" command is different. For me it was different by one second. But this second is extremely important because the time reported back by the "rrdtool LAST" is used in the get_current_value() function for thold.
So based on some earlier posts about problems with thold not alarming on thresholds I did my own little "hack" to the thold-fuctions.php file. What I did was this,
Current get_current_value() function code in [cacti-root]/lib/thold-fuctions.php,
And changed it to,
Basically I added $last_time_entry = $last_time_entry - 100; after the rrd_last() function call to decrement the last time the RRA had data stored in it by 100 seconds. This seemed to fix my problem.
I believe the problem has something to do with the way RRDTool reports the last entry time. In the [cacti-root]/lib directory the thold-functions.php file has a function called get_current_value() that uses the an "rrdtool last" call to figure out when the last time the RRA had anything stored in it. But it appears that the actual time of the last record and whats reported by the "rrdtool LAST" command is different. For me it was different by one second. But this second is extremely important because the time reported back by the "rrdtool LAST" is used in the get_current_value() function for thold.
So based on some earlier posts about problems with thold not alarming on thresholds I did my own little "hack" to the thold-fuctions.php file. What I did was this,
Current get_current_value() function code in [cacti-root]/lib/thold-fuctions.php,
Code: Select all
function get_current_value($rra, $ds)
{
global $config;
$last_time_entry = rrd_last($rra, "MAX");
$last_needed = $last_time_entry + 900;
$result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed);
$idx = array_search($ds, $result["data_source_names"]);
return
}
Code: Select all
function get_current_value($rra, $ds)
{
global $config;
$last_time_entry = rrd_last($rra, "MAX");
$last_time_entry = $last_time_entry - 100;
$last_needed = $last_time_entry + 900;
$result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed);
$idx = array_search($ds, $result["data_source_names"]);
return
}
-
- Posts: 49
- Joined: Fri Mar 18, 2005 7:33 am
- Location: France
htold plugin and smtp
can someone help me about implementing smtp with thold instead of using the standard phpmail.
i'm running w2k - cacti 0.8.6.f
thanks.
i'm running w2k - cacti 0.8.6.f
thanks.
-
- Posts: 4
- Joined: Sat Sep 10, 2005 4:47 am
Since i installed this script i get the following error if i want to export a Template:
Code: Select all
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Notice: Undefined index: 0.8.6f in /srv/www/htdocs/php/cacti/lib/functions.php on line 1604
Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/php/cacti/lib/functions.php:1604) in /srv/www/htdocs/php/cacti/templates_export.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/php/cacti/lib/functions.php:1604) in /srv/www/htdocs/php/cacti/templates_export.php on line 89
Eseldown on Eseldown hash_03c5466f79347dc8203d45ebef9e65a8d8 300 on hash_15c21df5178e5c955013591239eb0afd46|hash_150d9c0af8b8acdc7807943937b3208e29|hash_156fc2d038fb42950138b0ce3e9874cc60|hash_15e36f3adb9f152adfa5dc50fd2b23337e Eseldown 0 380 1 600 hash_07d3c90b997c1c3333a40d010902906fb6 EselDownload 1 sh /eseldown/mlstats/ml_down.sh Download on out Download Daily (5 Minute Average) 0.5 1 600 86400 1|3|4 Weekly (30 Minute Average) 0.5 6 700 604800 1|3|4 Monthly (2 Hour Average) 0.5 24 775 2678400 1|3|4 Yearly (1 Day Average) 0.5 288 797 33053184 1|3|4
Adding Threshold in Templates
Hi all.
First thanks for this really good and needed addon.
I would like to know if there is a way to add the threshold to a default template so that it is created at the same time as the graph itself.
Ex: having a threshold for every interface i graph...
I also created a set of templates to graph process monitored by ucd-snmp and netsnmp. One graph per process, with also the error field. It is then easy to graph a single daemon and put a threshold on it.
Just ask if someone neet it.
Cheers
First thanks for this really good and needed addon.
I would like to know if there is a way to add the threshold to a default template so that it is created at the same time as the graph itself.
Ex: having a threshold for every interface i graph...
I also created a set of templates to graph process monitored by ucd-snmp and netsnmp. One graph per process, with also the error field. It is then easy to graph a single daemon and put a threshold on it.
Just ask if someone neet it.
Cheers
--
Prune
(Dual G5/4go/RAID)
Prune
(Dual G5/4go/RAID)
Threshold Templates
Hi Prune,
I will be very interested by those templates, So if you could post them on the forum, this could help others people than me too.
Thank you (Merci) for your help
Regards
Laurent
I will be very interested by those templates, So if you could post them on the forum, this could help others people than me too.
Thank you (Merci) for your help
Regards
Laurent
-
- Posts: 4
- Joined: Wed Sep 07, 2005 11:47 am
This does seem to help. I still get zeros but now it lists them as not triggered.warnesj wrote:Hey guys I think I have a fix if you have problems with thold showing a 0 or nothing in your Threshold column when you view your thresholds.
I believe the problem has something to do with the way RRDTool reports the last entry time. In the [cacti-root]/lib directory the thold-functions.php file has a function called get_current_value() that uses the an "rrdtool last" call to figure out when the last time the RRA had anything stored in it. But it appears that the actual time of the last record and whats reported by the "rrdtool LAST" command is different. For me it was different by one second. But this second is extremely important because the time reported back by the "rrdtool LAST" is used in the get_current_value() function for thold.
So based on some earlier posts about problems with thold not alarming on thresholds I did my own little "hack" to the thold-fuctions.php file. What I did was this,
Current get_current_value() function code in [cacti-root]/lib/thold-fuctions.php,And changed it to,Code: Select all
function get_current_value($rra, $ds) { global $config; $last_time_entry = rrd_last($rra, "MAX"); $last_needed = $last_time_entry + 900; $result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed); $idx = array_search($ds, $result["data_source_names"]); return }
Basically I added $last_time_entry = $last_time_entry - 100; after the rrd_last() function call to decrement the last time the RRA had data stored in it by 100 seconds. This seemed to fix my problem.Code: Select all
function get_current_value($rra, $ds) { global $config; $last_time_entry = rrd_last($rra, "MAX"); $last_time_entry = $last_time_entry - 100; $last_needed = $last_time_entry + 900; $result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed); $idx = array_search($ds, $result["data_source_names"]); return }
I was getting the Undefined offset: 0 on line 37 error. I removed [0] from line 37 in the thold-functions.php file and the error disapeared but I still just get zeros.
I changed:
return round($result["values"][$idx][0]);
To:
return round($result["values"][$idx]);
I know very little about programming. I was just playing with the code to see if the results would change.
Edit:
I can also trigger the alerts by adjusting the high or low threshold levels. So I know that it is getting the correct current setting, it is just not displaying it.
THold 2.1a for Cacti 0.8.6g
Hi all,
First of all, thanks a lot for Cacti application, and also for Treshold addon.
This is my first post here.
You will find as attachement, treshold addon for cacti 0.8.6g.
This archive is only for cacti 0.8.6g under Unix. I have not tested under Win32.
Also include on this archive treshold-sorting patch.
Installation script is different from the original one.
I have prepare patch file. That give you choice of patching original files, or copying new one.
Have fun !
First of all, thanks a lot for Cacti application, and also for Treshold addon.
This is my first post here.
You will find as attachement, treshold addon for cacti 0.8.6g.
This archive is only for cacti 0.8.6g under Unix. I have not tested under Win32.
Also include on this archive treshold-sorting patch.
Installation script is different from the original one.
I have prepare patch file. That give you choice of patching original files, or copying new one.
Have fun !
- Attachments
-
- thold2.1a_cacti-0.8.6g.tar.gz
- Treshold2.1a for Cacti0.8.6g
- (65.1 KiB) Downloaded 645 times
Treshold features
Hi,
I have few questions about treshold addon.
1/ Will it be possible to have treshold configuration during graph creation ?
2/ Will it be possible to have different treshold for specific range of hours ? (example, having a high treshold traffic during days of 20Mbps and a high treshold of 5Mbps during nights)
Have a nice day !
I have few questions about treshold addon.
1/ Will it be possible to have treshold configuration during graph creation ?
2/ Will it be possible to have different treshold for specific range of hours ? (example, having a high treshold traffic during days of 20Mbps and a high treshold of 5Mbps during nights)
Have a nice day !
-
- Posts: 7
- Joined: Fri Mar 11, 2005 7:11 am
Installing Thold on Windows
Hy,
I want to install Thold on my Windows server 2003 machine.
Can anybody tell me how to do that?
Where can I find a manual ore someting?
Cacti 8.6f is already running good.
Thnx in advanced!
Greet, Hardinxcore
I want to install Thold on my Windows server 2003 machine.
Can anybody tell me how to do that?
Where can I find a manual ore someting?
Cacti 8.6f is already running good.
Thnx in advanced!
Greet, Hardinxcore
Re: Treshold features
I'd like to know this as well. Any ideas on this?cmarsot wrote:Hi,
I have few questions about treshold addon.
1/ Will it be possible to have treshold configuration during graph creation ?
2/ Will it be possible to have different treshold for specific range of hours ? (example, having a high treshold traffic during days of 20Mbps and a high treshold of 5Mbps during nights)
Have a nice day !
- cjennings_cr
- Posts: 20
- Joined: Thu Jan 06, 2005 8:09 am
- Contact:
No thold data template after new install.
I have Windows 2000 with cacti 0.8.6g and just downloaded the latest thold for this cacti release.
I manually installed it:
1) Backed up cacti files
2) mysqldump-ed the database
3) mysql cacti < thold.sql
4) created / copied (overwrite) the following files:
...a) {cactibase}\thold\check-thold.php
...b) {cactibase}\thold.php
...c) {cactibase}\listthold.php
...d) {cactibase}\images\tab_thold.gif
...e) {cactibase}\graph_thold.php
...f) {cactibase}\include\config_arrays.php
...g) {cactibase}\include\config_settings.php
...h) {cactibase}\data_sources.php
...i) {cactibase}\graphs_new.php
...j) {cactibase}\lib\functions.php
...k) {cactibase}\include\top_graph_header.php
...l) {cactibase}\include\top_header.php
...m) {cactibase}\lib\thold-functions.php
5) activated the check-thold.php as a scheduled task.
I have seen no errors that pop out at me - but - I don't have the thold data template - so I can't do anything.
Any ideas?
I manually installed it:
1) Backed up cacti files
2) mysqldump-ed the database
3) mysql cacti < thold.sql
4) created / copied (overwrite) the following files:
...a) {cactibase}\thold\check-thold.php
...b) {cactibase}\thold.php
...c) {cactibase}\listthold.php
...d) {cactibase}\images\tab_thold.gif
...e) {cactibase}\graph_thold.php
...f) {cactibase}\include\config_arrays.php
...g) {cactibase}\include\config_settings.php
...h) {cactibase}\data_sources.php
...i) {cactibase}\graphs_new.php
...j) {cactibase}\lib\functions.php
...k) {cactibase}\include\top_graph_header.php
...l) {cactibase}\include\top_header.php
...m) {cactibase}\lib\thold-functions.php
5) activated the check-thold.php as a scheduled task.
I have seen no errors that pop out at me - but - I don't have the thold data template - so I can't do anything.
Any ideas?
Code: Select all
So based on some earlier posts about problems with thold not alarming on thresholds I did my own little "hack" to the thold-fuctions.php file. What I did was this,
Current get_current_value() function code in [cacti-root]/lib/thold-fuctions.php,
Code:
function get_current_value($rra, $ds)
{
global $config;
$last_time_entry = rrd_last($rra, "MAX");
$last_needed = $last_time_entry + 900;
$result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed);
$idx = array_search($ds, $result["data_source_names"]);
return
}
And changed it to,
Code:
function get_current_value($rra, $ds)
{
global $config;
$last_time_entry = rrd_last($rra, "MAX");
$last_time_entry = $last_time_entry - 100;
$last_needed = $last_time_entry + 900;
$result = rrdtool_function_fetch($rra, $last_time_entry, $last_needed);
$idx = array_search($ds, $result["data_source_names"]);
return
}
My value ended up working at -200. I believe this value has to do with how long it takes for your poller to actually work. Mine takes about 2 minutes, 30 seconds so -200 worked for me great. Play with this value until it comes out correctly.
Who is online
Users browsing this forum: No registered users and 1 guest