Tag Archives: hdd

nagios hdd smart

Client side

aptitude install nagios-nrpe-server nagios-plugins-basic smartmontools

# netstat -an | grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN

edit /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,195.43.68.2

dont_blame_nrpe=1

command[check_smart]=/usr/lib/nagios/plugins/check_smart -t -d $ARG1$

/etc/init.d/nagios-nrpe-server restart

wget -P /usr/lib/nagios/plugins/ http://dl.dropbox.com/u/5742349/check_smart

chmod +x /usr/lib/nagios/plugins/check_smart

echo «nagios ALL=(ALL) NOPASSWD:/usr/sbin/smartctl» >> /etc/sudoers

 

Server side

edit /etc/nagios3/conf.d/group.cfg

define hostgroup{
hostgroup_name          check_lnx_smart0
alias Linux S.M.A.R.T TEST Disk 0
members server1,server2,server3
}
define hostgroup{
hostgroup_name          check_lnx_smart1
alias Linux S.M.A.R.T TEST Disk 1
members server1,server3
}

 

edit /etc/nagios3/conf.d/services.cfg

define service{
use                     generic-service
hostgroup_name          check_lnx_smart0
service_description     Linux SMART Disk sda
check_command           check_nrpe_smart!/dev/sda
check_interval          720
}

define service{
use                     generic-service
hostgroup_name          check_lnx_smart1
service_description     Linux SMART Disk sdb
check_command           check_nrpe_smart!/dev/sdb
check_interval          720
}

/etc/init.d/nagios3 reload