Nagios监控ESXI主机系统、硬件(2)

pywbem模块没有安装,安装python的第三方模块
?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpywbem%2Ffiles%2Fpywbem%2F&ts=1299742557&use_mirror=voxel
1234567 [root@nagioslibexec]# wget 
 [root@nagioslibexec]# tar -zxvf  pywbem-0.7.0.tar.gz
 [root@nagioslibexec]# cd pywbem-0.7.0
 [root@nagioslibexec]# python setup.py build
 [root@nagioslibexec]# python setup.py install --record files.txt
 [root@nagioslibexec]# ./check_esxi_hardware.py -H 10.10.2.233-U nagios -P nagios -V dell
 OK - Server: Dell Inc. PowerEdge R610 s/n: XXXXXX System BIOS: XXXXXXXXXXX

如果使用pywbem-0.8.0版本可能导致我们的插件无法使用,python setup.py install --record files.txt 记录安装目录的目的就是为了方便卸载插件,cat files.txt | xargs rm -rf

使用check_esx3.pl和check_esxi_hardware.py都只需要在Esxi主机上建立只读的用户名和密码即可。使用./check——esx3.pl -helo和check_esxi_hardware.py -help可以查看插件使用语法,
[root@localhost libexec]# ./check_esxi_hardware.py  -help
Usage: check_esxi_hardware.py  https://hostname user password system [verbose]
example: check_esxi_hardware.py https://my-shiny-new-vmware-server root fakepassword dell
 
or, using new style options:
 
usage: check_esxi_hardware.py -H hostname -U username -P password [-V system -v -p -I XX]
example: check_esxi_hardware.py -H my-shiny-new-vmware-server -U root -P fakepassword -V auto -I uk
 
or, verbosely:
 
usage: check_esxi_hardware.py --host=hostname --user=username --pass=password [--vendor=system --verbose --perfdata --html=XX]
 
 
Options:
  --version            show program's version number and exit
  -h, --help            show this help message and exit
 
  Mandatory parameters:
    -H HOST, --host=HOST
                        report on HOST
    -U USER, --user=USER
                        user to connect as
    -P PASS, --pass=PASS
                        password, if password matches file:<path>, first line
                        of given file will be used as password
 
  Optional parameters:
    -V VENDOR, --vendor=VENDOR
                        Vendor code: auto, dell, hp, ibm, intel, or unknown
                        (default)
    -v, --verbose      print status messages to stdout (default is to be
                        quiet)
    -p, --perfdata      collect performance data for pnp4nagios (default is
                        not to)
    -I XX, --html=XX    generate html links for country XX (default is not to)
    -t TIMEOUT, --timeout=TIMEOUT
                        timeout in seconds - no effect on Windows (default =
                        no timeout)     
                        comma-separated list of elements to ignore
    --no-power          don't collect power performance data
    --no-volts          don't collect voltage performance data
    --no-current        don't collect current performance data
    --no-temp          don't collect temperature performance data
    --no-fan            don't collect fan performance data
[root@localhost libexec]#

给Esxi主机设置只读用户
1)先登录Esxi主机,在“本地用户和组”标签中,空白处右键“添加”,即可添加用户。

Nagios监控ESXI主机系统、硬件

如果是esxi6.0以上 需要修改下密码复杂度,需要修改security中密码的值为 retry=3 min=8,8,8,7,6

1、登录ESXi Host后,执行如下命令:
#vi /etc/pam.d/passwd

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/bcdc0b42e2f951bbe13c86fb7418ecab.html