{"id":64,"date":"2013-03-10T16:18:33","date_gmt":"2013-03-10T16:18:33","guid":{"rendered":"https:\/\/notiz.comanet.xyz\/?p=64"},"modified":"2019-03-03T19:42:32","modified_gmt":"2019-03-03T18:42:32","slug":"dell-openmanage-omsa-setting-up-email-alerts","status":"publish","type":"post","link":"https:\/\/notiz.comanet.xyz\/?p=64","title":{"rendered":"Dell Openmanage (OMSA) &#8211; Setting up email alerts"},"content":{"rendered":"<p> \tDell Openmanage Server Administrator is a really useful tool for configuring and monitoring server hardware but it lacks built in E-Mail alerting or notifications.<\/p>\n<p> \tThe 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.<\/p>\n<p> \tThere 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.<\/p>\n<p> \tThe 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.<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tInstall the script by extracting the DellAlert.Vbs script file from this zip file:<\/p>\n<p> \t<a class=\"internal\" href=\"http:\/\/comanet.ddns.net\/notizjoomla\/files\/Phoenixtool197.zip\" title=\"DellAlert.zip\"><strong>Dell OMSA E-Mail Alerts<\/strong><\/a><\/p>\n<p> \t<strong><em><span style=\"text-decoration: underline;\">&#39;<\/span><\/em><a class=\"internal\" href=\"http:\/\/comanet.ddns.net\/notizjoomla\/files\/DellAlert_vbs.txt\" target=\"_blank\" title=\"DellAlert.vbs\" rel=\"noopener noreferrer\">DellAlert.vbs<\/a>&nbsp; &nbsp;<\/strong><a class=\"internal\" href=\"http:\/\/comanet.ddns.net\/notizjoomla\/files\/DellAlert_vbs.txt\" target=\"_blank\" title=\"DellAlert.vbs\" rel=\"noopener noreferrer\"><em><span style=\"text-decoration: underline;\">&#39;Dell OMSA E-Mail Alerts EDITED&#39;<\/span><\/em><\/a><em><span style=\"text-decoration: underline;\">&#39;<\/span><\/em><\/p>\n<p> \t&nbsp;<\/p>\n<p> \t&nbsp;<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<pre>&#39;========================================================================== &#39; NAME: Dell Openmanage E-Mail Alerts &#39; &#39; AUTHOR: Paul Murana &#39; DATE &nbsp;: 11\/03\/2010 &#39; &#39; The Script can be called with three different options: &#39; DellAlerts.vbs setup - Will automatically add alerts to OMSA &#39; DellAlerts.vbs testemail - Will send a test e-mail so you can check if mail config is correct. &#39; DellAlerts.vbs email X - Where X is a number that corresponds to a Dell alert, this is how OMSA will send its alert. &#39;==========================================================================   EmailFrom=&quot;Dell@comanet.local&quot;\t\t\t&#39;Set the from E-Mail Address  EmailTo=&quot;mis@tonton.local&quot;\t\t\t&#39;Set the E-Mail address to send alerts to SMTPServer=&quot;TONTON-AD-EXCH.tonton.local&quot;\t&#39;Specify remote SMTP server or leave blank to send through local machine SMTPPort=&quot;25&quot;\t\t\t\t\t&#39;Specify remote SMTP server port, default is 25 SMTPUser=&quot;&quot;\t\t\t\t\t&#39;Specify SMTP Username or leave blank for no authentication SMTPPass=&quot;&quot;\t\t\t\t\t&#39;Specify SMTP Password for SMTP Auth   MailSubject\t= &quot;Dell Server Alert on COMANET - &quot;  &#39;Comment out any alerts that you are not interested in   Dim AlertConfig(38) AlertConfig(0)=&quot;powersupply|Power supply failure&quot; AlertConfig(1)=&quot;powersupplywarn|Power supply warning&quot; AlertConfig(2)=&quot;tempwarn|Temperature warning&quot; AlertConfig(3)=&quot;tempfail|Temperature failure&quot; AlertConfig(4)=&quot;fanwarn|Fan speed warning&quot; AlertConfig(5)=&quot;fanfail|Fan speed failure&quot; AlertConfig(6)=&quot;voltwarn|Voltage warning&quot; AlertConfig(7)=&quot;voltfail|Voltage failure&quot; AlertConfig(8)=&quot;intrusion|Chassis intrusion&quot; AlertConfig(9)=&quot;redundegrad|Redundancy degraded&quot; AlertConfig(10)=&quot;redunlost|Redundancy lost&quot; AlertConfig(11)=&quot;memprefail|Nemory pre-failure&quot; AlertConfig(12)=&quot;memfail|Memory failure&quot; AlertConfig(13)=&quot;hardwarelogwarn|Hardware log warning&quot; AlertConfig(14)=&quot;hardwarelogfull|Hardware log full&quot; AlertConfig(15)=&quot;processorwarn|Processor warning&quot; AlertConfig(16)=&quot;processorfail|Processor failure&quot; AlertConfig(17)=&quot;watchdogasr|Watchdog asr&quot; AlertConfig(18)=&quot;batterywarn|Battery warning&quot; AlertConfig(19)=&quot;batteryfail|Battery failure&quot; AlertConfig(20)=&quot;systempowerwarn|Power warning&quot; AlertConfig(21)=&quot;systempowerfail|Power failure&quot; AlertConfig(22)=&quot;systempeakpower|Peak power&quot; AlertConfig(23)=&quot;removableflashmediapresent|Removable flash media present&quot; AlertConfig(24)=&quot;removableflashmediaremoved|Removable flash media removed&quot; AlertConfig(25)=&quot;removableflashmediafail|Removable flash media failure&quot; AlertConfig(26)=&quot;storagesyswarn|Storage System warning&quot; AlertConfig(27)=&quot;storagesysfail|Storage System failure&quot; AlertConfig(28)=&quot;storagectrlwarn|Storage Controller warning&quot; AlertConfig(29)=&quot;storagectrlfail|Storage Controller failure&quot; AlertConfig(30)=&quot;pdiskwarn|Physical Disk warning&quot; AlertConfig(31)=&quot;pdiskfail|Physical Disk failure&quot; AlertConfig(32)=&quot;vdiskwarn|Virtual Disk warning&quot; AlertConfig(33)=&quot;vdiskfail|Virtual Disk failure&quot; AlertConfig(34)=&quot;enclosurewarn|Enclosure warning&quot; AlertConfig(35)=&quot;enclosurefail|Enclosure failure&quot; AlertConfig(36)=&quot;storagectrlbatterywarn|Storage Controller Battery warning&quot; AlertConfig(37)=&quot;storagectrlbatteryfail|Storage Controller Battery failure&quot;  Args=WScript.Arguments.Count  If Args &gt; 0 Then \tAction = trim(lcase(WScript.Arguments.Item(0))) \tSelect Case Action \tCase &quot;setup&quot; \t\tFor i = 0 To ubound(AlertConfig) \t\t\tIf AlertConfig(i) &lt;&gt; &quot;&quot; then \t\t\t\tAlertDetails=Split(AlertConfig(i),&quot;|&quot;) \t\t\t\tSetDellAlert AlertDetails(0), i End If \t\tNext \tCase &quot;email&quot;  \t\tAlertDetails=Split(AlertConfig(WScript.Arguments.Item(1)), &quot;|&quot;)                 MailSubject = Mailsubject &amp; AlertDetails(1)                 SendAlert MailSubject \tCase &quot;testemail&quot; \t\tMailSubject = Mailsubject &amp; &quot;Test Alert&quot; \t\tSendAlert MailSubject \tEnd select End If  Sub SendAlert(Subject)   \t\tSet objMessage \t\t= CreateObject(&quot;CDO.Message&quot;)  \t\tobjMessage.From \t= EmailFrom \t\tobjMessage.To \t\t= EmailTo \t\tobjMessage.Subject\t= Subject  \t\tIf SMTPServer = &quot;&quot; Then SMTPServer = &quot;localhost&quot;                     objMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/sendusing&quot;) = 2   \t\tobjMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/smtpserver&quot;) = SMTPServer \t\tobjMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/smtpserverport&quot;) = SMTPPort                                  If SMTPUser &lt;&gt; &quot;&quot; Then   \t\t\tobjMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/sendusername&quot;) = SMTPUser \t\t\tobjMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/sendpassword&quot;) = SMTPPass \t\t\tobjMessage.Configuration.Fields.Item (&quot;http:\/\/schemas.microsoft.com\/cdo\/configuration\/smtpauthenticate&quot;) = 1 \t\tEnd If    \t\tobjMessage.Configuration.Fields.Update \t\tobjMessage.Send End Sub  Sub SetDellAlert(DellEvent, EventID)   \tcmd=&quot;omconfig system alertaction event=&quot; &amp; DellEvent &amp; &quot; execappath=&quot; &amp; Chr(34) &amp; WScript.FullName &amp; &quot; \\&quot; &amp; chr(34) &amp; WScript.ScriptFullName &amp; &quot;\\&quot; &amp; chr(34) &amp;  &quot; email &quot; &amp; EventID &amp; Chr(34) \tSet WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;) \tWshShell.run cmd,1,true End Sub   <\/pre>\n<p> \t&nbsp;<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tOnce 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:<\/p>\n<p> \t<img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-61\" alt=\"\" class=\"cke-resize\" src=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/DellOMSAVariables.png\" style=\"width: 477px; height: 403px;\" width=\"477\" height=\"403\" srcset=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/DellOMSAVariables.png 477w, https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/DellOMSAVariables-300x253.png 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/p>\n<p> \t&nbsp;<\/p>\n<p> \tThe 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.<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tBelow these you can to decide what events you want to be notified of, just comment out any that you aren&rsquo;t interested in, e.g:<\/p>\n<p> \t&nbsp;<\/p>\n<pre>AlertConfig(0)=&quot;powersupply|Power supply failure&quot; AlertConfig(1)=&quot;powersupplywarn|Power supply warning&quot; &#39;AlertConfig(2)=&quot;tempwarn|Temperature warning&quot; &#39;AlertConfig(3)=&quot;tempfail|Temperature failure&quot; <\/pre>\n<p> \t&nbsp;<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tI have included every alert available in OMSA 6.2 on a PE T710, some of these alerts won&rsquo;t be available on older versions or machines.<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tAfter you have configured the script, I suggest you test that the E-Mail options by running:<\/p>\n<p> \t&nbsp;<\/p>\n<pre>cscript dellalert.vbs testemail <\/pre>\n<p> \t&nbsp;<\/p>\n<p> \tYou should receive a test e-mail, if not something isn&rsquo;t working properly.<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tWhen you have successfully tested e-mail, configure OMSA to send alerts by running:<\/p>\n<p> \t&nbsp;<\/p>\n<pre>cscript dellalert.vbs setup <\/pre>\n<p> \t&nbsp;<\/p>\n<p> \tYou 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 &ldquo;omconfig&rdquo; command takes a while. This step will not work if you do not have OMSA installed.<\/p>\n<p> \tOnce this is done you should be able to see that the script has been added into OMSA:<\/p>\n<p> \t<a class=\"image\" href=\"http:\/\/tonton.homelinux.net\/notizwiki\/index.php?title=File:OMSASetting.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-62\" alt=\"OMSASetting.png\" src=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSASetting.png\" style=\"width: 645px; height: 110px;\" width=\"645\" height=\"110\" srcset=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSASetting.png 645w, https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSASetting-300x51.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/a><\/p>\n<p> \t&nbsp;<\/p>\n<p> \tNow 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&rsquo;t test. Hopefully you should get something like this in your Inbox:<\/p>\n<p> \t&nbsp;<\/p>\n<p> \t<a class=\"image\" href=\"http:\/\/tonton.homelinux.net\/notizwiki\/index.php?title=File:OMSAEMail.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-63\" alt=\"OMSAEMail.png\" class=\"cke-resize\" src=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSAEMail.png\" style=\"width: 737px; height: 92px;\" width=\"737\" height=\"92\" srcset=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSAEMail.png 737w, https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/03\/OMSAEMail-300x37.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/p>\n<p> \t&nbsp;<\/p>\n<p> \tI 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.<\/p>\n<p> \t&nbsp;<\/p>\n<p> \t&nbsp;<\/p>\n<h2> \t<span class=\"mw-headline\" id=\"If_you_are_using_Exchange_2007.E2.80.A6..\">If you are using Exchange 2007&hellip;.. <\/span><\/h2>\n<p> \t&nbsp;<\/p>\n<p> \tThis script will not work properly until you register the 32-Bit version of cdo.dll. Follow the instructions for doing this here:<\/p>\n<p> \t<a class=\"external free\" href=\"http:\/\/blogs.msdn.com\/mstehle\/archive\/2007\/12\/11\/fyi-after-installing-exchange-2007-sp1-32-bit-cdosys-might-not-be-registered.aspx\" rel=\"nofollow\">http:\/\/blogs.msdn.com\/mstehle\/archive\/2007\/12\/11\/fyi-after-installing-exchange-2007-sp1-32-bit-cdosys-might-not-be-registered.aspx<\/a><\/p>\n<div id=\"ckimgrsz\" style=\"left: 0px; top: 2993px;\">\n<div class=\"preview\"> \t\t&nbsp;<\/div>\n<\/p><\/div>\n<div id=\"ckimgrsz\" style=\"left: 0px; top: 4310px;\">\n<div class=\"preview\"> \t\t&nbsp;<\/div>\n<\/p><\/div>\n<div id=\"ckimgrsz\" style=\"left: 0px; top: 2921px;\">\n<div class=\"preview\"> \t\t&nbsp;<\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network"],"_links":{"self":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":1,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions\/460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/media\/61"}],"wp:attachment":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}