check_systemd_service: handle nfs mounts
This commit is contained in:
parent
2055e4161e
commit
0eab3624e8
|
@ -77,18 +77,23 @@ current_time=$(date +%s)
|
||||||
start_time_diff_perf=""
|
start_time_diff_perf=""
|
||||||
end_time_diff_perf=""
|
end_time_diff_perf=""
|
||||||
|
|
||||||
if [ -n "$start_time" ] && [ "$start_time" != "n/a" ]; then
|
start_time_str=""
|
||||||
|
if [ -n "$start_time" ] && [ "$start_time" != "n/a" ] && [ -z "$start_time" ]; then
|
||||||
start_time_diff=$((current_time - $(date -d "$start_time" +%s)))
|
start_time_diff=$((current_time - $(date -d "$start_time" +%s)))
|
||||||
start_time_diff_perf="| uptime=${start_time_diff}s"
|
start_time_diff_perf="| uptime=${start_time_diff}s"
|
||||||
|
start_time_str=" Started at $start_time."
|
||||||
fi
|
fi
|
||||||
if [ -n "$end_time" ] && [ "$end_time" != "n/a" ]; then
|
|
||||||
|
end_time_str=""
|
||||||
|
if [ -n "$end_time" ] && [ "$end_time" != "n/a" ] && [ -z "$end_time" ]; then
|
||||||
end_time_diff=$((current_time - $(date -d "$end_time" +%s)))
|
end_time_diff=$((current_time - $(date -d "$end_time" +%s)))
|
||||||
end_time_diff_perf="| downtime=${end_time_diff}s"
|
end_time_diff_perf="| downtime=${end_time_diff}s"
|
||||||
|
end_time_str=" Exited at $end_time."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$IS_TIMER" = true ] && { [ "$substate" = "exited" ] || [ "$active" = "inactive" ]; }; then
|
if [ "$IS_TIMER" = true ] && { [ "$substate" = "exited" ] || [ "$active" = "inactive" ]; }; then
|
||||||
echo "OK - $UNIT_NAME is active and exited (returned $exit_code) and enabled. Exited at $end_time. $end_time_diff_perf"
|
echo "OK - $UNIT_NAME is active and exited (returned $exit_code) and enabled.$end_time_str $end_time_diff_perf"
|
||||||
else
|
else
|
||||||
echo "OK - $UNIT_NAME is active and enabled. Started at $start_time. $start_time_diff_perf"
|
echo "OK - $UNIT_NAME is active and enabled.$start_time_str $start_time_diff_perf"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue