Sound an alarm

Richard Harman nagios at richardharman.com
Tue Jun 21 06:31:10 CEST 2005


Serial interface?  Alarm clock?  Wow.  Leave it to the EEs to whip out a 
soldering iron. ;)  Not that there's anything wrong with that.

I'm in the process of replacing a WhatsUpGold box (that already makes 
noise and has a decent pair of speakers that can be heard throughout the 
entire OPS floor) with Nagios, and here's my solution to the same problem:

misccommands.cfg:
define command {
  command_name host-notify-by-sound
  command_line $USER2$/notify_by_sound $HOSTSTATE$
}

notify_by_sound:
#!/usr/bin/perl

use strict;
use warnings;

my ($status) = @ARGV;

if ($status eq "DOWN" || $status eq "UNREACHABLE")
{ system("/usr/lib/nagios/plugins/check_nrpe -H 
windows.box.running.nrpe-nt -c sfx_hostdown"); }
else
{ system("/usr/lib/nagios/plugins/check_nrpe -H 
windows.box.running.nrpe-nt -c sfx_hostup"); }

sfx_hostdown.cmd:
@echo off
sndrec32 /play /cluse "c:\nrpe\host_down.wav":
echo Command completed successfully
exit 0

HTH!

Rusch, Daniel wrote:

> All,
>  
> How can I have Nagios sound a physical alarm. In other words I want to 
> wake up the NOC if a a system goes critical?
>  
> Thank you,
>  
> Daniel G. Rusch
> x2027
>  



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050621/91ddd0da/attachment.html>


More information about the Users mailing list