Check all HD volumes for free space (variable threshold)
I don't follow how to implement the test on the last step. Could you tell me more specifically how I would implement the free diskspace percentage? I would like to setup a 10% threshold for the C, D, E, R, and S drives.Paul_NHS wrote:GreyHat64, I liked your script so much I thought we should have a more flexible version.
I have added the ability to supply drive specific sizes on the command line.
Usage: CSCRIPT HDFree.VBS {computer_name} {[drive:]threshold [[drive:]threshold] [.....]}
e.g. CSCRIPT HDFree.VBS Mycomp C:2 D:20%% 10%%
The final free space parameter sets the default for unspecified drives.
p.s. It is worth mentioning the mechanism for running this script.Now you can select the script from the HostMonitor dropdown and specify the parameters.
- Select the "Shell Script" test method.
- Click on the "Script Manager" icon.
- Select "New" for a new script.
- Name the script appropriately.
- Check the "Start Command" is set to: cmd /c cscript /B /E:VBScript %Script% %Params%
- Copy and paste the VBS file into the script box.
- Add a hint, e.g. {computer_name} {[drive:]threshold [[drive:]threshold] [.....]}
Note: You also don't require 2 percent signs in the parameters, one works nicely. e.g. Mycomp C:5% D:10% 20%
If you use this "Shell Script" method and you run a lot of these tests, check the potential problem discussed in the post where the code is shown below.
cheers, Paul
Code: Select all
Please see lower down on this page for the latest code.
Dave
It depends on what drives you have and which ones you want to check.
If you only have drives C, D, E, R, and S, then you only need to specify the threshold once.
computername 10%
if you have other drives that you don't want to check you can just specify individual drives as Alex has mentioned.
If you have other drives and want to set a different threshold for only C: & D: you can specify those drives and then a global threshold.
computername C:10% D:15% 20%
Note: you can either specify a number which tests for a specific size in GB, or a % of disk space. There is no requirement to use double % signs.
cheers, Paul
If you only have drives C, D, E, R, and S, then you only need to specify the threshold once.
computername 10%
if you have other drives that you don't want to check you can just specify individual drives as Alex has mentioned.
If you have other drives and want to set a different threshold for only C: & D: you can specify those drives and then a global threshold.
computername C:10% D:15% 20%
Note: you can either specify a number which tests for a specific size in GB, or a % of disk space. There is no requirement to use double % signs.
cheers, Paul
Latest version, hot off the presses.
We have a new Exchange box and it uses Mount Points for the database disks. This requires the use of Win32_Volume, but this is not supported in XP. The test for compatability (line 183) is ugly so all suggestions welcome on a nice way to do this.
Unfortunately I have not added the ability to specify a specific threshold for mount points, or a test for specific MPs, but you can probably work around that by specifying a threshold for the real disks and use a default for the MPs.
Return values for MPs include colons and trailing slashes so I've replaced ":\" with "-" and added a trailing colon to satisfy HostMonitor.
cheers, Paul
We have a new Exchange box and it uses Mount Points for the database disks. This requires the use of Win32_Volume, but this is not supported in XP. The test for compatability (line 183) is ugly so all suggestions welcome on a nice way to do this.
Unfortunately I have not added the ability to specify a specific threshold for mount points, or a test for specific MPs, but you can probably work around that by specifying a threshold for the real disks and use a default for the MPs.
Return values for MPs include colons and trailing slashes so I've replaced ":\" with "-" and added a trailing colon to satisfy HostMonitor.
cheers, Paul
I would LOVE this to be added to host monitor. We are starting to use mount points and need to monitor the volume name a certain servers. Hope I can figure out how to do this until thenjivetolkein wrote: Anyway, my main point of posting is - who thinks this should now move to a feature request? Move Paul/greyhats work into an official HM test? I like scripts, but I think this is core requirement for most Windows shops, that perhaps people are missing if they don't follow the forums, and maybe discounting the product without investigating thoroughly enough.
Error: Script Returns no Results
Hi -
I set up this scrtip in HM using Shell Script. If I plug in the Params under the "Lets try" tab it runs and returns a Status and Reply (e.g - Status: Ok
- Reply: C:46%(7.79) ) Though when the Params are set in "Test properties" and test is ran I receive the following:
Status: Unknown
Reply: Error: Script Returns no Results
Thoughts?
Thanks!
I set up this scrtip in HM using Shell Script. If I plug in the Params under the "Lets try" tab it runs and returns a Status and Reply (e.g - Status: Ok
- Reply: C:46%(7.79) ) Though when the Params are set in "Test properties" and test is ran I receive the following:
Status: Unknown
Reply: Error: Script Returns no Results
Thoughts?
Thanks!
I'm not sure I understand what you mean "cscript will display error message... ". Should I be using Shell script for a test method? Excuse my ignorance, I'm not much of a scripting person.KS-Soft wrote:We can start it just fine on Windows 2003 SP2.
Try to save script into .VBS file and start it without /B switch, cscript will display error message...
Note: start script on HostMonitor system
(in case you are managing HostMonitor remotely using RCC)
Regards
Alex
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: