Downtime in UP messages?
Hugo van der Kooij
hvdkooij at vanderkooij.org
Mon Nov 20 22:56:29 CET 2006
Hi,
I have been looking over the documentation and have searched for it but I
could not find an answer. (Which may be entirely my fault ;-)
I would like to put the downtime in the host up messages. So if I get a
host UP message I can tell how long it has been down.
Looking in the manual the $HOSTDURATION$ macro seems a tempting target.
But it seems the only alert which seems to give a sane duration is the
FLAPPINGSTOP message.
Does anyone happen to have a simple solution to this challenge?
I tried it with a misccommand.cfg entry like:
# 'host-notify-by-email' command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nDuration: $HOSTDURATION$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
Perhaps my approach is flawed.
Hugo.
--
hvdkooij at vanderkooij.org http://hvdkooij.xs4all.nl/
This message is using 100% recycled electrons.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list