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

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Locked
proxyo
Posts: 11
Joined: Wed Apr 20, 2005 9:07 am
Location: France

Post by proxyo »

Pour john le lardon...

en gros sous windows ce qu'il faut faire

- integrer le produit thold a cacti par des copier coller + mysql --user --pasword cacti < [folder]thold.sql

- modifier le fichier php.ini de php (email sender, @ server smtp, port) attention aux guillemets

- creer une tache planifié lancant php.exe avec en parametre check-thold.sql

si ton accès a ton sever smtp est un accès necessitant authentif + mot de passe il te faut un soft du style argosoft mail server sous windows ( le mail est envoyé en local sur argosoft qui s'occupe de l'authentif)

autre chose verifier si une politique de securité blok pas tes mails (firewall....)

j'espère que ca pourra t'aider.... :wink:
edit in english:

under windows operating system, what you have to do:

- interger the thold product in cacti with copy, paste + mysql --user --pasword cacti < [folder]thold.sql

-modify the php.ini file in c:\php (email sender, @ server smtp, port) warning: quotation marks

-create a schedule task who launch php.exe with in parameters check-thold.php

-if you need an authentificate access to your smtp server you will need to use a software who looks like this one : argosoft mail server under windows operating system (the mail is locally send to argosoft witch made the authentification)

another things, verify if you don't have any security rules who can blcok email sending (firewall...)

hope that will help you.. wink
Last edited by proxyo on Thu May 19, 2005 5:33 am, edited 3 times in total.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

J'apprécie les gens qui répondent dans de différentes langues. Il me donne une chance d'utiliser le logiciel de traduction.

TheWitness :)
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
proxyo
Posts: 11
Joined: Wed Apr 20, 2005 9:07 am
Location: France

Post by proxyo »

TheWitness wrote:J'apprécie les gens qui répondent dans de différentes langues. Il me donne une chance d'utiliser le logiciel de traduction.

TheWitness :)
I answer in french because, "john le lardon" has his location in france and "le lardon" is a french word for cubic piece of bacon ;-)

sorry for the desaprouval.... and for my english ;-)
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I don't disapprove at all. I actually like to see this happen. It shows that Cacti is, in fact, an international product. BTB, I am working frantically at making Cacti 0.9 completely language transparent at the moment. Most of the work is done, then the translation group can work each of their respective translations (French, German, Japanese, etc.).

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
o_dupuis
Posts: 18
Joined: Fri Mar 18, 2005 12:55 pm
Location: Paris/France

Post by o_dupuis »

Hi,

I have made a tab based on the threshold tab, to be able to have a supervision console (PATROL like), with the thesholds alerts on.
So what I did is, first, modify the graph_tree and graph_tree_item tables to allow the addition of an icon.
The I added a tab (like the threshold tab) that I named NetMap (ie Network Map). This tab presents a map based on the cacti tree with drill down feature. Each graph tree item is underline in red (=alert) if one of the sub component has its threshold alert set. If no alert, it's underlined in green. And if no threshold has been added in the sub-component it is underlined in grey.

It is not yet finished (You can't add an icon the a graph tree, but it is possible on a graph tree item), but I wanted to have feeback before I continue.

On screen 2 you see the main cacti tree (just to understand where how the next screenshot is constructed)

On the first screen shot you see where you add an icon the a graph tree item (screenshot 1). You still have to upload manually (via FTP or SSH...) your icons into $cactiroot/images/netmap. I will soon work to make possible the upload via the cacti interface.

On screen 3 : you see the new tab, with an explaination about the navigation.


I will post the .php and sql file on my next post.

Olivier
Attachments
Screenshot 2 : the main cacti tree.
Screenshot 2 : the main cacti tree.
screenshot2.PNG (20.13 KiB) Viewed 7182 times
Screenshot 3 : Net Map tab and how you navigate accross it.
Screenshot 3 : Net Map tab and how you navigate accross it.
screenshot3.JPG (116.97 KiB) Viewed 7182 times
Screenshot 1 : add an icon to a graph tree item. If none added a default icon is shown on the NetMap
Screenshot 1 : add an icon to a graph tree item. If none added a default icon is shown on the NetMap
screennshot1.PNG (20.91 KiB) Viewed 7182 times
User avatar
o_dupuis
Posts: 18
Joined: Fri Mar 18, 2005 12:55 pm
Location: Paris/France

NetMap : the files

Post by o_dupuis »

Hi,

Here are the files required to have what I called NetMap running.
All the tests I have made where with cacti 0.8.6d, I don't know if it could work with others.

IMPORTANT : this is still under development. Backup all your $cactiroot and your cacti mysql db before using these files.

first you must install the Thold 2.1a - Thresholding/Alerting module for cacti 8.6

All you have to do is unzip the netmap.zip from you $cactiroot, be sure to make you unzipper keep the directory structure of the zip.

Then run the following sql commands :

INSERT INTO `user_auth_realm` ( `realm_id` , `user_id` ) VALUES ('100', '1');
INSERT INTO `user_auth_realm` ( `realm_id` , `user_id` ) VALUES ('101', '1');
ALTER TABLE `graph_tree_items` ADD `icon` VARCHAR( 255 ) AFTER `sort_children_type` ;
ALTER TABLE `graph_tree` ADD `icon` VARCHAR( 255 ) AFTER `name` ;


You will immediatly get the NetMap tab running on you cacti tree. All you have to do is upload your own icons into :
$cactiroot/images/netmap

I will clean my code, later, so don't look at it too carefully ;)

Olivier

PS to adesimone the author of this topic : if you think I should migrate and make a new topic, I will do it of course, I would understand. I thought that, as my development is based on your, I should post it here.
Attachments
netmap.zip
The Zip file, to be extracted in $cactiroot, keeping its directory structure.
(33.2 KiB) Downloaded 345 times
Last edited by o_dupuis on Thu May 19, 2005 8:26 am, edited 1 time in total.
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Threshold failure

Post by cigamit »

JEL wrote:Hi all,

I have just created a fresh install, the basic specs are;

RH Linux WS 3.0
cacti-0.8.6d
thold-cacti-0.8.6d
rrdtool-1.2.1
mysql-4.1.11

I am having some issues with the Threshold piece. When I view 'Data Sources'=>'Template Name / Click for THold'

I see this on each and every one.......
Notice: Undefined offset: 0 in /monitor/cacti-0.8.6d/lib/thold-functions.php on line 36

I have seen some discussion of this in the groups but was not previously able to get the problem resolved. Any input on this is much appreciated.

Thanks
This is what I did to fix that particular error

Code: Select all

===================================================================
RCS file: /home/CVSROOT/cacti/lib/thold-functions.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- thold-functions.php	2005/04/04 18:32:19	1.2
+++ thold-functions.php	2005/04/19 19:02:56	1.3
@@ -29,10 +29,15 @@
 	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);
-	
+
+	// Return 0 if the data source is not found (Newly created?)
+	if (!isset( $result["data_source_names"])) return false;
 	$idx = array_search($ds, $result["data_source_names"]);
+
+	// Return 0 if the value was not found (Cache Cleared?)
+	if (!isset($result["values"][$idx][0])) return false;
 	return round($result["values"][$idx][0]);
 }
 
Let me know if that patch helps, granted there is a bigger underlying problem, but this helps with the errors. The errors would always disappear for me after 1 polling cycle, so I was thinking it had something to do with the fact that the rrds weren't created yet, and I would also run into the problem again after clearing the poller cache (which is even odder).
john le lardon
Cacti User
Posts: 52
Joined: Fri May 06, 2005 7:39 am
Location: france
Contact:

Post by john le lardon »

Pour john le lardon...

en gros sous windows ce qu'il faut faire
FR> :lol: je suis sous fedora core 3 ( je l'avais pourtant ecrit >_< ) mais merci quand meme :p
EN> :lol: i'm on fedora core 3 (... secrets french code :lol: , no i'm just bad in english :p ) but thanks
J'apprécie les gens qui répondent dans de différentes langues. Il me donne une chance d'utiliser le logiciel de traduction.
can we speak always in french ? :lol:
there are a forum for french cacti/zabbix/nagios user :
http://forums.opsyx.com/
but in cacti forum no pepole :'(

then i don't receive email :cry: ... hope you can help me :D

edit : .... i see in PHP.ini where i must work , sorry :lol: doesn't read ALL posts :oops:

Code: Select all

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
i go try to work on it by myself :p but a good thing be make a things on thold for able admin to set easy sender ( :s i don't know if i'm clear )
in french :
ca serais bien si l'on pouvais metre dans l'interface thold l'@ du poster, car je suis obligé de passé par un server pour envoyer des emails si je ne le fait pas je ne recois pas les email d'alerte. (je sais pas si je suis plus clair en francais :lol: )
magnetyk
Posts: 34
Joined: Tue May 10, 2005 10:04 am

Post by magnetyk »

Hi,

I need some help for this wonderful script. I've just installed it on a 0.8.6d. To test it, i set max value and min value for "logged in user" of my local computer.

"72 10.2.1.40 - [infodebian] - Logged in Users [users] 3 1 on no"

When there are more than 3 users or less than 1, it doesn't do anything, why ? I've tried this to another graph (like transfer) and it doesn't work to.

What could be wrong ??

Thks for your work ! (soz im french, my english sucks and i'm hungry)
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

How to fix ERROR: Notice: Undefined offset: 1

Post by mmerelles »

I've installed thold for cacti 0.8.6d, and I tried to activate threshold checking for a cisco router cpu usage.

At the threshold web page it is green and says current=0, but the router has a 50% cpu usage.

When i run the thold script from the command prompt it shows the following message.

Notice: Undefined offset: 1 in /opt/cacti/lib/thold-functions.php on line 36

How can i fix this?

I also tried to configure interface bits/sec thresholds having same result.

thanks
Manuel
aboyz

same here

Post by aboyz »

same here

its not alerting us or marking it RED when it go over a limit

i setup my web server connection max 2000. to warn me and email me but this never happen. my web server went over to 2500 and still no email or light turning RED. all still green.. anyone know the issues?
[asm]
Posts: 21
Joined: Sun Apr 03, 2005 5:36 pm

Re: same here

Post by [asm] »

aboyz wrote:same here

its not alerting us or marking it RED when it go over a limit

i setup my web server connection max 2000. to warn me and email me but this never happen. my web server went over to 2500 and still no email or light turning RED. all still green.. anyone know the issues?

Code: Select all

--- cacti_old/lib/thold-functions.php   2005-02-19 15:13:33.000000000 +0200
+++ cacti/lib/thold-functions.php       2005-05-23 00:40:00.000000000 +0300
@@ -30,9 +30,15 @@
        $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"]);
+       $result = rrdtool_function_fetch($rra, time() - 900, time());
+       // Return 0 if the data source is not found (Newly created?)
+       if (!isset( $result["data_source_names"])) return false;
+//     var_dump($result); die();
+       $idx = array_search($ds, $result["data_source_names"]);
+
+       // Return 0 if the value was not found (Cache Cleared?)
+       if (!isset($result["values"][$idx][0])) return false;
+
        return round($result["values"][$idx][0]);
 }
This patch solved the problem for me... I hope it will help to you too ;)
aboyz

how to patch

Post by aboyz »

How do you run the patch anyway? can you walk me thru step by step in order to insert the patch..

thank you so much.. for the help
[asm]
Posts: 21
Joined: Sun Apr 03, 2005 5:36 pm

Post by [asm] »

save the patch into cacti's dir. then run:
patch -p1 < name.patch

That must be all... if you run over Windows open lib/thold-functions.php and make function get_current_value looks like this:

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, time() - 900, time());
        // Return 0 if the data source is not found (Newly created?)
        if (!isset( $result["data_source_names"])) return false;

        $idx = array_search($ds, $result["data_source_names"]);

        // Return 0 if the value was not found (Cache Cleared?)
        if (!isset($result["values"][$idx][0])) return false;

        return round($result["values"][$idx][0]);
}
john le lardon
Cacti User
Posts: 52
Joined: Fri May 06, 2005 7:39 am
Location: france
Contact:

Post by john le lardon »

i try to change php.ini but nothing better. no mail on my emailbox don't know how to do that .
Locked

Who is online

Users browsing this forum: No registered users and 3 guests