CISCO OIDs help

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
 
A

axel

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?

No, this is not a Perl script.

Axel
 
A

Anno Siegel

Hy all, i'm trying to get some informations about my routers.
i found this simple script on the cisco cookbook:

[shell script snipped]
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.

Why are you asking this on a Perl newsgroup?

Anno
 
J

Josef Moellers

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.

And your Perl question is?

The above is shell, not Perl.
And this newsgroup does not have SNMP in its name.
 
T

tarantatu

Sorry, i forgot the most important question, is there a perl script to
do it?
can you helpme finding resources (links or suggests)?

thanks
 
S

SSS

Sorry, i forgot the most important question, is there a perl script to
do it?
can you helpme finding resources (links or suggests)?

thanks

Check out the SNMP module on CPAN :)
 
A

A. Sinan Unur

(e-mail address removed) wrote in @g14g2000cwa.googlegroups.com:
Sorry, i forgot the most important question, is there a perl script to
do it?

Do what?
can you helpme finding resources (links or suggests)?

Please read the posting guidelines.

Sinan
 
J

Josef Moellers

Sorry, i forgot the most important question, is there a perl script to
do it?
can you helpme finding resources (links or suggests)?

thanks

Have you not found the Net::SNMP package while looking for a solution?
 

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top