Dead Hosts Notifications

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
khm
Posts: 25
Joined: Fri Jul 14, 2006 3:57 am

Dead Hosts Notifications

Post by khm »

In the settings you can activate "Dead hosts Notification" but you will get a message for every dead host.

Is there a chance to get a notification only for special hosts?
[quote][b]Cacti Version[/b] - 0.8.7e
[b]Plugin Architecture[/b] - 2.6
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.31-14-server
[b]Web Server[/b] - Apache/2.2.12 (Ubuntu)
[b]PHP[/b] - 5.2.10-2ubuntu6.4
[b]MySQL[/b] - 5.1.37-1ubuntu5.1
[b]RRDTool[/b] - 1.3.1
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.6)
Thresholds (thold - v0.4.1)
PHP Network Weathermap (weathermap - v0.97)
Device Tracking (mactrack - v1.1)
Network Discovery (discovery - v0.9)
Host Info (hostinfo - v0.2)
SuperLinks (superlinks - v0.8)
Documents (docs - v0.2)
Cycle Graphs (Cycle Graphs - v0.7)[/list][/quote]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Feature requests go here: http://bugs.cacti.net

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?
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Selective Dead Hosts Notifications

Post by amadill »

We just recently upgraded cacti to the latest version and added in the thold plugin. It is functional but we have a number of hosts that go up and down like yo-yos. It would be really useful to be able to enable/disable dead hosts detection. I've browsed through the code and I think I can hack it out on my own but I would like to follow acceptable practice when I do those mods.

The change that I'm wondering about is adding a field to the hosts table. Is that schema untouchable?
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Selective Dead Hosts Notifications

Post by cigamit »

amadill wrote:We just recently upgraded cacti to the latest version and added in the thold plugin. It is functional but we have a number of hosts that go up and down like yo-yos. It would be really useful to be able to enable/disable dead hosts detection. I've browsed through the code and I think I can hack it out on my own but I would like to follow acceptable practice when I do those mods.

The change that I'm wondering about is adding a field to the hosts table. Is that schema untouchable?
So... you are wanting it per host? Because otherwise you can completely disable dead host alerting in the settings. You can also set the "Failure Count" in the settings (under Poller) to something a bit higher.
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

Yes, I need to disable it for most of the hosts that we monitor. (We are a WISP and I really don't need a text message every time a customer unplugs his CPE, but I do want one if one of our servers or AP's go down).
It would involve changes to host.php, global_settings.php, polling.php, and an additional field (thold_down?) in the host table. I'm just a bit reluctant to add an arbitrary field name to a well established schema.
The easiest place to add it is in the devices/change availability options.
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

As an experiment I added two fields to the availability options screen in host.php

diff host.php host.php.orig
404c404
< if (ereg("(availability_method|ping_method|ping_port|ping_timeout|ping_retries)", $field_name)) {
---
> if (ereg("(availability_method|ping_method|ping_port)", $field_name)) {

If the new field was in table host, a tiny change in polling.php where it does the downed host detection, and whatever support needed for the new field in the librarys. The code looks a bit more convoluted in the area where you add/edit a device in host.php.

My handicap is I don't do much coding in php and I'm not familiar with the code base.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Dead Hosts Notifications

Post by cigamit »

I will be adding an option for this in the next few days, possibly with an option to send to different email addresses per device. People have waited long enough I guess.
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

That would be awesome :-)
BTW - browsing through the code gave an appreciation for how well all of this was put together. WD & thank you.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Dead Hosts Notifications

Post by TheWitness »

amadill wrote:That would be awesome :-)
BTW - browsing through the code gave an appreciation for how well all of this was put together. WD & thank you.
Compliments are welcomed, but the best form of sucking up is a cash donation...

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?
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

<grin>In lieu of cash how about a donation of labor?</grin>
Updated Cacti 0.8.7g RPMs for Fedora Core 8 can be found at http://www.wiseoldcat.com/?q=node/9
Last edited by amadill on Thu Jan 06, 2011 9:19 pm, edited 1 time in total.
Alan's adage - "95% of all computer problems can be fixed by turning the computer off and then on again. The remaining 5% can be resolved by leaving the computer off"
alexupton
Posts: 6
Joined: Sat Feb 24, 2007 8:24 pm

Re: Dead Hosts Notifications

Post by alexupton »

I seem to remember cacti/thold working like this in the past where if the monitor wasn't selected for a device, the thold plugin wouldn't send an e-mail... Am I wrong?
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

That might have been the case in a previous version. Another sysadmin claims that is how his works. I installed Monitor V1.2 and upgraded Thold to the latest version I could find, V0.4.3. and I still get Dead Host Notifications for systems that I excluded from monitor. But the monitor plugin does put a field in the host table that I can use. I added a couple of lines in poller.php that seems to be working.

Code: Select all

[includes]# diff polling.php polling.php.orig
177,183d176
< 
<                               if (api_plugin_is_enabled('monitor')) {
<                                       if ($host['monitor'] == '') {
<                                               continue;
<                                       }
<                               }
< 
301,306d293
<                       if (api_plugin_is_enabled('monitor')) {
<                               if ($host['monitor'] == '') {
<                                       continue;
<                               }
<                       }
< 
The flood of email from the unimportant systems has stopped.
amadill
Posts: 7
Joined: Wed Jan 05, 2011 4:18 pm

Re: Dead Hosts Notifications

Post by amadill »

I've been scratiching my head wondering why I am not getting messages when the host goes down. It turns out I am, it's the subject in the email that is wrong. At about line 327 in polling.php the routine where it detects hosts that have just gone down it has
$subject = read_config_option('thold_up_subject');
Shouldn't that be 'thold_down_subject' or something similar?
Alan's adage - "95% of all computer problems can be fixed by turning the computer off and then on again. The remaining 5% can be resolved by leaving the computer off"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest