How to convert UNIX epoch to date format for u se in Alerts?

Pulyankote, Gopinath Gopinath_Pulyankote at affymetrix.com
Tue Dec 17 23:55:29 CET 2002


Its me again,
	I figured this out.  I created a new notify method with the
following:
define command {
command_name                   host-notify-manager
command_line                   /usr/bin/printf "%b" " since
'$LASTSTATECHANGE$' \nTime now is: $DATETIME$" | /bin/mail -s
"$NOTIFICATIONTYPE$ alert - Host $HOSTALIAS$ is $HOSTSTATE$" $CONTACTPAGER$
}
 The only problem now is that $LASTSTATECHANGE$ is in UNIX epoch format. How
does one convert this to readable format ?
Thanks
-Gopinath

-----Original Message-----
From: Pulyankote, Gopinath [mailto:Gopinath_Pulyankote at affymetrix.com] 
Sent: Tuesday, December 17, 2002 11:04 AM
To: Nagios List
Subject: [Nagios-users] About Alerts


Hi there,
	We have setup escalations to our Managers when a host is down for
more than 2 hours, but every alert that they get has the time stamp when it
was sent out, NOT when the host actually went down. 
	Can someone help me figure out how to get this done? Looking at the
host details, I see a field called Last State Change that has the info I am
looking for. Is there a way to get the "Last State Change" value into the
alerts Nagios sends out. 
Thanks in advance
-Gopinath
	


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/




More information about the Users mailing list