Xymon Mailing List Archive search

Suppressing tests?

3 messages in this thread

list James Gearing · Fri, 21 Jul 2006 10:36:16 -0400 ·
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.

Im using hobbit server 4.2 with BB 1.9i clients.
list Henrik Størner · Fri, 21 Jul 2006 16:53:44 +0200 ·
quoted from James Gearing
On Fri, Jul 21, 2006 at 10:36:16AM -0400, 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.
The "group-only" and "group-except" settings can do that. See the
bb-hosts(5) man-page for details.


Regards,
Henrik
list Kolbjørn Barmen · Fri, 21 Jul 2006 16:59:30 +0200 (CEST) ·
quoted from Henrik Størner
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