Dell Openmanage Server Administrator is a really useful tool for configuring and monitoring server hardware but it lacks built in E-Mail alerting or notifications.
The software is capable of calling external programs or scripts when a server alert is triggered so I have written a simple script that provides E-Mail alert functionality.
There are a couple of scripts out there that do similar, but I wanted something self contained and capable of using SMTP Authentication with an external relay.
The other problem with OMSA is that you need to go into each individual alert to configure the settings which can be very time consuming, I wanted a way to add them all automatically as I am going to install the script on a number of servers.
Install the script by extracting the DellAlert.Vbs script file from this zip file:
'DellAlert.vbs 'Dell OMSA E-Mail Alerts EDITED''
'========================================================================== ' NAME: Dell Openmanage E-Mail Alerts ' ' AUTHOR: Paul Murana ' DATE : 11/03/2010 ' ' The Script can be called with three different options: ' DellAlerts.vbs setup - Will automatically add alerts to OMSA ' DellAlerts.vbs testemail - Will send a test e-mail so you can check if mail config is correct. ' DellAlerts.vbs email X - Where X is a number that corresponds to a Dell alert, this is how OMSA will send its alert. '========================================================================== EmailFrom="Dell@comanet.local" 'Set the from E-Mail Address EmailTo="mis@tonton.local" 'Set the E-Mail address to send alerts to SMTPServer="TONTON-AD-EXCH.tonton.local" 'Specify remote SMTP server or leave blank to send through local machine SMTPPort="25" 'Specify remote SMTP server port, default is 25 SMTPUser="" 'Specify SMTP Username or leave blank for no authentication SMTPPass="" 'Specify SMTP Password for SMTP Auth MailSubject = "Dell Server Alert on COMANET - " 'Comment out any alerts that you are not interested in Dim AlertConfig(38) AlertConfig(0)="powersupply|Power supply failure" AlertConfig(1)="powersupplywarn|Power supply warning" AlertConfig(2)="tempwarn|Temperature warning" AlertConfig(3)="tempfail|Temperature failure" AlertConfig(4)="fanwarn|Fan speed warning" AlertConfig(5)="fanfail|Fan speed failure" AlertConfig(6)="voltwarn|Voltage warning" AlertConfig(7)="voltfail|Voltage failure" AlertConfig(8)="intrusion|Chassis intrusion" AlertConfig(9)="redundegrad|Redundancy degraded" AlertConfig(10)="redunlost|Redundancy lost" AlertConfig(11)="memprefail|Nemory pre-failure" AlertConfig(12)="memfail|Memory failure" AlertConfig(13)="hardwarelogwarn|Hardware log warning" AlertConfig(14)="hardwarelogfull|Hardware log full" AlertConfig(15)="processorwarn|Processor warning" AlertConfig(16)="processorfail|Processor failure" AlertConfig(17)="watchdogasr|Watchdog asr" AlertConfig(18)="batterywarn|Battery warning" AlertConfig(19)="batteryfail|Battery failure" AlertConfig(20)="systempowerwarn|Power warning" AlertConfig(21)="systempowerfail|Power failure" AlertConfig(22)="systempeakpower|Peak power" AlertConfig(23)="removableflashmediapresent|Removable flash media present" AlertConfig(24)="removableflashmediaremoved|Removable flash media removed" AlertConfig(25)="removableflashmediafail|Removable flash media failure" AlertConfig(26)="storagesyswarn|Storage System warning" AlertConfig(27)="storagesysfail|Storage System failure" AlertConfig(28)="storagectrlwarn|Storage Controller warning" AlertConfig(29)="storagectrlfail|Storage Controller failure" AlertConfig(30)="pdiskwarn|Physical Disk warning" AlertConfig(31)="pdiskfail|Physical Disk failure" AlertConfig(32)="vdiskwarn|Virtual Disk warning" AlertConfig(33)="vdiskfail|Virtual Disk failure" AlertConfig(34)="enclosurewarn|Enclosure warning" AlertConfig(35)="enclosurefail|Enclosure failure" AlertConfig(36)="storagectrlbatterywarn|Storage Controller Battery warning" AlertConfig(37)="storagectrlbatteryfail|Storage Controller Battery failure" Args=WScript.Arguments.Count If Args > 0 Then Action = trim(lcase(WScript.Arguments.Item(0))) Select Case Action Case "setup" For i = 0 To ubound(AlertConfig) If AlertConfig(i) <> "" then AlertDetails=Split(AlertConfig(i),"|") SetDellAlert AlertDetails(0), i End If Next Case "email" AlertDetails=Split(AlertConfig(WScript.Arguments.Item(1)), "|") MailSubject = Mailsubject & AlertDetails(1) SendAlert MailSubject Case "testemail" MailSubject = Mailsubject & "Test Alert" SendAlert MailSubject End select End If Sub SendAlert(Subject) Set objMessage = CreateObject("CDO.Message") objMessage.From = EmailFrom objMessage.To = EmailTo objMessage.Subject = Subject If SMTPServer = "" Then SMTPServer = "localhost" objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort If SMTPUser <> "" Then objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPUser objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPass objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 End If objMessage.Configuration.Fields.Update objMessage.Send End Sub Sub SetDellAlert(DellEvent, EventID) cmd="omconfig system alertaction event=" & DellEvent & " execappath=" & Chr(34) & WScript.FullName & " \" & chr(34) & WScript.ScriptFullName & "\" & chr(34) & " email " & EventID & Chr(34) Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.run cmd,1,true End Sub
Once you have extracted the zip file you will need to edit the variables at the top of the script to make them appropriate for your environment:
The variables at the top define the e-mail settings and are hopefully self explanatory. If a remote SMTP server is not specified the local machine will be used to send the E-Mail.
Below these you can to decide what events you want to be notified of, just comment out any that you aren’t interested in, e.g:
AlertConfig(0)="powersupply|Power supply failure" AlertConfig(1)="powersupplywarn|Power supply warning" 'AlertConfig(2)="tempwarn|Temperature warning" 'AlertConfig(3)="tempfail|Temperature failure"
I have included every alert available in OMSA 6.2 on a PE T710, some of these alerts won’t be available on older versions or machines.
After you have configured the script, I suggest you test that the E-Mail options by running:
cscript dellalert.vbs testemail
You should receive a test e-mail, if not something isn’t working properly.
When you have successfully tested e-mail, configure OMSA to send alerts by running:
cscript dellalert.vbs setup
You will then see the script go through and setup all the appropriate alerts as per your settings. This process can take a couple of minutes as the “omconfig” command takes a while. This step will not work if you do not have OMSA installed.
Once this is done you should be able to see that the script has been added into OMSA:
Now you need to generate some real alerts to test the script properly. How you do this will depend on the capabilities of your server, I was able to disconnect the redundant power supply and have an alert generated almost immediately. I think opening the case will also generate an event, but I am not sure as I didn’t test. Hopefully you should get something like this in your Inbox:
I have installed this on a few servers and it seems to be working well. I will update the script with any tweaks that I add as I roll it out further. Hope this is useful to someone else.
If you are using Exchange 2007…..
This script will not work properly until you register the 32-Bit version of cdo.dll. Follow the instructions for doing this here: