好多重要的服务器都使用了RAID阵列来提高气硬件的冗余,保护数据的绝对安全,尤其是数据库使用的更加广泛。然而有的时候磁盘阵列组中的某些磁盘可能由于某些原因导致掉线,会使系统出现异常,所以对其进行监控是很必要的,文章就是介绍如何进行监控
其实很简单的啦:)
安装脚本: 需要做一个web服务器作为软件下载使用,如果多台机器的话,直接执行就OK了
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wget http://192.168.1.100/Lib_Utils-1.00-08.noarch.rpm
wget http://192.168.1.100/MegaCli-8.00.40-1.i386.rpm
wget http://192.168.1.100/check_raid_info.sh
/bin/rpm -ivh MegaCli-8.00.40-1.i386.rpm Lib_Utils-1.00-08.noarch.rpm
/usr/bin/killall nrpe
/bin/cp -av check_raid_info.sh /usr/local/nagios/libexec/
echo "command[check_raid_info]=/usr/local/nagios/libexec/check_raid_info.sh" >>/usr/local/nagios/etc/nrpe.cfg
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
/bin/chmod a+rx /usr/local/nagios/libexec/*
/bin/sed -i 's/require/!require/' /etc/sudoers
/bin/echo "nagios ALL= (ALL) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64" >>/etc/sudoers
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
然后需要在nagios的服务器上添加对应的监控配置片段:
define service{
use generic-service ; Name of service template to use
host_name DB_service
service_description Raid Array Info
check_command check_nrpe!check_raid_info
check_interval 30
}
这个配置将检查间隔设置成30分钟检测一次
完成之后检测nangios配置无误,重启服务
web界面的显示效果如下:
可以很明显看出阵列类型是RAID10 4块磁盘 容量和状态。
附件:http://down.51cto.com/data/2363772
本文转自andylhz 51CTO博客,原文链接:http://blog.51cto.com/andylhz2009/1329154,如需转载请自行联系原作者