Nagios Logfile

Andreas Wassatsch a.wassatsch at meg-gmbh.de
Fri Sep 20 14:40:18 CEST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


With a little perl..

Best regards from Heidelberg,
Andreas

- ---
#!/usr/bin/perl
use Time::Local;
open(LOG,"/usr/local/nagios/var/nagios.log");
while (! eof(LOG)) {
    $line = <LOG>;
    ($part1, $part2) = split(/\s+/, $line, 2);
    $part1 =~ s/\[//;
    $part1 =~ s/\]//;
    print "[", scalar localtime($part1), "] $part2";
};
close(LOG);
- ---

On 20. September 2002 14:22, ralf.lebeda at ezi.de wrote:
> Hello,
>
> in the nagios logfile is at the begining of each line a unix time stamp.
>
> Is there a way to get this time stamp changed in a human readable time
> stamp???
>
> Nagios Log file Unix time Stamp -->    ???????    --> logfile with human
> readable timestamp
>
> It would be nice, if someone could help me, becaus I need it.
>
> Thanks in advance
> ---------
> Ralf Lebeda                                   E-Mail: ralf.lebeda at ezi.de
> IT - Administration
>
> EZI GmbH                                      URL: WWW.EZI.DE
> Kreuzgasse 42
> D-35708 Haiger
>
> Tel.: +49 (0)2773-835135
> Fax: +49 (0)2773-835195
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users

- -- 
[ Bitte keine HTML-Mail / MS-Attachments *.xls *.doc ]

Andreas Wassatsch                  MEG Kommunikationssysteme GmbH
Dipl.-Ing.                         Hans-Bunte-Straße 20
                                   D-69123 Heidelberg
using Linux since 0.99pl10         Fon 06221-8320-490 Fax -444
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9ixc2hfo0oE4rIFERAvKRAJ9UEiJ/Jxad3ykAHZ4a6AtY5uVo1ACdHDHD
IAdDtsvwsGPYBW+65OktytQ=
=Rxt2
-----END PGP SIGNATURE-----



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list