I need sort Cisco configs to report but i cannot do the script to made this:
#### INPUT #####
Code:
config-register 0x2102
version 12.2
!
hostname Router
!
interface Ethernet0
description Red LAN
ip address 192.168.1.1 255.255.255.0
no cdp enable
!
interface Serial0
description Red WAN
ip address 172.16.1.1 255.255.255.0
!
interface loopback0
shutdown
!
line con 0
exec-timeout 20 0
stopbits 1
!
line vty 0 4
exec-timeout 20 0
transport preferred none
!
end
### OUTPUT ###
Code:
config-register 0x2102
version 12.2
hostname Router
interface Ethernet0 description Red LAN
interface Ethernet0 ip address 192.168.1.1 255.255.255.0
interface Ethernet0 no cdp enable
interface Serial0 description Red WAN
interface Serial0 ip address 172.16.1.1 255.255.255.0
interface loopback0 shutdown
line con 0 exec-timeout 20 0
line con 0 stopbits 1
line vty 0 4 exec-timeout 20 0
line vty 0 4 transport preferred none
end
Can someone help me with this?, I was trying with awk, grep, etc but I failed.
Thanks
Last edited by Scott; 10-27-2010 at 03:42 PM..
Reason: Please use code tags
I'm trying to write a login script to ssh into a cisco switch that will run some command remotely. Similar to this expect script located here:
SSH login expect shell script to supply username and password
However, that script does not work with cisco ios. Anyway know what the best way to... (1 Reply)
Hi,
I'm somewhat new to unix OS
and I'm at course for programmers in my country.
and in the course we learn unix and how to script in unix. of course we just started and we learned only the very basic, but I'm a really computer freak and I looking for a way to make the course easier on all of... (8 Replies)
hi All, is there a way in linux to loop thru all variables sourced?
i have a set configs like
A=100
b=200
c=400
i can add the above lines to a file and source - so that $A will be 100 .. like wise
now when i do a cut -c 1-2 file.txt |sort | uniq -c on a file it returns me
A 100
B 50
c... (1 Reply)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
I know there are better ways to do this.
I prefer snmp. I do not have the proper perl modules loaded on the platorm. Snmp isnt loaded on the platform. Telnet is not an option. I need to write an expect script to pull cisco equipment configs.
The following code is executed once I gain... (0 Replies)
Is there an easy way to stack Cisco 2960-S and Cisco 2960X switches? If you have no idea, follow this:
1. Stacking is not supported on switches running the LAN Lite image. All switches in the stack must be running the LAN Base image.
2. In a mixed stack of Catalyst 2960-X and Catalyst 2960-S... (0 Replies)
Discussion started by: Ayaerlee
0 Replies
LEARN ABOUT DEBIAN
rancid
rancid(1) General Commands Manual rancid(1)NAME
rancid - Cisco configuration filter
SYNOPSIS
rancid [-dlV] (-f filename | hostname)
DESCRIPTION
rancid is a perl(1) script which uses the login scripts (see clogin(1)) to login to a device, execute commands to display the
configuration, etc, then filters the output for formatting, security, and so on. rancid's product is a file with the name of it's last
argument plus the suffix .new. For example, hostname.new.
There are complementary scripts for other platforms and/or manufacturers that are supported by rancid(1). Briefly, these are:
agmrancid Cisco Anomaly Guard Module (AGM)
arancid Alteon WebOS switches
arrancid Arista Networks devices
brancid Bay Networks (nortel)
cat5rancid Cisco catalyst switches
cssrancid Cisco content services switches
erancid ADC-kentrox EZ-T3 mux
f10rancid Force10
f5rancid F5 BigIPs
fnrancid Fortinet Firewalls
francid Foundry and HP procurve OEMs of Foundry
hrancid HP Procurve Switches
htranicd Hitachi Routers
jerancid Juniper Networks E-series
jrancid Juniper Networks
mrancid MRTd
mrvrancid MRV optical switches
mtrancid Mikrotik routesrs
nrancid Netscreen firewalls
nsrancid Netscaler
nxrancid Cisco Nexus boxes
prancid Procket Networks
rivrancid Riverstone
rrancid Redback
srancid SMC switch (some Dell OEMs)
trancid Netopia sDSL/T1 routers
tntrancid Lucent TNT
xrancid Extreme switches
xrrancid Cisco IOS-XR boxes
zrancid Zebra routing software
The command-line options are as follows:
-V Prints package name and version strings.
-d Display debugging information.
-l Display somewhat less debugging information.
-f rancid should interpret the next argument as a filename which contains the output it would normally collect from the device (
hostname) with clogin(1).
SEE ALSO control_rancid(1), clogin(1), rancid.conf(5)CAVEATS
Cisco IOS offers a DHCP server that maintains a text database which can be stored remotely or on local storage. If stored locally, the
file changes constantly and causes constant diffs from rancid. If this file's name ('ip dhcp database') matches the regex
dhcp_[^[:space:].].txt, it will be filtered.
For Catalyst switches running CatOS, type cat5, the prompt must end with '>'. clogin(1) looks for '>' to determine when a login is
successful. For example:
cat5k>
cat5k> enable
Password:
cat5k> (enable)
rancid works on Cisco Catalyst 1900 series switches that are running Enterprise Edition software. This software provides a menu at
connection time that allows a command line interface to be used by entering 'K' at the prompt.
26 April 2011 rancid(1)