How do I monitor # of files in a folder on a Windows client
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How do I monitor # of files in a folder on a Windows cli
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: How do I monitor # of files in a folder on a Windows cli
Good tip box, OP please let us know what results you get.
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: How do I monitor # of files in a folder on a Windows cli
I am still getting a parsing error when I either run the command directly from the Nagios server or the gui interface. Any ideas?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: How do I monitor # of files in a folder on a Windows cli
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.
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: How do I monitor # of files in a folder on a Windows cli
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.
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.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How do I monitor # of files in a folder on a Windows cli
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:
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'As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How do I monitor # of files in a folder on a Windows cli
wspackaging, Did you get your checkfiles syntax working? Can we close this thread?
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: How do I monitor # of files in a folder on a Windows cli
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
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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: How do I monitor # of files in a folder on a Windows cli
You can close this now. Thanks for the help it is working