Monitoring file count on remote windows machine

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
tmattingly
Posts: 115
Joined: Thu Oct 23, 2014 12:53 pm

Monitoring file count on remote windows machine

Post 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
tmattingly
Posts: 115
Joined: Thu Oct 23, 2014 12:53 pm

Re: Monitoring file count on remote windows machine

Post 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...?
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Monitoring file count on remote windows machine

Post by SteveBeauchemin »

Is NSClient++ an option? Was not clear from the posted question.

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring file count on remote windows machine

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tmattingly
Posts: 115
Joined: Thu Oct 23, 2014 12:53 pm

Re: Monitoring file count on remote windows machine

Post by tmattingly »

The example link I think is perfect. I'll be testing it this week.
bolson

Re: Monitoring file count on remote windows machine

Post by bolson »

Excellent! Keep us posted.
tmattingly
Posts: 115
Joined: Thu Oct 23, 2014 12:53 pm

Re: Monitoring file count on remote windows machine

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring file count on remote windows machine

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
tmattingly
Posts: 115
Joined: Thu Oct 23, 2014 12:53 pm

Re: Monitoring file count on remote windows machine

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitoring file count on remote windows machine

Post by tgriep »

Can you show us the command you are typing in to cause the issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked