Nagios check files count on Windows

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Nagios check files count on Windows

Postby jaysyu » Mon Jan 11, 2021 2:43 am

Hi Guys.

does anyone know how to monitor the amount of files in a folder in windows?
In my nagios, I want to monitor how many files are in a windows server folder at a certain hour.
If in the specified time span, the files in the folder are below 16, then Nagios will send a notification.
I have nsclient installed on windows and use nrpe to monitor this. But I lack information about the commands or scripts used.

I found this article https://support.nagios.com/kb/article/f ... s-783.html
And the command is "./check_nrpe -H 10.25.14.2 -c check_files -a path='C:\\Temp' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${count} files found' 'empty-state=ok' "

But, but I don't know exactly where to enter the command, in the Nagios command file or in the nsclient windows file?

Thank you
jaysyu
 
Posts: 1
Joined: Mon Jan 11, 2021 1:29 am

Re: Nagios check files count on Windows

Postby gormank » Tue Jan 12, 2021 4:01 pm

I usually just search the internet as shown...
https://www.google.com/search?rlz=1C1GC ... CA0&uact=5

If you want to use check_files you need to have it defined in nsclient.ini in Windows, and then define a service on the nagios server that uses check_nrpe.
gormank
 
Posts: 825
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios check files count on Windows

Postby mcapra » Mon Jan 18, 2021 10:23 pm

jaysyu wrote:But, but I don't know exactly where to enter the command, in the Nagios command file or in the nsclient windows file?


Which NSClient++ version are you running on the Windows machine?

check_files is a built-in NSClient++ plugin:
https://docs.nsclient.org/reference/windows/CheckDisk/

I'd suggest reviewing the "getting started" documentation:
https://assets.nagios.com/downloads/nag ... ndows.html

Which does everything with NCPA, which is very different from NSClient++, but the Nagios Core configurations are pretty comparable. If you're trying to monitor a machine using NSClient++, you'd need to change your service/command definitions to leverage the check_nrpe plugin instead of check_ncpa. But if you're totally new to Nagios Core in general, I'd suggest starting with NCPA as it's pretty well documented and has official support. Though it doesn't do everything NSClient++ does, it'll at least get you acquainted with some Nagios Core fundamentals.
Former Nagios employee
https://www.mcapra.com/
User avatar
mcapra
 
Posts: 3643
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios check files count on Windows

Postby orgmf » Sat Feb 06, 2021 7:02 am

jaysyu wrote:Hi Guys.

does anyone know how to monitor the amount of files in a folder in windows?
In my nagios, I want to monitor how many files are in a windows server folder at a certain hour.
If in the specified time span, the files in the folder are below 16, then Nagios will send a notification.
I have nsclient installed on windows and use nrpe to monitor this. But I lack information about the commands or scripts used.

I found this article https://support.nagios.com/kb/article/f ... s-783.html
And the command is "./check_nrpe -H 10.25.14.2 -c check_files -a path='C:\\Temp' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${count} files found' 'empty-state=ok' "

But, but I don't know exactly where to enter the command, in the Nagios command file or in the nsclient windows file?

Thank you


You can use poweshell commands to do this...
orgmf
 
Posts: 1
Joined: Sat Feb 06, 2021 6:44 am
Location: USA


Return to Community Support

Who is online

Users browsing this forum: nagiosxi-admins and 53 guests