Nagios 监控服务器的RAID磁盘阵列状态
好多重要的服务器都使用了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块磁盘 容量和状态
推荐阅读:
Nagios 的详细介绍:请点这里
Nagios 的下载地址:请点这里