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

Pulyankote, Gopinath Gopinath_Pulyankote at affymetrix.com
Wed Dec 18 22:58:24 CET 2002


Thanks. But how do I get this conversion done within this command definition
in checkcommands.cfg ?
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$
}
-Gopinath


-----Original Message-----
From: Steve Burton [mailto:steve at sliderule.demon.co.uk] 
Sent: Wednesday, December 18, 2002 12:59 PM
Cc: Nagios List
Subject: Re: [Nagios-users] How to convert UNIX epoch to date format for u
se in Alerts?




Olaf Greis wrote:
> 
> >  The only problem now is that $LASTSTATECHANGE$ is in UNIX epoch format.
> > How does one convert this to readable format ?
> 
> perl -e 'print scalar localtime(1234567890)' is one of the possible
solutions.
> 
under FreeBSD (at least) date -r <unixtimeseconds> does the same.

Steve.

> brdgs
>   olaf
> 
> -------------------------------------------------------
> 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

-- 
Steve Burton

Webmaster & Sub-optimal Coder


-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/
_______________________________________________
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: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/




More information about the Users mailing list