Need a script to monitor servers disk free space remotely
Hello
I need a script or utility (free) to monitor the disk space into my network. Can you
please provide me a script which can fulfill my requirements:
I want to run this script remotely from one server to monitor the disk space on
all other servers into the network.
I'll put this into Schedule task and i want to get output into the text file
(just total space on server disks and available free space, if possible then show in
percentage also)
Please provide me a script which pick the name of the server one by one from a text file
then store the information of all the servers into the another text file.
Please let me know your concerns.
Thanks in advance
Waiting for positive reply soon
# 1 Re: Need a script to monitor servers disk free space remotely
Well, so long as you are using drive letters, you can easily do this with VBScript. Here is a little script I whipped up. It should help you out.
Dim total, free, freegb, percentfree, percentused, drive
' drive letter of which to check the space on
drive = "C"
Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='" & drive & ":'")
total = objLogicalDisk.Size
free = objLogicalDisk.FreeSpace
freegb = round(free / (1024 ^ 3), 2) & "GB"
percentfree = round((free / total) * 100, 1) & "%"
percentused = round(((total - free) / total) * 100, 1) & "%"
theOutput = "Free: " & freegb & vbCr & vbLf & "Percent Free: " & percentfree & vbCr & vbLf & "Percent Used: " & percentused
Const ForAppending = 8
Dim objFSO, theFile
' This is the log file
theFile = "C:\path\to\log\file.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLog = objFSO.OpenTextFile(theFile, ForAppending, True)
objLog.WriteLine(theOutput)
objLog.Close
WScript.Quit
# 2 Re: Need a script to monitor servers disk free space remotely
thanks for sending me the script ...
but can you do two modifications into your script like ...
can we monitor the space on all the drives of the server
can run the script remotely on many servers and output of disk space of all the server along with server name goes to same file
# 3 Re: Need a script to monitor servers disk free space remotely
The idea behind dev-archive is to help other people solve their problems, mostly related to programming. It is not to do all the work for the people. I personally do not have time to write code for every person that comes here, nor do I know your network setup. So, I cannot do as you ask for those two reasons.
Take what I have given you, and do some more research and learn. Maybe someone else will do all the work for you, but I simply don't have the time.
Good luck with the modifications and research. :thumb:
# 4 Re: Need a script to monitor servers disk free space remotely
Sure .. I'll try to find the solution of this problem
Thanks !@!
# 5 Re: Need a script to monitor servers disk free space remotely
This should help you get started. Using WMI, you can do this all remotely or locally on each machine:
http://www.microsoft.com/technet/scriptcenter/scripts/storage/disks/monitor/stmovb01.mspx
# 6 Re: Need a script to monitor servers disk free space remotely
thanks for sending me the script ...
but can you do two modifications into your script like ...
can we monitor the space on all the drives of the server
can run the script remotely on many servers and output of disk space of all the server along with server name goes to same file
Thanks and regards
http://www.egbsystems.com