Check file content

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kaiserclaw
Posts: 15
Joined: Thu Dec 10, 2015 5:30 am

Check file content

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check file content

Post 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.
Former Nagios Employee
kaiserclaw
Posts: 15
Joined: Thu Dec 10, 2015 5:30 am

Re: Check file content

Post by kaiserclaw »

Thank you.

Isn't check_logfile a local check on server? What about another host/client?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check file content

Post 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
Former Nagios employee
Locked