[monitoring-plugin-perl] Update Getopt.pm

Paul Dugas <[email protected]>
Newsgroups gmane.network.nagios.cvs
Message-ID <[email protected]>
 Module: monitoring-plugin-perl
 Branch: master
 Commit: 9fb9fd53f22fe8b806909b4d5cff83e493e72ab4
 Author: Paul Dugas <[email protected]>
   Date: Wed Apr 20 11:36:23 2016 -0400
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=9fb9fd5

Update Getopt.pm

Allow hypen or underscore in plugin name.

---

 lib/Monitoring/Plugin/Getopt.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm
index 19ad7fe..9e68301 100644
--- a/lib/Monitoring/Plugin/Getopt.pm
+++ b/lib/Monitoring/Plugin/Getopt.pm
@@ -445,7 +445,7 @@ sub getopts
   # Setup default alarm handler for alarm($ng->timeout) in plugin
   $SIG{ALRM} = sub {
     my $plugin = uc $self->{_attr}->{plugin};
-    $plugin =~ s/^CHECK_//;
+    $plugin =~ s/^CHECK[-_]//;
     $self->_die(
       sprintf("%s UNKNOWN - plugin timed out (timeout %ss)",
         $plugin, $self->timeout));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.