[Nagiosplug-help] check logfiles?

Blake blakes_email at yahoo.com
Fri Mar 26 11:24:06 CET 2004


In regards to using check_log here are some thoughts
for you ... 

you could update the check_log script to accept grep
extended option.

Add -E to the following line:

# Count the number of matching log entries we have
count=`$GREP -E -c "$query" $tempdiff`

and your query should look like this:

check_log -F logfile -O oldlog -q 'ERROR|response'  


Also to update the number of lines you receive.  I
dont think you want to send more than 1 line to Nagios
so maybe you should just add another command to copy
the matches to a specific file.

# Get the last matching entry in the diff file
lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1`

$GREP "$query" $tempdiff > filename.log

or something like that ... I think you can get
creative with this one.

OTher options are to look at check_log2.pl in the
plugins contrib or use something like swatch. For
information on using swatch with Nagios please refer
to the Nagios-users mail archives for a message sent
by: "Jim Mozley" <jim.mozley at exponential-e.com> on
Mon, 22 Mar 2004 10:07:27 +0000 with the subject: Re:
[Nagios-users] System Log monitoring with nagios?


--Blake


--- Rainer Anschober <arm at spar.at> wrote:
> Hi members,
> 
> i have a spezial problem. I will control my linux
> servers with nagios.
> 
> But how can i control logfiles?
> 
> I now, there is an plugin named check_log. But with
> this, i can only
> search for one expression and i can only transfer
> ONE LINE to the
> server. But i must be able to transfer more then one
> Line to the server,
> because i don't now, how many messages kernel
> drivers will produce on
> error. And i don't now the content of this messages.
> 
> Each device driver has it's own error messages and i
> will see all of
> them.
> 
> If anyone nows a solution about it, please let me
> know. When i can solve
> this problem, i will control more then 2000 hosts
> with nagios.
> 
> Thank you
> Rainer
> 
> 
> 
>
-------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux
> Tutorials
> Free Linux tutorial presented by Daniel Robbins,
> President and CEO of
> GenToo technologies. Learn everything from
> fundamentals to system
>
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when
> reporting any issue. 
> ::: Messages without supporting info will risk being
> sent to /dev/null


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html




More information about the Help mailing list