#!/bin/sh # # Try to fetch the WL internet status via SNMP # # Rick van der Zwet # PATH="/usr/local/bin:/usr/bin" HOSTNAME=$1 if [ -z "$HOSTNAME" ]; then echo "VERSION UNKNOWN: No remote host specified" exit 3 fi INTERNET=`snmpget -t 3 -Ovq -c public -v2c $HOSTNAME .1.3.6.1.4.1.2021.95.3.1.1.15.105.110.116.101.114.110.101.116.45.115.116.97.116.117.115` if [ -z "$INTERNET" -o $? -ne 0 ]; then echo "INTERNET UNKNOWN: Cannot get results via SNMP" exit 3 fi if [ $INTERNET = '"internet=up"' ]; then echo "INTERNET OK" exit 0 else echo "INTERNET DOWN" exit 2 fi