#! /bin/sh CHECK="/usr/lib/nagios/plugins/check_http" CHECK_OPTS="-S --sni -H visio.chapril.org" IP_FRONT='192.168.1.93' THRESHOLDS='20,10' usage() { echo echo "SYNTAX" echo "`basename ${0}` -h" echo "`basename ${0}` -i -C " echo echo "EXAMPLE" echo "`basename ${0}` -i 192.168.0.254 -C 30,14" echo } optstring=":hi:t:" while getopts ${optstring} arg; do case ${arg} in h) usage exit 0 ;; :) echo "$0: Must supply an argument to -$OPTARG." >&2 exit 1 ;; i) IP_FRONT="${OPTARG}" ;; C) THRESHOLDS="${OPTARG}" ;; esac done res="`${CHECK} ${CHECK_OPTS} -I ${IP_FRONT} -C ${THRESHOLDS}`" ret=${?} echo "${res}" exit ${ret}