Nagios is a network monitoring system that comes with build in support to send notifications by email. You can easily configure nagios to send out notifications in any way you need. For example to an sms gateway. Today I wanted to send out notification to my TV-Set-top-box. It’s a Dbox2 running a linux kernel with a http demon that allows to accept commands by http requests.
You can use wget (or other tools like that) to send http requests to your dbox. Here is, what I have added to my /etc/nagios/misccommand.cfg:
# ‘notify-by-dbox2’ command definition
# dbox2 needs to be definied in /etc/hosts
# use ?popup instead of ?nmsg if you want to close the message automatically after a few seconds.
# Doku of dbox http apu: http://cvs.tuxbox.org/cgi-bin/viewcvs.cgi/tuxbox/apps/tuxbox/ neutrino/daemons/nhttpd/api_doku.txt?rev=1.31
define command{
command_name notify-by-dbox2
command_line /usr/bin/wget –quiet “http://dbox2/control/message?nmsg=$NOTIFICATIONTYPE$: %20$HOSTALIAS$/$SERVICEDESC$%20is%20$SERVICESTATE$” > /dev/null
}
# ‘host-notify-by-dbox2’ command definition
# dbox2 needs to be definied in /etc/hosts
# use ?popup instead of ?nmsg if you want to close the message automatically after a few seconds.
define command{
command_name host-notify-by-dbox2
command_line /usr/bin/wget –quiet “http://dbox2/control/message?nmsg=$NOTIFICATIONTYPE$ %20Host%20’$HOSTNAME$’%20is%20$HOSTSTATE$” > /dev/null
}
Ad these commands to your /etc/nagios/contacts.cfg for your contact:
service_notification_commands notify-by-email, notify-by-dbox2
host_notification_commands host-notify-by-email, host-notify-by-dbox2
That’s it. Restart nagios and be on the alert even while watching TV.