nagios監(jiān)控vsphere ESXi主機硬件狀態(tài)(CPU風扇、電源模塊、硬盤、溫度)
讓客戶滿意是我們工作的目標,不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:申請域名、網(wǎng)站空間、營銷軟件、網(wǎng)站建設(shè)、朝陽縣網(wǎng)站維護、網(wǎng)站推廣。
esxi 的只讀賬戶和密碼(本文以chkhardware/chkreadonly為例)
插架下載地址,此地址附有相關(guān)說明:http://www.claudiokuenzler.com/nagios-plugins/check_esxi_hardware.php
ESXI主機:DELL R410
ESXI版本:ESXI4.0
配置
1)check_esxi_hardware.py 復制到nagios插件目錄/usr/local/nagios/libexec
2)command.cfg
要實現(xiàn)如下的效果: -U 用戶名 -P 密碼
check_esxi_hardware.py -H 192.168.0.130 -U chkhardware -P chkreadonly -V dell
下面這是根據(jù)模板,按照實際環(huán)境添加的內(nèi)容:commands.cfg
# 'check_esxi_hardware' command definition chkhardware/chkreadonly
define command{
command_name check_esxi_hardware
command_line $USER1$/check_esxi_hardware.py -H $HOSTADDRESS$ -U $ARG1$ -P $ARG2$ -t $ARG3$ -V $ARG4$
}
增加監(jiān)控主機,在主機配置文件中
# chkhardware/chkreadonly
define service{
use remote-service
host_name vsphere.0.xxx
service_description check_esxi_hardware
check_command check_esxi_hardware!chkhardware!chkreadonly!500!dell
}
新建一只讀帳號,進行測試
# /root/check_esxi_hardware.py -H 192.168.0.130 -U chkhardware -P chkreadonly -V dell
OK - Server: Dell Inc. PowerEdge R410 s/n: 2FPTV2X System BIOS: 1.3.9 2010-04-07
這個腳本用到了PyWEEM模塊,如果機器上沒有,需要安裝的:
PyWEEM模塊主頁:http://pywbem.sourceforge.net/
# wget http://downloads.sourceforge.net/project/pywbem/pywbem/pywbem-0.7/pywbem-0.7.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpywbem%2Ffiles%2Fpywbem%2F&ts=1299742557&use_mirror=voxel
# tar -xvzf pywbem-0.7.0.tar.gz
# cd pywbem-0.7.0
# python setup.py build
# python setup.py install
####
參考文檔:
http://www.claudiokuenzler.com/nagios-plugins/check_esxi_hardware.php#PasswordFile
http://blog.163.com/x_b_xuebi/blog/static/59649492201135102817844/