Detecting a string in a file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Detecting a string in a file

Post by RIDS_I2MP »

Hi Team,

We have a requirement to monitor the Webserver log files on servers for a particular string with a fixed frequency of polling for 24x7 throughout the year.
Please can you let us know if this can be enabled using Nagios tool to highlight/alert the team if the string is found.
Thanks & Regards,
I2MP Team.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Detecting a string in a file

Post by WillemDH »

In order to answer this question, you will need to tell us if you are want to check for this string in a logfile on Linux or a Windows host.
Nagios XI 5.8.1
https://outsideit.net
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Detecting a string in a file

Post by ssax »

Also, in addition to WillemDH's questions, are you looking to have near-real-time alerting (passive checks) or to have the XI server reach out on an interval to check (active checks).

Thank you
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Detecting a string in a file

Post by RIDS_I2MP »

Hi Team,

We want to implement this for a windows remote host.

There is a folder containing number of files, files are generated regularly in this folder as these are log files, file name will be consisting the date and time specifying at what particular time it was created. Nagios needs to fetch the recent file from the folder.

Nagios should check that file after some time interval (say 5mins) and fetch the string in the file , if the string is found then alert needs should be send.
Thanks & Regards,
I2MP Team.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Detecting a string in a file

Post by lmiltchev »

You should be able to achieve your goal by using the "check_log3" with "NSClient++".

https://exchange.nagios.org/directory/P ... pl/details

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Detecting a string in a file

Post by RIDS_I2MP »

I search led me that we need to enable NRPE in NSclient++.

Can you tell using NRPE how can I achieve my gaol?
Thanks & Regards,
I2MP Team.
ischwartz

Re: Detecting a string in a file

Post by ischwartz »

RIDS_I2MP wrote:I search led me that we need to enable NRPE in NSclient++.

Can you tell using NRPE how can I achieve my gaol?
You should check one of the two docs linked here depending on your version.

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... -0.3.x.pdf
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Detecting a string in a file

Post by RIDS_I2MP »

Hi Team,

Thanks for the document explaining how to enable NRPE in NSClient++.

But let me know how to detect a string in a file for windows host.
Thanks & Regards,
I2MP Team.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Detecting a string in a file

Post by Box293 »

lmiltchev wrote:You should be able to achieve your goal by using the "check_log3" with "NSClient++".

https://exchange.nagios.org/directory/P ... pl/details

Hope this helps.
RIDS_I2MP wrote:I search led me that we need to enable NRPE in NSclient++.

Can you tell using NRPE how can I achieve my gaol?
RIDS_I2MP wrote:Hi Team,

Thanks for the document explaining how to enable NRPE in NSClient++.

But let me know how to detect a string in a file for windows host.

Now you need to go back to what @lmiltchev suggested and use check_log3 with NSClient++
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Detecting a string in a file

Post by RIDS_I2MP »

Hi Team,

Nagios forum:
"You should be able to achieve your goal by using the "check_log3" with "NSClient++".

https://exchange.nagios.org/directory/P ... pl/details

Hope this helps."


Can you let me know some other link from where I can download the "check_log3.exe" file for my windows host?
Thanks & Regards,
I2MP Team.
Locked