Last year I posted a script written in VBScript which enables email alerts from Dell OMSA without the need for IT Assistant. This script has proved to be very popular, but a number of users have not been able to make it work because it depends on CDO, which is not included in Windows Server Core.
So, I have rewritten the script in Powershell and it should now work on any system which has Powershell installed. The new script is easier to read and includes support for SMTP over SSL, making the use of a Gmail account for sending the alerts very straightforward.
The whole process is very similar to the previous script, so if you used that one, this will be immediatly familiar.
After you have downloaded the Zip file extract it to a folder on your server, e.g “C:\Script”
You will then need to edit the variables at the top of the script to make them appropriate for your environment:
If you do not specify an SMTPServer, it will default to localhost. If you do not specify an SMTPPort it will default to port 25.
If you intend to use the script with a gmail account set:
$SMTPServer = “smtp.gmail.com”
$SMTPUser = Your gmail account name (without the @gmail.com part).
$SMTPPassword = Your gmail account password
$SMTPPort = 587
$EnableSSL = true
Test Email is functional
Now that you have the script installed open up a powershell prompt and run the script with the “testemail” parameter e.g:
If everything is working properly you should receive a test alert in your inbox.
Setup Alerts from OpenManage
Once the email function has been tested you can go ahead and setup the script to run from open manage, simply run the script again with the “setup” parameter, and you should see something like this:
There are a few easy ways to test the script in practice with a real alert generated by OpenManage:
- Pop the side off the server casing, this will generate a chassis intrusion alert.
- If you have a dual powersupply system you can pull the power to one of the supplies and the server should report the power loss.
The problem with these methods is that you have to be in the same place as the server. So I prefer to trigger a tempreture alert like this:
Just set the warning threshold to be a couple of degrees lower than your current reading. Warning: If you have a thermal shutdown action configured, this could trigger that process off and shutdown your server. Once you have received your test emails, set the tempreture wanrings back to default values.
Please let me know of any issues you have with the script and I will work on them as soon as possible. I have installed this updated version on a number of systems and it is working well.
The download includes both the new version and the older VBScript version.