Page 2 of 3
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Thu Jan 22, 2015 1:53 pm
by Box293
The test check command is not going to work in this situation. Save the service with the double \\, apply config, go find the service and schedule immediate check.
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Thu Jan 22, 2015 2:06 pm
by slansing
Good tip box, OP please let us know what results you get.
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Mon Jan 26, 2015 10:04 am
by wspackaging
I am still getting a parsing error when I either run the command directly from the Nagios server or the gui interface. Any ideas?
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Mon Jan 26, 2015 10:39 am
by slansing
Can you run the check command directly from the nagios server's CLI, then open up your nsclient.log file? Please copy all relevant information out and post it here, you should see the point where the XI server calls the handler you've defined.
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Mon Jan 26, 2015 3:45 pm
by wspackaging
Here is the error in the nsclient.log after I ran from CLI.
2015-01-26 14:40:52: error:include\parsers/filter/where_filter_impl.hpp:85: Parsing failed of '' at:
And the command:
./check_nrpe -H dc1ms032120 -t 30 -c CheckFiles -a path='E:\\Quest Software\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=5 MaxCrit=1000
Parsing failed:
[root@dc1ux086 libexec]#
And to confirm the file location it is E:\Quest Software\ArchiveManager\Error on a Windows 2012 R2 Server. We are monitoring this server up pings, drive sizes, and services and they all work.
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Mon Jan 26, 2015 5:21 pm
by Box293
Ahh it looks like you're using NSClient++ 0.3.9.
For this version it requires one extra option 'filter=size gt 0b'
Try this command:
Code: Select all
./check_nrpe -H dc1ms032120 -t 30 -c CheckFiles -a path='E:\\Quest Software\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=5 MaxCrit=1000 'filter=size gt 0b'
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Tue Jan 27, 2015 10:22 am
by cmerchant
wspackaging, Did you get your checkfiles syntax working? Can we close this thread?
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Tue Jan 27, 2015 2:23 pm
by wspackaging
Not yet, we are getting closer now. We now can run the command but it does not return any files. It comes back with 0 files found. Is there anything special we have to do with the space in the folder name? Unfortunately this is an install folder and cannot change.
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Tue Jan 27, 2015 3:27 pm
by lmiltchev
I am not sure if the space is the issue here... Have you tried creating a new folder with no spaces in the name, for example "C:\tmp", placing some files in it, and running the check against it?
Re: How do I monitor # of files in a folder on a Windows cli
Posted: Tue Jan 27, 2015 5:28 pm
by wspackaging
You can close this now. Thanks for the help it is working