Page 1 of 1

Monitor Keywords for client logs and return status to nagios

Posted: Mon Mar 22, 2021 4:20 am
by ISGPRDFT
i want to monitor certain keywords like "error" or warning" in client logs file.How to setup and to monitor this keyword ?

Re: Monitor Keywords for client logs and return status to na

Posted: Mon Mar 22, 2021 2:22 pm
by vtrac
Hi,
You can try the "check_log" script which came standard with Nagios XI located at:

Code: Select all

/usr/local/nagios/libexec/check_log
Example: Check "/var/log/messages" for word "error:":
(NOTE: the very first runs of check_log will initialize the "oldlog" file, so no output or checking is done on the first run of check_log.)

Code: Select all

./check_log -F /var/log/messages -O /var/log/oldlog -q "error:" -w 2
or you could try searching the Nagios Exchange web page:
https://exchange.nagios.org/


Regards,
Vinh

Re: Monitor Keywords for client logs and return status to na

Posted: Fri Mar 26, 2021 2:33 am
by ISGPRDCIS
Still encountering issue :

This one parameter I set at my nagios server using check_nrpe :
$ /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -t 30 -c keywords
NRPE_NT failed to create process, exiting...


This is window server. But it doesnt work.
command[keywords]=C:\NRPE_NT\plugins\check_log -F D:\emaileater_20210308.out.log -O D:\oldlog -q "Detected invalid subscription" -w 2

for the check_log,i download the plugin from the nagios xi >Admin > Manage Plugins >Check_log ...so it is not compatible to windew?

Re: Monitor Keywords for client logs and return status to na

Posted: Fri Mar 26, 2021 6:26 pm
by ssax
Correct, not compatible with Windows.

Locking thread, ticket received, we will continue support through the ticket.

Thank you!