Page 1 of 1

Monitoring a text file for a phrase.

Posted: Tue May 07, 2019 4:48 pm
by antorres
Hi there.

I am trying to monitor a file which is in a Windows server. The exact location is like this. "\\171.10.XX.XX\FileAdapter\sowal.log", I am looking for this exact phrase "Tracing is being stopped"


I have already tried some plugins I found but I still can no make it work.

Has anyone resolve this kind of issues?
Can Somebody help me.?

Thank you very much in advance.

Best Regards.

Re: Monitoring a text file for a phrase.

Posted: Wed May 08, 2019 12:50 pm
by lmiltchev
You could try using this plugin:

https://github.com/pmcaulay/nagios-plug ... k_log3.exe

Place it in the NSClient++ scripts directory. Create an entry in the nsclient.ini (under the [/settings/external scripts/scripts] section):

Code: Select all

check_log3 = scripts\check_log3.exe $ARG1$
save, exit, and restart the NSClient++ service. Test your command from the command line on the Nagios XI server by running:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_log3 -a '-l "\\171.10.XX.XX\FileAdapter\sowal.log" -p "Tracing is being stopped"'
To view the usage of the plugin, run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_log3 -a '-h'
Hope this helps.

Re: Monitoring a text file for a phrase.

Posted: Thu May 16, 2019 1:43 pm
by antorres
HI lmiltchev

Thank you very much for your aswer.

I have encounter a solution for this, All I did was first mount the windows shared folder on my nagios server. with this command.

Code: Select all

mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver
Then used a very simple plugin

https://github.com/deimosfr/nagios-chec ... master.zip

I have changed some stuffs to adapt exactly to my needs and it worked!!

If for some reason this work-around does not works for me anymore I will try your way!

Thank you very much again.

Best Regards

Re: Monitoring a text file for a phrase.

Posted: Thu May 16, 2019 4:07 pm
by scottwilkerson
antorres wrote:HI lmiltchev

Thank you very much for your aswer.

I have encounter a solution for this, All I did was first mount the windows shared folder on my nagios server. with this command.

Code: Select all

mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver
Then used a very simple plugin

https://github.com/deimosfr/nagios-chec ... master.zip

I have changed some stuffs to adapt exactly to my needs and it worked!!

If for some reason this work-around does not works for me anymore I will try your way!

Thank you very much again.

Best Regards
Glad you found a working solution!

Locking thread