BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {bb} SNMP2BB



On Wed, 2005-08-31 at 08:10, arun.nale@tcs.com wrote:
> 
> Thanks Philip,
> 
> here is the BBOUT contents
> 
> The hardware is CISCO routers and CISCO switches
> 
> Wed Aug 31 08:01:06 2005 snmp ALPHAPGR=/usr/local/bin/qpage
> Wed Aug 31 08:01:06 2005 snmp AWK=/bin/awk
> Wed Aug 31 08:01:06 2005 snmp BASH=/bin/sh
> Wed Aug 31 08:01:06 2005 snmp BASH_ENV=/root/.bashrc
> Wed Aug 31 08:01:06 2005 snmp BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" 
> [3]="1" [
> 4]="release" [5]="i386-redhat-linux-gnu")
> Wed Aug 31 08:01:06 2005 snmp BASH_VERSION='2.05b.0(1)-release'
> Wed Aug 31 08:01:06 2005 snmp BB=/home/bbuser/bb/bin/bb
> Wed Aug 31 08:01:06 2005 snmp BBACKS=/home/bbuser/bbvar/acks
> Wed Aug 31 08:01:06 2005 snmp BBALLHISTLOG=TRUE
> Wed Aug 31 08:01:06 2005 snmp BBDATA=/home/bbuser/bbvar/data
> Wed Aug 31 08:01:06 2005 snmp BBDEFSLEEP=300
> Wed Aug 31 08:01:06 2005 snmp BBDISABLED=/home/bbuser/bbvar/disabled
> Wed Aug 31 08:01:06 2005 snmp BBDISP=192.168.0.23
> Wed Aug 31 08:01:06 2005 snmp BBDISPLAY=TRUE
> Wed Aug 31 08:01:06 2005 snmp BBDISPLAYS=
> Wed Aug 31 08:01:06 2005 snmp BBEXT='mrtg/bbmrtg.pl:60 larrd/larrd.pl 
> snmp'
> Wed Aug 31 08:01:06 2005 snmp BBEXTTAB=/home/bbuser/bb/etc/bb-bbexttab
> Wed Aug 31 08:01:06 2005 snmp BBHIST=/home/bbuser/bbvar/hist
> Wed Aug 31 08:01:06 2005 snmp BBHISTEXT=
> Wed Aug 31 08:01:06 2005 snmp BBHISTLOGS=/home/bbuser/bbvar/histlogs
> Wed Aug 31 08:01:06 2005 snmp BBHIST_IGNOREBLUE=FALSE
> Wed Aug 31 08:01:06 2005 snmp BBHOME=/home/bbuser/bb/
> Wed Aug 31 08:01:06 2005 snmp BBHOSTHISTLOG=TRUE
> Wed Aug 31 08:01:06 2005 snmp BBHOSTS=/home/bbuser/bb/etc/bb-hosts
> Wed Aug 31 08:01:06 2005 snmp BBHTML=/home/bbuser/bb/www/html
> Wed Aug 31 08:01:06 2005 snmp BBLOGS=/home/bbuser/bbvar/logs
> Wed Aug 31 08:01:06 2005 snmp BBLOGSTATUS=STATIC
> Wed Aug 31 08:01:06 2005 snmp BBMKBB2EXT='eventlog.sh acklog.sh'
> Wed Aug 31 08:01:06 2005 snmp BBMKBBEXT=
> Wed Aug 31 08:01:06 2005 snmp BBNET=TRUE
> Wed Aug 31 08:01:06 2005 snmp BBNETSVCS='smtp telnet ftp pop pop3 pop-3 
> ssh imap ssh1 ssh2 imap2 imap3 imap4 pop2 pop-2 nntp'
> Wed Aug 31 08:01:06 2005 snmp BBNETTHREADS=1
> Wed Aug 31 08:01:06 2005 snmp BBNETTIMER1=3
> Wed Aug 31 08:01:06 2005 snmp BBNETTIMER2=5
> Wed Aug 31 08:01:06 2005 snmp BBNETTIMER3=12
> Wed Aug 31 08:01:06 2005 snmp BBNOTES=/home/bbuser/bb/www/notes
> Wed Aug 31 08:01:06 2005 snmp BBOSTYPE=redhatES
> Wed Aug 31 08:01:06 2005 snmp BBOUT=/home/bbuser/bb/BBOUT
> 
> Arun

OK. The script is dumping the environment variables. This is normally
caused by an empty "set" command. For example, a line like:

  set $MYVAR

where the variable is empty.

There are 6 such lines in the main "snmp" script:

  1. set $line - This looks safe as the variable must have matched the
    preceding "grep".
  2. set $MACHINEMASK - Might be triggered by an error in the bb-hosts
    file, but only when not using FQDN.
  3 & 4. set $COMMUNITY - Safe. Empty variable specifically excluded.
  5. set $SYSNAME - This looks unsafe. The result of an "snmpget"
    command is used without testing to see what it contains.
  6. set $SYSUPTIME - Unsafe, as above.

My guess would be that one or both of those "snmpget" commands is
returning an empty string. I'd try modifying the script to test for
that and produce some helpful debugging output, like so:

  if test "$SYSNAME" != ""
  then
    set $SYSNAME
    shift; shift;
    SYSNAME=`echo $* | $SED "s/\"//g"`
  else
    echo "snmpget $HOST $COMMUNITY sysDescr.0 returned empty"
    continue;
  fi

That should produce something useful in BBOUT in place of the
list of environment variables.

Cheers, Phil.



-- 
I've never wished a man to meet his maker before his time. But, there
are a
few obituaries that I've read with approval. (Leslie Nielsen)

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index