您好,登錄后才能下訂單哦!
icinga2通過(guò)check_hpasm監(jiān)控HP服務(wù)器硬件報(bào)警:
https://labs.consol.de/nagios/check_hpasm/#download
注:該工具也可用來(lái)直接監(jiān)控Windows系統(tǒng),Windows服務(wù)器在安裝系統(tǒng)時(shí)默認(rèn)會(huì)安裝hp-snmp-agents組件
被監(jiān)控服務(wù)器需安裝hp-snmp-agents(及snmp)
# dpkg -i hp-snmp-agents_10.40-2909.34_amd64.deb
# /sbin/hpsnmpconfig
輸入y (即使用已有/etc/snmp/snmpd.conf配置)
如果報(bào)下面錯(cuò)誤,解決辦法也簡(jiǎn)單(不一定通用,我遇到的是這么好的),執(zhí)行/sbin/hpsnmpconfig,然后選擇n,第1項(xiàng)隨便輸入2次一樣的密碼(commutiy那個(gè)),后面全默認(rèn)回車(chē),就好了
CRITICAL - snmpwalk returns no product name (cpqsinfo-mib), wrong device
redhat上可通過(guò)下面命令排錯(cuò):
# snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.232
# /etc/init.d/hp-snmp-agents status (確保是start狀態(tài))
# 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
也可借助被監(jiān)控端的nrpe(不易受網(wǎng)絡(luò)影響)
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 (默認(rèn)未注釋?zhuān)?/p>
:wq
監(jiān)控端icinga2配置略
附:
-v:顯示服務(wù)器硬件詳細(xì)信息
--hpasmcli /sbin/hpasmcli 顯示硬盤(pán)健康情況
--snmpwalk /usr/bin/snmpwalk 結(jié)果同--hpasmcli
--blacklist daac 排除控制器加速器健康情況
https://labs.consol.de/nagios/check_hpasm/
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。