T
tarantatu
Hy all, i'm trying to get some informations about my routers.
i found this simple script on the cisco cookbook:
public="my-com"
workingdir="myhome"
#
LOG=$workingdir/RESULT-inventory.csv
infile=$workingdir/RTR_LIST-inventory
snmp="/usr/bin/snmpget -v1 -c $public"
#
while read device
do
$snmp $device sysName.0 > /dev/null
if [ "$?" = "0" ] ; then
rtr=`$snmp $device .1.3.6.1.4.1.9.2.1.3.0 | cut -f2 -d\" `
type2=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.3 | cut -f2 -d$ `
ios=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.5 | cut -f2 -d$ `
prot=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.4 | cut -f2 -d$ `
echo "$device, $rtr, $type2, $ios, $prot" >> $LOG
fi
done < $infile
i need to add other OIDs to get info about interfaces type and the
amount of the memory installed on the devices but i'm not able to
undrstand how to find'em.
can you help me to understand how?
thanks in advance
Jug
i found this simple script on the cisco cookbook:
public="my-com"
workingdir="myhome"
#
LOG=$workingdir/RESULT-inventory.csv
infile=$workingdir/RTR_LIST-inventory
snmp="/usr/bin/snmpget -v1 -c $public"
#
while read device
do
$snmp $device sysName.0 > /dev/null
if [ "$?" = "0" ] ; then
rtr=`$snmp $device .1.3.6.1.4.1.9.2.1.3.0 | cut -f2 -d\" `
type2=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.3 | cut -f2 -d$ `
ios=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.5 | cut -f2 -d$ `
prot=`$snmp $device .1.3.6.1.4.1.9.9.25.1.1.1.2.4 | cut -f2 -d$ `
echo "$device, $rtr, $type2, $ios, $prot" >> $LOG
fi
done < $infile
i need to add other OIDs to get info about interfaces type and the
amount of the memory installed on the devices but i'm not able to
undrstand how to find'em.
can you help me to understand how?
thanks in advance
Jug