
dell服务器硬件检测
All Dell servers come with the Dell OpenManage Server Administrator software which has the ability to monitor and display system level indicators. Additionally, through the Alert Management tab you can configure actions to execute whenever an alert is triggered. Unfortunately there is no vehicle for applying uniform notifications to all events, so we are going to provide a script which configures all the alert actions to send an email notifying you of the respective event. While you could set these up manually, having a script is ideal as you can easily deploy this across multiple servers.
所有Dell服务器均随附Dell OpenManage Server Administrator软件,该软件能够监视和显示系统级指示器。 此外,通过“警报管理”选项卡,您可以配置要在触发警报时执行的操作。 不幸的是,目前还没有将统一的通知应用于所有事件的工具,因此我们将提供一个脚本,该脚本配置所有警报措施以发送电子邮件通知您有关相应事件。 尽管您可以手动设置它们,但是拥有脚本是理想的选择,因为您可以轻松地在多个服务器之间部署它。
这个怎么运作 (How it Works)
The script is very simple. There is a setup command which sets each alert to “Execute application” with the application being the script itself. When the script runs, it simply generates an email (by using the the Blat tool) with the computer name, date, time and alert triggered.
该脚本非常简单。 有一个设置命令可将每个警报设置为“执行应用程序”,其中应用程序为脚本本身。 脚本运行时,它只是通过使用计算机的名称,日期,时间和警报触发(通过使用Blat工具)生成一封电子邮件。
Before script is run:
在运行脚本之前:

After script is run:
运行脚本后:

All alerts use the email notification script:
所有警报都使用电子邮件通知脚本:

要求 (Requirements)
Of course, you will need to have Dell OpenManage Server Assistant installed. This software, if not provided with your system, is downloadable through Dell’s support site.
当然,您将需要安装Dell OpenManage Server Assistant。 如果您的系统未提供此软件,则可以从Dell支持站点下载该软件。
Additionally, you will need to have Blat, a command line emailer, configured on your system. To configure Blat, just download the binary files and extract them (3 total: blat.exe, blat.dll, blat.lib) to a location in your system’s PATH variable, such as your Windowssystem32 folder. Then from the command line, run:
此外,您将需要在系统上配置命令行电子邮件Blat。 要配置Blat,只需下载二进制文件并将其解压缩(共3个文件:blat.exe,blat.dll,blat.lib)到系统的PATH变量中的某个位置,例如Windowssystem32文件夹。 然后从命令行运行:
blat -install my.mailserver.com fromaddress@email.com
blat-从地址@ email.com安装my.mailserver.com
Replace the mail server and from email address appropriately. For the most part this command is all you need to run, but if your server has a special configuration (alternate port, etc.), you can see the full install options on Blat’s website.
更换邮件服务器,并从电子邮件地址中适当更换。 在大多数情况下,此命令仅是您需要运行的命令,但是如果您的服务器具有特殊配置(备用端口等),则可以在Blat网站上看到完整的安装选项。
电子邮件警报通知设置 (Email Alert Notification Setup)
Once you have these requirements in place, you are ready to use the script. Edit the script to include the email address(es) to notify (the ‘ToEmail’ variable). If your server requires authentication to relay, you will have to add these parameters to the Blat command as documented in the script.
满足这些要求后,就可以使用脚本了。 编辑脚本以包括要通知的电子邮件地址(“ ToEmail”变量)。 如果您的服务器需要身份验证才能中继,则必须按照脚本中的说明将这些参数添加到Blat命令中。
To setup the Server Assistant alerts to use the script, just run the setup:
要设置服务器助手警报以使用脚本,只需运行安装程序:
DellAlert /setup
DellAlert /设置
Confirm you want to use this script as your alert action and you are all set. As part of the setup, a sample alert is triggered so you can make sure the emails are reaching the intended recipients.
确认您要将此脚本用作警报操作,并且一切就绪。 在设置过程中,将触发示例警报,以便您确保电子邮件已到达预期的收件人。
剧本 (The Script)
@ECHO OFF
TITLE Dell Hardware Email Alert
ECHO Dell Hardware Email Alert
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO.
ECHO.
REM Sends email alerts when Dell hardware warnings are triggered.
REM This script should _not_ be in a path which contains spaces.
REM
REM Usage:
REM DellAlert {/SETUP | Alert message}
REM /SETUP Configure Dell Server Assistant to use this script for alerts.
REM Alert Message
REM Message to send.
REM
REM Requires:
REM Blat : (command line emailer) is configured and working on the current system.
REM If your email server requires authentication to relay, see comments below.
REM Email address(es) to send alerts to (comma separated)
SET ToEmail=myaddress@email.com
SETLOCAL EnableExtensions
IF /I {%1}=={/SETUP} GOTO Setup
IF NOT {%1}=={} GOTO Alert
GOTO End
:Alert
SET Log="%TEMP%DellAlert.txt"
DATE /T > %Log%
TIME /T >> %Log%
ECHO Dell Alert Tripped! >> %Log%
ECHO %* >> %Log%
REM If your email server requires autentication to relay,
REM add the following to the end of the line below:
REM -u UserName -pw Password
BLAT %Log% -to %ToEmail% -subject "%ComputerName% Hardware Alert"
IF EXIST %Log% DEL /F /Q %Log%
GOTO End
:Setup
ECHO This will replace all the current Dell Server Assistant alerts with a call
ECHO to this script. To confirm you want to continue, enter YES (case sensitive).
SET /P Confirm=
IF NOT {%Confirm%}=={YES} GOTO End
SET ScriptPath=%~dpnx0
ECHO Configuring alerts to use: %ScriptPath%
omconfig system alertaction event=powersupply execappath="%ScriptPath% power supply failure"
omconfig system alertaction event=powersupplywarn execappath="%ScriptPath% power supply warning"
omconfig system alertaction event=tempwarn execappath="%ScriptPath% temperature warning"
omconfig system alertaction event=tempfail execappath="%ScriptPath% temperature failure"
omconfig system alertaction event=fanwarn execappath="%ScriptPath% fan speed warning"
omconfig system alertaction event=fanfail execappath="%ScriptPath% fan speed failure"
omconfig system alertaction event=voltwarn execappath="%ScriptPath% voltage warning"
omconfig system alertaction event=voltfail execappath="%ScriptPath% voltage failure"
omconfig system alertaction event=intrusion execappath="%ScriptPath% chassis intrusion"
omconfig system alertaction event=redundegrad execappath="%ScriptPath% redundancy degraded"
omconfig system alertaction event=redunlost execappath="%ScriptPath% redundancy lost"
omconfig system alertaction event=memprefail execappath="%ScriptPath% memory pre-failure"
omconfig system alertaction event=memfail execappath="%ScriptPath% memory failure"
omconfig system alertaction event=hardwarelogwarn execappath="%ScriptPath% hardware log warning"
omconfig system alertaction event=hardwarelogfull execappath="%ScriptPath% hardware log full"
omconfig system alertaction event=processorwarn execappath="%ScriptPath% processor warning"
omconfig system alertaction event=processorfail execappath="%ScriptPath% processor failure"
omconfig system alertaction event=watchdogasr execappath="%ScriptPath% watchdog asr"
omconfig system alertaction event=batterywarn execappath="%ScriptPath% battery warning"
omconfig system alertaction event=batteryfail execappath="%ScriptPath% battery failure"
omconfig system alertaction event=systempowerwarn execappath="%ScriptPath% system power warning"
omconfig system alertaction event=systempowerfail execappath="%ScriptPath% system power failure"
omconfig system alertaction event=storagesyswarn execappath="%ScriptPath% storage system warning"
omconfig system alertaction event=storagesysfail execappath="%ScriptPath% storage system failure"
omconfig system alertaction event=storagectrlwarn execappath="%ScriptPath% storage controller warning"
omconfig system alertaction event=storagectrlfail execappath="%ScriptPath% storage controller failure"
omconfig system alertaction event=pdiskwarn execappath="%ScriptPath% physical disk warning"
omconfig system alertaction event=pdiskfail execappath="%ScriptPath% physical disk failure"
omconfig system alertaction event=vdiskwarn execappath="%ScriptPath% virtual disk warning"
omconfig system alertaction event=vdiskfail execappath="%ScriptPath% virtual disk failure"
omconfig system alertaction event=enclosurewarn execappath="%ScriptPath% enclosure warning"
omconfig system alertaction event=enclosurefail execappath="%ScriptPath% enclosure failure"
omconfig system alertaction event=storagectrlbatterywarn execappath="%ScriptPath% storage controller battery warning"
omconfig system alertaction event=storagectrlbatteryfail execappath="%ScriptPath% storage controller battery failure"
ECHO.
ECHO Sending sample alert to:
ECHO %ToEmail%
CALL :Alert Testing Dell hardware alert warnings...
ECHO.
PAUSE
GOTO End
:End
ENDLOCAL
脚本修改/维护 (Script Modifications/Maintenance)
The event alerts from the provided script are from one of our Dell servers. Depending on your Dell server hardware and Server Assistant version, the alerts may vary. Generally, you can tell when you run the setup script if an event is not valid for your server (for example, if you don’t have Dell RAID controllers) as some of the storage event creation items will fail.
提供的脚本中的事件警报来自我们的一台Dell服务器。 根据您的Dell服务器硬件和Server Assistant版本,警报可能会有所不同。 通常,由于某些存储事件创建项将失败,因此您可以告诉您运行设置脚本的时间是否对服务器无效(例如,如果您没有Dell RAID控制器)。
The event triggers in the script above were obtained by running the following from a command prompt:
上面脚本中的事件触发器是通过从命令提示符处运行以下命令获得的:
omconfig system alertaction /?
omconfig系统alertaction /?
This command lists all event keywords with a description of the respective alert. To add additional alerts, run the command above and add the missing entries to the setup portion of the script and then rerun the script with the /Setup switch.
该命令列出了所有事件关键字以及相应警报的描述。 要添加其他警报,请运行上面的命令,并将缺少的条目添加到脚本的设置部分,然后使用/ Setup开关重新运行脚本。
链接 (Links)
Download Dell Server Email Alert Script from SysadminGeek.com
从SysadminGeek.com下载Dell服务器电子邮件警报脚本
Download Blat Command Line Emailer
翻译自: https://www.howtogeek.com/50555/setup-email-notifications-for-dell-server-hardware-alerts/
dell服务器硬件检测