Page 1 of 1

can Nagios scan a log file for a keyword?

Posted: Mon Aug 10, 2020 8:42 am
by rnjie
can Nagios scan a log file for a keyword? like search for a particular string from log files and send out an alert

Re: can Nagios scan a log file for a keyword?

Posted: Mon Aug 10, 2020 4:26 pm
by jbrunkow
You can monitor log files for a specific regular expression with the check log files plugin.
check_logfiles

Managing Plugins in Nagios XI

Re: can Nagios scan a log file for a keyword?

Posted: Wed Aug 12, 2020 12:00 pm
by rnjie
thank you, but i do not see anywhere to download the plugin you provided, usually there is always an option to download or copy the script but i do not see it, all i see is this https://labs.consol.de/nagios/check_log ... stallation which just basically explains the plugin, am confused as to which is the actually plugin

Re: can Nagios scan a log file for a keyword?

Posted: Wed Aug 12, 2020 2:52 pm
by jbrunkow
Whups! Sorry about that. It looks like the same plugin is posted on GitHub as well. You should be able to download it from there.
check_logfiles on GitHub

You may already have a plugin called check log installed. It looks like you can search for a query in a log file using the -q flag.

Code: Select all

ls /usr/local/nagios/libexec | grep check_log