[mrtg] Re: script problem

Tim Kennedy tkennedy at newsreal.com
Sat Feb 19 09:23:21 MET 2000


> Error in packet
> Reason: (noSuchName) There is no such variable name in this MIB.
> This name doesn't exist:
> ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex.63.237.114.173
> 
> [mrtg at ipgate bin]$ cat get-dynamic-port
> #!/bin/bash
> HOST="$1"
> COMMUNITY="$2"
> TARGET="$3"
> SNMPCMD="/usr/local/bin/snmpget"
> GET_PORT="ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex"
> GET_IN="interfaces.ifTable.ifEntry.ifInOctets"
> GET_OUT="interfaces.ifTable.ifEntry.ifOutOctets"
> GET_UPTIME="system.sysUpTime.0"
> 
> PORT=`$SNMPCMD $HOST $COMMUNITY $GET_PORT.$TARGET |awk '{print $3}'`;

I'm not really up to speed on my shell scripting these days, but you
could probably add something like:

if [ $GET_PORT = "" ] then
    exit 0
fi

> #echo "$PORT";
> IN=`$SNMPCMD $HOST $COMMUNITY $GET_IN.$PORT |awk '{print $3}'`;
> echo "$IN";
> OUT=`$SNMPCMD $HOST $COMMUNITY $GET_OUT.$PORT |awk '{print $3}'`;
> echo "$OUT";
> UPTIME=`$SNMPCMD $HOST $COMMUNITY $GET_UPTIME |awk '{print $5,$6, $7}'`;
> echo "$UPTIME";
> echo "$HOST";

-Tim

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list