首页 > 代码库 > icinga2通过check_hpasm监控HP服务器硬件报警

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=http://www.mamicode.com/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=http://www.mamicode.com/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服务器硬件报警