Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

notification

Created: 14 Mar 2013 • Updated: 02 May 2013 | 5 comments
This issue has been solved. See solution.

Hi

I am using Altiris 7.1, I am getting the manually report on daily for low disk space.

Is their any solution to get the notification email for low disk space system?

Comments 5 CommentsJump to latest comment

Sachin Sawant's picture

Hi

Please check this script .VBS

Const Unknown = 0

Const Removable = 1

Const Fixed = 2

Const Remote = 3

Const CDROM = 4

Const RAMDisk = 5

' general constants – NEED TO BE MODIFIED FOR YOUR ENVIRONMENT

Const MailServer = "hbdakcsmtp1.hbctxdom.com" ' Mail Server to use (SMTP)

Const MailServerPort = "25" ' SMTP Port used at Mail server (25 is default)

Const LOCAL_HARD_DISK = 3

' Send a mail message

Sub SendMail(Sender, Recipient, Subject ,  Message)

Set objMessage = CreateObject("CDO.Message")

objMessage.Subject = Subject

objMessage.From = Sender

objMessage.To = Recipient

'objMessage.Cc = cc

objMessage.TextBody = Message

objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server

objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailServer

'Server port (typically 25)

objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = MailServerPort

objMessage.Configuration.Fields.Update

objMessage.Send

End Sub

' get current computer name (from system environment variables)

Function GetCurrentComputerName

set oWsh = WScript.CreateObject("WScript.Shell")

set oWshSysEnv = oWsh.Environment("PROCESS")

GetCurrentComputerName = oWshSysEnv("COMPUTERNAME")

End Function

'==================================================================

' Begin main code

'==================================================================

str = ""

'Only enumerate physical disks (Not Network Drives)

Const HARD_DISK = 3

'====================================================================

' Server Server1

'===================================================================

strComputer = "10.225.6.119"

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")

str = str & "Server: " & strComputer & vbcrlf

For Each objDisk in colDisks

str = str & "Disk: "& objDisk.DeviceID & vbTab

str = str & " Free Disk Space: "& FormatNumber(CLng(objDisk.FreeSpace / 1024 / 1024),0,,,-1) & " MB" & vbcrlf

Next

str = str & vbcrlf

str = str & vbcrlf & vbcrlf & "Disk Space script by Nagesh Singh"

SendMail "A.Support@Test.com","A.Support@test.com","name of server " & strComputerName & ": Drive Space Report",str  

SOLUTION
rs_cert's picture

Have you tested this script, because i will be run it in production?

Sachin Sawant's picture

Yes, I have used this script in my production but make show change the mail server name.