[hobbit] Suppressing tests?
kolbjorn.barmen at uninett.no
kolbjorn.barmen at uninett.no
Fri Jul 21 16:59:30 CEST 2006
On Fri, 21 Jul 2006, Gearing, James wrote:
> Does anyone know of a simple way, maybe in the bb-hosts file to suppress
> tests? I'd like to suppress the "info" and "conn" and a few other custom
> test column names, for some, but not all clients.
"noconn noinfo" for the host in bb-hosts, for the custom tests, you have
to make them awae of "nomytest" tags. How you do that depends on how the
script is made.
As an example, I have a test called "kind" that runs on the hobbit server and
does checks for all machines with real IP-adresses (that is, all lines that
begin with a number between 1 and 9 in bb-hosts) except those with "nokind".
---
#! /bin/bash
BBHTAG=kind
COLUMN=${BBHTAG}
${BBHOME}/bin/bbhostshow | ${GREP} '^[1-9]' | while read L
do
set ${L}
echo ${L} | ${GREP} -q -w no${BBHTAG} && continue
HOSTIP="${1}"
MACHINEDOTS="${2}"
MACHINE="${MACHINEDOTS//./,}"
COLOR="green"
SUMMARY="OK"
MSG=$(${PERL} ${BBHOME}/ext/kind.pl ${MACHINEDOTS} ${HOSTIP})
# Replace OK/WARNING/FATAL with corresponding color dots
MSG=$(echo "${MSG}" | ${SED} 's:^OK:\&green:g ; s:^WARNING:\&yellow:g ; s:^FATAL:\&red:g')
echo "${MSG}" | ${GREP} -q "&yellow" && COLOR="yellow" && SUMMARY="Not OK"
echo "${MSG}" | ${GREP} -q "&red" && COLOR="red" && SUMMARY="Error"
${BB} ${BBDISP} "status ${MACHINE}.${COLUMN} ${COLOR} $(date): ${SUMMARY}
${MSG}"
done
exit 0
---
--
Kolbjørn Barmen
UNINETT Driftsenter
More information about the Xymon
mailing list