Answer the question
In order to leave comments, you need to log in
Monitoring free disk space
Good afternoon!
There are several servers running Windows 2003. Each of them has several partitions for storing user data. It’s not very convenient to constantly go to the servers and look with your eyes. Therefore, we are looking for a software that is quite lightweight, which will monitor the free space on the disk and, upon reaching a certain threshold (which can be specified), send an e-mail to the specified address.
Thanks for the help.
Answer the question
In order to leave comments, you need to log in
I quickly threw it on PowerShell:
$MinimumSize = 10 * 1024 * 1024 * 1024
$InfoArr = Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" | Where { $_.FreeSpace -lt $MinimumSize }
ForEach ($Info in $InfoArr)
{
Write-Host "sending mail"
$mail = New-Object System.Net.Mail.MailMessage
$mail.From = New-Object System.Net.Mail.MailAddress("[email protected]")
$mail.To.Add("[email protected]")
$mail.Subject = "Недостаточно свободного места.";
$mail.Body = "На сервере server.net на диске " + $Info.DeviceID + " недостаточно свободного места. Осталось: " + "{0:N0}" -f ($Info.FreeSpace / 1024 / 1024) + "Мб"
$smtp = New-Object System.Net.Mail.SmtpClient
$smtp.host = "server.net"
$Credentials = new-object System.Net.networkCredential
$Credentials.domain = "net"
$Credentials.UserName = "[email protected]"
$Credentials.Password = "password"
$smtp.Credentials = $Credentials
$smtp.Send($mail)
}
$InfoArr = Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -computer (Get-Content servers.txt) | Where { $_.FreeSpace -lt $MinimumSize }
This is not solved by the batch file in the scheduler?
I apologize if I'm talking nonsense: I have never managed to administer Windows, but in Linux I would have done just that.
The key word is monitoring. Why not take and install some kind of monitor - starting with some kind of nagios or kakti , ending with SCOM, and have the full status of the systems, and not just single data?
www.opennet.ru/tips/info/1405.shtml
borisnote.wordpress.com/2009/02/06/test_free_disk/
the first option is for Unix systems, which is not suitable.
The second is not a cake because of Net Send instead of mail.
But thanks anyway:)
https://www.superbasis.de/ru/diskfree/
when the lower specified limit is reached, it will launch a batch file or another program and transfer (if necessary) to them the size of the remaining disk space. In the batch file, use blat to send a message to email.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question