diff options
author | Bernd Arnold <wopfel@gmail.com> | 2018-06-17 09:36:13 +0200 |
---|---|---|
committer | Bernd Arnold <wopfel@gmail.com> | 2018-06-17 09:36:13 +0200 |
commit | 37f9b45266acfeb45157d3c27a65979b33c57df7 (patch) | |
tree | 87e84bfbbe785fdabe1816a068f588e6ad11fc25 /plugins-scripts/check_uptime.pl | |
parent | 28f4d144f286e115eb2502c6c9e130d26eaba441 (diff) | |
download | monitoring-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-x | plugins-scripts/check_uptime.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl index 0a13cc0e..ed859ab3 100755 --- a/plugins-scripts/check_uptime.pl +++ b/plugins-scripts/check_uptime.pl @@ -143,7 +143,7 @@ $msg .= "uptime is $uptime_seconds seconds. "; $msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text; $msg .= "Running for $pretty_uptime. " if $opt_f; if ( $opt_s ) { - chomp( my $up_since = `uptime -s` ); + my $up_since = strftime( "%Y-%m-%d %H:%M:%S", localtime( time - $uptime_seconds ) ); $msg .= "Running since $up_since. "; } |