.xml logfile monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
aditya.c.anand
Posts: 56
Joined: Mon Mar 20, 2017 7:16 am

.xml logfile monitoring

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: .xml logfile monitoring

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked