aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_uptime.pl
diff options
context:
space:
mode:
authorGravatar Bernd Arnold <wopfel@gmail.com> 2018-06-03 20:55:42 +0200
committerGravatar Bernd Arnold <wopfel@gmail.com> 2018-06-03 20:55:42 +0200
commit554b702f9d65fdfe640f20633543e00cd79d64ac (patch)
tree1456d78a49af011a3fb3db940f804e23333f9b70 /plugins-scripts/check_uptime.pl
parent250adb31ef1849adea8b3bd7f66e92df1bbdd431 (diff)
downloadmonitoring-plugins-554b702f9d65fdfe640f20633543e00cd79d64ac.tar.gz
Fix: uptime_file variable was declared too late
When called with --help, the following error was shown: Use of uninitialized value $uptime_file in concatenation (.) or string at
Diffstat (limited to 'plugins-scripts/check_uptime.pl')
-rwxr-xr-xplugins-scripts/check_uptime.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
index 8c1f3d20..27dc93ff 100755
--- a/plugins-scripts/check_uptime.pl
+++ b/plugins-scripts/check_uptime.pl
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!/usr/bin/perl -w
# check_uptime - check uptime to see how long the system is running.
#
@@ -41,6 +41,8 @@ $ENV{'ENV'}='';
$PROGNAME = "check_uptime";
$state = $ERRORS{'UNKNOWN'};
+my $uptime_file = "/proc/uptime";
+
# Process arguments
@@ -54,8 +56,6 @@ if ($status){
# Get uptime info from file
-my $uptime_file = "/proc/uptime";
-
if ( ! -r $uptime_file ) {
print "ERROR: file '$uptime_file' is not readable\n";
exit $ERRORS{"UNKNOWN"};