How do I monitor # of files in a folder on a Windows client

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
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

Post 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.
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

Post by slansing »

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

Post 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?
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

Post 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.
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

Post 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.
User avatar
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

Post 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'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: How do I monitor # of files in a folder on a Windows cli

Post by cmerchant »

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

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How do I monitor # of files in a folder on a Windows cli

Post 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?
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

Post by wspackaging »

You can close this now. Thanks for the help it is working
Locked