Announcement

Collapse
No announcement yet.

Collecting data from multiple switches / routers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Collecting data from multiple switches / routers

    I'm currently working on a project where pretty much each day we have to get information from 10-40 switches / routers. We're wondering if there's a way to batch grab this info. We're looking to grab the serial # at a minimum, but if we could get the arp table from the routers and the dynamic mac address list from the switches that would be awesome.

    Has anyone ever had to do something like this?
    ** Remember to give credit where credit is due and leave reputation points where appropriate **

  • #2
    Re: Collecting data from multiple switches / routers

    MRTG _may_ be able to do this.. but that uses SNMP, which you may choose not to use in your network due to inherent security concerns..
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Collecting data from multiple switches / routers

      So far my research on MRTG shows that it may not do what I'm looking for, but it got me thinking. Found this thread:

      http://stackoverflow.com/questions/2...telnet-vs-snmp

      which led me to the Cisco IOS XR XML API Guide, Release 3.2 as well as the Python library: telnetlib.

      The IOS XR API probably isn't on the equipment in question, and writing a Python scraper program to grab info via telnetlib may be overkill, but OTOH I don't look forward to doing this till at least the end of the year!

      Sidenote: that StackOverflow site looks like an interesting comunity Q&A for programming questions,
      Last edited by Wired; 20th April 2010, 07:32.
      ** Remember to give credit where credit is due and leave reputation points where appropriate **

      Comment


      • #4
        Re: Collecting data from multiple switches / routers

        mrtg can, basically, retreive anything you want, provided an SNMP OID string exists, at least that's my understanding..


        the other option may be to use kron on the routers and swtiches to somehow push the information outwards.. ? i don't know if that's possible though
        Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

        Comment


        • #5
          Re: Collecting data from multiple switches / routers

          Is this of any help: http://www.petri.com/network-device-...solarwinds.htm
          Caesar's cipher - 3

          ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

          SFX JNRS FC U6 MNGR

          Comment


          • #6
            Re: Collecting data from multiple switches / routers

            Found a way to do it (sorta). You can export a telnet session by doing:

            telnet <IP> -f <filename.txt>

            Whipped up a script that pops up user / password input boxes, runs the above line, pops in the login info, runs sh arp, then exits. It then parses the text file and removes everything but the ARP table.

            Next on the list is to trim it to only the data I need, and work up similar code for a switch and "show mac-add dyn". After that I'll slap it in some arrays and match data up according to the MAC and push it all out into a CSV. ordered by port. When I have it all done I'll post it here.
            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment


            • #7
              Re: Collecting data from multiple switches / routers

              Quick update: My afforementioned script works, but it just attempts to mimics a basic human skillset (e.g. hit space a set number of times split up by a pre-defined interval in the hopes that the arp table is done and then types in exit) and doesn't look at the data on the screen. Currently we're back to doing it manually.

              I may try next to do something with AutoIT, but currently I'm looking at SNMP again (already have the read only community string). I may look at MRTG again, but in more depth, but it may be too powerful for our needs. Our needs are REALLY basic. Just need to get data from:

              show arp
              show mac-address dynamic
              show cdp neighbors detail
              show ip interface brief
              show config
              show ver

              No need to continually monitor it or anything. Just a one time query.

              Oooohhhhh, interesting: http://serverfault.com/questions/393...cted-to-switch
              Last edited by Wired; 20th May 2010, 09:23.
              ** Remember to give credit where credit is due and leave reputation points where appropriate **

              Comment


              • #8
                Re: Collecting data from multiple switches / routers

                Got my script to work. Yippee! Within 30 sec of entering on the data (name, password, router IP, switch IP) it pops open Notepad with a list of what IP is on what port and what its MAC is. Need to scan the network beforehand to ensure the ARP and MAC tables are up to date.

                Next step (aside from maybe moving this thread to the scripting area) is to put in table headers, port status info, and then pop it into a csv or excel file.

                Also going to make a script that grabs inventory info (name of device, model, serial number).
                ** Remember to give credit where credit is due and leave reputation points where appropriate **

                Comment


                • #9
                  Re: Collecting data from multiple switches / routers

                  FYI I've posted the script in the scripting area:
                  http://forums.petri.com/showthread.php?t=46464
                  ** Remember to give credit where credit is due and leave reputation points where appropriate **

                  Comment

                  Working...
                  X