Nagios log

Montse Seisdedos mseisdedos at mediafusion.es
Tue Mar 8 12:53:18 CET 2005


You can edit a script with these lines:
if [ $# == 0 ]
then
        printf "Error. Uso: verlog logfile\n"
        exit 1

fi

perl -ane '$F[0] =~ /(\d+)/ && print
localtime($1) . " @F[1..$#F]\n" ' $1


And then execute:

> ./name_of_the_script nagios.log





----- Original Message ----- 
From: "Sandoval, Julio" <jsandoval at achs.cl>
To: <nagios-users at lists.sourceforge.net>
Sent: Monday, March 07, 2005 10:28 PM
Subject: RE: [Nagios-users] Nagios log


> Help Nagios List,
>
> I need to have log file of nagios (/etc/nagios/nagios.log) with date and
hour...
> actualy, i can see the following:
> For example:
> [1096384167] SERVICE ALERT: mailsweeper;PING;OK;SOFT;2;PING OK - Packet
loss = 0%, RTA = 1.73 ms
> [1096384167] SERVICE ALERT: fw1;PING;OK;SOFT;2;PING OK - Packet loss = 0%,
RTA = 1.54 ms
> [1096385027] SERVICE ALERT: achs-tam01;PING;WARNING;SOFT;1;PING WARNING -
Packet loss = 0%, RTA = 368.90 ms
> ....etc
>
> Logically i can see the date/hour.. in the nagios page, for example:
> [07-03-2005 16:57:50] SERVICE ALERT:
Sitios_Web_Internet;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 3.53 ms
> [07-03-2005 16:56:50] SERVICE ALERT:
Sitios_Web_Internet;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 0%, RTA
= 120.87 ms
> [07-03-2005 16:53:50] SERVICE ALERT:
Antivirus_Webshield;PING;OK;SOFT;2;PING OK - Packet
> ..etc
>
> But I need to send this data to database for analysis, for that I need the
archive.
> Could you help me, please?
>
> Thak you list,
> Julio Sandoval Sch.
>
>
>
>
>
>
>
>
> "Este mensaje y cualquier archivo adjunto es confidencial y está destinado
a la persona o entidad a quién ha sido dirigido. Si usted no es el receptor
individualizado en el mismo, le solicitamos notificar de ello al remitente
de manera inmediata, estando prohibido y sancionado por la ley cualquier
almacenamiento, divulgación, distribución o copia de su contenido."
>                      隊X'u޼NL v -y蝚v'z q݉ 'wky (|Ϯnrۮyn 8r
brkۜk˺\ -r 왚� x'   ,v��oi  ږZ
'  )rO                  ֠ f)+-5֨"  X  y +
zmض b q  +-떳b ~j稳z  y
嫊w%׍j*' n)z"쎋� t䰅 z+)j|ࢲ˞ 1 ,j+a¢l뺚hا)ߣ 
h ׯ{



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
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