Client Management Suite

 View Only
  • 1.  notification

    Posted Mar 15, 2013 12:35 AM

    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?



  • 2.  RE: notification
    Best Answer

    Posted Mar 16, 2013 02:29 AM

    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  



  • 3.  RE: notification

    Posted Mar 16, 2013 07:50 AM


  • 4.  RE: notification

    Posted Apr 15, 2013 09:48 AM

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



  • 5.  RE: notification

    Posted Apr 22, 2013 03:24 AM

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



  • 6.  RE: notification

    Posted May 02, 2013 01:52 PM

    Nice Script.