nagios.log

Skip Montanaro skip at pobox.com
Wed Jun 25 18:56:37 CEST 2003


    Jeyri> Hi, when i see the nagios.log files, where can I see the event
    Jeyri> time (hour,minutes,seconds),

It's there, it's just hidden as the number of seconds since the start of the
Unix epoch.  Mine starts with

    [1056436964] LOG ROTATION: DAILY
    [1056436997] SERVICE ALERT: sparky;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 20%, RTA = 21.90 ms
    [1056437057] SERVICE ALERT: uccpss;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 20%, RTA = 25.60 ms

The first number is key.  You can convert it using a number of methods.  I
find Python's time.localtime() the easiest:

    % python
    Python 2.3b1+ (#66, Jun 20 2003, 10:06:31) 
    [GCC 3.1 20020420 (prerelease)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    import time>>> import time
    >>> time.localtime(1056436964)
    (2003, 6, 24, 1, 42, 44, 1, 175, 1)

So the first timestape corresponds to 2003-06-24 01:42:44.  The last three
fields of the tuple are the weekday, year day and isdst flag.

-- 
Skip Montanaro
skip at pobox.com
Got spam? http://spambayes.sf.net/


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
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