summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_uptime.pl
diff options
context:
space:
mode:
authorBernd Arnold <wopfel@gmail.com>2018-06-17 07:36:13 (GMT)
committerBernd Arnold <wopfel@gmail.com>2018-06-17 07:36:13 (GMT)
commit37f9b45266acfeb45157d3c27a65979b33c57df7 (patch)
tree87e84bfbbe785fdabe1816a068f588e6ad11fc25 /plugins-scripts/check_uptime.pl
parent28f4d144f286e115eb2502c6c9e130d26eaba441 (diff)
downloadmonitoring-plugins-37f9b45266acfeb45157d3c27a65979b33c57df7.tar.gz
Drop uptime binary call
No need to call /bin/uptime, since the string can be generated with strftime(...).
Diffstat (limited to 'plugins-scripts/check_uptime.pl')
-rwxr-xr-xplugins-scripts/check_uptime.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
index 0a13cc0..ed859ab 100755
--- a/plugins-scripts/check_uptime.pl
+++ b/plugins-scripts/check_uptime.pl
@@ -143,7 +143,7 @@ $msg .= "uptime is $uptime_seconds seconds. ";
143$msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text; 143$msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text;
144$msg .= "Running for $pretty_uptime. " if $opt_f; 144$msg .= "Running for $pretty_uptime. " if $opt_f;
145if ( $opt_s ) { 145if ( $opt_s ) {
146 chomp( my $up_since = `uptime -s` ); 146 my $up_since = strftime( "%Y-%m-%d %H:%M:%S", localtime( time - $uptime_seconds ) );
147 $msg .= "Running since $up_since. "; 147 $msg .= "Running since $up_since. ";
148} 148}
149 149