Page 1 of 1

How to monitor a dynamically changing Log file

Posted: Fri Sep 04, 2020 8:17 am
by deek
Hi ,
I have got to monitor a Log file and search for a string . But the problem is that the Log file is dynamic in nature . I tried using regular expression , but its not working .
Ill attach the command line I have used .

Command View :
$USER1$/check_nrpe -H $HOSTADDRESS$ -u -t 60 -c $ARG1$ $ARG2$

$ARG1$ : check_logfile_WinTerm

Screenshot of the Log file path -
cot log file pic.PNG
Screenshot of WinTerm text file which I created -
winterm capture.PNG
Screenshot of the output Im getting -
output capture.PNG
Please let me know how can I monitor a dynamic log file in Nagios .

Re: How to monitor a dynamically changing Log file

Posted: Fri Sep 04, 2020 8:18 am
by deek
Im also attaching the nsclient++ file below .
nsclient_log.txt

Re: How to monitor a dynamically changing Log file

Posted: Fri Sep 04, 2020 5:39 pm
by benjaminsmith
Hi @deek,

I'm not too familiar with this plugin, check_logfile_WinTerm. Can you provide a link to the plugin page?

That said, Nagios XI is not really designed for log file monitoring, we have a separate product for that called Nagios Log Server. We even offer a free version for small environments.

https://www.nagios.com/products/nagios-log-server/

Let me know if that would be an option for you.

Re: How to monitor a dynamically changing Log file

Posted: Sat Sep 05, 2020 5:47 am
by deek
Hi ,
Actually check_logfile_WinTerm is not a plugin . I had defined this term in the nsclient++ file under [/settings/external scripts/scripts] . So I mentioned in the $ARG1$ .
Capture winterm.PNG

Ill check the Nagios log server capabilities . Thank you

Re: How to monitor a dynamically changing Log file

Posted: Mon Sep 07, 2020 5:38 am
by deek
Hi ,
Actually we wont be using Nagios Log server because we already using Splunk to monitor the logs .

But I wanted to know if there is a way to monitor dynamically changing log files in Nagios XI .

Re: How to monitor a dynamically changing Log file

Posted: Tue Sep 08, 2020 2:08 pm
by ssax
If you change your logfile line to this, does it work?

Code: Select all

logfile => 'I:\log\cot\cot.$CL_DATE_MM$.$CL_DATE_DD$'
You may want to create a I:\temp folder and change your $protocolsdir and $seekfilesdir to it and see if that resolves the permissions issue.

Re: How to monitor a dynamically changing Log file

Posted: Wed Sep 09, 2020 2:00 am
by deek
Hi ,

Its working and we are getting an output .
I also tried with check_log3 and I was able to get the output .

Thank you so much .

Re: How to monitor a dynamically changing Log file

Posted: Wed Sep 09, 2020 7:16 am
by scottwilkerson
deek wrote:Hi ,

Its working and we are getting an output .
I also tried with check_log3 and I was able to get the output .

Thank you so much .
Great!

Locking thread