View previous topic :: View next topic |
Author |
Message |
Paul_NHS
Joined: 25 Feb 2009 Posts: 59
|
Posted: Mon Aug 03, 2009 8:24 am Post subject: |
|
|
Yes, it would be good if it was a core disk test - it's one of the first tests I added.
I really like the ability to add additional tests and get a bit of user driven development. I also like the way the KS boys take notice and fix things.
cheers, Paul |
|
Back to top |
|
|
davephan
Joined: 19 Oct 2007 Posts: 14
|
Posted: Fri Aug 13, 2010 8:26 am Post subject: |
|
|
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.- 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] [.....]}
Now you can select the script from the HostMonitor dropdown and specify the parameters.
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: | Please see lower down on this page for the latest code. |
|
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.
Dave |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12815 Location: USA
|
Posted: Fri Aug 13, 2010 1:58 pm Post subject: |
|
|
As I understand you should specify the following parameters
computername C:.1 D:.1 E:.1 R:.1 S:.1
Regards
Alex |
|
Back to top |
|
|
Paul_NHS
Joined: 25 Feb 2009 Posts: 59
|
Posted: Mon Aug 16, 2010 2:19 am Post subject: |
|
|
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 |
|
Back to top |
|
|
Paul_NHS
Joined: 25 Feb 2009 Posts: 59
|
Posted: Tue Oct 19, 2010 4:55 am Post subject: |
|
|
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 |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Tue Jun 05, 2012 9:02 am Post subject: |
|
|
jivetolkein 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.
|
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 then |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Fri Jun 22, 2012 12:45 pm Post subject: 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! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12815 Location: USA
|
Posted: Fri Jun 22, 2012 2:08 pm Post subject: |
|
|
Windows version?
Service Pack?
HostMonitor version?
What exactly command line do you use to start the script?
Regards
Alex |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Fri Jun 22, 2012 2:17 pm Post subject: |
|
|
KS-Soft wrote: | Windows version?
Service Pack?
HostMonitor version?
What exactly command line do you use to start the script? |
Windows Server 2003
SP 2
HM v 9.18
cmd /c cscript /B /E:VBScript %Script% %Params% |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12815 Location: USA
|
Posted: Fri Jun 22, 2012 4:06 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Fri Jun 29, 2012 7:36 am Post subject: |
|
|
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 |
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. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12815 Location: USA
|
Posted: Fri Jun 29, 2012 8:06 am Post subject: |
|
|
Yes, you should use Shell Script test for the test.
But you said it does not work on your system. And you do not know the reason why it does not work. This means you should debug the problem, e.g. you may start script using command line without /B switch
Regards
Alex |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Fri Jun 29, 2012 9:23 am Post subject: |
|
|
Looks like line 101 character 1 is the issue:
WScript.StdOut.Write HDFreeTest(sCompStatus, aThreshold) |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Fri Jun 29, 2012 10:39 am Post subject: |
|
|
What command line did you use to start script from cmd shell ?
What exactly error message did you get ? |
|
Back to top |
|
|
chhm
Joined: 05 Jun 2012 Posts: 7
|
Posted: Fri Jun 29, 2012 10:43 am Post subject: |
|
|
I'm giving up on this method and am working on using WMI. Thanks for the help. |
|
Back to top |
|
|
|