驱动器出现故障时,如何让我的HP服务器向我发送电子邮件?

理想情况下,尽可能简单的安装,而不需要重新启动服务器。 主要是DL380 G5的,如果有帮助。 谢谢。

这稍微取决于您在服务器上运行的操作系统,但通常可以从HP ProLiant服务器和Smart Array RAID控制器获取警报。

此处列出了您的DL380 G5系统的完整驱动程序和软件支持列表。

SNMP和监控解决scheme是最好的方法……但是,您可以使用一些惠普的工具进行扩展。 惠普提供了HP Systems Insight Manager ,可以下载并随服务器一起提供。 这对服务器的集合是理想的。 如果您在不build立pipe理或监视基础架构的情况下查找一次性警报,则只需安装HP Management Agents (又名ProLiant支持工具包 )即可。

对于独立的Linux系统,我会让代理通过电子邮件发送陷阱。 我通常会使用默认configuration或自定义捆绑configuration支持包,然后编辑/opt/hp/hp-snmp-agents/cma.conf并更改trapemail行以指向收件人地址:

 ######################################################################## # trapemail is used for configuring email command(s) which will be # executed whenever a SNMP trap is generated. # Multiple trapemail lines are allowed. # Note: any command that reads standard input can be used. For example: # trapemail /usr/bin/logger # will log trap messages into system log (/var/log/messages). ######################################################################## trapemail /bin/mail -s 'HP Insight Management Agents Trap Alarm' [email protected] 

如果您正在运行Linux并且不想安装完整的HPpipe理套件,则可以使用cciss_vol_status实用程序开发脚本来查询控制器/磁盘状态。 另请参阅: 在OpenFiler上安装HP代理

查看HP Insight Manager

http://www.hp.com/go/hpsim

我相信它应该与您的服务器

我使用了@ewwite在他的回答中提到的轻量级程序: cciss_vol_status

如果您按照随附的INSTALL说明操作,则该脚本将放置在/usr/local/bin/cciss_vol_status

这是一个包装脚本,用于grep cciss_vol_status的输出,如果任何数组的状态为FAILED,则发送一封电子邮件。

 #!/bin/bash # # Check status of RAID volumes on HP Smart Array controllers. Send an email # alert if any volumes have a FAILED status. # status=`/usr/local/bin/cciss_vol_status /dev/sd*` # email lock file lockfile=/tmp/raid.check.hp.smartarray.lock # how often to send an email (minutes) _notification_freq=59 _host=`hostname` # To: email _toemail=root # create email lock file [ ! -f ${lockfile} ] && /bin/touch ${lockfile} if echo $status | grep -q FAILED then # make sure we haven't sent a notification in the last X minutes if test `find ${lockfile} -mmin +${_notification_freq}` then echo -e "${status}" | /bin/mail -s "System Alert! RAID failure on ${_host}" ${_toemail} # update lock file mod time /bin/touch ${lockfile} fi fi 

在cron中调用上面的脚本。 我每隔两分钟运行一次支票:

 */2 * * * * /usr/local/bin/raid.check.hp.smartarray.sh 

我们确实使用HP System Insight Manager来检查我们的惠普是否已经正常运行,但除此之外没有任何其他信息。 我发现Linux代理对我们来说太过分了,因为我们有其他监控解决scheme,所以上面这个脚本很好地服务于它的具体目的。

UPDATE

只是一个故障排除提示,如果你碰到这种情况。 这个脚本今天早上被certificate是有帮助的,

caching达到了脏限制

该设备是只读的,在/proc/partitions不可见。 我重新启动服务器,并在启动时看到这些消息:

逻辑驱动器由于可能的数据丢失而被禁用。 select“F1”继续禁用逻辑驱动器select“F2”接受数据丢失并重新启用逻辑驱动器(s)

我selectF2和RAID是好的,并安装在启动。

安装smartmontools。 在驱动器之前邮寄失败。

看看这个脚本 ,使用cli来检查raid状态。 稍微改动一下,在第八代Proliant上的Debian环境下,它对我来说工作得很好。