Cheshire Cat Computing

Software support and information
It is currently Wed May 24, 2017 7:05 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 177 posts ]  Go to page 1, 2, 3, 4, 5 ... 18  Next
Author Message
PostPosted: Mon Sep 29, 2008 4:57 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
This plugin, for both MRTG and Nagios, uses the VMware VI API to query the virtualcentre (or individual ESX hosts) to obtain information. It can be somewhat resource intensive. You will need to install the Perl API packages (available from http://www.vmware.com) and also SOAP::Lite and Class::MethodMaker.

Use the --help option to get a full list of available options.

It has a --generate option to generate the MRTG (or Nagios) configuration files required.

Try setting a configfile with the necessary information, then:
Code:
check_vmware.pl --mode=mrtg --guest=guestname --config=configfile --generate
check_vmware.pl --mode=mrtg --cluster=clustername --config=configfile --generate


Examples:
Checking a particular guest CPU usage in MRTG
Code:
check_vmware.pl --config=vmconfig --report=cpu --mode=mrtg --guest=list
Checking all guest statuses in a cluster in Nagios and sending alerts via NSCA
Code:
check_vmware.pl --config=vmconfig --report=status --mode=nagios --nsca --nscastrip='.auckland.ac.nz' --nscaserver=nagios.auckland.ac.nz --tolower


Example configfile contents:
Code:
VI_PASSWORD=fjdkhfjksd
VI_SERVER=vcserver.auckland.ac.nz
VI_USERNAME=myusername


Attachments:
File comment: version 1.13
Now added net monitoring and version number reported correctly.

check_vmware.pl [67.08 KiB]
Downloaded 5379 times
File comment: version 0.12beta
check_vmware.pl [61.04 KiB]
Downloaded 1574 times
File comment: NRPE plugins for Linux and Windows to query vCPU and Memory via VMware Tools API
VMWare.zip [73.17 KiB]
Downloaded 3017 times

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11
Top
 Profile Send private message  
 
PostPosted: Mon Sep 29, 2008 5:07 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
Here are some example graphs, taken from MRTG


Attachments:
File comment: Farm datastores (total)
example-farm-datastores-graph.png
example-farm-datastores-graph.png [ 43.2 KiB | Viewed 63772 times ]
File comment: Guest CPU usage
example-guest-cpu-graph.png
example-guest-cpu-graph.png [ 54.4 KiB | Viewed 63768 times ]
File comment: Host resource usage
example-host-resources-graph.png
example-host-resources-graph.png [ 68.01 KiB | Viewed 63744 times ]

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11
Top
 Profile Send private message  
 
PostPosted: Thu Oct 02, 2008 8:16 pm 
Offline
User

Joined: Thu Oct 02, 2008 8:00 pm
Posts: 5
Location: Hamburg (Germany)
Hi Steve,

i installed the plugin & API on OpenSuSe 11 and it is working perfect! Currently i'm monitoring 4 ESX Hosts.

Are there any plans to report performance data to nagios?

Regards from Hamburg (Germany)

Dennis


Top
 Profile Send private message  
 
PostPosted: Fri Oct 03, 2008 10:59 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
Glad to hear its working!

The plugin already works with Nagios, and we're using it here.

Code:
define command {
       command_name check_vmware
       command_line check_vmware --mode=nagios --config=/usr/local/nagios/etc/vc.cfg --report=$ARG1$ $ARG2$
}


... and then, the configuration for the cluster. You can do similarly for hosts, guests, and datacentres of course.

Code:
define service {
    use                  generic-service
    host_name           virtualcentre
    service_description  VMWare: %OPTA% Status
    check_command        check_vmware!status!--cluster="cluster1"
    normal_check_interval   15
    retry_check_interval    5
    max_check_attempts  3

}
# Check host/cluster/datacenter memory
define service {
    use                  generic-service
    host_name            virtualcentre
    service_description  VMWare: clsuter1 Memory
    check_command        check_vmware!memory!--cluster="cluster1"
    normal_check_interval   5
    retry_check_interval    2
    max_check_attempts  4

}
# Check host/cluster/datacenter CPU
define service {
    use                  generic-service
    host_name            virtualcentre
    service_description  VMWare: cluster1 CPU
    check_command        check_vmware!cpu!--cluster="cluster1"
    normal_check_interval   5
    retry_check_interval    2
    max_check_attempts  4
}
# Check host/cluster/datacenter disk space
define service {
    use                  generic-service
    host_name            virtualcentre
    service_description  VMWare:  cluster1 Datastores
    check_command        check_vmware!disk!--cluster="clsuter1" --exclude="-swap-"
    normal_check_interval   60
    retry_check_interval    15
    max_check_attempts  2
}

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Mon Oct 13, 2008 11:02 am 
Offline
User

Joined: Mon Oct 13, 2008 11:00 am
Posts: 1
First let me say thank you for working on this plugin. I have been struggling to find a good solution to chart performance of ESX 3i hosts. I have currently been experimenting with unnoc and that is working ok but not quite how I want it to. I have one quick question on this plugin. Will it work with MRTG for windows?

Again many thanks.


Top
 Profile Send private message  
 
PostPosted: Tue Oct 14, 2008 5:34 am 
Offline
User

Joined: Tue Oct 14, 2008 5:30 am
Posts: 1
Hey Steve & elwappo,

Fair play on the work with this plugin.
I'm trying to configure it to query my ESX 3.5 hosts via my VC, but I keep getting a login failed error.

:/var/local/nagios/libexec# ./check_vmware.pl --guest guestname --password=mypasswd --username=myuser --debug --server=myserverip --verbose
Connecting
Login to VirtualCentre server failed.
UNKNOWN: Login to VirtualCentre server failed.

any quick pointers for me?
- I've already tested my connectivity and I do have sufficient privileges on the box in question.
- Nagios box has sufficient network routes/fw rules in place to talk to the VC.

Really appreciate it.
D.


Top
 Profile Send private message  
 
PostPosted: Tue Oct 14, 2008 9:50 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
This plugin should work the same with MRTG for windows; of course you'll need to get the Windows version of the VI API files.

The login failure may be due to specifying the username. If your username has a backstroke in it then you'll need to escape it. Maybe use a vmconfig file, specified with --config=filename and put the username and password in there, as in the example above? This can solve problems with unusual characters in the username and password.

Also, try using different usernames just in case it is a permissions issue (use one you know works via the virtualcentre client)

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Thu Oct 16, 2008 10:25 pm 
Offline
User

Joined: Thu Oct 16, 2008 10:19 pm
Posts: 1
Hello,

First, thank you for this plugin.

I configure your plugin but i have an error :

[libexec]# ./check_vmware.pl --username=****** --password=****** --server=10.165.13.8 --report=cpu
CPU usage at 12.35%<BR>(Problem retrieving CPU fairness data)

I try on other vmware but i have the same problem, and in NAGIOS I have no result.

Thanks


Top
 Profile Send private message  
 
PostPosted: Fri Oct 17, 2008 11:44 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
The 'problem retrieving fairness data' is currently normal - it happens on our VC servers, too. For some reason, although the VC can report this fairness data, and the counter exists in the object definition, it does not appear to be presented when the retrieval is run. I'm looking into this; however the other CPU and Memory checks work fine so lack of Fairness data is not a big issue.

The 'fairness data' is the per-ESX host indicator of what percentage of guest resources requested are actually provided. In a low-usage farm this would normally always be >95% - its the lower of the two DRS graphs. If you don't have DRS enabled, of course, you probably dont have this figure available :)

I'm currently working to get a persistent session established with this - the performance of the VI API sucks and with a lot of servers it puts an unacceptable load of login/logout on the VC.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Tue Oct 21, 2008 5:27 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3035
Location: Auckland, New Zealand
I now have a 'persistent session' versionof this plugin, which stops the constant login/logout on the VC. It is slightly faster, but not by much, as the majority of the time is taken up downloading the initial object tree. You need a nice, fast VC server (don't run your VC in a guest. I know VMware say you can, and it does work, but it is stupidly slow, not to mention the chicken-and-egg situation you get if all your ESX hosts go down)

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 177 posts ]  Go to page 1, 2, 3, 4, 5 ... 18  Next

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group