Page 1 of 1
Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 11:51 am
by TSCAdmin
While going through the VMware wizard, I ran into a couple problems created by "invalid characters" in the name of the virtual machine guest.
Example guest name (which is perfectly valid in VMware):
The problems that occur are:
1) When the guest name is used as part of the service description, it generates an error (due to the parens)
2) When the check_esx3.pl script is executed, it fails with an error (again, due to the parens)
Recommendations:
1) In the guest name portion of the service description, do a character translation of invalid characters for nagios
2) In the check script, wrap the guest name in double quotes
Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 1:32 pm
by mmestnik
Thank you for bringing this up. It's getting done.
Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 1:46 pm
by mmestnik
Though keep in mind that say, "a(" and "a)" could both exist on VMWare, but then not in Nagios. A better example would be accents on an 'a'.
We would fix one bug to create another.
Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 1:58 pm
by mmestnik
I remember now, you can change the check description and in the background(though it dosen't show in the interface) the VM name is still keept. As for the check command I'm pushing a fix for that, as you suggested, and I'll add a test that will send a error if the service name has not been changed.
As for automagically changing the names to support that I'd have to change the interface to include the real names and that means line wrapping something. I'll look into it.
Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 2:08 pm
by mmestnik
You can be the first to try this out, the php will run is about all I tested. Reverting would be as easy as uploading a "?working?" wizard.
Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 2:25 pm
by TSCAdmin
True enough ... I haven't tested the check_esx3.pl script to verify it works with the single quotes for explicit strings, so obviously that should probably be a first step. I did test the double quotes, which fixed my particular issue.

Re: Recommendation for VMware Wizard bug
Posted: Thu Jul 22, 2010 2:46 pm
by TSCAdmin
Single quotes do work ... easiest way to apply the fix is via the templates file for new installations.
vmware/templates/vmware.cfg
Code: Select all
--- vmware.cfg 2010-05-27 13:10:42.000000000 -0400
+++ vmware.cfg 2010-07-22 15:36:50.000000000 -0400
@@ -30,6 +30,6 @@
# '' command definition
define command{
command_name check_esx3_guest
- command_line $USER1$/check_esx3.pl -H $HOSTADDRESS$ -f $ARG1$ -N $ARG2$ -l $ARG3$$ARG4$
+ command_line $USER1$/check_esx3.pl -H $HOSTADDRESS$ -f $ARG1$ -N '$ARG2$' -l $ARG3$$ARG4$
}
Re: Recommendation for VMware Wizard bug
Posted: Mon Jul 26, 2010 9:38 am
by mmestnik
What's the rational behind using single quotes VS double? I know single quotes will allow more, in some cases, strings to match. I did double assuming ppl would do things like "Mike's SNMP trap test" Instead of 'This box is a "down".'.
I'm fine with installations changing this to taste, but I may be persuaded to change the default.