File Count Monitoring using NRPE
File Count Monitoring using NRPE
Hi,
We are trying to monitor the number of files in a directory on a remote windows server using the plugin from the below link. when I run the .exe file on widnows it works fine. Now i need to call it from nagios server. I have been going through some documentation and found that a command needs to added to the nrpe.cfg, does the below commad look fine or am i supposed to create it in a different way?
command[check_file_count]=\\ipaddress\test-file-count\check_winfile
https://www.itefix.no/i2/check_winfile
Please assist.
We are trying to monitor the number of files in a directory on a remote windows server using the plugin from the below link. when I run the .exe file on widnows it works fine. Now i need to call it from nagios server. I have been going through some documentation and found that a command needs to added to the nrpe.cfg, does the below commad look fine or am i supposed to create it in a different way?
command[check_file_count]=\\ipaddress\test-file-count\check_winfile
https://www.itefix.no/i2/check_winfile
Please assist.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: File Count Monitoring using NRPE
What you need to do is install NSClient++ on the windows box if it isn't already
32bit
http://assets.nagios.com/downloads/nagi ... ble-32.msi
64bit
http://assets.nagios.com/downloads/nagi ... ble-64.msi
Enable NRPE
Place the check_winfile.exe in C:\Program Files\NSClient++\scripts
Then, add the following under [External Scripts] add your command, like
Save
Restart NSClient++
Then from your XI server you should be able to call the command like
/usr/local/nagios/libexec/check_nrpe -H <IP_ADDRESS> -c check_file_count
32bit
http://assets.nagios.com/downloads/nagi ... ble-32.msi
64bit
http://assets.nagios.com/downloads/nagi ... ble-64.msi
Enable NRPE
Place the check_winfile.exe in C:\Program Files\NSClient++\scripts
Then, add the following under [External Scripts] add your command, like
Code: Select all
check_file_count=scripts\check_winfile.exe -t C:\temp --filter "age ge -24 hours" --critical 0
Restart NSClient++
Then from your XI server you should be able to call the command like
/usr/local/nagios/libexec/check_nrpe -H <IP_ADDRESS> -c check_file_count
Re: File Count Monitoring using NRPE
HI
Where can i find [External Scripts]
The client is already installed and NRPE is enabled
The addition at remote host side is not clear.
Where can i find [External Scripts]
The client is already installed and NRPE is enabled
The addition at remote host side is not clear.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: File Count Monitoring using NRPE
Sorry I didn't add that, you add it to the nsc.ini in C:\Program Files\NSClient++
Re: File Count Monitoring using NRPE
Hi,
Thanks for the reply....We are trying to monitor the file count in multiple directories on the same server. How do i modify the command to accept an argument - which will be the path of folder where the check has to be performed - rathere than creating multiple check commands in the nsc.ini file.
I have already set the allow aruments option to 1
Thanks for the reply....We are trying to monitor the file count in multiple directories on the same server. How do i modify the command to accept an argument - which will be the path of folder where the check has to be performed - rathere than creating multiple check commands in the nsc.ini file.
I have already set the allow aruments option to 1
Re: File Count Monitoring using NRPE
You can specify a list of values seperated by comma, or multiple --target commands
https://www.itefix.no/i2/check_winfile
https://www.itefix.no/i2/check_winfile
So for example to check both drive c: and c:\windows:--target file/directory[,file/directory]...]] [[--target ...] ... ]
This option specifies targets to check. A target can be a simple file or a recursive list of files in a directory. You can specify several comma separated targets for one --target option, as well as several --target options. At least one is required.
Code: Select all
check_winfile.exe --target "c:\windows","c:"
FILE OK - 58043 files to consider |'selected files'=58043;;; 'all files'=58043 '
deleted files'=0
Re: File Count Monitoring using NRPE
that shows the combined count of all the files in the folders included in the target field....!! we need an ability set the threshold for each of the folder on a server.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: File Count Monitoring using NRPE
Hi there,
It appears it is doing what you asked, could you add a little more detail to your most recent request? What exactly do you need returned to the Nagios server. Did you want it to tell you specifically how many files are in each directory separated out?We are trying to monitor the file count in multiple directories on the same server
Re: File Count Monitoring using NRPE
Yes,
From the pevious post where it says i can list multiple files using comma....I have tried that and the output returned to nagios is the sum of all the files from each of these folder combined.
My Original ques was if I could create a command using nrpe which takes the filepath on the remote folder as an argument, which can save me a lot of time rather than creating a command for each folder and keep it in NSC.ini file
From the pevious post where it says i can list multiple files using comma....I have tried that and the output returned to nagios is the sum of all the files from each of these folder combined.
My Original ques was if I could create a command using nrpe which takes the filepath on the remote folder as an argument, which can save me a lot of time rather than creating a command for each folder and keep it in NSC.ini file
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: File Count Monitoring using NRPE
If you would like to separate each folder, you will need to create individual checks for each folder. The plugins intent is to combine all files\folders, on a per check basis.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.