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

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Locked
LeonT
Posts: 8
Joined: Mon May 09, 2005 2:12 am

Post by LeonT »

Weathermap with Cactid as poller works fine for me :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: baselining overridden by explicit thresholds?

Post by gandalf »

lvm wrote: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?
Ok, had a look at the code by myself. As I understand, it seems to go this way:
1. check, whether absolute thresholds are set
2. if set, check each absolute threshold seperately
3. if any of these absolute thresholds is triggered, sent email
4. but if none of these absolute thresholds is met, we go on checking BOTH baseline thresholds, if baselining is set
In this case, an unmet low absolute threshold will be followed by a baseline test that may even trigger a "low threshold underrun". Changing this would require a patch for both check-thold.php and thold-functions.php.
If there is demand for such a patch, I would supply one.

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

Threshold Patches

Post by cigamit »

Here are a few patches for something that was annoying me today.

1. When you add a threshold for a Data Source that has multiple Data Source Items, if you add the threshold to any Data Source Item except the first one, the HOSTID is not properly passed on and placed into the database resulting in it using the default which is 0.

2. The sorting of the threshold tables and listbox is hard to read since there isn't much of a logical order besides the alerting at the top. These patches also set the threshold tables and listboxes to sort by alerting and then the hosts description, which makes everything nice and pretty yet still puts all the alerts up top.

Let me know if you have any questions about these. Hopefully I will get around to posting alot more patches today.
Attachments
thold-sorting.zip
Patches to the Threshold Sorting
(2.34 KiB) Downloaded 257 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Threshold Patches for Orphaned Thresholds

Post by cigamit »

Here are a few patches for when a data source is deleted. The threshold would exist, and when viewing any page that displayed the thresholds, you would receive multiple errors. This solves this by not letting it error, and instead displaying "Unknown Data Source" as the Data Source Name.

Ideally, when you delete a datasource, the threshold should be deleted along withit, and if someone would like, I can create a patch for that also.
Attachments
Thold - Orphaned.zip
Patch for Orphaned Thresholds
(2.17 KiB) Downloaded 228 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Patch for RRD Sorting issue in Thresholds

Post by cigamit »

This patch fixes an RRD sorting issue that I have seen crop up in a few places. This only occurs when items are inserted into data_template_rrd but the ID is not internally sorted correctly (its very strange, but it seems to happen to at least half my hosts, possibly when certain datasources are created and then deleted again). This completely stopped the auto creation of thresholds, and the graph in the thresholds editting window from working on certain hosts. (I can elaborate more if needed)

To fix this, the only thing that is required is to "sort by id" on the 2 select statements.
Attachments
thold-rrd-sorting.zip
Patch for RRD Sorting issue in Thresholds
(1.06 KiB) Downloaded 239 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

cigamit,
thank you for your work. But I really got some problems with these patches. What is the sequence for them? I recognized from the diff files, that there are some release number e.g. r1.2, r1.3, r1.4 and so on. So may you add a hint for the correct sequence?
By the way ... is there a more useful way to contribute extensions or patches? If other people will extend this thold feature, I suppose we soon will be lost in all those patches.
Just tried to add the "filter" feature and check boxes for "multiple delete" the way like data_sources.php ... but it seems to be a greater work for unexperienced php coders as me ...
:cry:
Reinhard
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

lvm wrote:cigamit,
thank you for your work. But I really got some problems with these patches. What is the sequence for them? I recognized from the diff files, that there are some release number e.g. r1.2, r1.3, r1.4 and so on. So may you add a hint for the correct sequence?
By the way ... is there a more useful way to contribute extensions or patches? If other people will extend this thold feature, I suppose we soon will be lost in all those patches.
Just tried to add the "filter" feature and check boxes for "multiple delete" the way like data_sources.php ... but it seems to be a greater work for unexperienced php coders as me ...
:cry:
Reinhard
The reason they are posted as patches is for TheWitness to integrate them into the next version if he wishes. There is no actual sequence to the patches, they should work no matter which order you integrate them into the codebase with (you may get fuzz warnings, but that is normal).

The version numbers at the top are just the revisions of that file within my own CVS Resposistory, you could I get use that for sequencing, but otherwise I would just ignore it.

I have plenty more to submit, I just have to take the time to export them from my CVS.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

The next release have changed so much that I don't think these patches will apply. I'm refering to 0.9, btw.
[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]
R2D2
Posts: 10
Joined: Fri Apr 15, 2005 6:06 am

Post by R2D2 »

Hi I'm getting this problem while doing auto-create treshold, any idea how to resolve this?


Warning: main(c:\Inetpub\wwwroot\cacti\lib/thold-functions.php) [function.main]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\cacti\thold.php on line 19

Warning: main() [function.include]: Failed opening 'c:\Inetpub\wwwroot\cacti\lib/thold-functions.php' for inclusion (include_path='.;C:\php5\pear') in c:\Inetpub\wwwroot\cacti\thold.php on line 19

Fatal error: Call to undefined function autocreate() in c:\Inetpub\wwwroot\cacti\thold.php on line 41

Thanks,
R2D2
R2D2
Posts: 10
Joined: Fri Apr 15, 2005 6:06 am

Post by R2D2 »

Need your BIG HELP guys, just managed to turn TRESHOLD up and running but after rebooting my server I can't get in to MRTG page and I'm getting this instead.

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mrtg01' (10061) in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 339

Fatal error: Call to undefined function cacti_log() in c:\Inetpub\wwwroot\cacti\lib\database.php on line 51
theuruguayan
Posts: 4
Joined: Sun May 15, 2005 6:26 pm

Post by theuruguayan »

monitoring looks amazing, but it looks kind of funny in firefox if you have more than 5 servers..

it scrolls to the right..

i have edit the amount of servers per row. amazing work .. realy amazing work jimmy + everyone..
theuruguayan
Posts: 4
Joined: Sun May 15, 2005 6:26 pm

Post by theuruguayan »

Perhaps is my setup, when i install thold the monitoring link in the tab disappear.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

theuruguayan wrote:Perhaps is my setup, when i install thold the monitoring link in the tab disappear.
The patch submitted doesn't work well with the threshold module, since the patch is strictly against cacti v0.8.6d without thold installed. I will shortly be releasing another patch to use after you install thold, so all should be well.

The monitoring window is built for viewing on a 1024x768 view, but I do hope at some point to put in a user definable option for the number of hosts in a row (its currently 10).

The audible alarm works perfect in IE, but in Firefox (using Quicktime to play the wav) when the alarm goes off, quicktime will not let the page auto-refresh, but I would clauk that up to a quicktime / firefox problem more than anything else.

I should probably move all this to its own thread since the monitoring part of it hasn't much to do with the thold module (the rest does though).
theuruguayan
Posts: 4
Joined: Sun May 15, 2005 6:26 pm

Post by theuruguayan »

cigamit, thanks for the answer, i manage to add the monitor script to the menu for the moment, and disable the autentification so i could login.

Because when i install thold it got ride of the allow configuration for a user, so for the moment i disable it, and change the folder it was hosted just in case.

Monitor scripts looks realy nice, amazing work. I edited by hand the file and put 5 and works perfect. In firefoxs it looks really weird with 10.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

rony wrote:The next release have changed so much that I don't think these patches will apply. I'm refering to 0.9, btw.
So, is there anywhere I could grab a CVS copy of the thold module? I was led to believe that it would be integrated into the next cacti, but have not seen it go through CVS yet.

As far as Cacti, I currently run seperate boxes with v0.8.6c (for production), v0.8.6d (will be prod), and the latest CVS installed (for testing / developing). I really wish you all had a CVS Mailing List so I could keep up with changes that come through!. I so really like how the CVS is shaping up and have been tracking down a small bug in it for the last day or so. For certain default graphs its not passing the data source fields to rrdtool, so that its throwing an error instead of updating. (Local processes, local users)

Code: Select all

2005-05-15 21:32:28 - DEBUG: POLLER: CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacticvs/rra/localhost_users_1.rrd --template  1115865147:0
ERROR: Not enough arguments
Everytime I get close to tracking it down, my wife decides its well past my bedtime, since I have to get up in the morning. By the next day, I completely forget what I was looking at.
Locked

Who is online

Users browsing this forum: No registered users and 0 guests