View Single Post
Old 05-12-2017, 10:08 AM
Raikoug Raikoug is offline
Registered User
Join Date: May 2017
Posts: 1
CDP neighbor to interface description

I'm nearly new to scripting, and I can't understand how to achieve this:

retrive from sh cdp neighbor commands the info I want to make the description command I need

Well, i know what I should know, but I can't find it:
First I can't store line per line output in a variable to handle it.

Second I can't find a way to handle string in regex (just: simple as [1-9]//[1-48] match or "FixedHostnamePart-[0-9]-Stuff" )
The most I achieved is:
make a sh cdp neighbor to be stored in a hostname.txt file. Than with notepad++ and regex easily make the
  • int x/y
  • description hostname
for each cdp neighbor in the file.
I would like to achieve this with a single securecrt script to be able later to try to make it run on ALL the machine we handle (+80) in a single shot.

(I'm just wandering if no one ever needed this... )
Reply With Quote