|
#1
|
|||
|
|||
![]()
Hi all, I'm new to scripting for networking... in the past, I've written scripts for all types of hosts and clients, but I always ran these locally and now I'm a telecom engineer and I'm only dealing with networking devices currently. So I need some background and info to point me in the right direction.
So here is what I am trying to accomplish: basically, to start, I'm trying to get basic interface data out of all our cisco products and into a database. The fields defined in this DB currently include the following: key - the device key for which all the below belong to. INTERFACE - interface name/designation IP_ADDRESS - obvious SUBNET_MASK - obvious MAC_ADDRESS - obvious DOMAIN_NAME - obvious DESCRIPTION - obvious VLN_INTERFACES -which physical interfaces belong to which VLAN STANDBY_IP - the failover IP NOTES - obvious Right now I'm attacking this task for the catalyst 2950/60s; once I get this I far I should have all the knowledge I need to carry the task further. I've experimented with a number of commands (e.g "show ip interface brief" and "show vlan brief") that show some of this data, but obviously not in a DB importable form. 1. So the first question is, "will it be possible to precisely get this output in a DB importable form using the pipe operator, or is this just far to much customizing for the pipe to handle?". If yes, got any hints? 2. In the script, or even in the session itself, how do I make the output go to a text file or similar so that it can be imported directly without having to COPY/PASTE(perhaps parsed first if necessary, which I can handle that part)? 3. How do I run/create scripts that, I suppose, would use secureCRT or putty to a) connect b)run the script c)output to a text file on my computer. 4. What's the best web reference you guys know of for whatever scripting language you're going to tell me to use? I may actually try connecting locally at the console port using putty instead of remotely using secure CRT, fyi.... this is prefered since I'm newer on the networking stuff. Any comment is appreciated... I feel I just need a little help getting my feet wet... I've never met a programming language I couldn't tackle, but this situation is a bit different due to the unfamilar components and potentially remote accesses over a WAN/LAN. |
#2
|
|||||
|
|||||
Greetings gunslingor,
Thanks for posting your scripting / automation questions. Quote:
Quote:
Quote:
Quote:
Quote:
__________________
Mike VanDyke Software Technical Support [http://www.vandyke.com/support] |
#3
|
|||
|
|||
Thanks, this should help out a lot.
"Alternatively, you could run a script from within SecureCRT and read the data, parsing as you go." -This is prefered... parse it before it goes into the text/import file rather than parsing just the command outputs from within my DB... primarily because each device will likely require modifications to the script and I feel the script is the most appropriate spot for all this variably, rather than cluttering up my DB. However, later, I may want to initiate the script from the DB for one click importing. The script will likely grow later, gathering even more configuration data. -Are there any other nuggets of information related to this approach that you can feed me? Or are there any examples, sections or documents that you think I should read to accomplish this approach? I am a highly experienced programmer of arbitrary languages; the hardest part for me is always just getting setup in a development environment. I've never really had to worry about scripting engines, in the past I always used the OS default engine I presume. But I suspect your document will clear up this missing knowledge. I think this questions are still outstanding: 1. So the first question is, "will it be possible to precisely get this output in a DB importable form using the pipe operator, or is this just far to much customizing for the pipe to handle?". If yes, got any hints? -If I can precisely control the command outputs and sort of combine commands, this will make parsing easier for me, a lot easiler. For example, "show ip interface brief" contains interface names plus IP addresses (in tabular form which will help with parsing) that I want in my table, "show vlan brief" tells me what physical interfaces are on which vlan (vlans are being treated the same as physical interfaces within my DB, i.e. same table) and "show interface" tells me the MAC addresses of the interfaces. Would there be a way to type in a long structured command that only gives the data I need, or is this just too much for the device to handle and a script is really the only option? |
#4
|
|||
|
|||
Is this site serious? Every single post is reviewed by a moderator? This kind of makes the forum unusable. Hey moderator, go look at other forums, this isn't a standard way of doing things and your forcing people to wait a lot longer for replies as you catch up on the backlog. I would change this policy quickly, because there are a lot of similar forums that don't require this and their gonna get all the users.
|
#5
|
||||
|
||||
Quote:
Quote:
__________________
Mike VanDyke Software Technical Support [http://www.vandyke.com/support] |
#6
|
|||
|
|||
Thanks Miked, you've been a massive help.... I have my toes wet... now for the feet =).
|
#7
|
||||
|
||||
Quote:
These forums are created and maintained for the benefit of those who are using VanDyke Software products. The forums are public, but you'll notice that the vast majority of responses come from VanDyke Software technical support staff. In the past, bogus posts about topics unrelated to VanDyke Software products would have been allowed without restraint, making it difficult for individuals to search for and find relevant information. Since these forums also allow for RSS feed subscriptions, this meant that undesired posts would be broadcast to all RSS readers before they could be filtered as junk. To honor requests from legitimate forum users, we have implemented mechanisms that can help prevent garbage from polluting the forums. The first few posts of a new user will be moderated. A post made by a new user won't appear until the post has been approved. This is not unusual for a forum that desires to be of value to a specific audience. Moderated forum posts are evaluated for approval between the hours of 7:30AM to 5:30PM (GMT-7:00). The vast majority of technical support (even for evaluators) occurs via email. If you prefer to have an email conversation rather than interact via a public forum web page, please send email to support@vandyke.com. One example where email should be used is with any question involving sensitive information. For security reasons, log files and other sensitive information exposing usernames, host names, machine names, IP addresses, etc. should not be posted to a public forum. If your question involves sensitive information as described, please send email to support@vandyke.com; do not post sensitive information to the forums.
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
![]() |
Tags |
data export , interfaces , managment |
Thread Tools | |
Display Modes | Rate This Thread |
|
|