nv-l
[Top] [All Lists]

BadOIDs Collection on UNIX

To: nv-l@lists.tivoli.com
Subject: BadOIDs Collection on UNIX
From: Don Davis <don-n-darla@worldnet.att.net>
Date: Tue, 09 May 2000 13:25:30 -0400
Here is a utility that I wrote that can find all of your "bad OIDs".
That is, OIDs that are not registered in /usr/OV/conf/C/oid_to_sym file.

This will find all of your SNMP agents that display as plain green
squares.
This provides a similar function on UNIX that is available on NetView
for NT.

1. getOIDs : script file that does the work
2. oid.format : config file for nvdbformat command that is called by the
getOIDs script
3. getinfo.reg : Application Registration File that puts getOIDs on the
Tools Menu.

The getOIDs file and the oid.format file should be placed in the root
"/" directory.
Be sure to modify the getOIDs script if you put them somewhere else.
The getinfo.reg file goes in /usr/OV/registration/C directory.

The getinfo.reg file also has a "get traps" action clause that will get
all of the traps for
the selected node from trapd.log and display them in an xnmappmon window
when
getTraps is selected from the Tools Menu.

Best Regards,

======================================================
Don Davis  -  Instructor / Tivoli Certified Consultant
Visit our Web site at: http://www.apc-services.com

Attachment: getinfo.reg
Description: application/unknown-content-type-regfile

#!/bin/ksh
# This script will create a collection of nodes whose OIDs are not
# registered in NetView's /usr/OV/conf/C/oid_to_sym regisrtation file.
# Requires the following oid.format file for the nvdbformat command.
# Be sure to put appropriate path to this file in this script.
#
#    SELECTRULE:isNode=TRUE
#    SELECTRULE:isSNMPSupported=TRUE
#    SELECTFIELD:1:SNMP sysObjectID
#    OUTPUT:${1}
#
# Creates a /usr/OV/conf/C/badOIDs file that can be modified with 
# the appropriate Symbol-class and bitmaps and then appended to
# /usr/OV/conf/C/oid_to_sym file.
# 
# Written by Don Davis 20APR00
# 
# 
# Delete existing BadOIDs Collection
if /usr/OV/bin/nvUtil L | grep BadOIDs > /dev/nul
  then
    /usr/OV/bin/nvUtil D BadOIDs force
fi
# Delete existing badOIDs file
if [ -f /usr/OV/conf/C/badOIDs ] ; then
  rm /usr/OV/conf/C/badOIDs
fi
# Initialize counter
let N=0
# Loop through OIDs of SNMP nodes
# *** IMPORTANT *** Verify the path to the oid.format file ***
for i in `/usr/OV/bin/nvdbformat -f /oid.format | sort -u`
do
  if grep ^$i: /usr/OV/conf/C/oid_to_sym > /dev/nul
    then
      # Found Match - Try Again
      continue
  else
    # No Match - Increment Counter
    let N=$N+1
    # Write OID to File
    echo $i >> /usr/OV/conf/C/badOIDs
    # Build Collection Rule (with Escaped Dots)
    OID=`echo $i | sed 's/\./\\\./g'`
    OID="'^"$OID"')"
    # Got first OID
    if [ $N -eq 1 ] ; then
      RULE="nvUtil a BadOIDs \"\" \"(('isNode' = True) && (('SNMP sysObjectID' 
~ "$OID
    # Got additional OIDs
    else
      RULE=$RULE" || ('SNMP sysObjectID' ~ "$OID
    fi
  fi
done
RULE=$RULE"))"\"
# Execute nvUtil command only if badOIDs were found
if [ $N -gt 0 ] ; then
  eval "$RULE"
fi
SELECTRULE:isNode=TRUE
SELECTRULE:isSNMPSupported=TRUE
SELECTFIELD:1:SNMP sysObjectID
OUTPUT:${1}
<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web