Uptime

patch_for_uptime

Description:

just patch

Current Version

Last Release Date

February 4, 2010

Compatible With


Project Files
Project Notes
Hello from Russia! ;) Thanks for your script! I have modified your script for correct work in FreeBSD. --- /usr/local/nagios/libexec/check_uptime.sh Mon Nov 30 11:19:59 2009 +++ check_uptime.sh Thu Dec 10 16:12:00 2009 @@ -73,11 +73,16 @@ if echo $UPTIME_REPORT | grep -i day > /dev/null ; then DAYS=`echo $UPTIME_REPORT | awk '{ print $3 }'` HOURS=`echo $UPTIME_REPORT | awk '{ print $5}' | cut -f1 -d":"` - MINUTES=`echo $UPTIME_REPORT | awk '{ print $5}' | cut -f2 -d":"` + if echo $UPTIME_REPORT | grep -v hrs ; then + MINUTES=`echo $UPTIME_REPORT | awk '{ print $5}' | cut -f2 -d":"` + else + MINUTES=0 + fi - elif #in AIX 5:00 will show up as 5 hours, and in Solaris 2.6 as 5 hr(s) - echo $UPTIME_REPORT | egrep -e "hour|hr(s)" > /dev/null ; then + elif #in AIX 5:00 will show up as 5 hours, and in Solaris 2.6 as 5 hr(s), and in FreeBSD as 5 hrs + echo $UPTIME_REPORT | egrep -e "hour|hr(s)|hrs" > /dev/null ; then HOURS=`echo $UPTIME_REPORT | awk '{ print $3}'` + MINUTES=0 else echo $UPTIME_REPORT | awk '{ print $3}' | grep ":" > /dev/null && HOURS=`echo $UPTIME_REPORT | awk '{ print $3}' | cut -f1 -d":"` for example, in FreeBSD uptime command output looks like 11:45AM up 31 mins, 1 user, load averages: 0.04, 0.22, 0.27 2:13PM up 2:59, 1 user, load averages: 0.01, 0.01, 0.00 2:13PM up 3 hrs, 1 user, load averages: 0.01, 0.00, 0.00 2:26PM up 205 days, 18:59, 3 users, load averages: 0.07, 0.13, 0.12 2:26PM up 205 days, 19 hrs, 3 users, load averages: 0.05, 0.12, 0.12
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
154,957