icinga2通過check_hpasm監控HP服務器硬件報警
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
本文出自 “linux” 博客,請務必保留此出處http://yangzhiming.blog.51cto.com/4849999/1943582
icinga2通過check_hpasm監控HP服務器硬件報警