checking multiple log files
Kyle O'Donnell
kyle.odonnell at gmail.com
Tue Apr 3 17:28:01 CEST 2007
Hi,
I need to check for a string in multiple log files. The names of the
log files will contain a constant string, and be located in constant
directory.
Currently I am using the check_logfiles plugin with the following configuration:
@logs = (
{
tag => 'mqrefused',
logfile => '/var/mqm/exits/logs/.*.log',
rotation => 'solaris',
warningpatterns => 'refused',
}
);
@logs = (
{
tag => 'mqfdcprobe',
logfile => '/var/mqm/errors/.*.FDC',
rotation => 'solaris',
warningpatterns => 'Probe Id',
}
);
The only problems are that, the output does not contain the offending
string/line, and the status is set to UNKNOWN when a string isn't
matched.
One thought was to write a wrapper for check_logs.pl which does
for i in `ls *.log`
do
output=`check_logs.pl -f $i -s /tmp/$i.tmp -p "blah"`
printf $output\t
done
This should print all of the output... I can work out the exit status
as well... but this isn't ideal
Any Ideas?
Thanks,
Kyle
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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