Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
dpalermo
bydpalermo, April 24, 2022
The linkuptime function doesn't take the input warning and critical arguments:
check_greater ${UPTIME} 1 0 "${RESULT}"
to fix it, you need to change that line to:
check_greater ${UPTIME} ${WARN} ${CRIT} "${RESULT}"
also, if you want the uptime in days/hours/minutes/seconds, you need to change the lines just above the fixed one to:
DAYS=$((${UPTIME}/3600/24))
HOURS=$(((${UPTIME}/3600)-(${DAYS}*24)))
MINUTES=$(((${UPTIME}-(${DAYS}*24*3600)-(${HOURS}*3600))/60))
SECONDS=$((${UPTIME}-(${DAYS}*24*3600)-(${HOURS}*3600)-(${MINUTES}*60)))
RESULT="Link uptime ${UPTIME} seconds (${DAYS}d ${HOURS}h ${MINUTES}m ${SECONDS}s)| uptime=${UPTIME} "
check_greater ${UPTIME} 1 0 "${RESULT}"
to fix it, you need to change that line to:
check_greater ${UPTIME} ${WARN} ${CRIT} "${RESULT}"
also, if you want the uptime in days/hours/minutes/seconds, you need to change the lines just above the fixed one to:
DAYS=$((${UPTIME}/3600/24))
HOURS=$(((${UPTIME}/3600)-(${DAYS}*24)))
MINUTES=$(((${UPTIME}-(${DAYS}*24*3600)-(${HOURS}*3600))/60))
SECONDS=$((${UPTIME}-(${DAYS}*24*3600)-(${HOURS}*3600)-(${MINUTES}*60)))
RESULT="Link uptime ${UPTIME} seconds (${DAYS}d ${HOURS}h ${MINUTES}m ${SECONDS}s)| uptime=${UPTIME} "