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