How to monitor a dynamically changing Log file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

How to monitor a dynamically changing Log file

Post 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 .
You do not have the required permissions to view the files attached to this post.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: How to monitor a dynamically changing Log file

Post by deek »

Im also attaching the nsclient++ file below .
nsclient_log.txt
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to monitor a dynamically changing Log file

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: How to monitor a dynamically changing Log file

Post 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
You do not have the required permissions to view the files attached to this post.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: How to monitor a dynamically changing Log file

Post 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 .
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How to monitor a dynamically changing Log file

Post 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.
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: How to monitor a dynamically changing Log file

Post 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 .
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to monitor a dynamically changing Log file

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked