Monitoring a text file for a phrase.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
antorres
Posts: 20
Joined: Thu Aug 22, 2013 12:11 pm

Monitoring a text file for a phrase.

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring a text file for a phrase.

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
antorres
Posts: 20
Joined: Thu Aug 22, 2013 12:11 pm

Re: Monitoring a text file for a phrase.

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

Re: Monitoring a text file for a phrase.

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