Skip to content

Commit

Permalink
Merge pull request #23 from cxcv/master
Browse files Browse the repository at this point in the history
split vars uptime/linkuptime
  • Loading branch information
mcktr committed Oct 18, 2017
2 parents 958e946 + 4399c38 commit 1c29ae5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions check_tr64_fritz
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,16 @@ case ${FUNCTION} in
esac
;;
"linkuptime")
UPTIME=$(find_xml_value "${queryResult}" "NewUptime")
LINKUPTIME=$(find_xml_value "${queryResult}" "NewUptime")

check_number "${UPTIME}"
check_number "${LINKUPTIME}"

days=$(( ${UPTIME} / 86400 ))
hours=$(( (${UPTIME} / 3600) - (${days} * 24) ))
minutes=$(( (${UPTIME} / 60) - (${days} * 1440) - (${hours} * 60) ))
seconds=$(( ${UPTIME} % 60 ))
days=$(( ${LINKUPTIME} / 86400 ))
hours=$(( (${LINKUPTIME} / 3600) - (${days} * 24) ))
minutes=$(( (${LINKUPTIME} / 60) - (${days} * 1440) - (${hours} * 60) ))
seconds=$(( ${LINKUPTIME} % 60 ))

echo "OK - Uptime ${UPTIME} seconds (${days}d ${hours}h ${minutes}m ${seconds}s) | uptime=${UPTIME}"
echo "OK - Link Uptime ${LINKUPTIME} seconds (${days}d ${hours}h ${minutes}m ${seconds}s) | linkuptime=${LINKUPTIME}"

exit ${PLUGIN_OK}

Expand Down

0 comments on commit 1c29ae5

Please sign in to comment.