Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
swerrie
byswerrie, February 10, 2010
no Perf data and the plugin shows not very accurate info...
But it works like a charm... I've edited myself for my needs:
if [ $RES = 0 ]; then
UPTDAY=$(expr $UPTMIN / 60 / 24 )
UPTMINT=$(( $UPTDAY * 1440 ))
UPTMINM=$(( $UPTMIN - $UPTMINT ))
UPTMINH=$(expr $UPTMINM / 60 )
UPTMINHM=$(( $UPTMINH * 60 ))
UPTMINHMS=$(( $UPTMINM - $UPTMINHM ))
if [ $UPTMIN -lt $CRIT ]; then
echo CRITICAL: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 2
fi
if [ $UPTMIN -lt $WARN ]; then
echo OK: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 0
fi
if [ $UPTMIN -ge $WARN ]; then
echo WARNING: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 1
fi
fi
But it works like a charm... I've edited myself for my needs:
if [ $RES = 0 ]; then
UPTDAY=$(expr $UPTMIN / 60 / 24 )
UPTMINT=$(( $UPTDAY * 1440 ))
UPTMINM=$(( $UPTMIN - $UPTMINT ))
UPTMINH=$(expr $UPTMINM / 60 )
UPTMINHM=$(( $UPTMINH * 60 ))
UPTMINHMS=$(( $UPTMINM - $UPTMINHM ))
if [ $UPTMIN -lt $CRIT ]; then
echo CRITICAL: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 2
fi
if [ $UPTMIN -lt $WARN ]; then
echo OK: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 0
fi
if [ $UPTMIN -ge $WARN ]; then
echo WARNING: Systemuptime $UPTDAY Days $UPTMINH Hours $UPTMINHMS Mins'|Uptime='$UPTMIN'm;'$WARN';'$CRIT';0;0'
exit 1
fi
fi