您好,登錄后才能下訂單哦!
nagios監控vsphere ESXi主機硬件狀態(CPU風扇、電源模塊、硬盤、溫度)
esxi 的只讀賬戶和密碼(本文以chkhardware/chkreadonly為例)
插架下載地址,此地址附有相關說明: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
要實現如下的效果: -U 用戶名 -P 密碼
check_esxi_hardware.py -H 192.168.0.130 -U chkhardware -P chkreadonly -V dell
下面這是根據模板,按照實際環境添加的內容: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$
}
增加監控主機,在主機配置文件中
# 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/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。