You could get ARP info via Telnet or Web, but my preference is to get it via SNMP. Here is some code you can plagerize - lot of stuf you probably won't use, and you will need to remove database references, but it should get you a lot more than you wanted.
Sorry - Not the cleanest code -- I was still learning SNMP.
Concentrate on "sub ARPtable".
Earth first! (We'll rob the other planets later)
| [reply] [d/l] |
Thanks everybody for you help. That code is exactly the kind of thing i was looking for. To Netwallah, it also sounds like the task for which it was used is similar to what i intend to do.This is the first time the task has been performed.
Basically i am going to collect the arp table off our router and hopefully the switch forwarding tables off our hp switches. the output of both things were then going to be inserted into a databse (i have a script to put the output into an sql database) which would be periodically updated so as to give an idea of what is on our network at any given time.
The database would have a record for each address with fields such as the related mac or ip address, the port that the mac address relates to( i forsee this could be difficult) and when it last appeared on the network.
so to get to the point, how difficult would it be to change Netwallah's script to do all these things? I would also be interested in seeing what the DBinterface module does as this may be better then adding more code to put the resulting output into an sql database.Any ideas netwallah? sorry for the long winded post but i am very new to this perl malarky and am still trying to find my feet.Once again thanks for all the replies so far.
| [reply] |
I will be happy to share the Database structure, and related perl module with you - the Database is SQLServer, and the module handles the ODBC interface to a table named "ARP". I am not sure if this is appropriate for your environment.There is anothere script which scans the WINS database and populates device Names.
Please /msg me with your e-mail address, so I can send it to you.
Here is the layout of the ARP table:
Earth first! (We'll rob the other planets later)
| [reply] [d/l] |
What control interfaces are available to you for the router? Can you telnet or FTP to the router?
With questions like this it is really helpful to include how you would normally do the task. This opens up the question to a lot of other monks that may not have used your equipment but have done something similar in the past. As well it would be good to include any ideas you have on how this may be done, or code you have tried already. | [reply] |
I know nothing bout routers...
Can you get to the information on the router from a browser? If so, you might be able to use LWP to scrape the information you are looking for.
"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.
OSUnderdog
| [reply] |