Check Windows Files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Check Windows Files

Post 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
Last edited by dwhitfield on Tue Oct 18, 2016 1:59 pm, edited 1 time in total.
Reason: marking with green check mark
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check Windows Files

Post 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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post by rlinux57 »

its 0.4.3.143, how can i upgrade to 0.4.4 ?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check Windows Files

Post 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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post 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 ?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Windows Files

Post 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.
Former Nagios Employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Windows Files

Post 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
Former Nagios Employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post 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 ?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Windows Files

Post 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
Former Nagios Employee
Locked