I have been attempting to write a script to retrieve configurations via SSH 
from Extreme devices for a while now, and have hit a bit of a block.

I have taken the standard Cisco collect via SSH and adjusted it to use the 
Extreme commands instead.

So instead of "term pag 0" or "term len 0", I've got "disable clipaging", and 
for "show running config" or "sh run" I have "show configuration detail".

For a large proportion of my Extreme devices, this works well.

All the ExtremeWare version 7.x devices return configs with no problems as the 
configuration shown by "show configuration detail" is continuous and all the 
individual config sections are separated by a "#" character.

The Black Diamond 6808s return a full config, even though the individual 
sections are separated by a blank line.

The  ExtremeXOS version 12.x devices however are being a pain.  The config 
sections look to be separated the same way as the Black Diamonds (modules have 
# prefixing titles, and a blank line between modules) however when I attempt to 
capture the config in my script, I only get the first module.

# disable paging
$ssh->exec( "disable clipaging" );

# grab stuff!
$ssh->timeout( $capture_timeout );
$ssh->read_all();
$ssh->send "sh configuration detail" );
$ssh->peek(0);

while ( (my $line = ( $ssh->read_line())))
 {
  push @config, $line;
  }

Nice and simple right?  It turns out that the read_line() bit sees the blank 
line between the modules and thinks "That's the end of the input, jump out of 
the "while" loop.

Config when viewed in Putty is:
HOSTNAME.x # sh configuration detail
#
# Module devmgr configuration.
#
configure snmp sysName "**DELETED**"
configure snmp sysLocation "*DELETED**"
configure snmp sysContact "*DELETED**"
configure timezone name GMT 0 autodst name BST  begins every last sunday march 
at 1 0 ends every last sunday october at 1 0
configure slot 1 module G48Pe
configure inline-power budget 100 slot 1
configure sys-recovery-level slot 1 reset
configure slot 1 restart-limit 5
configure slot 2 module G48Pe
configure inline-power budget 100 slot 2
configure sys-recovery-level slot 2 reset
configure slot 2 restart-limit 5
configure slot 3 module G48Pe
configure sys-recovery-level slot 3 reset
configure slot 3 restart-limit 5
configure slot 5 module G8X
configure sys-recovery-level slot 5 reset
configure slot 5 restart-limit 5
configure slot 6 module G8X
configure sys-recovery-level slot 6 reset
configure slot 6 restart-limit 5  <------------- CONFIG RETURNED BY SCRIPT 
STOPS HERE

#
# Module vlan configuration.
#
configure vlan default delete ports 1:1-48, 2:1-48, 3:1-14, 3:17-32, 3:34, 
3:36, 3:40-48, 5:1-8, 6:1-8
configure sharing address-based
... and so on.

Dumping out to a file I can see that those blank lines are "\r\n" (0x0D,0x0A) 
so I have a suspicion it's the CR that's causing it.  The terminator variable 
on my EXPECT session is at default "\n".

The only thing I have left that I can do is to create two device families - one 
for Extreme Works using my working script, and another for ExtremeXOS if I can 
get it to work with it properly.

Has anyone here had any experience backing up ExtremeXOS via script who could 
offer a few pointers?

Thanks & regards

Dave
David K. Game
Consultant - Managed Services
Logicalis UK Ltd

110 Buckingham Avenue
Slough, Berkshire, SL1 4PF
www.uk.logicalis.com<http://www.logicalis.com/>

My working hours are  09:00-17:30 UK time,  Monday-Friday.
Emails received outside this period may not quickly be responded to.
_________________________________________________
Business and technology working as one
[CA_Cert_Pro_Spectrum_r9x_sml]
Follow us on:

[cid:[email protected]]<http://www.twitter.com/@LogicalisUK>

[cid:[email protected]]<http://www.linkedin.com/company/logicalis-uk>

[cid:[email protected]]<http://www.youtube.com/user/LogicalisUK>

[cid:[email protected]]<http://www.cxounplugged.com/>


Cisco Managed Services Channel Partner
Cisco UK Services Partner of the Year 2010
Cisco UK & European Cloud Services Partner of the Year 2010
Cisco Global Architectural Excellence Partner of the Year 2010
HP Data Protector Partner of the Year 2010
IBM Centre of Technical Excellence Award - IBM Breadth
IBM Centre of Technical Excellence Award - Power AIX & System z


This email communication does not create or vary any contractual relationship 
between Logicalis and you. Internet communications are not secure and 
accordingly Logicalis does not accept any legal liability for the contents of 
this message. The contents of this email are confidential to the intended 
recipient at the email address to which it has been addressed. It may not be 
disclosed to or used by anyone other than this addressee, nor may it be copied 
in any way. If received in error, please contact Logicalis on the above 
switchboard number quoting the name of the sender and the addressee and then 
delete it from your system. Please note that neither Logicalis nor the sender 
accepts any responsibility for viruses and it is your responsibility to scan 
the email and attachments (if any).

Please be aware that Logicalis UK Ltd may monitor email traffic data and also 
email content for security purposes.

Logicalis UK Ltd,  Registered in England and Wales No: 3732397,  Registered 
Office: 110 Buckingham Avenue, Slough. Berkshire, SL1 4PF 

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
---
To unsubscribe from spectrum, send email to [email protected] with the body: 
unsubscribe spectrum [email protected]

<<inline: image005.png>>

<<inline: image006.png>>

<<inline: image007.png>>

<<inline: image008.png>>

<<inline: image001.jpg>>

Reply via email to