[Nagios::]Monitoring::Plugin::Getopt bug + fix

Brandon Peirce BPeirce at isabel.eu
Wed Jul 25 18:47:47 CEST 2018


Named arguments sometimes* don't work if label is supplied in
Nagios::Monitoring::Plugin-0.51 | Monitoring::Plugin-0.39.

* Sometimes it works, sometimes not.  Non-deterministic, depends on internal Perl ordering of hash members...


I have tried to make this fix fork-agnostic.  It should, with the right patch options, apply to both with some offset.


--- a/xxx/Plugin/Getopt.pm
+++ b/xxx/Plugin/Getopt.pm
@@ -399,7 +399,7 @@
  my %args;

  # Named args
-  if ($_[0] =~ m/^(spec|help|required|default)$/ && scalar(@_) % 2 == 0) {
+  if ($_[0] =~ m/^(spec|help|required|label|default)$/ && scalar(@_) % 2 == 0) {
    %args = validate( @_, {
      spec => 1,
      help => 1,





Regards,

Brandon Peirce






Brandon Peirce

Monitoring & Health Engineer Sr.
BPeirce at isabel.eu<mailto:BPeirce at isabel.eu>
t. +32 2 4031 875
m.+32 472 54 51 64

Isabel NV/SA
Keizerinlaan 13-15 Bld de l'Impératrice
1000 Brussels
Belgium
t. +32 2 5451 711
f. +32 2 5451 719
www.isabel.eu<http://www.isabel.eu>
www.isabelgroup.eu<http://www.isabelgroup.eu>

[cid:image2baa0c.PNG at 267a5f7b.4e9a7c61]<http://www.isabel.eu>

[cid:imagea47fb0.PNG at 3db357b8.48b8d382]


Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee, you should not further read, disclose, distribute, copy or use this e-mail or its contents, immediately notify the sender by reply to this e-mail and delete this message as well as any attachments without retaining a copy. The entire email disclaimer of Isabel NV/SA<http://www.isabel.eu/en/forbusiness/support6/disclaimer/email.html>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20180725/53904a57/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image2baa0c.PNG
Type: image/png
Size: 4000 bytes
Desc: image2baa0c.PNG
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20180725/53904a57/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imagea47fb0.PNG
Type: image/png
Size: 4424 bytes
Desc: imagea47fb0.PNG
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20180725/53904a57/attachment-0001.png>


More information about the Devel mailing list