Veritas-bu

[Veritas-bu] Initial script for send exit_status as traps from NBU 3.4

2003-08-04 16:15:03
Subject: [Veritas-bu] Initial script for send exit_status as traps from NBU 3.4
From: mbartsch AT netglobalis DOT net (Marcelo Bartsch)
Date: 04 Aug 2003 16:15:03 -0400
--=-/P7sERVvGnve838PQM1/
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi list, this is a small, ugly, but seems to be working way to send
traps from backup status from the NBU Server to a nms station, as
nagios, HPOV , NetCool , who nows what else :)
is not really tested, considering it was coded in a few ours, also there
is no real mib writen, inside the script is the values of the oids.


-- 
   Marcelo Bartsch
mbartsch AT netglobalis DOT net
  www.netglobalis.net

PGP Fingerprint : 
877E 3A56 F523 B44A 3260  8F83 8916 E158 6100 F721

--=-/P7sERVvGnve838PQM1/
Content-Disposition: attachment; filename=nbu-traps.sh
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-sh; name=nbu-traps.sh; charset=ISO-8859-1

#!/bin/sh
# Coded by Marcelo Bartsch <mbartsch AT unix911.ath DOT cx>
# uses ucd-snmp snmptrap
# You need to change TRAPHOST, SNMPCOMMUNITY, OID and SNMPTRAP=20
# variables.
#
#
#         CLIENT           - the client hostname                        | $=
OID.100.10.1
#         CLASS            - the class label                            | $=
OID.100.10.2
#         SCHEDULE         - the schedule label                         | $=
OID.100.10.3
#         SCHEDULE_TYPE    - the type of schedule:  FULL INCR UBAK UARC | $=
OID.100.10.4
#         STATUS           - the backup status for this job             | $=
OID.100.10.5
#         STREAM           - the backup stream number for this job      | $=
OID.100.10.6
SNMPCOMMUNITY=3D"public"
TRAPHOST=3D"localhost"
OID=3Denterprises.7121
SNMPTRAP=3D"/opt/NGsnmp/bin/snmptrap"
#
#

if [ "$#" -lt 6 ]
then
        echo `date` "$0 expects at least 6 parameters: $*"
        exit 1
fi

CLIENT=3D$1
CLASS=3D$2
SCHEDULE=3D$3
SCHEDULE_TYPE=3D$4
STATUS=3D$5
STREAM=3D$6
#
#
$SNMPTRAP -v 2c -c $SNMPCOMMUNITY $TRAPHOST '' $OID.100.10 \
        $OID.100.10.1 s "$CLIENT" \
        $OID.100.10.2 s "$CLASS" \
        $OID.100.10.3 s "$SCHEDULE" \
        $OID.100.10.4 s "$SCHEDULE_TYPE" \
        $OID.100.10.5 i $STATUS \
        $OID.100.10.6 i $STREAM

--=-/P7sERVvGnve838PQM1/--

<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] Initial script for send exit_status as traps from NBU 3.4, Marcelo Bartsch <=