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

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Locked
Rossco
Cacti User
Posts: 76
Joined: Sat Jan 15, 2005 4:52 pm
Location: London, England

Thold locking browser

Post by Rossco »

Hi all

Well, this maybe just a problem for me and my install.

Having gone through the code and selectively removed huge chunks, the line that seems to be causing the problem is:

<img src="graph_image.php?local_graph_id=<?php echo $graph ?>&rra_id=1&graph_start=-32400&graph_height=100&graph_width=300&graph_nolegend=true">
I remove this, restart IIS(wasted a good hour having not realised IIS was caching the damn page) and it hasnt locked up on me yet. Reinhard may be correct in that it is some bizarre issue with rrdtool(or the syntax used with it) that only occurs a certain period after the RRD has been updated.

Got my finger crossed this problem doesnt return.

Cheers

Ross[/quote]
Rossco
Cacti User
Posts: 76
Joined: Sat Jan 15, 2005 4:52 pm
Location: London, England

weekend exemption

Post by Rossco »

Hi All

Whilst trying to fix my above problem (still working ok!) I noticed I wasnt getting alert mails even with weekend exemption turned off.

I'm not a php coder, but looking at this:
// check for exemptions
$weekday=date("l");
if ($weekday == "Saturday" || $weekday == "Sunday" && $alert_exempt == "on") {
exit("weekend exemption is on");
}
Doesnt it mean it will always ignore alerts on a saturday and only do the correct check on a sunday? Shouldnt it be something like...
// check for exemptions
$weekday=date("l");
if ($weekday == "Saturday" || $weekday == "Sunday") {
if ($alert_exempt == "on") {
exit("weekend exemption is on");
}
}
Or just slap in a couple of extra brackets to the earlier line to make it look prettier ;-)

cheers

Rossco

PS - Cacti and THOLD are great, keep up the good work!
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

Cigamit wrote:
In case anyone is interested, I have done numerous enhancements to our local copy of the Thresholds module, and if you would like to incorporate the code back I'll post them (There are several patches to different files).
yes! very interested. can you please post the changes / addons?

regards,
harel
john le lardon
Cacti User
Posts: 52
Joined: Fri May 06, 2005 7:39 am
Location: france
Contact:

Post by john le lardon »

hi!
i have some problems about installing thold for cacti 0.8.6d
i had install cacti via rpms, and i don't know how to install thold ?

i try :
patch -p1 < cactid-0.8.6d-thold.patch
but patch want util.c and i don't know where it is. ( not in cacti directory or subdirectory )

and i'm bite afraid , must I reinstall cacti with sources file and patch sources before instaling cacti ?

can you help me ? :)
aboyz

can someone post a final working version

Post by aboyz »

Hi,

was wondering if someone can post or upload a final working relelase. i believe there have been some fixes and bug? Please upload a working version or where I can downlaod the update of this nice script. and a howto on it

thanks
predou
Posts: 45
Joined: Fri Jan 07, 2005 8:42 am

Post by predou »

Hi !
Someone have tried with Cacti 0.86d ???

Treshold 2.1b will go out soon ?

Thx for you great work :)

Pierre
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Here is the beginnings of a plugin architecture for Cacti. This is basically the same plugin backend we currently use in Squirrelmail (GPL Licensed!). It makes for an excellent way to hook into almost any area of the code, just by adding a simple function call. I threw this together last night, and it seems to work without any problems. Eventually we would want to add a ton more hooks, but the functionality is the same.

There are a few things that were taken for granted before, but can't be now. We can't be sure that the current displayed page will always be in the root of the Cacti folder, so we have to add an extra variable to the config.php for this, and modify the header images to use it, instead of just blindly saying "images/picture.gif". You basically just specifiy the root url path to cacti, like "http://testserver/cacti/". We also add a $plugins variable to list the name (IE folder name) of the plugins we want to load. We could have them auto-load, but that would be a security hole waiting to happen.

This patch is against v0.8.6d, without the threshold module instatlled. I will release another patch for the threshold module users later. The patch is only 16K, so its very unintrusive.

-----

Just as a proof of concept, I have completely modified my Monitoring module to use this architecture. You can see that I easily added to the Host editting form, saving forms, permissions, and even a tab up top. Much more can be done, and I am sure will be done in the future.

This plugin will add a Column to your Host table called "monitor" but other than that, it doesn't change a single thing.

As with anytime you are testing something new, BESURE TO BACKUP FIRST!!!!

-----

Instructions are simple, apply the patch, create a folder in the cacti folder called "plugins" and then extract the contents of the plugin into a folder called "monitor" in the plugins folder.

Edit your patched include/config.php and uncomment the $plugins[] = 'monitor'; and also set the $config['url_path'].
Attachments
cacti-plugin-arch.zip
Beta Plugin Architecture for Cacti
(3.45 KiB) Downloaded 320 times
monitor.0.1.tar.gz
Monitoring module for Cacti
(216.74 KiB) Downloaded 401 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

baselining overridden by explicit thresholds?

Post by gandalf »

First of all a great "thank you" to adesimone for this great work! :D

I'm working with baselining "on" and overriding only low threshold with value 0 (this is: I only want baselining to be in effect for above threshold alerting. As I understood, the precedence however is on the "hard" thresholds ....
But thold still triggers even for "below" values (value is below "baselined low threshold" but above "absolute low threshold")
So I tried to set both High and Low Thresholds. Leaving "Baseline Monitoring" checked, it seems that these absolute thresholds are ignored.
So, do I have to uncheck even if only "Low Threshold" is set?

thanx for help
Reinhard

by the way:
Personally, I would like to see the actual computed "High and Low Baselined Threshold" in the "Threshold Management" View, just near column "Current" (think I can do this by myself).
And I'd like a filtering function similar to the "Search: " filter in e.g. Devices View to easily fiddle around with some 100 trigger definitions ... (seems to be more complicated to me, as I'm not a php coder).
What about cigamit's approach? Seems to be VERY interesting ...
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

Cigamit says:
Instructions are simple, apply the patch, create a folder in the cacti folder called "plugins" and then extract the contents of the plugin into a folder called "monitor" in the plugins folder.

Edit your patched include/config.php and uncomment the $plugins[] = 'monitor'; and also set the $config['url_path'].
pardon? :)
how do i apply tha patch?

Harel
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

oharel wrote: pardon? :)
how do i apply tha patch?
Harel
patch -p1 -N < cacti-plugin-arch.diff

From inside the cacti directory (copy the patch there).
That should do the trick assuming you are on nix, or have cgywin on windows. The patch is small enough that its fairly simple to do by hand also.
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

Cigamit wrote:
patch -p1 -N < cacti-plugin-arch.diff
this is what i get:

C:\cygwin\bin>patch -p1 -N < C:\Apache\Apache\htdocs\cacti\plugins\monitor\cact
i-plugin-arch.diff
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur cacti-0.8.6d/include/config_arrays.php cacti/include/config_arrays.p
hp
|--- cacti-0.8.6d/include/config_arrays.php 2005-04-26 19:47:36.000000000 -0
500
|+++ cacti/include/config_arrays.php 2005-05-10 00:08:04.000000000 -0500
--------------------------
File to patch:

i get pretty much the same on a linux machine i have Cacti installed on.
what am i doing wrong?
also, which files should i backup exactly before doing this?

thanks
Harel
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

oharel wrote:Cigamit wrote:
patch -p1 -N < cacti-plugin-arch.diff
this is what i get:

C:\cygwin\bin>patch -p1 -N < C:\Apache\Apache\htdocs\cacti\plugins\monitor\cact
i-plugin-arch.diff
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur cacti-0.8.6d/include/config_arrays.php cacti/include/config_arrays.p
hp
|--- cacti-0.8.6d/include/config_arrays.php 2005-04-26 19:47:36.000000000 -0
500
|+++ cacti/include/config_arrays.php 2005-05-10 00:08:04.000000000 -0500
--------------------------
File to patch:

i get pretty much the same on a linux machine i have Cacti installed on.
what am i doing wrong?
also, which files should i backup exactly before doing this?

thanks
Harel
Um.. I see a few things that are not correct, try doing this...
copy the file to C:\Apache\Apache\htdocs\cacti\
then
cd C:\Apache\Apache\htdocs\cacti\
C:\cygwin\bin\patch -p1 -N < cacti-plugin-arch.diff

That should do it, you have to be in the cacti directory (and so does the patch) when you run the patch command. You were also putting it in cacti/plugins/monitor/cacti, which would also cause some problems (thats not the "cacti" directory).

If that doesn't work, then you might want to put C:\cygwin\bin in the system path and then do
cd C:\Apache\Apache\htdocs\cacti\
patch -p1 -N < cacti-plugin-arch.diff

Also, I noticed that I trimmed the extra new line off the end of the file, you may want to go to the bottom of the patch file, and put a blank line, otherwise it tells you that it ended abruptly (even though everything still patches correctly)

As far as what you should backup... this is what it patches, so the minimum I would do is these and the SQL database. Granted the include/plugins.php and plugins/index.php do not exist yet, so you can't back them up.

[root@localhost cacti-0.8.6d]# patch -p1 -N < cacti-plugin-arch.diff
patching file include/config_arrays.php
patching file include/config_form.php
patching file include/config.php
patching file include/config_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
patching file include/top_header.php
patching file lib/api_device.php
patching file lib/functions.php
patching file plugins/index.php
aboyz

new version??

Post by aboyz »

when will version B be out???
john le lardon
Cacti User
Posts: 52
Joined: Fri May 06, 2005 7:39 am
Location: france
Contact:

Post by john le lardon »

no patch want to work T_T:
i'm in cacti work directory
---------------------------------------------------------------------------------------------------------
[root@test cacti]# patch -p1 -N < cactid-0.8.6d-thold.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cacti-cactid-0.8.6d-backup/util.c 2005-01-19 07:04:10.000000000 +0200
|+++ cacti-cactid-0.8.6d/util.c 2005-04-04 02:02:07.000000000 +0300
--------------------------
File to patch:
--------------------------------------------------------------------------------------------------------
where must i do the patch ??

and after i try the other patch but :
--------------------------------------------------------------------------------------------------------
[root@test cacti]# patch -p1 -N < cacti-plugin-arch.diff
patching file include/config_arrays.php
patching file include/config_form.php
patching file include/config.php
Hunk #1 succeeded at 31 with fuzz 2.
patching file include/config_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
patching file include/top_header.php
patching file lib/api_device.php
patching file lib/functions.php
patching file plugins/index.php
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 307:
--------------------------------------------------------------------------------------------------------
cacti is not with me >_<
if anyone can help me :'( ? please

edit : and now all is dead on my cacti .
aboyz

anyone know if this work for latest cacti d?

Post by aboyz »

Hi,

was wondering if this work with cacti d? before i try it i don't want to mess up my cacti. or can someone upload a new version of thehold that will work for cacti_d.

thanks
Locked

Who is online

Users browsing this forum: No registered users and 0 guests