BaldMansMojo / check_vmware_esx

chech_vmware_esx Fork of check_vmware_api.pl
GNU General Public License v2.0
124 stars 67 forks source link

Bug fixes and improvements #57

Closed simonmeggle closed 9 years ago

simonmeggle commented 9 years ago

Fixed bug in host storage adapter whitelisting.

BaldMansMojo commented 9 years ago

Hi Simon,

57. I choosed --statelabels instead of --nostatelabels to avoid confusion with current users. I implemented not in the short version as your last commit because the other way is easier to read than printf "%s%s", $statelabel, $output;

--nostatelabels was not in help. Added --statelabels

Option --plugindirname was nonsense due to my fault. Copied the variable from another plugin where I needed temporary files. In this plugin it was only used for the session files and could be overwirtten by --sessionfiledir :-( . I corrected it and enhenced it with your additions for OMD and the directory test.

All other is done. See comments on issues. Please test it. I have tested it but it's late in the night.

Best regards Martin

sni commented 9 years ago

Thats quite unusual, i would use statelabels by default. Thats what 99% of the plugins do and i'd say this is what people would expect from a plugin.

BaldMansMojo commented 9 years ago

Hi Sven, ok - rewritten. Instead of --statelabels of --nostatelabels I use now a default in $statelabels_def which is set to y. It can be overwritten with --statelabels=y/n. Folks like me can set set $statelabels_def to n and don't have to struggle with the "unneccessary" string. So the recommendations of the guidlines are fulfilled by default but can be changed permanently or on a on demand basis. I think this satisfies all.

As an extra little benefit I don't use a simple string comparision in if (is it y or n). I use a regex case insensitive match for the first letter of the string. This avoids typos. So y is equal to "Yeshergottverdammichnochmal".

Regards Martin

sni commented 9 years ago

sounds good, thanks :-)