Page 1 of 3

Check Windows Files

Posted: Thu Oct 13, 2016 10:24 am
by rlinux57
I want to check the file modification within past 1 hour from nagios server to windows server. But it not shown the file as critical as it's modified in past 5 min.

Code: Select all

check_nrpe -H WIndowsServerIP -t 30 -c check_files -a path='C:\\testing\\testing' 'filter=written > -1h' 'critical=count<1' 'empty-state=critical'
Output:

Code: Select all

No files found|'count'=0;0;1

Re: Check Windows Files

Posted: Thu Oct 13, 2016 11:11 am
by dwhitfield
What version of check_files are you using? Count was broken in 0.4.3, but should be fixed in 0.4.4.

Re: Check Windows Files

Posted: Thu Oct 13, 2016 11:41 am
by rlinux57
its 0.4.3.143, how can i upgrade to 0.4.4 ?

Re: Check Windows Files

Posted: Thu Oct 13, 2016 11:52 am
by dwhitfield
http://nsclient.org/download/0.4.4/#0.4.4.23

There's also a 0.5 out (http://nsclient.org/download/0.5.0/), but personally, I'd stick with 0.4.4 for now for maximum compatibility.

Re: Check Windows Files

Posted: Thu Oct 13, 2016 11:44 pm
by rlinux57
Okay,
And if i want to find multiple words in a files using check_files and give crritical notification if found than what is the procedure ?

Re: Check Windows Files

Posted: Fri Oct 14, 2016 10:44 am
by rkennedy
What sort of logic are you looking for - if all words are present, or if it finds any one of your many words?

You may need to just create a new check for each one, depending on your answer to the above question.

Re: Check Windows Files

Posted: Fri Oct 14, 2016 10:58 am
by rlinux57
I want to find multiple words(contains my own specific words) in a file, if anyone of them is found it shows an critical message.

Re: Check Windows Files

Posted: Fri Oct 14, 2016 1:56 pm
by rkennedy
check_files is not the plugin you'd need to use in that case, as it won't analyze the data.

If you have a lot of log checks to setup, I would look at another one of our products, Nagios Log Server (which has this exact purpose, and retains historical data) - https://www.nagios.com/products/nagios-log-server/

Otherwise, take a look at our Exchange to see if you can find one that will work - https://exchange.nagios.org/directory/Plugins/Log-Files

This one seems to have the best reviews, and mentions Windows Support - https://exchange.nagios.org/directory/P ... pl/details

Re: Check Windows Files

Posted: Fri Oct 14, 2016 4:45 pm
by rlinux57
If i will use this script https://exchange.nagios.org/directory/P ... py/details for windows client, what would be its command definition and service definition ?

Re: Check Windows Files

Posted: Mon Oct 17, 2016 9:48 am
by rkennedy
I would first make sure it's going to work on your Windows machine.

Code: Select all

Usage check_in_logfiles.py : <patfile> <logfile>
Using python, does it return your requested output?

Otherwise, the way to go may be following this guide - http://nagios.fm4dd.com/howto/monitor-c ... gfiles.htm