Page 1 of 1

[Solved] Trouble with backup of Cisco switches

Posted: Wed Oct 19, 2016 10:23 pm
by mhopkins
I can backup simple devices such as Ubiquiti and the like without issues. Any ideas?


- 'String index out of range: -1'!




Oct 19 14:36:03 Unimus java[1656]: 2016-10-19 14:36:03.425 INFO 1656 --- [nio-8085-exec-6] n.u.core.util.DuplicateRequestFilter : Checking backup request address duplicity 10.20.47.254
Oct 19 14:36:03 Unimus java[1656]: 2016-10-19 14:36:03.425 INFO 1656 --- [nio-8085-exec-6] n.u.core.util.DuplicateRequestFilter : Not duplicated BackupRequest(context=JobContext(uuid=c51f1673-c2f6-415f-80a6-347fa565d436, deviceId=43, groupId=1), address=10.20.47.254, port=Port{id='3', createdTime='null', port='22'}, deviceVendor=Cisco, deviceType=IOS switch, connectorType=SSH)
Oct 19 14:36:03 Unimus java[1656]: 2016-10-19 14:36:03.430 INFO 1656 --- [nio-8085-exec-6] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.CoreRequestBuilder@37911f88]'.
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.340 WARN 1656 --- [ backup-6] n.u.c.d.cisco.CiscoIosBackupDriver : Unable to download backup - 'String index out of range: -1'!
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.348 INFO 1656 --- [ backup-6] n.u.core.util.DuplicateRequestFilter : Removing backup request address 10.20.47.254
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.349 INFO 1656 --- [ backup-6] n.u.core.util.DuplicateRequestFilter : Address removed 10.20.47.254
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.403 INFO 1656 --- [ backup-6] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.CoreRequestBuilder@37911f88]'.
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.406 INFO 1656 --- [ backup-6] n.u.core.util.DuplicateRequestFilter : Checking discovery request address duplicity 10.20.47.254
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.408 INFO 1656 --- [ backup-6] n.u.core.util.DuplicateRequestFilter : Not duplicated DiscoveryRequest(context=JobContext(uuid=3c014d52-40df-45fc-a8db-04fae5ffa720, deviceId=43, groupId=1), address=10.20.47.254)
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.410 INFO 1656 --- [ backup-6] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.ResultHandler@19e7a160]'.
Oct 19 14:36:04 Unimus java[1656]: 2016-10-19 14:36:04.412 INFO 1656 --- [ backup-6] net.unimus.core.util.MessageLogger : Logging message GenericMessage [payload=BackupResult(context=JobContext(uuid=3c014d52-40df-45fc-a8db-04fae5ffa720, deviceId=43, groupId=1), address=10.20.47.254, backupType=TEXT, timestamp=null, duration=0, backupError=SSH_BACKUP_DOWNLOAD_FAILED), headers={unimus-core-discovery-context=BackerContext(isDiscovered=false, sshConnectorConfig=SshConnectorConfig{id='null', createdTime='null', ports='[Port{id='3', createdTime='null', port='22'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpConnectorConfig=HttpConnectorConfig{id='6', createdTime='1476824869', ports='[Port{id='5', createdTime='null', port='80'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpsConnectorConfig=HttpsConnectorConfig{id='null', createdTime='null', ports='[]', connectTimeout='0', expectTimeout='0', backupTimeout='0'}), id=b8c0786f-9946-45a4-5677-38f7a48c401d, unimus-request-processing-duration=PT0.92S, timestamp=1476912964412}]
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.799 INFO 1656 --- [ discovery-10] n.u.core.util.DuplicateRequestFilter : Removing discovery request address 10.20.47.254
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.801 INFO 1656 --- [ discovery-10] n.u.core.util.DuplicateRequestFilter : Address removed 10.20.47.254
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.845 INFO 1656 --- [ discovery-10] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.CoreRequestBuilder@37911f88]'.
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.847 INFO 1656 --- [ discovery-10] n.u.core.util.DuplicateRequestFilter : Checking backup request address duplicity 10.20.47.254
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.848 INFO 1656 --- [ discovery-10] n.u.core.util.DuplicateRequestFilter : Not duplicated BackupRequest(context=JobContext(uuid=eabb96bc-49b9-4d1d-9e81-fb37267a7a11, deviceId=43, groupId=1), address=10.20.47.254, port=Port{id='3', createdTime='null', port='22'}, deviceVendor=Cisco, deviceType=IOS switch, connectorType=SSH)
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.850 INFO 1656 --- [ discovery-10] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.ResultHandler@19e7a160]'.
Oct 19 14:36:21 Unimus java[1656]: 2016-10-19 14:36:21.852 INFO 1656 --- [ discovery-10] net.unimus.core.util.MessageLogger : Logging message GenericMessage [payload=DiscoveryResult(context=JobContext(uuid=eabb96bc-49b9-4d1d-9e81-fb37267a7a11, deviceId=43, groupId=1), address=10.20.47.254, port=Port{id='3', createdTime='null', port='22'}, credentials=DeviceCredential{username='admin', password = '7 character(s)'}, deviceVendor=Cisco, deviceType=IOS switch, model=WS-C3560G-48TS, connectorType=SSH, discoveryLog=null, successful=true), headers={unimus-core-discovery-context=BackerContext(isDiscovered=false, sshConnectorConfig=SshConnectorConfig{id='null', createdTime='null', ports='[Port{id='3', createdTime='null', port='22'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpConnectorConfig=HttpConnectorConfig{id='6', createdTime='1476824869', ports='[Port{id='5', createdTime='null', port='80'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpsConnectorConfig=HttpsConnectorConfig{id='null', createdTime='null', ports='[]', connectTimeout='0', expectTimeout='0', backupTimeout='0'}), id=02466ff4-d96e-b867-32c8-ea6b7782804f, unimus-request-processing-duration=PT17.389S, timestamp=1476912981852}]
Oct 19 14:36:22 Unimus java[1656]: 2016-10-19 14:36:22.682 WARN 1656 --- [ backup-3] n.u.c.d.cisco.CiscoIosBackupDriver : Unable to download backup - 'String index out of range: -1'!
Oct 19 14:36:22 Unimus java[1656]: 2016-10-19 14:36:22.689 INFO 1656 --- [ backup-3] n.u.core.util.DuplicateRequestFilter : Removing backup request address 10.20.47.254
Oct 19 14:36:22 Unimus java[1656]: 2016-10-19 14:36:22.690 INFO 1656 --- [ backup-3] n.u.core.util.DuplicateRequestFilter : Address removed 10.20.47.254
Oct 19 14:36:22 Unimus java[1656]: 2016-10-19 14:36:22.709 INFO 1656 --- [ backup-3] net.unimus.ui.core.AbstractTableWidget : New data set change event. Event = 'DataSetChangedEvent{, topic='/1/class net.unimus.schema.Device'} net.unimus.events.DataSetChangedEvent[source=net.unimus.business.backup.handler.ResultHandler@19e7a160]'.
Oct 19 14:36:22 Unimus java[1656]: 2016-10-19 14:36:22.711 INFO 1656 --- [ backup-3] net.unimus.core.util.MessageLogger : Logging message GenericMessage [payload=BackupResult(context=JobContext(uuid=null, deviceId=43, groupId=1), address=10.20.47.254, backupType=TEXT, timestamp=null, duration=0, backupError=SSH_BACKUP_DOWNLOAD_FAILED), headers={unimus-core-discovery-context=BackerContext(isDiscovered=false, sshConnectorConfig=SshConnectorConfig{id='null', createdTime='null', ports='[Port{id='3', createdTime='null', port='22'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpConnectorConfig=HttpConnectorConfig{id='6', createdTime='1476824869', ports='[Port{id='5', createdTime='null', port='80'}]', connectTimeout='20000', expectTimeout='20000', backupTimeout='20000'}, httpsConnectorConfig=HttpsConnectorConfig{id='null', createdTime='null', ports='[]', connectTimeout='0', expectTimeout='0', backupTimeout='0'}), id=0f9c5382-57b9-162d-1bfb-029b86c70f30, unimus-request-processing-duration=PT0.839S, timestamp=1476912982711}]

Re: Trouble with backup of Cisco switches

Posted: Thu Oct 20, 2016 1:39 am
by Tomas
Hi,

As you noticed, the issue is here:
[ backup-6] n.u.c.d.cisco.CiscoIosBackupDriver : Unable to download backup - 'String index out of range: -1'!

IOS switch backup driver was based on WS-C2950SX-24, but it seems your switch behaves differently.
Is there any chance I could get SSH access to the switch to handle it properly in the backup driver?

Please PM me to work out the details.

Thanks!

Re: Trouble with backup of Cisco switches

Posted: Thu Oct 20, 2016 7:05 pm
by Tomas
After investigation, the issue was in the enable password.

Unimus IOS backup driver currently requires that the enable password is the same as the login password, or that there is no enable password at all (like when using Radius for login).

I have fixed the driver so that it logs the proper error - switching to enable mode failed, rather than a cryptic message about string index out of range :)

Re: Trouble with backup of Cisco switches

Posted: Fri Oct 21, 2016 10:10 am
by thobias
Will a future release have the option to specify separate login and enable-passwords?

Re: Trouble with backup of Cisco switches

Posted: Fri Oct 21, 2016 10:23 am
by Tomas
EDIT:
Unimus now fully supports separate Enable/Configure passwords from login credentials.

I see this as quite an important thing to have, but it will require proper implementation. To support it in a proper way, there should be a list of enable passwords in credentials screen, and which is used for which device would be automatically discovered during device discovery.

This will need changes to the wizard, the credentials screen, the discovery process (to detect which of a list of enable passwords are correct), and changes to all drivers that require entering enabled mode (not to mention rewriting all the related code and tests).

Currently the development focus is on stability and finishing up things for release.
So I would classify this as one of the first things to come after release.

You can keep track of this feature here: https://tracker.unimus.net/browse/UN-34