icinga2通过check_hpasm监控HP服务器硬件报警:
https://labs.consol.de/nagios/check_hpasm/#download
被监控服务器需安装hp-snmp-agents
# dpkg -i hp-snmp-agents_10.40-2909.34_amd64.deb
# /sbin/hpsnmpconfig
输入y (即使用已有/etc/snmp/snmpd.conf配置)
# tar zxfv check_hpasm-4.7.5.4.tar.gz
# cd check_hpasm-4.7.5.4
# ./configure
# make
# make install
# cp -rv /usr/local/nagios/libexec/check_hpasm /usr/lib64/nagios/plugins/
# /usr/lib64/nagios/plugins/check_hpasm -H 10.0.0.3 -C public --perfdata=short
配置icinga2
# vi /etc/icinga2/conf.d/templates.conf
object CheckCommand "HP" {
import "plugin-check-command"
command = [ PluginDir + "/check_hpasm" ]
arguments = {
"-H" = "$address$"
"-C" = "$snmp$"
"--perfdata" = "$perf$"
}
}
:wq
# vi /etc/icinga2/conf.d/services.conf
apply Service "HP" {
import "generic-service"
check_command = "HP"
vars.snmp="SPD.ubuntusrv#989"
vars.perf="--perfdata=short"
assign where host.address == "10.29.1.52" || host.address == "10.29.1.53"
}
:wq
# service icinga2 restart