Absoblogginlutely! » Page 'Dell Open Manage Server Administrator (OMSA) alert setup – updated'

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 pager=destinationpageraddress@company.com
set mail=destinationemailaddress@company.com
set company=Companyname
set server=%computername%
set mailserver=mailservername
set alertfrom=fromemailaddress@company.com

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.

Like this post? Spread the word!
delicious digg google
stumbleupon technorati Yahoo!

80 comments to “Dell Open Manage Server Administrator (OMSA) alert setup – updated”

  1. 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)

  2. 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 to=toemailaddress@yourdomain.com
    set mailserver=123.123.123.123
    set from=fromemailaddress@yourdomain.com
    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.

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

  4. 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?

  5. 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 youremail@yourdomain.com -server youremailserver -f alerts@yourdomain.com -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

  6. 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

  7. 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", http://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 alerts@mydomain.org -to me@mydomain.org -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", http://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

  8. Hey Tim,

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

  9. 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.

  10. 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 youruserid@yoursite.tld” and this is the
    result C: \ Windows \ system32> Blat-install server.123.local myemail@123.local
    Blat v2.6.2 w / GSS encryption (build: February 25, 2007 12:06:19)

    SMTP server set to port 25 on server.123.local myemail@123.local 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.

  11. C:\jobs>dellalert.bat

    C:\jobs>setlocal

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

    C:\jobs>set pager=myemail@123.com

    C:\jobs>set mail=myemail@123.com

    C:\jobs>set company=123.company

    C:\jobs>set server=server-omsa

    C:\jobs>set mailserver=srv-smtp

    C:\jobs>set alertfrom=srv-omsa@123.com

    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 myemail@123.com -s
    erver srv-smtp -f srv-omsa@123.com -subject “123.company srv-omsa
    alert – ”

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

    C:\jobs>endlocal

    C:\jobs>

    this gives me mail only if dellalert.bat

  12. 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

  13. 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,

  14. 4. so that I can not do is that when I remove the cable send the automatic email,

  15. 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

  16. Thank you. I ended up doing a combination of your tips to get my script working.

  17. 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.

  18. 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.

  19. 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.

  20. 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.

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

  22. One correction. The command to test is “c:\jobs\dellalert test message”.

  23. Thanks Andy, you’ve made me look clever @ work! 🙂

  24. 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.

  25. 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

  26. 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.

  27. 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

  28. 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 to@domain.com -f from@domain.com -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.

  29. 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!

  30. 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

Leave a comment

XHTML - You can use:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Top of page / Subscribe to new Entries (RSS)