mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-23 02:43:02 -04:00
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
This commit is contained in:
parent
250adb31ef
commit
554b702f9d
1 changed files with 3 additions and 3 deletions
|
|
@ -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"};
|
||||
|
|
|
|||
Loading…
Reference in a new issue