Post by john heasleyPost by john heasleyPost by Per-Olof OlssonIn later versions of clogin width set to 80
i changed that to 132 for clogin [-s|-c], but this was to stop a few
show commands from oscillating, particularly show vlan. but, i've not
seen the device wrap other lines as thread is implying for nexus and
ASA, of which I have none. is this perhaps driven by some other variable
on these devices, such as terminal type? ie: particular types have or
lack some capability. 500 seems like it would not be strictly portable.
fwiw, the desired effect from my PoV is that the device do no screen
manipulation in any manner what so ever for -c or -s (command or script)
mode of the login scripts. no line length handling, no line shifting,
no bolding, refreshing, etc etc.
Sorry.
Some days, most get wrong.
1. First nexus that fooled me.
After some test I find out that turning of pager also turn off wrapping.
(Nexus 5000 running version 4.2(1)N2(1a) )
Can't find any notes of this in Nexus manuals. Only ACE manual have a
note about terminal length settings:
"A value of 0 instructs the ACE to scroll continuously (no pausing) and
overrides the terminal width command."
For NX-os it looks like "terminal length 0" is what needed for initial
terminal settings to rancid.
2. Thanks for the note. I have installed the wrong version when I
updated clogin.in
Rewrite it one more time to make i easy to read and use the same lines
for command and script.
I still like to ad "terminal width 0" to one of ours 6500. The output
from show vlan is 600+ character long! And it's easier to post process
one liners from rancid.
-x_test-----------------------
show terminal
exit
-eof--------------------------
-s_test-----------------------
send "\r"
expect -re $prompt {}
send "show terminal\r"
expect -re $prompt {}
send_user $expect_out(buffer)
send "exit\r"
-eof--------------------------
/115-> clogin -x x_test cisco_6500
cisco_6500
spawn ssh -c 3des -x -l rancid cisco_6500
cisco_6500>enable
Password:
cisco_6500#
cisco_6500#terminal width 0
cisco_6500#terminal length 0
cisco_6500#show terminal
Line 1, Location: "", Type: "xterm"
Length: 0 lines, Width: 0 columns
Baud rate (TX/RX) is 9600/9600
...
/116-> clogin -s s_test cisco_6500
cisco_6500
show terminal
Line 1, Location: "", Type: "xterm"
Length: 0 lines, Width: 0 columns
Baud rate (TX/RX) is 9600/9600
/117-> clogin -x x_test nx-5000
nx-5000
spawn ssh -i .ssh/Rancid-to-Nexus -c 3des -x -l rancid nx_5000
Nexus 5000 Switch
...
nx-5000#
nx-5000# terminal width 0
^
% Invalid number, range is (24:511) at '^' marker.
nx-5000# terminal length 0
nx-5000# show terminal
TTY: /dev/pts/2 Type: "xterm"
Length: 0 lines, Width: 81 columns
Session Timeout: 30 minutes
...
/118-> clogin -s s_test nx_5000
nx_5000
show terminal
TTY: /dev/pts/2 Type: "xterm"
Length: 0 lines, Width: 81 columns
Session Timeout: 30 minutes
...
After install new patch I test to run it on our site with a mix of
2950,2960,3750, 3560, 6500 and nx-5010's.
My new patch---------------------------------------------
*** clogin.in.ORG Wed Oct 6 22:31:24 2010
--- clogin.in Thu Sep 15 05:20:01 2011
***************
*** 621,626 ****
--- 621,634 ----
# subsequent expects to handle everything as normal.
set command "set logging session disable;$command"
} else {
+ # To prevent diffs from some IOS "show vlan" output
+ # use fixed line width
+ # send "terminal width 80\r"
+ # expect -re $prompt {}
+ # some IOS "no wrap"
+ send "terminal width 0\r"
+ expect -re $prompt {}
+ #
send "terminal length 0\r"
}
# match cisco config mode prompts too, such as router(config-if)#,
***************
*** 919,927 ****
expect -re $prompt {}
send "set logging session disable\r"
} else {
! send "terminal length 0\r"
expect -re $prompt {}
! send "terminal width 80\r"
}
expect -re $prompt {}
source $sfile
--- 927,940 ----
expect -re $prompt {}
send "set logging session disable\r"
} else {
! # use fixed line width
! # send "terminal width 80\r"
! # expect -re $prompt {}
! # some ios "no wrap"
! send "terminal width 0\r"
expect -re $prompt {}
! #
! send "terminal length 0\r"
}
expect -re $prompt {}
source $sfile
-end of patch------------------------------------
Notes:
1. I can't test extreme switches but it look lite clogin skip initial
terminal settings only for commands
“ if { [ string compare "extreme" "$platform" ] } {“
not for scripts!
2. Is there any dist of clogin having “terminal width” for commands?
clogin 2.3.6 only have it for scripts!
/Peo
----------------------------------------------------------
Per-Olof Olsson Email: ***@chalmers.se
Chalmers tekniska högskola IT-service
Hörsalsvägen 5 412 96 Göteborg
Tel: 031/772 6738 Fax: 031/772 8680
----------------------------------------------------------