summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_uptime.pl
diff options
context:
space:
mode:
authorBernd Arnold <wopfel@gmail.com>2018-06-09 10:02:23 +0200
committerBernd Arnold <wopfel@gmail.com>2018-06-09 10:02:23 +0200
commit5a73671ec6299c480c90ec5b9f0f3d58397fbcfb (patch)
treef1bc8f4118f95b36d45ff3983282e40f16c62ea0 /plugins-scripts/check_uptime.pl
parent554b702f9d65fdfe640f20633543e00cd79d64ac (diff)
downloadmonitoring-plugins-5a73671ec6299c480c90ec5b9f0f3d58397fbcfb.tar.gz
Fix: Initialize values
Otherwise, there's a warning about unitialized values: Use of uninitialized value $hours in numeric gt (>) at ... Use of uninitialized value $days in numeric gt (>) at ...
Diffstat (limited to 'plugins-scripts/check_uptime.pl')
-rwxr-xr-xplugins-scripts/check_uptime.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
index 27dc93ff..20234c88 100755
--- a/plugins-scripts/check_uptime.pl
+++ b/plugins-scripts/check_uptime.pl
@@ -85,6 +85,7 @@ if ( $uptime_seconds !~ /^\d+$/ ) {
85 85
86my ( $secs, $mins, $hours, $days, $weeks ); 86my ( $secs, $mins, $hours, $days, $weeks );
87$secs = $uptime_seconds; 87$secs = $uptime_seconds;
88$mins = $hours = $days = $weeks = 0;
88if ( $secs > 100 ) { 89if ( $secs > 100 ) {
89 $mins = int( $secs / 60 ); 90 $mins = int( $secs / 60 );
90 $secs -= $mins * 60; 91 $secs -= $mins * 60;