summaryrefslogtreecommitdiffstats
path: root/lib/Nagios/Plugin/Functions.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r--lib/Nagios/Plugin/Functions.pm10
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
3package Nagios::Plugin::Functions; 4package Nagios::Plugin::Functions;
4 5
6use 5.006;
7
5use strict; 8use strict;
6use warnings; 9use warnings;
7use File::Basename; 10use 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