diff options
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r-- | lib/Nagios/Plugin/Functions.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm index 9cb7eb6..804661c 100644 --- a/lib/Nagios/Plugin/Functions.pm +++ b/lib/Nagios/Plugin/Functions.pm | |||
@@ -1,7 +1,10 @@ | |||
1 | # This module holds all exported variables | 1 | # Functional interface to basic Nagios::Plugin constants, exports, |
2 | # and base functions | 2 | # and functions |
3 | |||
3 | package Nagios::Plugin::Functions; | 4 | package Nagios::Plugin::Functions; |
4 | 5 | ||
6 | use 5.006; | ||
7 | |||
5 | use strict; | 8 | use strict; |
6 | use warnings; | 9 | use warnings; |
7 | use File::Basename; | 10 | use File::Basename; |
@@ -47,7 +50,8 @@ sub get_shortname { | |||
47 | return $arg{plugin}->shortname if $arg{plugin}; | 50 | return $arg{plugin}->shortname if $arg{plugin}; |
48 | 51 | ||
49 | my $shortname = uc basename($ENV{NAGIOS_PLUGIN} || $0); | 52 | my $shortname = uc basename($ENV{NAGIOS_PLUGIN} || $0); |
50 | $shortname =~ s/^CHECK_//; | 53 | $shortname =~ s/^CHECK_//; # Remove any leading CHECK_ |
54 | $shortname =~ s/\..*$//; # Remove any trailing suffix | ||
51 | return $shortname; | 55 | return $shortname; |
52 | } | 56 | } |
53 | 57 | ||