THold 2.0 beta - Threshold monitoring plugin for cacti 8.6c

Support questions about the Threshold plugin

Moderators: Developers, Moderators

User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I suggest an alternative.

If you add a patch for the poller.php that would collect the values of the metrics before they are written to the RRDs and then a function at the end of the polling that processes thresholds.

This would make it less platform dependant.

That's how I would do it.. ;)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Matt_B
Posts: 6
Joined: Tue Feb 08, 2005 1:22 pm

Post by Matt_B »

mdw162 thx for the help. I have an parse error at:

$output = `$rrdtoolpath fetch $cactiroot/rra/*_$rra.rrd MAX -s $last_time_entry | \
grep -vi nan | tail -1 | awk '{print $2}' `;

being the newbie I am to php I am not sure how to fix it. It sees to be arountd the t/rra/*_$rra.rrd area.

Thank you again!

-Matt
mdw162
Posts: 23
Joined: Fri Feb 04, 2005 7:49 pm

Post by mdw162 »

One more thing I noticed about Register_Globals:

In listthold.php, the email and del variables need the same isset($_REQUEST[VAR]) fix.

Thanks.
mdw162
Posts: 23
Joined: Fri Feb 04, 2005 7:49 pm

Post by mdw162 »

Matt_B: not sure I can help you much with the parse error. Can you give me the exact error message and your PHP version? I don't know, but maybe some versions execute shell code differently. I'm using 4.3.10.

rony: I couldn't agree more. I'm just hacking a few patches on to get this to work because I need the alert functionality. But it would be great if someone could write this all in PHP and integrate it better with the the main Cacti release.

Everyone: Not a bug, but just in case anyone has a simlilar issue...I was trying to use the email functionality to send a text message to my cell phone (number@vtext.com) but it never got through. I think the relay server was blocking it because of the content type being text/html. I changed that to text/plain and it worked fine.

By the way, I forgot to mention in a previous email that you can turn off the DEBUG logging off in Cacti if you make the changes I listed in the other post.
benhanson
Posts: 43
Joined: Tue Feb 08, 2005 8:59 pm

Win32 use

Post by benhanson »

This appears to be working with Win2k. I've included a .bat file for those without sh or any of the other handy unix tools(grep, awk, replace)

I have a few questions:

How can I tell if a graph is GAUGE based or COUNTER based?

Does anyone have this working to provide drive space alerts on Win2k?
Attachments
install.zip
(1.6 KiB) Downloaded 383 times
benhanson
Posts: 43
Joined: Tue Feb 08, 2005 8:59 pm

I guess I spoke too soon

Post by benhanson »

All of the interface modifications appear OK, but all of the thresholds show current value of 0(zero) I just ran the check-thold.php from the shell and it appears I'll need to conver the parse.sh to a bat file, removing the unix specifics.

Looks like there are several shell_exec comands in check-thold.php, and just some awking in parse.sh. If anyone beats me to it converting these for win32, please post.
adesimone
Posts: 32
Joined: Mon Jan 24, 2005 12:46 am
Contact:

Post by adesimone »

yes, the windows-compatability issue is not only with the install file, rather with the check-thold.php

I think I have found a way to avoid grabbing the data from rrd or log files, which would make this compatable with windows...

thanks for everyone's input... I hope to release an update tonight.

stay tuned..
adesimone
Ip-Watch
Posts: 2
Joined: Wed Jan 19, 2005 6:18 pm

Post by Ip-Watch »

GREAT TOOL !!

i have a question please ..
i belive this add-on is based on sending an email in case of problem..

ok, is it possible to open an http://URL instead ?
you might be asking why .. well, i can send this way SMS to my mobile ..
i mean i have a way of sending SMS to my mobile via one http://URL so it would be more better that email ...

i hope it's possible...
adesimone
Posts: 32
Joined: Mon Jan 24, 2005 12:46 am
Contact:

Post by adesimone »

The main 'threshld' tab shows the summary; that could be included in the emails easily if that is the functionality you would like.
adesimone
Posts: 32
Joined: Mon Jan 24, 2005 12:46 am
Contact:

Post by adesimone »

OK - here's version 2.0c

I think we are bridging the gap here for the desired functionality; thanks for everyone's suggestions / input.

I belive I can integrate this into poller.php as rony suggested (this is my ultimate goal) by taking advantage of the 'poller_output' table before the data is flushed. This may require a bit of table restructuring and may take a bit longer.

New features:
- more intelligent polling via rrdfetch (thanks to mdw162)
- host up/down notification
- minor enhancments

Bug fixes/etc:
- minor bug fixes (register_globals, etc)

I have attached an update for existing installations and a complete install for new installations.

thanks
adesimone
Attachments
thold2.0c.zip
full install
(44.25 KiB) Downloaded 559 times
thold2.0c-update.zip
update to thold2.0b
(6.35 KiB) Downloaded 393 times
ranko
Posts: 9
Joined: Tue Feb 04, 2003 7:07 pm
Location: Nicosia, Cyprus

Suggestions for enhancements

Post by ranko »

Suggestions on enhancing THold:

1. To have both upper and lower bound thresholds - but only one to be mandatory: this way you can have an alert if you run out of something (free disk space...)

2. "Baseline" thresholds:

RRDs hold a lot of very useful data. The contents of the RRD could be used to monitor the baseline of what is considered the normal thresholds for a particular time of the day for the particular data source.

My vision of how this could work is by having this baseline thresholds as an additional option to the "hard" threshold. I would still leave the "hard" threshold(s) as a mandatory parameter. This way if the standard deviation of the baseline covers gradual change in the baseline over time, you would still get an alert if the "hard" threshold is breached.

The first and basic requirement for this feature would be to have enough data to work with. For some data sources it could be for example an hour, while for the other sources it could be a week. Why? If you take as an example the CPU utilization of a server: the utilization pattern of Friday is not the same as the pattern of Saturday. The same applies for Sunday and Monday. But if you take the pattern of the CPU utilization from a week ago, you will see that they are most probably the same within a boundary of some deviation.

Second, the baseline alerts should be configurable to be triggered only after a number of "failures". This way you could smooth out some spikes and dips.

Another addition to this, that I consider it would be very useful, would be the exception periods. An example of the exception period would be a scheduled maintenance or a holiday. It should be expected that monitored baseline thresholds would be breached during those periods. For those periods, only the "hard" thresholds should be monitored.

Just my 2c.

R.

PS: I am also very much willing to invest some time on this subject, both developing it conceptually and coding.
Nitro
Posts: 5
Joined: Thu Feb 10, 2005 8:31 am

Awsome addon for an allready awsome tool :)

Post by Nitro »

few things tho

1. the check-thold.php did not like for some reason ../include/config.php for the include line, wierd but I had to substitute that for the full path to config.php

2. the install script failed if it was designed to create the thold.log and chmod it

Once I had manually fixed those it seemed fine and is now updating the database

now i have made an lmsensors perl script that works both remote and local but I monitor multiple items to one graph and ie fan speeds and temps go to 1 graph and voltages go to another, seems that thold doesnt like that ?

also will it be possible to have < or > than thresholds ie your cpu fan drops below 2000 rpm you want to know about it instead of waiting for the cpu temp to peak @ < 60 .

I know its early days for this addon but thats just how I would hope could be done

Well great job so far tho and note I did wait for the rrdfecth ver which aside from the install script not creating a log file it installed with ease on suse 9.1
Matt_B
Posts: 6
Joined: Tue Feb 08, 2005 1:22 pm

Post by Matt_B »

adesimone: Thank you for the update. That fixed all my issues. Now if I can get it to notify my by email. I am not sure what the troubel is there.

mdw162: Thx for the help. Now that I have updated to 2.0c all is working (besides email notify).

Thank you all for your help!

-Matt
www.mattsshack.com
Matt_B
Posts: 6
Joined: Tue Feb 08, 2005 1:22 pm

Post by Matt_B »

Ok I have everythign working great now. I changed the email field length to 100 (since i have 3 email address I like to send too) and edited the listtholg.php to match these changes.

Email is now following. Thank you again to everyone. This is awsome.

-Matt
www.mattsshack.com
mdw162
Posts: 23
Joined: Fri Feb 04, 2005 7:49 pm

Post by mdw162 »

MATT_B, out of curiosity, what was the cause of the parse error you got earlier?

Also, I thought about increasing the email width, too, but was afraid it would break something. What changes did you make to listthold.php?
Locked

Who is online

Users browsing this forum: No registered users and 1 guest