Thold 2.x - Thresholding/Alerting module for cacti 8.6

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Locked
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

Post by rik »

äähhhmm...

no it is not a windows specific problem, because i am working with freebsd in a jailed enviroment and uni_tom has the same problem on his redhat linux.

i had no time to look further to solve this till now.

grtz
Vaayl
Posts: 4
Joined: Tue Aug 16, 2005 1:49 pm

Post by Vaayl »

I'm having a similar problem to the current value showing 0 but mine is not showing anything for the current value at all.

I am using the following:
Windows 2000 Server
cacti 0.8.6f
Plugin Arch 0.6
Thold Plugin 0.2.4
Attachments
ScreenShot001.jpg
ScreenShot001.jpg (16.5 KiB) Viewed 7147 times
warnesj
Cacti User
Posts: 173
Joined: Sun May 29, 2005 7:34 pm

Post by warnesj »

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,

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
}
And changed it to,

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
}
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.
scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

htold plugin and smtp

Post by scavenger67 »

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.
:D
..:Dude:..
Posts: 4
Joined: Sat Sep 10, 2005 4:47 am

Post by ..:Dude:.. »

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 
prune
Posts: 23
Joined: Sun Sep 11, 2005 9:51 am
Location: Paris, France
Contact:

Adding Threshold in Templates

Post by prune »

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
--
Prune
(Dual G5/4go/RAID)
lgastou
Posts: 1
Joined: Mon Sep 12, 2005 2:35 am
Location: France

Threshold Templates

Post by lgastou »

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
monkranter
Posts: 4
Joined: Wed Sep 07, 2005 11:47 am

Post by monkranter »

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,

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
}
And changed it to,

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
}
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.
This does seem to help. I still get zeros but now it lists them as not triggered.

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.
cmarsot
Posts: 29
Joined: Tue Sep 13, 2005 5:30 am
Contact:

THold 2.1a for Cacti 0.8.6g

Post by cmarsot »

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 !
Attachments
thold2.1a_cacti-0.8.6g.tar.gz
Treshold2.1a for Cacti0.8.6g
(65.1 KiB) Downloaded 651 times
cmarsot
Posts: 29
Joined: Tue Sep 13, 2005 5:30 am
Contact:

Treshold features

Post by cmarsot »

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 !
Hardinxcore
Posts: 7
Joined: Fri Mar 11, 2005 7:11 am

Installing Thold on Windows

Post by Hardinxcore »

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
xphu
Posts: 12
Joined: Thu Jun 30, 2005 7:31 am
Location: Helsinki, Finland

Installing Thold on Windows

Post by xphu »

Mikkel
Posts: 32
Joined: Thu May 12, 2005 12:41 am

Re: Treshold features

Post by Mikkel »

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 !
I'd like to know this as well. Any ideas on this?
User avatar
cjennings_cr
Posts: 20
Joined: Thu Jan 06, 2005 8:09 am
Contact:

No thold data template after new install.

Post by cjennings_cr »

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?
Phobos182
Cacti User
Posts: 65
Joined: Tue Sep 21, 2004 2:22 pm
Location: Madison, WI

Post by Phobos182 »

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
}
Utilizing this solution solved the problem for me. Windows 2003, Cacti-0.8.6f, RRDtool 1.2.10.

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.
Locked

Who is online

Users browsing this forum: No registered users and 2 guests