您好,登錄后才能下訂單哦!
icinga2通過check_hpasm監控HP服務器硬件報警:
https://labs.consol.de/nagios/check_hpasm/#download
注:該工具也可用來直接監控Windows系統,Windows服務器在安裝系統時默認會安裝hp-snmp-agents組件
被監控服務器需安裝hp-snmp-agents(及snmp)
# dpkg -i hp-snmp-agents_10.40-2909.34_amd64.deb
# /sbin/hpsnmpconfig
輸入y (即使用已有/etc/snmp/snmpd.conf配置)
如果報下面錯誤,解決辦法也簡單(不一定通用,我遇到的是這么好的),執行/sbin/hpsnmpconfig,然后選擇n,第1項隨便輸入2次一樣的密碼(commutiy那個),后面全默認回車,就好了
CRITICAL - snmpwalk returns no product name (cpqsinfo-mib), wrong device
redhat上可通過下面命令排錯:
# snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.232
# /etc/init.d/hp-snmp-agents status (確保是start狀態)
# 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="xxxxxxx"
vars.perf="--perfdata=short"
assign where host.address == "10.0.0.2" || host.address == "10.0.0.3"
}
:wq
# service icinga2 restart
也可借助被監控端的nrpe(不易受網絡影響)
Ubuntu:
# vi /etc/nagios/nrpe.cfg
command[check_hpubt]=/usr/lib/nagios/plugins/check_hpasm -H 127.0.0.1 -C public
:wq
# service nagios-nrpe-server restart
Redhat:
# vi /etc/nagios/nrpe.cfg
command[check_hpubt]=sudo /usr/lib64/nagios/plugins/check_hpasm -H 127.0.0.1 -C public
:wq
# service nrpe restart
# vi /etc/sudoers
nagios ALL=(ALL) NOPASSWD:/usr/lib64/nagios/plugins/*
#Defaults requiretty (默認未注釋)
:wq
監控端icinga2配置略
附:
-v:顯示服務器硬件詳細信息
--hpasmcli /sbin/hpasmcli 顯示硬盤健康情況
--snmpwalk /usr/bin/snmpwalk 結果同--hpasmcli
--blacklist daac 排除控制器加速器健康情況
https://labs.consol.de/nagios/check_hpasm/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。