Hi
I want to setup monitoring of file count in a particular folder using wmi/command/nrpe.
Can you please advise how can setup using command or plugin etc.
I tried this using check command "check_file_service".
I created a new command as:
$USER1$/folder_watch.pl -H $HOSTADDRESS -u $ARG1$ -p $ARG2$ -f $ARG3$ -D $ARG4$ $ARG5$
where Arguments are as:
ARG1 = 'username'
ARG2 = 'password'
ARG3 = files
ARG4 = C:\test (path of folder which we want to monitor files)
ARG5 = -F '[^\0] ' -w 5 -c 10
Can you please advise how to fix this or if there is any other way to achieve this?
Thanks
Monitoring File count using wmi/nrpe/command
-
linearstack
- Posts: 26
- Joined: Tue Nov 07, 2017 7:35 pm
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Monitoring File count using wmi/nrpe/command
Hi,
Do you have NSClient installed on the remote Windows System? We have helpful examples on the following page.
See: File And Folder Checks
For NSLCIent, the check command would look like:
For the case of WMI, you can check the folder size, for example.
Let us know which approach you'd like to use and if you need assistance.
Benjamin
Do you have NSClient installed on the remote Windows System? We have helpful examples on the following page.
See: File And Folder Checks
For NSLCIent, the check command would look like:
Code: Select all
./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'
Code: Select all
./check_wmi_plus.pl -H 10.25.14.3 -u wmiagent -p Str0ngP@ssw0rd -m checkfoldersize -a C:/Temp
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
linearstack
- Posts: 26
- Joined: Tue Nov 07, 2017 7:35 pm
Re: Monitoring File count using wmi/nrpe/command
Thanks for replying.
We are actually monitoring it using WMI.
With WMI we want to set the monitoring of number of files in folder rather than folder size.
We are actually monitoring it using WMI.
With WMI we want to set the monitoring of number of files in folder rather than folder size.
Re: Monitoring File count using wmi/nrpe/command
You should be able to do this which checks the count:
CRITICAL if count greater than 10:
CRITICAL if count less than 10:
You can change 10 to whatever you'd like:
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
CRITICAL if count greater than 10:
Code: Select all
./check_wmi_plus.pl -H 10.25.14.3 -u wmiagent -p 'Str0ngP@ssw0rd' -m checkfoldersize -a C:/Temp -c _ItemCount=10Code: Select all
./check_wmi_plus.pl -H 10.25.14.3 -u wmiagent -p 'Str0ngP@ssw0rd' -m checkfoldersize -a C:/Temp -c _ItemCount=10:https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT