thold and mails

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

thold and mails

Post by JJX »

is possible to change the text that sends thold when a host goes down?

searching i found that i should change ping.c but this file doesnt exist :(

i am using cacti 0.8.6g / debian sarge
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Post by JJX »

Code: Select all

      if ($status != HOST_DOWN) {
                $subject = "Host Notice : " . $hosts[$host_id]["hostname"] . " returned from DOWN state";
                $msg= $subject;
                thold_mail(read_config_option("alert_email"), '', $subject, $msg, '');
        } else {
                $subject = "Host Error : " . $hosts[$host_id]["hostname"] . " is DOWN";
                $msg ="Host Error : " . $hosts[$host_id]["hostname"] . " is DOWN<br>Message : " . $hosts[$host_id]["status_last_error"];
                thold_mail(read_config_option("alert_email"), '', $subject, $msg, '');
        }
change this code in plugins/thold/setup.php
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

JJX wrote:

Code: Select all

      if ($status != HOST_DOWN) {
                $subject = "Host Notice : " . $hosts[$host_id]["hostname"] . " returned from DOWN state";
                $msg= $subject;
                thold_mail(read_config_option("alert_email"), '', $subject, $msg, '');
        } else {
                $subject = "Host Error : " . $hosts[$host_id]["hostname"] . " is DOWN";
                $msg ="Host Error : " . $hosts[$host_id]["hostname"] . " is DOWN<br>Message : " . $hosts[$host_id]["status_last_error"];
                thold_mail(read_config_option("alert_email"), '', $subject, $msg, '');
        }
change this code in plugins/thold/setup.php
Maybe I should make this a configurable option? It would be simple enough, but would anyone else use it?
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Post by JJX »

it would be really usefull ;)
cacti rulez!
User avatar
joed
Posts: 29
Joined: Mon Sep 19, 2005 6:27 am
Location: Germany/Palatinate

Post by joed »

could be usefull, if alarm email is sent to a not english speaking person ;-)
ancery
Posts: 11
Joined: Thu Nov 03, 2005 4:43 am

Post by ancery »

cigamit wrote: Maybe I should make this a configurable option? It would be simple enough, but would anyone else use it?
yes, it's very useful for me,

and would you make a option to change the units about disk usage and so on, the long number often confused me :o

thx for your great job, it's very useful for me, thank you!! :D

and also, would it possible to add a sound alarm, it may very useful for me!!! thx again :D
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

ancery wrote:
cigamit wrote: Maybe I should make this a configurable option? It would be simple enough, but would anyone else use it?
yes, it's very useful for me,

and would you make a option to change the units about disk usage and so on, the long number often confused me :o

thx for your great job, it's very useful for me, thank you!! :D

and also, would it possible to add a sound alarm, it may very useful for me!!! thx again :D
I am currently working on making the text configurable, and adding Sound is currently in the works also.

As far as the units on disk space, this is something that is best if handled by the output scripts. If it isn't returning the units you want, I would recommend changing the scripts. I actually did this with the Host - Disk Space scripts that come with Cacti. I modified them to also output a "percentage" that can be used by Thold. You can find that script here.

http://cactiusers.org/forums/viewtopic.php?t=107

Let me know how that works out for you.
ancery
Posts: 11
Joined: Thu Nov 03, 2005 4:43 am

Post by ancery »

hi cigamit, thx for your reply, i'm very excited to hear your good news,

and I try your scripts just now, it really could show the percentage of disk graphs, but i couldn't find the units,

and when i wanted to set the thold, i have found the current value showing nothing, so the thold has no effect,

could u tell me what's wrong with me, thank you!! :wink:
Attachments
Snap1.jpg
Snap1.jpg (4.25 KiB) Viewed 6546 times
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

ancery wrote:hi cigamit, thx for your reply, i'm very excited to hear your good news,

and I try your scripts just now, it really could show the percentage of disk graphs, but i couldn't find the units,

and when i wanted to set the thold, i have found the current value showing nothing, so the thold has no effect,

could u tell me what's wrong with me, thank you!! :wink:
Is this on a new datasource, or one that you already had setup? You will have to recreate all the datasources and graphs for those devices that use it. Does it show data in the graph?
ancery
Posts: 11
Joined: Thu Nov 03, 2005 4:43 am

Post by ancery »

cigamit wrote:Is this on a new datasource, or one that you already had setup? You will have to recreate all the datasources and graphs for those devices that use it. Does it show data in the graph?
yes, i added a new device, and did it just follow your README,

i can see the data in the graph, but all graph "current value" in thold had gone, so i had to restore the 2 files, and i'm sure there's something wrong in them,

need your help!! :-?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest