what about using Awk? it's my precious tool (Golum's voice) here you are with an example I'm using daily to monitor some devices:
awk '/Media/ {print $7, $8, $9}' ping.txt
Media = Word to look for in ping.txt file
ping.txt = is a file with acumulative results (>>) from ping command to few
devices
give it a try... I'm sure you will love it...
Best regards.
________________________________
Desde: Brian Anderson - ASI [[email protected]]
Enviado el: jueves, 02 de mayo de 2013 9:36
Hasta: Enterasys Customer Mailing List
Asunto: RE: [enterasys] Port Config...
If you have the linux install of Netsight, I’ve used grep to find strings
inside of config files. I believe it is something like grep -Hrn 'search term'
path/to/files. With Windows you can use DOS, and Findstr command there:
http://www.computerhope.com/findstr.htm
Thanks,
Brian Anderson
[email protected]<mailto:[email protected]>
Network Engineer
3000 United Founders Boulevard, Suite 212
Oklahoma City, Oklahoma 73112
C +1 (501) 690-3305
F +1 (405) 562-8669
[arcadia-secure-it2-long-small]
From: Nick Allen [mailto:[email protected]]
Sent: Thursday, May 02, 2013 9:21 AM
To: Enterasys Customer Mailing List
Subject: Re: [enterasys] Port Config...
Yup, thanks Jay, but that was mainly my point about the port consolidation.
And those were only examples I gave - ideally one command would show *any* line
of config which referenced the given port - spanning tree, policy, maclock -
anything.
N.
Nick Allen
IT Director
[cid:AABF268-03B9-4F422-95C6-5929C7DDA3@MimeCtl]
76-80 Whitfield Street
London, W1T 4EZ
Direct: +44 20 7573 6792
Mobile: +44 7970 121 609
Main: +44 20 7573 6500
Google Chat: [email protected]<mailto:[email protected]>
Reg. Office: TBWA UK GROUP Ltd, 239 Old Marylebone Road, London, NW1 5QT
Company Reg. #: 4332188 (UK)
Company VAT #: GB 656 8994 61
On Thu, May 2, 2013 at 1:28 PM, Auger, Jay (IS)
<[email protected]<mailto:[email protected]>> wrote:
You can use the 'find' command (no space after the pipe):
show config port |find ge.1.3
or just:
show config |find ge.1.3
Only limiting factor would in the case of port consolidation (like your duplex
below). You might have ports ge.1.1-10 configured in a command. The find
command wouldn't match on ge.1.3 for this string.
Oh ya, not for the C-series, only N/K/S (AFAIK).
Jay
From: Nick Allen <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Date: Thursday, May 2, 2013 8:22 AM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Subject: [enterasys] Port Config...
Hi,
We have S-series, N-series, C-series switches and I have always thought it
would be helpful to be able to type a command on a switch - something like:
show config port ge.1.3
and have it return all the lines of non-default config which refer to that port
- duplex, speed, lacp, alias, mirroring, vlan egress etc - for example:
show config port ge.1.3
might return:
set port alias ge.1.3 lon-srv1-nic1
set port duplex ge.1.1-10 full
set port lacp port ge.1.3 aadminkey 333
set port negotiation ge.1.3 disable
set port vlan ge.1.3 14
set vlan egress 15 ge.1.2-8;lag.0.1-2 tagged
set vlan egress 121 ge.1.1-5;ge.2.12-15;lag.0.1-3 untagged
Mainly when re-purposing a port, it's useful to know if someone previously
turned off negotiation etc, or had it as part of a LAG.
Obviously stepping through the config file is do-able but a can be a bit
time-consuming.
Is there already anything like this - preferably from the command line?
Assuming there isn't, then we pull our configs off regularly and commit any
changes to an SVN repo, so I could run a command against a copy of that text
file on the remote box as a second best option. In which case, I don't suppose
anyone has written a regex or a script that could handle that have they?
Thanks,
N.
--
This e-mail is intended only for the named person or entity to which it is
addressed and
contains valuable business information that is proprietary, privileged,
confidential and/or
otherwise protected from disclosure. If you received this e-mail in error, any
review, use,
dissemination, distribution or copying of this e-mail is strictly prohibited.
Please notify
us immediately of the error via e-mail to
[email protected]<mailto:[email protected]> and please
delete
the e-mail from your system, retaining no copies in any media. We appreciate
your cooperation.
• --To unsubscribe from enterasys, send email to
[email protected]<mailto:[email protected]> with the body: unsubscribe enterasys
[email protected]<mailto:[email protected]>
•
* --To unsubscribe from enterasys, send email to
[email protected]<mailto:[email protected]> with the body: unsubscribe enterasys
[email protected]<mailto:[email protected]>
--
This e-mail is intended only for the named person or entity to which it is
addressed and
contains valuable business information that is proprietary, privileged,
confidential and/or
otherwise protected from disclosure. If you received this e-mail in error, any
review, use,
dissemination, distribution or copying of this e-mail is strictly prohibited.
Please notify
us immediately of the error via e-mail to
[email protected]<mailto:[email protected]> and please
delete
the e-mail from your system, retaining no copies in any media. We appreciate
your cooperation.
• --To unsubscribe from enterasys, send email to
[email protected]<mailto:[email protected]> with the body: unsubscribe enterasys
[email protected]<mailto:[email protected]>
•
* --To unsubscribe from enterasys, send email to
[email protected]<mailto:[email protected]> with the body: unsubscribe enterasys
[email protected]
---
To unsubscribe from enterasys, send email to [email protected] with the body:
unsubscribe enterasys [email protected]<<inline: image001.png>>
<<inline: tbwa-uk_group.gif>>
