Page 1 of 1

.xml logfile monitoring

Posted: Tue Feb 19, 2019 5:46 am
by aditya.c.anand
Hello Team,

We are using check_log3.pl script for all log monitoring.
We have a new request to monitor a certain string like "Error while provisioning" under an .xml log file. Can we monitor .xml logs via the same plugin or is there any other plugin that can help us here?

Regards,
Aditya Anand

Re: .xml logfile monitoring

Posted: Tue Feb 19, 2019 10:11 am
by lmiltchev
You should be able to. I added the pattern to a "test" xml file, and ran the plugin against it. During the first run, the plugin found the pattern. During the second run, the plugin showed "Found 0 lines" as there were no new lines found, matching the pattern. See below:

Code: Select all

[root@main-nagios-xi libexec]# ./check_log3.pl -l /tmp/test.xml -p  "Error while provisioning"
WARNING: Found 1 lines (limit=1/0):   <NAGIOS_PERFDATA>Error while provisioning</NAGIOS_PERFDATA>|lines=1
[root@main-nagios-xi libexec]# ./check_log3.pl -l /tmp/test.xml -p  "Error while provisioning"
OK: Found 0 lines (limit=1/0): No matches found.|lines=0