CISCO OIDs help

Discussion in 'Perl Misc' started by tarantatu@gmail.com, Oct 13, 2005.

  1. Guest

    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
     
    , Oct 13, 2005
    #1
    1. Advertising

  2. Guest

    wrote:
    > 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
     
    , Oct 13, 2005
    #2
    1. Advertising

  3. Anno Siegel Guest

    <> wrote in comp.lang.perl.misc:
    > 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
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
     
    Anno Siegel, Oct 13, 2005
    #3
  4. wrote:
    > 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.
    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Oct 13, 2005
    #4
  5. Guest

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

    thanks
     
    , Oct 13, 2005
    #5
  6. SSS Guest

    wrote:
    > 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 :)
     
    SSS, Oct 13, 2005
    #6
  7. wrote in news:1129199612.388927.308400
    @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

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Oct 13, 2005
    #7
  8. wrote:
    > 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?

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Oct 13, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    399
    Joerg Jooss
    Oct 14, 2005
  2. Replies:
    1
    Views:
    4,364
    magickapil
    Nov 20, 2006
  3. Shaun Clark
    Replies:
    0
    Views:
    3,426
    Shaun Clark
    Jun 28, 2003
  4. SpamMePlease PleasePlease

    Translating pysnmp oids to human readable strings

    SpamMePlease PleasePlease, Mar 5, 2009, in forum: Python
    Replies:
    15
    Views:
    3,399
    Shantanu Joshi
    Mar 9, 2009
  5. John Ramsden
    Replies:
    2
    Views:
    253
    John Ramsden
    Sep 4, 2003
Loading...

Share This Page