Cacti e-mails alarms

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
TELCO
Cacti User
Posts: 59
Joined: Thu Aug 17, 2006 9:37 am

Cacti e-mails alarms

Post by TELCO »

Dear All :lol: ,

I am needing which in mails that arrives to me with the alarms it includes the hostname of each equipment and not only the IP. Exists some form of which they arrive mails with the IP and hostame or description of the equipment? :oops:

Example :
_________

Subject: Host Error : 200.xxx.xxx.xxx is DOWN

Host Error : 200.xxx.xxx.xxx is DOWN
Message : Host did not respond to SNMP


Thanks. :wink:

Best Regards.
TELCO
warnesj
Cacti User
Posts: 173
Joined: Sun May 29, 2005 7:34 pm

Post by warnesj »

Here is the modification I made to include the device description in the email subject. You'll need to modify the plugins/thold/setup.php file,

Find,

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, '');
}
And change it to,

Code: Select all

if ($status != HOST_DOWN) {
        $subject = "Host Notice : " . $hosts[$host_id]["description"] . "(" . $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]["description"] . "(" . $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, '');
}
This will change the subject of your alerts messages from "Host Error: [host ip address] is DOWN" to "Host Error: [host description] ([host ip address]) is DOWN". It will also change "Host Notice: [host ip address] returned from DOWN state" to "Host Notice: [host description] ([host ip address]) returned from DOWN state".

I hope this helps.
TELCO
Cacti User
Posts: 59
Joined: Thu Aug 17, 2006 9:37 am

Post by TELCO »

Dear warnesj , :lol:

It works perfect. Thank you very much! :wink:

Best Regards ,

TELCO
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest