Dell Openmanage Server Administrator Windows Server 2008 R2
Microsoft Windows > Problems Installing Dell OpenManage Administrator on Dell PowerEdge 2950 running Windows 2008 R2 (64-bit.)posted 31 Aug 2012, 00:54 by Tristan Self
|
I managed to install OMSA 9.1.0 on Windows Server 2008 R2, to remotely manage a VMware ESXi 6.5 host that has OpenManage 9.1.0 installed.
This How-To describes how to setup E-mail alerts in Dell's OpenManage Server Administrator using PowerShell and the OpenManage Application.
8 Steps total
Step 1: Updated - 01-14-2020
I've updated the script a little bit, including some cleanup!
Only tested with x64 (Server 2016) as I have no x32 to test with anymore.
Step 2: Install Dell OpenManage Server Administrator
If you have not installed Dell OpenManage Server Administrator, you can download it from Dell's Website (http://www.dell.com/support/contents/us/en/19/article/Product-Support/Self-support-Knowledgebase/enterprise-resource-center/SystemsManagement/OMSA)
Step 3: Set-Execution Policy in PowerShell
You must run one of the following two commands in PowerShell or the script will not be permitted to run 'remotely'.
Set-ExecutionPolicy RemoteSigned
or
Set-ExecutionPolicy Unrestricted
Step 4: Download OMAlert.ps1 script
Download the OMAlert PowerShell script and save it to a location on your server. (Make sure to save it as a PowerShell .ps1 file)
Step 5: Alter OMAlert.ps1 file for Gmail Servers
Alter the Email fields in the OMAlert.ps1 file to suit your needs. Make sure use an actual account as this will authenticate against the Gmail servers.
Step 6: Alter OMAlert.ps1 for Script Path
Alter the 'ScriptPath' variable to the path where your saved OMAlert.ps1 script file.
Step 7: Run the Script Once
Open a PowerShell Window to the location of your saved script. Run the following command to configure your alerts:'OMAlert.ps1 -configure' This could take about a minute and will set the options in the Dell OpenManage utility.
Step 8: Test Your Script
To test script, you can either unplug a redundant power supply, or change the temperature warning threshold (just make sure to change it back).
You should get an e-mail to whatever addresses you added on the EmailTo line as well as it showing up in the Sent Mail folder of the Specified SMTPClient.
That's it! Hopefully this saves some people some time and effort!
Note*** Rerun the script manually using the '.OMAlert.ps1 -configure' if you change any of the $Body section of the script.
References
- Another Dell OpenManage Server Administrator Question
- Email alerts from Dell OpenManage Server Administrator
- Sending email with gmail using powershell
22 Comments
- Thai PepperLuc23 Jan 19, 2017 at 08:28pm
Nicely done! OMSA alerts was in need of some updating.
- Anaheimdanle2 Mar 27, 2017 at 04:10pm
I can't get this to work for some reason. I also use gmail but I am unable to receive any email alert. I changed the minimum temperature from 3C to 26C, which is a bit high than the current temperature. How long does it take to send the alert? Do I need some other prerequisite in order to make this work? I am on WS2012R2.
- SerranoAndy R Mar 27, 2017 at 07:24pm
Hi Dan,
Alerts should be sent pretty quick.. Usually within a couple of seconds. Did you run the script manually first with the -configure option? - SerranoDustin5323 Apr 6, 2017 at 08:55pm
Getting this error on one of my servers. Running WIndows 2008 R2 Standard.
'Ampersand not allowed. The & operator is reserved for future use
At C:OpenManageSMTP-DELL.ps1:23 char:31'
Any Ideas?
Here is my powershell version infoName Value
---- -----
CLRVersion 2.0.50727.5420
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1Note: Didnt have this issue with any of my 2012 servers. May be an 2008 server issue
- SerranoAndy R Apr 7, 2017 at 12:59pm
I'm not 100% certain on that.. Like you said it could be a 2008 issue. I've only used it on 2012 / 2012R2 / 2016.
- Pimientoninjamint Apr 30, 2017 at 04:35pm
some might find that the script wont run without adding './' in front of the script - './OMAlert.ps1 -configure'
that was an issue for me anyway - PoblanoShadowInc May 8, 2017 at 03:20pm
This script is great and it works great when I run what it puts under 'Execute application:' manually. However, when I trigger an alert nothing happens.
For instance, when I win+R this: powershell C:ScriptsOMAlert.ps1 'Temperature Warning' , which is what I have the script set to add to openmanage, all is well and I receive an email.
However, when I set the temperature threshold below current, I get an alert in OpenManage.. but no email.
Any ideas?
- SerranoAndy R May 8, 2017 at 04:09pm
Did you run C:ScriptsOMAlert.ps1 -configure ?
That part is what puts the commands into OpenManage.
- PoblanoShadowInc May 8, 2017 at 04:21pm
Yeah I did, and the alerts were properly configured in OpenManage. I solved the issue - my OpenManage was outdated and actually a 32-bit version for some reason (on a 64-bit machine).
Updated to latest 64-bit version and all is well!
- PoblanoShadowInc May 8, 2017 at 04:37pm
I replaced some things with variables in your script - you no longer have to even set the path of the script itself - it gets where it's located from the file itself.
#begin PS script
### You must run 'Set-ExecutionPolicy RemoteSigned' or 'Set-ExecutionPolicy Unrestricted' on the server first, or the script will not run automatically. ###
### For Dell OpenManage Administrator use, run the script manually once with the -configure option to set the script in the OpenManage application. Example: 'OMAlert.ps1 -configure' ###
### Rerun the script manually if you change any of the information in the Body section. ###
### To test script, you can either pull a redundant power supply, or change the temperature warning (just make sure to change it back). ###
### Source: http://lemonfilling.com/Tech/omalert.html ###
### Source: http://stackoverflow.com/questions/29029364/sending-email-with-gmail-using-powershell ###
param ([switch]$configure)$SysManagerPath = 'c:program filesdellsysmgtomabinomconfig.exe'
$Date = Get-Date
$Server = gc env:computername
$EmailFrom = 'ActualAccount@yourdomain.com'
$EmailTo = 'Email1@yourdomain.com,Email2@yourdomain.com,Email3@yourdomain.com'
$Subject = 'Hardware Alert from $Server $Date'
$SMTPServer = 'smtp.gmail.com'
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential('ActualAccount@yourdomain.com', 'PASSWORD')
$Body=$args[0]# Sets the script path to where this file is stored now
if ($PSVersionTable.PSVersion.Major -gt 2){
$ScriptPath = $PSCommandPath
}
else{
$ScriptPath = split-path -parent $MyInvocation.MyCommand.Definition
}if ($configure -eq $true)
{
` & $SysManagerPath system alertaction event=powersupply execappath='powershell $ScriptPath 'Power Supply Failure'
& $SysManagerPath system alertaction event=powersupplywarn execappath='powershell $ScriptPath 'Power Supply Warning'
& $SysManagerPath system alertaction event=tempwarn execappath='powershell $ScriptPath 'Temperature Warning'
& $SysManagerPath system alertaction event=tempfail execappath='powershell $ScriptPath 'Temperature Failure'
& $SysManagerPath system alertaction event=fanwarn execappath='powershell $ScriptPath 'Fan Warning'
& $SysManagerPath system alertaction event=fanfail execappath='powershell $ScriptPath 'Fan Failure'
& $SysManagerPath system alertaction event=voltwarn execappath='powershell $ScriptPath 'Voltage Warning'
& $SysManagerPath system alertaction event=voltfail execappath='powershell $ScriptPath 'Voltage Failure'
& $SysManagerPath system alertaction event=intrusion execappath='powershell $ScriptPath 'Chassis Intrusion Detected'
& $SysManagerPath system alertaction event=redundegrad execappath='powershell $ScriptPath 'System Redundancy Degraded'
& $SysManagerPath system alertaction event=redunlost execappath='powershell $ScriptPath 'System Redundancy Lost'
& $SysManagerPath system alertaction event=memprefail execappath='powershell $ScriptPath 'Memory Pre-Fail'
& $SysManagerPath system alertaction event=memfail execappath='powershell $ScriptPath 'Memory Failure'
& $SysManagerPath system alertaction event=processorwarn execappath='powershell $ScriptPath 'Processor Warning'
& $SysManagerPath system alertaction event=processorfail execappath='powershell $ScriptPath 'Processor Failure'
& $SysManagerPath system alertaction event=watchdogasr execappath='powershell $ScriptPath 'Automatic System Recovery'
& $SysManagerPath system alertaction event=batterywarn execappath='powershell $ScriptPath 'Battery Warning'
& $SysManagerPath system alertaction event=batteryfail execappath='powershell $ScriptPath 'Battery Failure'
& $SysManagerPath system alertaction event=systempowerwarn execappath='powershell $ScriptPath 'System Power Warning'
& $SysManagerPath system alertaction event=systempowerfail execappath='powershell $ScriptPath 'System Power Failure'
& $SysManagerPath system alertaction event=systempeakpower execappath='powershell $ScriptPath 'System Power'
& $SysManagerPath system alertaction event=storagesyswarn execappath='powershell $ScriptPath 'Storage Warning'
& $SysManagerPath system alertaction event=storagesysfail execappath='powershell $ScriptPath 'Storage Failure'
& $SysManagerPath system alertaction event=storagectrlwarn execappath='powershell $ScriptPath 'Storage Controller Warning'
& $SysManagerPath system alertaction event=storagectrlfail execappath='powershell $ScriptPath 'Storage Controller Failure'
& $SysManagerPath system alertaction event=pdiskwarn execappath='powershell $ScriptPath 'Physical Disk Warning'
& $SysManagerPath system alertaction event=pdiskfail execappath='powershell $ScriptPath 'Physical Disk Failure'
& $SysManagerPath system alertaction event=vdiskwarn execappath='powershell $ScriptPath 'Virtual Disk Warning'
& $SysManagerPath system alertaction event=vdiskfail execappath='powershell $ScriptPath 'Virtual Disk Failure'
& $SysManagerPath system alertaction event=enclosurewarn execappath='powershell $ScriptPath 'System Enclosure Warning'
& $SysManagerPath system alertaction event=enclosurefail execappath='powershell $ScriptPath 'System Enclosure Failure'
& $SysManagerPath system alertaction event=storagectrlbatterywarn execappath='powershell $ScriptPath 'RAID Battery Warning'
& $SysManagerPath system alertaction event=storagectrlbatteryfail execappath='powershell $ScriptPath 'RAID Battery'
}else{
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
}
#end PS script - Anaheimsamscales Jun 6, 2017 at 10:07am
Out of interest why does Dell OpenManage server admin have an email setup section in the preferences if it does not support sending emails itself. I just tested and it does send me an email test, although I have no way of testing if it emails me when something fail.
- SerranoAndy R Jun 6, 2017 at 12:05pm
Sam, that's the question I've been asking myself for years! I usually test by setting the temperature threshold to something really low.
- Pimientorockyb42 Oct 23, 2017 at 10:44am
Excellent script and simple to implement on Server 2012.. However I, like others, encountered problems getting it to work on earlier server versions (with 32-bit OMSA install, PowerShell 2.0 etc).
For those that are still interested, the following slight changes were needed and it now works (for me at least!) on an old SBS 2008 so should be the same on a basic Server 2008, and I imagine Server 2008 R2 (SBS 2011).
* To negate the 'Ampersand not allowed' error, the beginning of the first line of the if statement needs to change to: if ($configure -eq $true) {& 'c:program files (x86)dellsysmgtomabinomconfig.exe' system alertaction event=powersupply execappath=.. [note the subtle change here from the original is the removal of the single quote and space from the beginning of the first ampersand].
* In addition, if you are using the 32-bit version of OMSA (as above), then the script needs to use 32-bit PowerShell, so the execpath= entry for each alert should not simply call powershell, you need the full path to the 32-bit version, C:Windowssyswow64WindowsPowerShellv1.0powershell.exe, and then pass the path to your script etc as in the original.
* Finally, as you are now using 32-bit Powershell you need to make sure the the Set-ExecutionPolicy cmdlet has been run within that environment (in other words, run Windows PowerShell (x86) and apply the requisite cmdlet as dictated by the script/your policies).
Hope this helps someone, I'll try and find a Server 2008 R2 system to apply it to and advise of any further tweaks! - Pimientokhurramimtiaz2 Aug 2, 2018 at 08:16am
using your script and configured it on windows server 2012 R2 with Dell EMC OpenManage Systems Management Software (64-Bit) Version 9.1.0.
when i run manually D:ScriptsOMAlert.ps1 it just generate blank email with server name date and time and no text in body,
if i run powershell D:ScriptsOMAlert.ps1 'Temperature Warning' via cmd than it generate email with message body containing Temperature Warning text in it.
unable to figure out the issue..
- PimientoDevinGreco Aug 27, 2018 at 07:39pm
Worked great for me. Couple of pointers.
The server variable should be configured with a value of 'computername' , no quotes. '$Server = gc env:computername'
If your SMTP server is Exchange, for the SMTP credentials you may need to use the format domainusername for the first part.
The script should be saved to the following location: C:ScriptsDellSMTPNotifyomalert.ps1. Otherwise you have to modify the path in the script to whichever path you used.
Rather than pulling a power supply cable to test whether your email config works properly, simply enter the command in PowerShell with the alert appended: Example:
PS C:ScriptsDellOMSA>.OMAlert.ps1 'Power Supply Failure'
This should generate an alert that should be received by the mailbox or group in your email to field.
- 1
- 2