Dell Open Manage Server Administrator (OMSA) alert setup – updated

Further to this post on how to set up Dell Open Manage Server Administrator (OMSA) for alerts I have amended the configuration files required to correctly configure OMSA.
I discovered that Dell’s documentation is incorrect and that running a batch file in an alert directly does not work – you need to call it with cmd.exe BUT you do not (normally) need to provide the path to cmd.exe – I have therefore changed the alert commands (shown in the extended entry).
I have also amended the dellalert.bat file as I also found that blat would not always work as there is no working blat profile when called from OMSA and there is no obvious way of setting a profile up. You could add the setup into dellalert.bat, trigger an alert and then remove the setup. Alternatively blat can have the mail server and the sender name provided in the dellalert.bat. This makes installation easier as all you need to do is copy the blat files to the windows directory. Again the updated dellalert.bat is in the extended entry.


Dellalert.bat should now contain the following lines.

@echo off
::Dell alert program
::v1.21a
::Set variables below as appropriate
::needs blat downloaded (http://tinyurl.com/2qdxea) Put blat.exe in the system path
::No longer needs blat installed as configuration is set in the environment variables.

@echo on
setlocal
set log=c:\jobs\dell.txt
set [email protected]
set [email protected]
set company=Companyname
set server=%computername%
set mailserver=mailservername
set [email protected]

date /t >%log%
time /t >>%log%
echo %* >>%log%
if {%1}=={p} blat %log% -to %pager% -server %mailserver% -f %alertfrom% -subject “%company% %server% alert – %*”
if not {%1}=={} blat %log% -to %mail% -server %mailserver% -f %alertfrom% -subject “%company% %server% alert – %*”
endlocal

The commands to specify the call to dellalert.bat are below. Note that you need to specify cmd.exe and then the batch file. As the batch file has parameters with quotes, the quotes need to escaped with backslashes (as per the information below). I highly recommend you save these commands to a batch file called conf.bat and then run the batch file – a lot easier to manage, recall and implement on multiple servers. Each line starts with omconfig – you will probably find your web browser has wrapped the lines, but if you copy/paste the content into notepad your lines should be correct.

omconfig system alertaction event=batterywarn execappath=”cmd /c \”c:\jobs\dellalert p battery probe warning\””
omconfig system alertaction event=batteryfail execappath=”cmd /c \”c:\jobs\dellalert p battery probe failure\””
omconfig system alertaction event=fanwarn execappath=”cmd /c \”c:\jobs\dellalert fan probe warning\””
omconfig system alertaction event=fanfail execappath=”cmd /c \”c:\jobs\dellalert p fan probe failure\””
omconfig system alertaction event=hardwarelogwarn execappath=”cmd /c \”c:\jobs\dellalert hardware log warning\””
omconfig system alertaction event=hardwarelogfull execappath=”cmd /c \”c:\jobs\dellalert p hardware log failure\””
omconfig system alertaction event=intrusion execappath=”cmd /c \”c:\jobs\dellalert chassis intrusion detected\””
omconfig system alertaction event=memprefail execappath=”cmd /c \”c:\jobs\dellalert p memory prefailure\””
omconfig system alertaction event=memfail execappath=”cmd /c \”c:\jobs\dellalert p memory failure\””
omconfig system alertaction event=systempowerwarn execappath=”cmd /c \”c:\jobs\dellalert p system power warning\””
omconfig system alertaction event=systempowerfail execappath=”cmd /c \”c:\jobs\dellalert p system power warning\””
omconfig system alertaction event=powersupply execappath=”cmd /c \”c:\jobs\dellalert p psu critical\””
omconfig system alertaction event=powersupplywarn execappath=”cmd /c \”c:\jobs\dellalert p psu warning\””
omconfig system alertaction event=processorwarn execappath=”cmd /c \”c:\jobs\dellalert p processor warning\””
omconfig system alertaction event=processorfail execappath=”cmd /c \”c:\jobs\dellalert p processor failure\””
omconfig system alertaction event=redundegrad execappath=”cmd /c \”c:\jobs\dellalert p redundancy degraded\””
omconfig system alertaction event=redunlost execappath=”cmd /c \”c:\jobs\dellalert p redundancy lost\””
omconfig system alertaction event=tempwarn execappath=”cmd /c \”c:\jobs\dellalert p temp probe warning\””
omconfig system alertaction event=tempfail execappath=”cmd /c \”c:\jobs\dellalert p temp probe failure\””
omconfig system alertaction event=voltwarn execappath=”cmd /c \”c:\jobs\dellalert voltage probe warning\””
omconfig system alertaction event=voltfail execappath=”cmd /c \”c:\jobs\dellalert p voltage probe failure\””
omconfig system alertaction event=watchdogasr execappath=”cmd /c \”c:\jobs\dellalert Watchdog ASR\””
omconfig system alertaction event=storagesyswarn execappath=”cmd /c \”c:\jobs\dellalert p storage system warning\””
omconfig system alertaction event=storagesysfail execappath=”cmd /c \”c:\jobs\dellalert p storage system failure\””
omconfig system alertaction event=storagectrlwarn execappath=”cmd /c \”c:\jobs\dellalert p storage controller warning\””
omconfig system alertaction event=storagectrlfail execappath=”cmd /c \”c:\jobs\dellalert p storage controller failure\””
omconfig system alertaction event=pdiskwarn execappath=”cmd /c \”c:\jobs\dellalert p physical disk warning\””
omconfig system alertaction event=pdiskfail execappath=”cmd /c \”c:\jobs\dellalert p physical disk failure\””
omconfig system alertaction event=vdiskwarn execappath=”cmd /c \”c:\jobs\dellalert p virtual disk warning\””
omconfig system alertaction event=vdiskfail execappath=”cmd /c \”c:\jobs\dellalert p virtual disk failure\””
omconfig system alertaction event=enclosurewarn execappath=”cmd /c \”c:\jobs\dellalert p enclosure warning\””
omconfig system alertaction event=enclosurefail execappath=”cmd /c \”c:\jobs\dellalert p enclosure failure\””
omconfig system alertaction event=currentwarn execappath=”cmd /c \”c:\jobs\dellalert p current probe warning\””
omconfig system alertaction event=currentfail execappath=”cmd /c \”c:\jobs\dellalert p current probe failure\””
omconfig system alertaction event=storagectrlbatterywarn execappath=”cmd /c \”c:\jobs\dellalert storage controller battery warning\””
omconfig system alertaction event=storagectrlbatteryfail execappath=”cmd /c \”c:\jobs\dellalert p storage controller battery failure\””

So now the implementation steps are as follows.

  • Install OMSA on the server
  • Download blat, copy dellalert.bat and conf.bat from above.
  • Edit dellalert.bat to have your specific information. The variables are pretty obvious
  • Extract blat to your windows directory
  • Double click conf.bat to configure OMSA
  • Run Server administrator to check the settings have been implemented correctly (see previous post for examples)
  • Test – normally a safe way to do this is to unplug one of the redundant power supplies. I would recommend you also set up the alerts to display a popup for this event so you know the alert has been triggered. Then unplug the power. Wait about 20-30 seconds for the alert to popup on screen and then wait for your email/pager to activate.

Any updates will be posted to this blog and to the OMSA category – so check there if this page is old.

Update – I’ve now made the OMSA Batch Files available for download
Update 2010.08.07 – Batch files updated with corrections to dellalert.bat and additions to conf.bat. The dellalert.bat in the body of this post was correct – the version available to download was not. Thanks to Martin Wiesner for the information.

Comments

  1. SS

    Thanks for this… I’ve been looking for exactly this solution. I really appreciate your helpful post. Next time you’re in Seattle, I owe you a beer.

  2. Craig

    Hi

    Thanks for this! So helpful. But the only things is, the quotation marks were wrong when I copied it off the page – maybe character set is different (I’m in Australia) so maybe worth providing as a download? Otherwise it’s a find and replace for both forward and reverse quotes in notepad.

    Thanks again for allowing me not to do a LOT of tedious OMSA work!

  3. Andy

    I have been thinking about doing this and was actually on my list of things to do once I’d moved to WordPress. It’ll be online shortly I hope.

  4. Post
    Author
  5. PK

    Much appreciated! This saved me a lot of time, and worked like a charm (and reminded me once again how handy Blat is). Thanks!

  6. Stuart Cowen

    Andy – GREAT POST!! I’m running OSMA 6.10 on a Windows 2008 server and am having trouble getting Blat to send mail out. Is there anything special I need to be doing or looking for to find out why this is?

  7. Stuart Cowen

    Andy – NEVER MIND… 😉 I just realized that I forgot to replace the non-standard double-quotes in the ‘dellalert.bat’ file with standard ones. All works good now. You ROCK!

  8. Dustin Clark

    This isn’t working for me for some reason. OSMA is configured properly, and it works when I go to Start > Run and execute the same command form the OSMA alert config. However, when I manually trigger the alert (by changing a temperature warning threshold), the alert is not sent. I can see that log.txt is updated, and when I pipe the results into a separate log file, no errors are printed. Could this be some kind of permissions issue with blat? Any other ideas? Thanks.

  9. Post
    Author
    Andy

    Hey Dustin – thanks for posting. First I’d try dropping to a dos prompt, then running “c:\jobs\dellalert test message” and see if the email is sent. If it is, then it’s likely to be a path issue – is blat.exe saved in your c:\jobs directory?
    Next thing to do is troubleshoot your blat command line – you will see what it should be doing from running dellalert by hand, so you should then be able to see what it is expecting. Also you can add a -debug to the blat command to get more details about what is going on. Hope this helps.

  10. Dustin Clark

    Hi Andy. Thanks for the quick response. Executing dellalert.bat manually works perfectly fine when I run it from a command line. In fact, so does this (when executed from Start > Run):

    cmd /c “c:\jobs\dellalert temp probe warning”

    This is the same exact configuration in the alert itself…so it’s really weird.

    blat.exe is in my System32 directory. I tried fully qualifying its path in the bat file, but that didn’t help. Neither did moving blat.exe to the same directory as my bat file. Adding “-debug” did show me additional details when I execute it manually, but blat doesn’t print anything out when it is triggered by the alert. In fact, that’s the case regardless of whether or not debug is turned on.

    However, I know that the bat file is executing, because log.txt is updated when the alert fires. Any other ideas? Thanks.

  11. Post
    Author
    Andy

    I heard back from Justin after suggesting he changed the command line for the blat interface to end with 1>c:\jobs\log.txt 2>c:\jobs\log.err.txt

    Justin replied back –

    “Wow…the simple “2>blat.error” was all I needed. Here’s what I got:

    ‘C:\Windows\system32\blat.exe’ is not recognized as an internal or external command,operable program or batch file.
    Note that it’s fully qualified, but it didn’t work. So I moved it to the jobs directory…still no dice. Then, I fully qualified the path to blat in my bat file (c:\jobs\blat.exe) and it worked! Finally!
    By the way, I’m running Windows Server 2008 Web…not sure if that had anything to do with all of these issues.”

    I’m not sure if it was the web interface – perhaps the path wasn’t being set on the server correctly.

  12. Bill

    When copying to my server, I came into all sorts of errors in the way that the web page copied the quotations (Backwards instead of forwards). Simply copying the script and then replacing the backwards quotations with standard quotations fixed it and everything works perfect. Not that you had backwards quotes, just that sometimes they don’t translate always exactly. Thanks for the great script!

  13. Allan Warner

    Hi,

    I am glad I found this blog it helped me get my system up and running.

    In setting it up I wanted to share some info on the ability to run multiple commands a single command line. I won’t go into why I needed to do this but just show how I got this into the alert action in OMSA.

    Normally you can run multiple commands from a single command line by separating them by ampersands (&), however I struggled to get the batch file (to setup OMSA) to accept this. In the end I found you had to escape the ampersand with a ^.

    In the example below I change drive (F:), then change directory (CD) and then call the batch file to run passing it 2 parameters (param1, param2).

    omconfig system alertaction event=batterywarn execappath=”cmd /c \”F: ^& CD F:\folder1^& F:\folder1\alertfile.bat param1 param2\””

    Hope this helps someone. Excellent blog.

  14. Post
    Author
    Andy

    Thanks Allan- the old ^ needs to be used where several control characters can be used. Why don’t you just put the full path to the batch file in the sequence and then change directory as part of your script? You could use pushd to make the change easier (as you can then popd back to your original location if required. Pushd will also change drive letters for you at the same time. For example pushd f:\temp

  15. Eric

    I’m running on a Windows 2008 server and am having trouble getting Blat to send mail out.

    runing command prompt: cmd /c “c:\jobs\dellalert temp probe warning” – aler is sent.
    unplug one of the redundant power supplies – alert is Not sent.

    how to replace the non-standard double-quotes in the ‘dellalert.bat’ file with standard ones? how to fully qualified the path to blat in my bat file (c:\jobs\blat.exe)?

    Is there anything special I need to be doing for Windows 2008 server? Can anyone help?

  16. Post
    Author
    Andy

    Eric – you need to put blat.exe into your windows directory as per the instructions – that way it will be in the path to use in this script and any others that you may. If you don’t want to put it into the windows directory then you will need to specify the path by changing any references from blat to c:\jobs\blat.exe
    Just replace the quotes by editing the file in notepad….
    There is no difference between running this on Windows 2008 or Windows 2003.

  17. Matt

    Nice Post! Been wanting to do something like this for a while now. Looks like everything got enabled in OMSA 6.2.0 with the quotation marks fixed. Damn blog formatting 😛

  18. Damian

    thank you for this interesting post!! very helpful to my environment…
    one question though, how can i add another e-mail address in the dellalert.bat file?
    i’m really not good at batch files, tried a few entries but it did not work when i ran the test…
    help?

  19. Post
    Author
    Andy

    As long as the email recipient is on the same mail server (or you can relay email) then append the email address’s with commas – ie change the email address line from
    set [email protected]
    to
    set [email protected],[email protected]

    If they are on different domains then you need
    a) a mail server that will allow you to relay (ie your local exchange/smtp server), or
    b)a server that accepts mail for both domains (ie postini’s outbound mail servers will accept mails for any of the address’s that postini host) or
    c) you would need to add another variable (mail2) and another blat line.

    Hopefully though the next recipient is on the same server.
    Andy

  20. Shek

    Excellent article!
    Note that in my case, everything worked as it should, only after I ordered everywhere absolute paths to files.
    Example:
    Execute application C:\Windows\System32\cmd.exe /c C:\jobs\jobs.cmd Watchdog ASR (as is, without quotes)
    In jobs.cmd you also need to specify the full path to blat.exe

  21. Post
    Author
    Andy

    Thanks for the feedback Shek. However I’m interested as to why it doesn’t work for you without the full paths. It does make me wonder if the path statement on your server is changed. Interestingly I used to have a server that logged on as administrator would not run commands from the windows or system32 directory but logged on as another administrative user would. The paths were the same though!

  22. Brady

    I have everything setup as the instructions should im running Windows 20028 64bit edition. This server is part of a domain. I can run a tes fromt eh command prompt but when i test by unplugging one of the redundant hard drives i get no email please help.

  23. Post
    Author
    Andy

    My first suggestion would be to check the c:\jobs\log.txt – that will show the output of the job file.
    If an email does not arrive then it could be blat is not in the path – if you run blat from a new dos prompt, does it run? Can you run the full blat command from the command line manually?
    On a 2008 server, you may need to allow system or network service to write to the c:\jobs folder? (I’ve not had to make this change, but you might need it.)

  24. sbp

    Just thought I would add I had the same issue as Justin (I’m running Server 2008 Ent R2 Core install). Everything ran fine from the command line but emails would not go out when unplugging 2nd power supply. I moved blat from system32 to c:\jobs and updated the path in the batch file and presto! problem solved

  25. Post
    Author
    Andy

    I’m not sure on the error – but try right clicking blat.exe and making sure it’s unblocked (not sure how you do this in a core install though!)

  26. blmuzzy

    I used a .bat file similar to this one and tested it by pulling the AC cable to one of the power supplies. I received 40 “redundancy lost” and 1 “power supply failure” emails in about 75 seconds. I haven’t found mention of how to adjust the frequency with which DOMSA spits out alerts. Any ideas?

    PS. I note that in your list above, you have system power fail sending a “warning” alert:

    “omconfig system alertaction event=systempowerwarn execappath=”cmd /c \”c:\jobs\dellalert p system power warning\””
    omconfig system alertaction event=systempowerfail execappath=”cmd /c \”c:\jobs\dellalert p system power warning\”””

  27. Post
    Author
    Andy

    Hi B and thanks for commenting. Funnily enough we had the same problem right at the start of the superbowl – I guess everyone plugging in their tv’s made a power surge 😉
    Currently I have some ideas on how to rate limit the batch file but it would be a little clunky. I’m not sure if the OMSA system can be throttled to only send alerts out once a minute or something. Keep an eye on this page and I’ll let you know my plans. Will be a couple of days at least before I get some downtime to work on the problem – in the meantime, if you have any breakthroughs then please let us know.
    Andy

  28. blmuzzy

    I spoke to Dell tech support about this. They were very clear that there is no way to manage the frequency of alerts within DOMSA and the only way to do that is to use ITA. So if the possibility of receiving the occasional non-stop barrage of email alerts is acceptable, use the “blat” method here. I note that some email clients can group email by thread so at least you can easily bulk delete them.

  29. elsavador

    Andy, thanks for the post! This will be great if i could pull it off however having some issues at them moment.

    I’ve downloaded and amended the scripts as you suggested and am getting the log file to update when removing the redundant power supply which is great however I’m not getting email notifications. I’ve set the servername, email address’ etc but think I there are a few parameters I’m missing or are incomplete.

    Is it possible you could highlight the parameters which need to be changed?

    Also i noticed that there are two different versions of Dellalert.bat scripts you have posted. Please can you advise which one to use?

    Thanks

  30. Post
    Author
    Andy

    Hey elsavador – thanks for the comments. The easiest way is to go to the OMSA category on the blog and then download the files.
    As far as the email is concerned, check a) is blat in the path (just drop to dos prompt change to somewhere like c:\temp and then type blat and hit return. If blat does not give you the syntax, then it is not in the path. Either stick it in c:\windows, in c:\jobs or include the path directly. Personally I don’t like to add things to c:\windows – I create a directory called c:\utils and then add utilities like blat, wuinstall, putty to this directory.
    Feel free to send me your changed dellalert.bat and I’ll take a look (I’ve emailed you privately too)

    Andy

  31. Josh

    Windows Server 2008 R2, trying to run blat I get the following error:

    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: blat.exe
    Application Version: 2.6.2.0
    Application Timestamp: 45e1c20d
    Fault Module Name: ntdll.dll
    Fault Module Version: 6.0.6002.18005
    Fault Module Timestamp: 49e03824
    Exception Code: c0000005
    Exception Offset: 0002b11f
    OS Version: 6.0.6002.2.2.0.274.10
    Locale ID: 1033
    Additional Information 1: fd00
    Additional Information 2: ea6f5fe8924aaa756324d57f87834160
    Additional Information 3: fd00
    Additional Information 4: ea6f5fe8924aaa756324d57f87834160

    Any assistance would be greatly appreciated.

  32. Matt

    Josh, I had the same issue on a Windows 2008 R2 server. If I remember correctly, it was due to User Account Control settings being enabled by default. Try setting to never notify and see if that’s the culprit, I’m pretty sure that was the cause.

  33. Josh

    I will give that a try thank you. I won’t know till next week because it requires a reboot which I will do this weekend.

  34. Matt

    I thought the same, the “p” is to differentiate which alerts go to phone. I wound up taking it out of the conf.bat and removed the if statement from the dellalert.bat since I only have the alerts going to one email address, which ends up sending to my phone anyway.

  35. Post
    Author
    Andy

    The only time I’ve had this happen is when blat (and the associated dll files) were not in my path or the complete command line is not correct. ( From what I remember it was a problem with the mail server not being resolvable as I had a typo in it)
    If you just run blat.exe by itself from the command line do you get the help syntax coming through?
    If so, then try typing in the blat command manually to see if that works

  36. Matt

    That could be it regarding the DLLs not being in the same path as blat.exe. I wrote a simple script to copy the assoicated files into the system32 folder. With user account prevention enabled, the script failed to copy all the files there. Hope that helps.

  37. Post
    Author
    Andy

    You can verify the uac requirements by running the script from an elevated command prompt to see if it works – if it does then you know the command line is correct and then it is something else (such as the uac) that is causing the problem. The p stands for pager and is used to send the more critical alerts to a pager/phone device as well as an email address. This hopefully allows faster remediation than checking your email (although make sure you are on an unlimited plan due to some alerts going off constantly until the problem is fixed).

  38. MM

    Great Post,
    after struggling arround with the Dell Support Team and using different other solutions I tried this one – workung perfect !
    Thanks

  39. Kevin Mills

    Thanks a bunch for this! It is great to see people out there in the IT community sharing what they’ve learned so that we may all benefit. Cheers!

  40. Mordechai Ochayon

    Great Post
    Andy you ROCK!!!
    Thanks a lot for a great tool
    I’m puzzled why dell didn’t release a mail alerter.
    On HP they have PSP –Proliant Support Tool
    Tanks again

  41. Post
    Author
    Andy

    Larry – let me know what the problem is – it certainly shouldn’t take you two days for this – even 2 hours is way longer than it should. However, without knowing the details it’s hard to help. I’ve sent you an email.
    Andy

  42. Larry

    Thanks Andy…didn’t get your email, if it’s more efficient for you to help that way I’m all for it, but I never got your original 🙁 And first things first, a huge thanks…same HOUR response, you’re the greatest.

    I’m running S2008R2 on Dell PE2850 – Don’t think I’m nailing the syntax in OMSA…I’ve tried many different ones and never got an email from blat…

    My latest misfire is below: (above poster Shek recommended…no quotes, full paths)

    C:\Windows\System32\cmd.exe /c C:\tools\dellalert psu warning

    Blat is in both system32 and my “c:\tools” folder…

    Oddly, when I type from start menu “cmd /c” I’m able to continue to type parameters…however, if I type “c:\windows\system32\cmd.exe /c” from the orb, everything after slash c disappears and the command doesn’t work…wierd.

    Is this a true statement- “If I cut/paste the syntax in the OMSA Execute Application text box into the OS start button menu – it should work?”

  43. Larry

    BTW….i did run blat with both elevated an non-elevated CMD’s…so I know it’s in the path…The DellAlert script runs fine and sends me an email if ran w/or w/o admin privs…

    I also unblocked the blat app and unchecked the UAC warnings….

    (shrug)

  44. Matt

    Sounds like something weird is going on for sure:

    I have it setup like so:

    Create C:\WINDOWS\scripts folder

    Create dellalert.bat file in that folder: I use the following syntax:

    @echo on
    setlocal
    set log=c:\windows\scripts\dell.txt
    set [email protected]
    set mailserver=123.123.123.123
    set [email protected]
    set company=COMPANYNAME
    set server=%computername%

    date /t >%log%
    time /t >>%log%
    echo %* >>%log%
    blat %log% -to %to% -server %mailserver% -f %from% -subject "%company% - %server% Alert - %*"
    endlocal

    For conf.bat, this is absolutely the correct syntax. Note that I custom tailored them from the example and also took out depreciated alert actions:

    omconfig system alertaction event=batterywarn execappath="cmd /c \"c:\windows\scripts\dellalert Battery Warning\""
    omconfig system alertaction event=batteryfail execappath="cmd /c \"c:\windows\scripts\dellalert Battery Failure\""
    omconfig system alertaction event=fanwarn execappath="cmd /c \"c:\windows\scripts\dellalert Fan Warning\""
    omconfig system alertaction event=fanfail execappath="cmd /c \"c:\windows\scripts\dellalert Fan Failure\""
    omconfig system alertaction event=hardwarelogwarn execappath="cmd /c \"c:\windows\scripts\dellalert Hardware Log Warning\""
    omconfig system alertaction event=hardwarelogfull execappath="cmd /c \"c:\windows\scripts\dellalert Hardware Log Failure\""
    omconfig system alertaction event=intrusion execappath="cmd /c \"c:\windows\scripts\dellalert Chassis Intrusion Detected\""
    omconfig system alertaction event=memprefail execappath="cmd /c \"c:\windows\scripts\dellalert Memory Warning\""
    omconfig system alertaction event=memfail execappath="cmd /c \"c:\windows\scripts\dellalert Memory Failure\""
    omconfig system alertaction event=systempeakpower execappath="cmd /c \"c:\windows\scripts\dellalert System Peak Power Warning\""
    omconfig system alertaction event=systempowerwarn execappath="cmd /c \"c:\windows\scripts\dellalert System Power Warning\""
    omconfig system alertaction event=systempowerfail execappath="cmd /c \"c:\windows\scripts\dellalert System Power Failure\""
    omconfig system alertaction event=powersupply execappath="cmd /c \"c:\windows\scripts\dellalert Power Supply Failure\""
    omconfig system alertaction event=powersupplywarn execappath="cmd /c \"c:\windows\scripts\dellalert Power Supply Warning\""
    omconfig system alertaction event=processorwarn execappath="cmd /c \"c:\windows\scripts\dellalert Processor Warning\""
    omconfig system alertaction event=processorfail execappath="cmd /c \"c:\windows\scripts\dellalert Processor Failure\""
    omconfig system alertaction event=redundegrad execappath="cmd /c \"c:\windows\scripts\dellalert Redundancy Degraded\""
    omconfig system alertaction event=redunlost execappath="cmd /c \"c:\windows\scripts\dellalert Redundancy Lost\""
    omconfig system alertaction event=tempwarn execappath="cmd /c \"c:\windows\scripts\dellalert Temperature Warning\""
    omconfig system alertaction event=tempfail execappath="cmd /c \"c:\windows\scripts\dellalert Temperature Failure\""
    omconfig system alertaction event=voltwarn execappath="cmd /c \"c:\windows\scripts\dellalert Voltage Warning\""
    omconfig system alertaction event=voltfail execappath="cmd /c \"c:\windows\scripts\dellalert Voltage Failure\""
    omconfig system alertaction event=watchdogasr execappath="cmd /c \"c:\windows\scripts\dellalert Watchdog ASR\""
    omconfig system alertaction event=removableflashmediapresent execappath="cmd /c \"c:\windows\scripts\dellalert Removable Flash Media Present\""
    omconfig system alertaction event=removableflashmediaremoved execappath="cmd /c \"c:\windows\scripts\dellalert Removable Flash Media Removed\""
    omconfig system alertaction event=removableflashmediafail execappath="cmd /c \"c:\windows\scripts\dellalert Removable Flash Media Failure\""
    omconfig system alertaction event=storagesyswarn execappath="cmd /c \"c:\windows\scripts\dellalert Storage System Warning\""
    omconfig system alertaction event=storagesysfail execappath="cmd /c \"c:\windows\scripts\dellalert Storage System Failure\""
    omconfig system alertaction event=storagectrlwarn execappath="cmd /c \"c:\windows\scripts\dellalert Storage Controller Warning\""
    omconfig system alertaction event=storagectrlfail execappath="cmd /c \"c:\windows\scripts\dellalert Storage Controller Failure\""
    omconfig system alertaction event=pdiskwarn execappath="cmd /c \"c:\windows\scripts\dellalert Physical Disk Warning\""
    omconfig system alertaction event=pdiskfail execappath="cmd /c \"c:\windows\scripts\dellalert Physical Disk Failure\""
    omconfig system alertaction event=vdiskwarn execappath="cmd /c \"c:\windows\scripts\dellalert Virtual Disk Warning\""
    omconfig system alertaction event=vdiskfail execappath="cmd /c \"c:\windows\scripts\dellalert Virtual Disk Failure\""
    omconfig system alertaction event=enclosurewarn execappath="cmd /c \"c:\windows\scripts\dellalert Enclosure Warning\""
    omconfig system alertaction event=enclosurefail execappath="cmd /c \"c:\windows\scripts\dellalert Enclosure Failure\""
    omconfig system alertaction event=storagectrlbatterywarn execappath="cmd /c \"c:\windows\scripts\dellalert Storage Controller Battery Warning\""
    omconfig system alertaction event=storagectrlbatteryfail execappath="cmd /c \"c:\windows\scripts\dellalert Storage Controller Battery Failure\""

    When you execute conf.bat it should populate everything into OMSA and not need any other modifications.

    Hope that helps.

  45. Matt

    Bah, when you copy and paste the code into your bat files, take out the leading spaces for good measure.

  46. Mike

    for some reason its not working for me.
    -i edited the dell alert bat file
    -placed all in the system32 folder

    -checked openmanage and all the changes took effect
    but for some reason i tried to remove one power supply and adjust the temperature above the threshold but its not working.
    It puts the file in the job directory once i press on dellalert.bat but thats it.

    Should i put a username and password after the sender email address?

  47. Post
    Author
    Andy

    Hi Mike – the first thing to troubleshoot in this case is the blat statement.
    Make sure you can send an email through your mail server. Depending on your mail environment you may need to allow anonymous connections, or set blat to use the authentication settings.
    Make sure you can do blat filename -to [email protected] -server youremailserver -f [email protected] -subject “test email using blat”
    If this fails to go through, add -debug to the end to see the conversation between blat and your mail server – you should see the reason the email is being rejected.
    You can also try using your mx records for your domain if the email server administrator has smtp locked down (but they may also block outbound smtp at the firewall).
    You can use authenticated email with blat, but then you’ll need a password in plain text which is probably more of a risk than allowing mail from your own server!
    Please let me know how you get on!

    Andy

  48. Mike

    HI Andy

    I tried the command line and i was able to send a message from blat.
    but once i try to run dellalert its not working
    i want to specify the username and password in it and i am using -u and -pw but still not sending.

    there is something wrong in my dellalert batch file

  49. Tim Miller Dyck

    Hi all, thanks for the script and ideas, Andy.

    I ended up going down a rabbit hole to get the script to parse the list of events from OpenManage, which made the script below really over-engineered. But this is the procedure I used and it is working for me.

    Regards,
    Tim Miller Dyck

    ==== Prerequisites ====

    * Download and install blat.exe and place it in \\%USERDOMAIN%\NETLOGON\Blat\blat.exe

    ==== Create the e-mail alert scripts ====

    mkdir D:\Scripts

    * D:\Scripts\EMailDellOpenManageAlert.cmd


    notepad "D:\Scripts\EMailDellOpenManageAlert.cmd"


    @echo off
    setlocal

    REM e-mail a Dell OpenManage alert (this is called by OpenManage automatically when an alert is logged)
    REM
    REM original script from "Dell Open Manage Server Administrator (OMSA) alert setup – updated", https://absoblogginlutely.net/2008/11/dell-open-manage-server-administrator-omsa-alert-setup-updated/
    REM
    REM Usage:
    REM EMailDellOpenManageAlert.cmd (text string to e-mail to the desired recipient)
    REM
    REM However, this script is not normally run manually. The "EMailDellOpenManageAlertSetup.cmd" script configures OpenManage to call this script when the specified event occurs.

    REM temporary log file location
    set LOGFILE="D:\Scripts\temp-EMailDellOpenManageAlert.txt"

    REM save the OpenManage alert details to a file
    echo Dell OpenManage alert generated at: > %LOGFILE%
    date /t >>%LOGFILE%
    time /t >>%LOGFILE%
    echo. >>%LOGFILE%
    echo %* >>%LOGFILE%

    REM set the Blat error log filename
    REM %~f0 is the fully-qualified path name of this script. Note the Windows "Region and Language" format needs to be "English (United States)" (so the date environment variable is of the format "Sun 11/13/2011")
    set BLATERRORLOGFILENAME="%~f0-%date:~-4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%-ERROR.log"

    REM mail the backup status message to the desired recipient
    "\\%USERDOMAIN%\NETLOGON\Blat\blat.exe" - -f [email protected] -to [email protected] -server mymailserver.mydomain.org -subject "ALERT: Dell OpenManage alert on server %COMPUTERNAME%" -body "Dell OpenManage raised an alert on server %COMPUTERNAME%. The details are below." -ps %LOGFILE% -log %BLATERRORLOGFILENAME%

    REM check if the e-mail was sent successfully (error level 0 returned); if it was, delete the Blat log file to clean up; if it was not, display an error message to the console and leave the full error log file in place
    if %ERRORLEVEL%==0 (del %BLATERRORLOGFILENAME%) else (echo ERROR: %date% %time% An error occurred when Blat tried to send e-mail. The e-mail was not sent. Please check the log file %BLATERRORLOGFILENAME% for more information. & echo %date% %time% An error occurred when Blat tried to send e-mail. The e-mail was not sent. Error details are above. >> %BLATERRORLOGFILENAME%)

    REM delete the temporary log file
    del %LOGFILE%

    * run the script to test it


    "D:\Scripts\EMailDellOpenManageAlert.cmd" TestDellAlert

    * Configure OpenManage to call the script
    * A .cmd script cannot be called directly — cmd.exe must be used as a wrapper

    * D:\Scripts\EMailDellOpenManageAlertSetup.cmd


    notepad "D:\Scripts\EMailDellOpenManageAlertSetup.cmd"


    @echo off
    setlocal enabledelayedexpansion

    REM configure OpenManage to send e-mail alerts for the specified events
    REM
    REM original script from "Dell Open Manage Server Administrator (OMSA) alert setup – updated", https://absoblogginlutely.net/2008/11/dell-open-manage-server-administrator-omsa-alert-setup-updated/
    REM
    REM Usage:
    REM Edit the script to check if the list of events is complete and correct for the version of Dell OpenManage on the server, then run this script
    REM

    REM =====
    REM define the list of monitored events
    REM to get this list, run "omconfig system alertaction" and observe the list of valid events
    REM place the updated list in the set EVENTLIST line below
    REM set the list of events to register with OpenManage
    REM double-quotes are required to allow the pipe symbols

    set EVENTLIST="powersupply|tempwarn|tempfail|fanwarn|fanfail|voltwarn|voltfail|systempowerwarn|systempowerfail|intrusion|redundegrad|redunlost|memprefail|memfail|powersupplywarn|hardwarelogwarn|hardwarelogfull|processorwarn|processorfail|watchdogasr|batterywarn|batteryfail|systempeakpower|removableflashmediapresent|removableflashmediaremoved|removableflashmediafail|storagesyswarn|storagesysfail|storagectrlwarn|storagectrlfail|pdiskwarn|pdiskfail|vdiskwarn|vdiskfail|enclosurewarn|enclosurefail|storagectrlbatterywarn|storagectrlbatteryfail"

    REM =====
    REM parameter string fixups

    REM replace the | character with a space to allow word-by-word parsing
    set EVENTLIST=%EVENTLIST:|= %
    REM remove the double quotes now that the | character is gone
    set EVENTLIST=%EVENTLIST:"=%

    REM =====
    REM user display

    echo The following OpenManage events will be configured to have e-mail alerting:
    echo.
    echo %EVENTLIST%
    echo.
    pause
    echo.

    REM =====
    REM main loop: proceeds until the EVENTLIST string has had every space-separated word processed

    :MAINLOOPTOP
    REM call the action subroutine
    call :PerformAction !EVENTLIST!
    REM update the EVENTLIST string with the shorter EVENTLIST string created by the subroutine
    set EVENTLIST=!RESULT!
    REM exit if the string is "ENDENDEND" (special end marker from the subroutine)
    if "!EVENTLIST!"=="ENDENDEND" goto ENDMAIN
    REM otherwise keep looping
    goto MAINLOOPTOP
    :ENDMAIN

    REM =====
    REM user display

    echo.
    echo Done.

    REM end of main script
    goto:EOF

    REM ==========

    REM =====
    REM PerformAction subroutine
    REM
    REM - this subroutine should be called with a list of space-separated parameters
    REM - the script will perform the designated action using the first parameter as input
    REM and then return the remaining parameter string (with the first parameter removed)
    REM in the environment variable RESULT

    :PerformAction
    setlocal enabledelayedexpansion

    REM =====
    REM perform the desired action on the first parameter %1
    REM in this case, call omconfig to configure OpenManage to run the designated command when the specified event occurs

    echo Setting event notification for event: %1
    omconfig system alertaction event=%1 execappath="cmd /c \"D:\Scripts\EMailDellOpenManageAlert.cmd %1\""
    echo.

    REM =====
    REM remove the first parameter from the parameter string
    REM technique from "Is there a way to indicate the last n parameters in a batch file?", http://stackoverflow.com/questions/761615/is-there-a-way-to-indicate-the-last-n-parameters-in-a-batch-file/761658#761658

    shift
    set params=%1
    :loop
    shift
    if [%1]==[] goto afterloop
    set params=%params% %1
    goto loop
    :afterloop

    REM =====
    REM return the remaining parameter string in the environment variable RESULT
    REM if there is no parameters left, return a single space to indicate this
    REM return technique from "BATCH_ Subroutines in Windows Batch", http://cypressor.twoday.net/stories/4486304
    REM and "BATCH_ input parameter with Ampersand", http://cypressor.twoday.net/stories/4480453/

    if not [!PARAMS!]==[] (
    set RESULT=!PARAMS!
    ) else (
    REM set RESULT to the special return code
    set RESULT=ENDENDEND
    )
    endlocal & set RESULT="%RESULT:"=^"%"& set RESULT=!RESULT:~1,-1!
    goto:EOF

    * run the script to configure OpenManage alerting


    "D:\Scripts\EMailDellOpenManageAlertSetup.cmd"

    ==== Verification ====

    === Local access ===

    * Open the side panel of the case to trigger a case open alert
    * If the server has dual power supplies, remove power from one of the power supplies

    === Remote access ===

    * Need an event that can be remotely triggered safely
    * not sure what to use for this

  50. Mike

    Hey Tim,

    thanks for your post. Did you have to configure blat?
    or all the configurations should be within the command file?

  51. Post
    Author
    Andy

    Mike – with both Tim’s and my scripts you do not need to configure blat – just ensure it is in your path or you specify the path.

  52. wil

    hello

    I have a W2008 R2 and follow the steps

    1. I have a directory c: \ jobs \ dellalert.bat and there is intoaccount the conf.bat
    2. conf.bat file if I update omsa
    3. if I can send emails when I put c: \ dellallert.txt test message
    4. blat file is copied into the c: windows \ system32 with. dll and. lib
    5 ran this option “Blat-install smtp.yoursite.tld [email protected]” and this is the
    result C: \ Windows \ system32> Blat-install server.123.local [email protected]
    Blat v2.6.2 w / GSS encryption (build: February 25, 2007 12:06:19)

    SMTP server set to port 25 on server.123.local [email protected] with user, retry 1 time (s)

    which will be my problem I can not send mail when an event, I can only send e-manual.

  53. wil

    C:\jobs>dellalert.bat

    C:\jobs>setlocal

    C:\jobs>set log=”c:\jobs\dell.txt”

    C:\jobs>set [email protected]

    C:\jobs>set [email protected]

    C:\jobs>set company=123.company

    C:\jobs>set server=server-omsa

    C:\jobs>set mailserver=srv-smtp

    C:\jobs>set [email protected]

    C:\jobs>date /t 1>”c:\jobs\dell.txt”

    C:\jobs>time /t 1>>”c:\jobs\dell.txt”

    C:\jobs>echo 1>>”c:\jobs\dell.txt”

    C:\jobs>if {} == {p} blat “c:\jobs\dell.txt” -to [email protected] -s
    erver srv-smtp -f [email protected] -subject “123.company srv-omsa
    alert – ”

    C:\jobs>if not {} == {} blat “c:\jobs\dell.txt” -to [email protected] -s
    erver srv-smtp -f [email protected] -subject “123.company srv-omsa alert – ”

    C:\jobs>endlocal

    C:\jobs>

    this gives me mail only if dellalert.bat

  54. Post
    Author
    Andy

    Wil – first off you need to run a couple of basic troubleshooting steps.
    1. Does log.txt get generated when you pull the power cable? Delete the file first to ensure it does get run successfully.
    2. I’m assuming if you run dellalert.bat p test then you get an email.
    3. add a -verbose to the blat line and redirect the output with >>c:\jobs\log2.txt to see what happens on the mail – the log2 file will contain the email conversation. You do not need to register blat beforehand.

    Andy

  55. wil

    hi andy
    1. testing remove the power cord, I just generate the file in the directory you specify
    2. if I dellalert.bat testing test message, sending e-mail
    3.agregar the line in the blat and diregirla a >> c: \ jobs \ log2.txt I did from here.
    if {% 1} == {p} blat% log%-to% pager%-server% mailserver%-f% alertfrom%-subject “% company%% server% alert -% *” >> c: \ jobs \ log2.txt
    I think I did wrong

    4.lo not do is that when I remove the cable send the automatic email,

  56. Post
    Author
    Andy

    Hi Wil – if that really is your blat line, it is not suprising it does not work. Your spaces and % characters are all over the place.
    It should read like this.
    if not {%1}=={} blat %log% -to %mail% -server %mailserver% -from %alertfrom% -subject “%company% %server% alert – %*” >>c:\jobs\log2.txt

  57. Athota

    Hello Andy,

    I followed the instructions and moved blat.exe to the system 32 folder. However, I am not able to receive an email. Here is the content of the log.

    Tue 06/19/2012
    12:13 PM
    ECHO is on.

    Also, I just ran (12:41 PM) conf.bat but the log is not updated.

  58. Post
    Author
    Andy

    Conf.bat is used as a one off configuration to set the alerts up. This won’t update any logs. Dellalert.bat is the file that is used to send the alerts.

  59. Linda

    Thank you so much for this. We had a problem where we had a failed HDD but no notifications coming through and then we realised that the alert config we had done in the RAC was not covering Storage. We needed to get it working in Server Administrator where Storage alerts are. Like others, I can’t believe that OMSA doesn’t have email alerts, it seems so obvious that it should. Thanks for your work, we did remove the “p” for pager in the conf.bat file and commented out a couple of lines in your dellalert.bat file but it works perfectly.

  60. Jerry Gonzales

    Thank so much for putting this together. The scripts and process worked just as advertised. For those of you that want to know what I did to make this work I have put my instructions below.

    You will be plaicng the files in the following locations:

    dellalert.bat and conf.bat c:\jobs
    blat.dll, blat.exe and blat.lib in c:\windows

    This is exactly what I did to make this work.

    • Install OMSA on the server confirm that it works. (Log in using web browser).
    • Create a directory called jobs in the c:\
    • Downloaded, extract and place files in jobs. Modify the email settings in the dellalert.bat file.
    • Donloaded and copy blat files listed above to the c:\windows directory.
    • From CMD prompt double click conf.bat to configure OMSA
    • Run Server administrator to check the settings have been implemented correctly. By going to Alert Management, you see what values are “off” or “on”. This script turns all of Systems Event’s on for “Execute Application”. You can modify to you likig.
    • Test – Again go into your CMD prompt and type “c: \ dellallert.txt test message” After this you might want to create a system event by doing this. Carefully unplug one of the redundant power supplies. I would recommend you also set up the alerts to display a popup for this event so you know the alert has been triggered. Then unplug the power. Wait about 20-30 seconds for the alert to popup on screen and then wait for your email/pager to activate.

    This worked correctly the first time I ran it. Good Luck.

  61. Post
    Author
    Andy

    Thanks Jerry – that’s exactly how it should be done. By reading the instructions it does work. You just have to read them properly.

  62. Post
    Author
    Andy

    Lol Al – glad to be of service. Interestingly the new versions of Dell servers now have the OMSA stuff built into the DRAC. I’ll have to see how easy it is to update the script to modify the DRAC setup programatically. At least now you don’t have to worry about setting up blat etc.

  63. Kevin

    Hi Andy,

    Thanks for sharing this script.

    I am trying to set up alerts for a number of Dell Servers, but I am having trouble authenticating my mail server.

    I was wondering is there any way to pass in username/password credentials which can authenticate the mail server any time an email/alert is triggered to be sent?

    Thanks,
    Kevin

  64. Post
    Author
    Andy

    Hi Kevin. Just add
    -u username -pw passwordhere
    to the blat lines and you should be good to go. Depending on your firewall environment there is no need to do this if you send mail to your mx record, although your firewall guys might have blocked smtp out on the firewall in which case you will need to send to your local mail server (and allow connection) from your internal servers.

  65. Kevin

    Thanks Andy,

    That appears to be working.

    I am now faced with another error which I investigated yesterday.

    When I run c:\jobs\dellalert test message

    I receive an error:

    SMTP server error
    Error: Not a socket

    I believe this might be an error with blat, but so far havn’t come up with a solution.

    I am pretty sure the mail server is listening on port 25.

    I have run -debug on blat, using the dell.txt log file and am seeing an error:

    Blat v2.6.2 (I think this was a common error on v2.6.1)

    Unknown error 32 when trying to open c:\jobs\dell.txt

    I don’t know if these two are related, and this is my first time setting up email alerts, so I am not too sure what to look out for.

    Have any other people encountered either of the errors I am having?
    Or, have you any idea what I need to do to fix this?

    Thanks for your time,

    Kevin

  66. Post
    Author
    Andy

    Thanks for the update Kevin.
    First check that you can telnet on port 25 (although you’d get a different error if that was the case). Then check the permissions of c:\jobs\dell.txt – the permissions may be set to not allow the software to write or read the file. You can also use blat and enter text on the command line to see if it works…
    blat -to [email protected] -f [email protected] -subject “test subject” -server mx.domain.com
    enter your text and then press F6 (or ctrl-Z) on the command line to see what happens.

  67. Kevin

    Thanks for your help Andy.

    I found out that the mailserver was being blocked by firewall rule.
    Have changed this and now the email alerts are working correctly.

    Thanks again!

  68. Al

    Really like the alerting! We have some old stuff so I am stuck with real specific versions 🙁

    I put everything in C:\jobs, so I had to modify the script since I didn’t have in the path (Until I did that blat would only run when directory was C:\jobs). Basically, when I manually ran dellalert.bat, it was fine, when Dell Open Manage tried to do it when an alert came through, the email never sent.

    Did you ever have a solution for the multiple email thing? I was going to add an if statement based on timestamp, just didn’t want to reinvent the wheel…

    thanks,

    Al

  69. Post
    Author
    Andy

    Thanks for the update Eder. I do believe that this registry key is used to get the OMSA software running in the OMSA software on a Windows Server. My original post is to get alerts running directly from the DRAC itself when there is a problem and does not require a Windows server.

  70. Post
    Author
    Andy

    Unfortunately not, For that you have to use the Dell ovf files to install on the esxi server. I think you can then use the linux os to set up commands and alerts or use esxi’s alerts. If you have vcenter then you can use the vcenter alerts as it can detect information on the server.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.