Page 1 of 2

Monitoring file count on remote windows machine

Posted: Thu Jul 06, 2017 6:01 pm
by tmattingly
Is there a way to use built in functionality (perferably not a 3rd party .pl to Nagios that can monitor file count on a remote Windows Server and Windows client?
Is there a way to do it without installing an agent? And if yes, what needs to be turned on the remote Windows Server and Windows client?

If there is only a community .PL which one works the best and easiest?

Tom

Re: Monitoring file count on remote windows machine

Posted: Thu Jul 06, 2017 6:03 pm
by tmattingly
And btw, that is in a single directory on remote Server/Client... Sorry I didn't get that in there in the beginning...?

Re: Monitoring file count on remote windows machine

Posted: Thu Jul 06, 2017 8:33 pm
by SteveBeauchemin
Is NSClient++ an option? Was not clear from the posted question.

Steve B

Re: Monitoring file count on remote windows machine

Posted: Fri Jul 07, 2017 10:36 am
by scottwilkerson
I don't believe there is any way to do it without an agent.

There is an example here
https://support.nagios.com/forum/viewto ... 10#p179235

you will likely need NSClient++ or NCPA and and a plugin.

More details can be found here
http://sites.box293.com/nagios/guides/c ... es-folders

Re: Monitoring file count on remote windows machine

Posted: Sat Jul 15, 2017 8:08 pm
by tmattingly
The example link I think is perfect. I'll be testing it this week.

Re: Monitoring file count on remote windows machine

Posted: Mon Jul 17, 2017 11:44 am
by bolson
Excellent! Keep us posted.

Re: Monitoring file count on remote windows machine

Posted: Mon Jul 24, 2017 6:44 pm
by tmattingly
I believe I have NSClient++ installed and Nagios appears to like it...

But when I use the examples in https://support.nagios.com/forum/viewto ... 10#p179235 (from above)
Nagios reports: Could not construct return packet in NRPE handler check client side (nsclient.log) logs earlier and then after allowing arguments

2017-07-24 15:36:31: message:CACHEmodules\FileLogger\FileLogger.cpp:87: Log path is: C:\Program Files\NSClient++\\nsclient.log
2017-07-24 15:36:31: error:modules\NRPEListener\NRPEListener.cpp:432: Request arguments contained illegal metachars!
2017-07-24 15:36:31: error:modules\NRPEListener\NRPEListener.cpp:320: Exception handling NRPE packet

The parameters I passed were... check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\\NO BACKUP' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'

One additional note when I use the configuration wizard (NRPE) and I monitor that host I get... (straight text, I couldn't paste the gui picture)

Current Load (Current Load)
Notifications are disabled for this service
Unknown 58m 55s 5/5 2017-07-24 15:53:23 UNKNOWN: No handler for that command

Current Users (Current Users)
Problem is acknowledgedNotifications are disabled for this service
Unknown 1h 2m 34s 5/5 2017-07-24 15:54:46 UNKNOWN: No handler for that command


Max File Check (Max File Check)
Notifications are disabled for this service
Unknown 54m 33s 3/3 2017-07-24 15:53:29 Could not construct return packet in NRPE handler check client side (nsclient.log) logs...


Total Processes (Total Processes)
Notifications are disabled for this service
Unknown 1h 1m 11s 5/5 2017-07-24 15:57:10 UNKNOWN: No handler for that command

Tom

Re: Monitoring file count on remote windows machine

Posted: Tue Jul 25, 2017 9:10 am
by lmiltchev
Change this:

Code: Select all

;CheckExternalScripts.dll
to this:

Code: Select all

CheckExternalScripts.dll
under the [modules] section.

Next, change this:

Code: Select all

;allow_arguments=0
;allow_nasty_meta_chars=0
to this:

Code: Select all

allow_arguments=1
allow_nasty_meta_chars=1
under the [External Script] section.

Also, change this:

Code: Select all

;allow_nasty_meta_chars=0
to this:

Code: Select all

allow_nasty_meta_chars=1
under the [NRPE] section.

Finally, restart the NSClient++ service.

Let us know if this resolved your issue. Thanks!

Re: Monitoring file count on remote windows machine

Posted: Tue Jul 25, 2017 2:26 pm
by tmattingly
Now when I type any command I get a '>' prompt. (I did restart the service after making the changes however in your last post was there a change in [NRPE]?
I've also uploaded the changed NSC.INI file.

Tom

Re: Monitoring file count on remote windows machine

Posted: Tue Jul 25, 2017 3:31 pm
by tgriep
Can you show us the command you are typing in to cause the issue?