Xymon Mailing List Archive search

Suitability for bb replacement in large enterprise

list Henrik Størner
Tue, 9 Dec 2008 06:57:41 +0000 (UTC)
Message-Id: <ghl4t5$go6$user-e356fad9864f@xymon.invalid>

In <user-0d7933c91e98@xymon.invalid> J Sloan <user-b1d2c84d244b@xymon.invalid> writes:
Yes, it's very simple and straightforward: send out an snmp trap based
on an event, per the bbwarnrules.cfg, just like the email alerts. If
hobbit can be made to do that, one of the two key requirements would be
met, and only the failover behaviour would still need to be resolved.
In hobbit-alerts.cfg you'd have something like

    HOST=* TEST=disk
        SCRIPT /usr/local/bin/trapmessage 0

Then your /usr/local/bin/trapmessage would do the trap-sending.
E.g. using Net-SNMP tools and the defaults from BB's bbwarnsetup.cfg:
 
    #!/bin/sh

    OID="enterprises.7058"    # 7058 is the Big Brother OID
    SNMPSTATION="10.3.2.1"    # IP of your monitoring system

    # BB maps a service to a numeric trapcode. See the
    # 'trapcodes' definition in bbwarnsetup.cfg
    # Add those you use here.
    case "$BBSVCNAME" in
      "disk") 
          TRAPCODE="2"
	  ;;
      "cpu")
          TRAPCODE="4"
	  ;;
    esac
    # ... and adds 1 if the status has recovered
    if test "$RECOVERED" = "1"
    then
       TRAPCODE=`expr $TRAPCODE + 1`
    fi

    snmptrap -v1 -c public $SNMPSTATION $OID \
       $BBHOSTNAME 6 $TRAPCODE '' $OID s "$BBALPHAMSG"

    exit 0


Regards,
Henrik