How to check folder size with NRPE (Windows folder)
How to check folder size with NRPE (Windows folder)
Hello Nagios Support
How to check folder size with NRPE (Windows folder)?
Thank you,
Dimitri
How to check folder size with NRPE (Windows folder)?
Thank you,
Dimitri
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: How to check folder size with NRPE (Windows folder)
Hello, @dlukinski. Please make sure that you have the check_folder_size.vbs script in the NSClient scripts folder. You should have it there by default, i think.
Here's an example of the command:
Here's an example of the nrpe command:
Here's an example of the command:
Code: Select all
check_foldersize = cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs c:\yourfolder 50 78Code: Select all
./check_nrpe -H 192.168.3.145 -c check_foldersizeAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How to check folder size with NRPE (Windows folder)
npolovenko wrote:Hello, @dlukinski. Please make sure that you have the check_folder_size.vbs script in the NSClient scripts folder. You should have it there by default, i think.
Here's an example of the command:Here's an example of the nrpe command:Code: Select all
check_foldersize = cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs c:\yourfolder 50 78Code: Select all
./check_nrpe -H 192.168.3.145 -c check_foldersize
Hi
1. Where to get the script?
- also found PS1 script https://www.reddit.com/r/nagios/comment ... rver_with/
- How to edit INI and XI Command / Service to get this working?
2. check_foldersize - Unknown command
Thank you
Last edited by tgriep on Wed May 02, 2018 10:45 am, edited 1 time in total.
Reason: Fixed link to the reddit site
Reason: Fixed link to the reddit site
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: How to check folder size with NRPE (Windows folder)
@dlukinski, I zipped the script file for you. Unzip it and place it in the scripts directory.
I verified that this plugin works. Go ahead and try it and if you don't like it I'll come up with the command for the one you suggested.
This definition:
[/settings/external scripts/scripts]
Don't forget to restart the nsclinet service after you modify the nslcient.ini.
Code: Select all
C:\Program Files\NSClient++\scriptsThis definition:
Should go into the following section in nsclient.ini file:check_foldersize = cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs c:\yourfolder 50 78
[/settings/external scripts/scripts]
Don't forget to restart the nsclinet service after you modify the nslcient.ini.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How to check folder size with NRPE (Windows folder)
npolovenko wrote:@dlukinski, I zipped the script file for you. Unzip it and place it in the scripts directory.I verified that this plugin works. Go ahead and try it and if you don't like it I'll come up with the command for the one you suggested.Code: Select all
C:\Program Files\NSClient++\scripts
This definition:Should go into the following section in nsclient.ini file:check_foldersize = cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs c:\yourfolder 50 78
[/settings/external scripts/scripts]
Don't forget to restart the nsclinet service after you modify the nslcient.ini.
we are now getting this:
C:\Program Files\NSClient++\scripts\check_folder_size.vbs(31, 1) Microsoft VBScript runtime error: Permission denied
Also tried using FileSize count from here: https://support.nagios.com/kb/article/f ... s-783.html
- does not work
- either files or the folder\\* check
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: How to check folder size with NRPE (Windows folder)
@dlukinski
Right click on the script, then go to properties and in the security settings tab make sure that users have full control permissions.
I'd probably check the permissions on the whole scripts folder as well.
Let's check the permissions.C:\Program Files\NSClient++\scripts\check_folder_size.vbs(31, 1) Microsoft VBScript runtime error: Permission denied
Right click on the script, then go to properties and in the security settings tab make sure that users have full control permissions.
I'd probably check the permissions on the whole scripts folder as well.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How to check folder size with NRPE (Windows folder)
I got check_files (working) with same permissions as this script: Read & Executenpolovenko wrote:@dlukinskiLet's check the permissions.C:\Program Files\NSClient++\scripts\check_folder_size.vbs(31, 1) Microsoft VBScript runtime error: Permission denied
Right click on the script, then go to properties and in the security settings tab make sure that users have full control permissions.
I'd probably check the permissions on the whole scripts folder as well.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: How to check folder size with NRPE (Windows folder)
@dlukinski, Do you get the same kind of errors when you run the plugin locally with no arguments?
I start to think that the problem with permissions is not on the plugin's side but on the target folder's side, that you're trying to query for a size.
Please check the permissions on the target folder in a similar way you checked the script's permissions.
Looks like someone on this forum had a similar issue:
https://tutel.me/c/programming/question ... +not+found
Where C:\Users is the folder that you're monitoring.
I start to think that the problem with permissions is not on the plugin's side but on the target folder's side, that you're trying to query for a size.
Please check the permissions on the target folder in a similar way you checked the script's permissions.
Looks like someone on this forum had a similar issue:
https://tutel.me/c/programming/question ... +not+found
Code: Select all
takeown /f C:\Users /r /d y
icacls C:\Users /grant administrators:F /T As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How to check folder size with NRPE (Windows folder)
icalcs was deprecated long time ago. Administrators already have full access anyways.npolovenko wrote:@dlukinski, Do you get the same kind of errors when you run the plugin locally with no arguments?
I start to think that the problem with permissions is not on the plugin's side but on the target folder's side, that you're trying to query for a size.
Please check the permissions on the target folder in a similar way you checked the script's permissions.
Looks like someone on this forum had a similar issue:
https://tutel.me/c/programming/question ... +not+found
Where C:\Users is the folder that you're monitoring.Code: Select all
takeown /f C:\Users /r /d y icacls C:\Users /grant administrators:F /T
Still does not explains why stock VBS scripts work
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: How to check folder size with NRPE (Windows folder)
@dlukinski, I see you have opened a ticket for the same issue in our ticketing system, so I will be closing this thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.