about faq f0070

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu May 8 12:12:40 CEST 2003


Dear Sir,

On Thu, May 08, 2003 at 11:11:53AM +0200, Montse Seisdedos wrote:
> How can I convert the timestamp values in the log file to a friendlier
> format?
>  
> Description:
> User would like to view the raw log files with human-readable
> timestamps. 
>   
> Solution:
> The following Perl script will print out the contents of a Nagios log
> file with a human-readable time format: 
>  

  .. elegant perl snipped ..
 
> ok, is there any way nagios do it for me directly? Or should I execute
> this script from command line???

Nagios does it for you in the 'Event Log' link under the Reporting
header in the left frame of the Nag start page.

If you want to look at 'the log files in a friendler format', then take
Mr Galstads advice, and from the CLI, cd into the log path and type

./perl_saved_as_file_and_chmod755 nagios.log | more

or a for a real quick one liner

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


Or have I misunderstood your question ?

Yours sincerely.


-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
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