Page 1 of 1

Check file content

Posted: Thu Sep 15, 2016 4:07 am
by kaiserclaw
Hi,

Is there any plugin/command for searching a logfile for a specific pattern?

I have a log file on a server, I would like to monitor this log file if there are any lines in this file containing a string like "error" .

Thank you.

Re: Check file content

Posted: Thu Sep 15, 2016 10:27 am
by rkennedy
Take a look and see if check_logfiles will work for you - https://labs.consol.de/nagios/check_logfiles/

Otherwise, another product we have is Nagios Log Server, which is meant to store data and do just what you're looking for.

Re: Check file content

Posted: Fri Sep 16, 2016 3:57 am
by kaiserclaw
Thank you.

Isn't check_logfile a local check on server? What about another host/client?

Re: Check file content

Posted: Fri Sep 16, 2016 9:46 am
by tmcdonald
kaiserclaw wrote:Isn't check_logfile a local check on server? What about another host/client?
You can run plugins on remote machines by using NRPE:

https://support.nagios.com/kb/article.php?id=515