首页 > 其他 > 详细

Nagios监控vmware-esxi5.0

时间:2014-03-06 17:38:37      阅读:503      评论:0      收藏:0      [点我收藏+]

Nagios监控vmware-esxi5.0

1.下载vSphere SDK for Perl

http://www.vmware.com/support/developer/viperltoolkit/index.html

解压,运行

export http_proxy=

export ftp_proxy=

./vmware-install.pl回车即可。

在安装sdk时,安装脚本使用cpan安装perl模块,会有一些perl模块安装不上,这些安装不上的模块,得手动使用cpan去安装,若还安装不上那么就用yum去安装,例如 UUID

error:installed manuallyfor use by vSphere CLI:

UUID 0.03 or newer

解决:

1yum install perl-SOAP-Lite perl-Data-Dumpperl-Class-MethodMaker perl-Crypt-SSLeay perl-libxml-perlperl-XML-LibXML-Common libuuid-devel  uuid-perl  -y


2perl -MCPAN -e‘install UUID‘

##

……In which directorydo you want to install the executable files?

[/usr/bin]

Please wait whilecopying vSphere CLI files...

The installation ofvSphere CLI 5.0.0 build-615831 for Linux completed

successfully. You candecide to remove this software from your system at any

time by invoking thefollowing command:

"/usr/bin/vmware-uninstall-vSphere-CLI.pl"……………..


有时因为网络的连通状况,还需要设置cpanurllist


#install Nagios::Plugin 使用 i/Implementation/方式查询;

yum install perl-CPAN

perl -MCPAN -e shell  

install YAML

install HTML::Parser

install URI

install Compress::Zlib

install Module::Runtime    //如果这里最后报错,重启下再insatll就成功了

reboot

install Module::Runtime  

install Module::Implementation

install Attribute::Handlers

install Params::Validate  

install Nagios::Plugin



2.然后下载监控插件http://exchange.nagios.org/directory/Plugins/Operating-Systems/*-Virtual-Environments/VMWare/Vmware-ESX-%26-VM-host/details

check_esx3.pl  记得给执行权限。

测试:/usr/local/nagios/libexec/check_esx3.pl –help   #显示帮助信息证明安装成功


Error:

[root@nagios libexec]#./check_esx3.pl  -H 10.168.0.109 -u root-p ‘w4n9w3i_!1‘ -l cpu

CHECK_ESX3.PL CRITICAL -Server version unavailable at ‘https://10.168.0.109:443/sdk/vimService.wsdl‘ at/usr/share/perl5/VMware/VICommon.pm line 545.

解决:修改check_esx3.pl脚本:添加参数

#!/usr/bin/perl -w

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;

#

# Nagios plugin to monitor vmware esxservers


测试:

[root@nagioslibexec]# ./check_esx3.pl  -H10.168.0.109 -u root -p ‘w4n9w3i_!1‘ -l cpu

CHECK_ESX3.PL OK -cpu usage=55.00 MHz (0.12%) | cpu_usagemhz=55.00Mhz;; cpu_usage=0.12%;;



本文出自 “袭浪” 博客,谢绝转载!

Nagios监控vmware-esxi5.0,布布扣,bubuko.com

Nagios监控vmware-esxi5.0

原文:http://chengcai.blog.51cto.com/728195/1369243

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!