KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Check all HD volumes for free space (variable threshold)
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
Paul_NHS



Joined: 25 Feb 2009
Posts: 59

PostPosted: Mon Aug 03, 2009 8:24 am    Post subject: Reply with quote

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
View user's profile Send private message
davephan



Joined: 19 Oct 2007
Posts: 14

PostPosted: Fri Aug 13, 2010 8:26 am    Post subject: Reply with quote

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.
  1. Select the "Shell Script" test method.
  2. Click on the "Script Manager" icon.
  3. Select "New" for a new script.
  4. Name the script appropriately.
  5. Check the "Start Command" is set to: cmd /c cscript /B /E:VBScript %Script% %Params%
  6. Copy and paste the VBS file into the script box.
  7. 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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Aug 13, 2010 1:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Paul_NHS



Joined: 25 Feb 2009
Posts: 59

PostPosted: Mon Aug 16, 2010 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Paul_NHS



Joined: 25 Feb 2009
Posts: 59

PostPosted: Tue Oct 19, 2010 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Tue Jun 05, 2012 9:02 am    Post subject: Reply with quote

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
View user's profile Send private message
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Fri Jun 22, 2012 12:45 pm    Post subject: Error: Script Returns no Results Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Jun 22, 2012 2:08 pm    Post subject: Reply with quote

Windows version?
Service Pack?
HostMonitor version?
What exactly command line do you use to start the script?

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Fri Jun 22, 2012 2:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Jun 22, 2012 4:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Fri Jun 29, 2012 7:36 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Jun 29, 2012 8:06 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Fri Jun 29, 2012 9:23 am    Post subject: Reply with quote

Looks like line 101 character 1 is the issue:

WScript.StdOut.Write HDFreeTest(sCompStatus, aThreshold)
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Jun 29, 2012 10:39 am    Post subject: Reply with quote

What command line did you use to start script from cmd shell ?
What exactly error message did you get ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chhm



Joined: 05 Jun 2012
Posts: 7

PostPosted: Fri Jun 29, 2012 10:43 am    Post subject: Reply with quote

I'm giving up on this method and am working on using WMI. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index