#!/bin/sh # Created By: Richard van Mansom richardvm@wirelessleiden.nl, Maart 2010 MIB=$2 HOST=$1 VERSION=2c COMMUNITY=public OUTPUT=`snmpget -v ${VERSION} -c ${COMMUNITY} ${HOST} ${MIB} | awk -F'\"' '{ print $2 }'` EXIT=`echo ${OUTPUT} | awk '{ print $2 }' | tr -d ":"` case ${EXIT} in OK) EXIT=0 ;; WARNING) EXIT=1 ;; CRITICAL) EXIT=2 ;; *) EXIT=3 ;; esac echo ${OUTPUT} exit ${EXIT}