mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
Drop uptime binary call
No need to call /bin/uptime, since the string can be generated with strftime(...).
This commit is contained in:
parent
28f4d144f2
commit
37f9b45266
1 changed files with 1 additions and 1 deletions
|
|
@ -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. ";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue