When adding VMWare checking to opsview, I was pleased to find that there
are already plugins included with the package.  Additionally, they
profess to have a feature that allows you to list all the possible ESX
servers on the commandline, and the script will find the vm guest on the
right host.

Unfortunately, there looks to be a scoping bug that clobbers the list of
guests on each vmhost pass.  Here's a quick patch for one of the scripts 
to demonstrate the problem:

--- check_snmp_vmware_cpu.orig  2009-05-08 08:56:39.000000000 -0400
+++ check_snmp_vmware_cpu       2009-05-08 08:55:22.000000000 -0400
@@ -232,10 +232,10 @@
     foreach $hostname (@hostnames) {
         next if ( create_snmp_session($hostname) > 0 );
 
-        $response = $s->get_table($oid_namebase);
-        next if !defined($response);
+        my $names = $s->get_table($oid_namebase);
+        next if !defined($names);
 
-        %$response = reverse %$response;
+        %$response = ($response ? %$response : (), reverse %$names);
 
         my ($vmname) = grep( /^$name$/i, keys(%$response) );
         if ($vmname) {


-j

-- 
Jason Lavoie
Ratvarre sbe uver
[email protected]
_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/listinfo/opsview-users

Reply via email to