IMC
cancel
Showing results for 
Search instead for 
Did you mean: 

Third Party Device Backup Issue

 
SOLVED
Go to solution
qos
Advisor

Third Party Device Backup Issue

I have created a custom adapter for backing up a third party device.

Currently stuck at "Failed to Execute Script"

I can log in ok via IMC Telnet proxy but when I try the backup config there is no telnet activity in wireshark.

The backup log shows:

2019-01-18 10:58:54.896 [INFO (0)] [THREAD(10748)] [imcscriptttol] log: =============================== Begin=============================
2019-01-18 10:58:54.896 [INFO (0)] [THREAD(10748)]
2019-01-18 10:58:53.629 [INFO (0)] [THREAD(11988)] [qvdm::QvGetLogFileSize] get file size from qvdm.conf: 50
2019-01-18 10:58:53.630 [INFO (0)] [THREAD(11988)] [ScriptTool::execScriptAction()] component_name: ICC, service_name: ConfigBackup, action_name: backup_running_config, input_vars: DevName=Phybridge_SW3?_?TFTPFile=running_2593189442.cfg?_?TFTPServer=10.10.10.10?_?UnitList=?_?VpnName=
2019-01-18 10:58:53.652 [INFO (2001)] [THREAD(11988)] [CCLIScriptProcessor::init()] Device login type is 1,dev_id=4054,AdaptName=PhybridgePOLRE
2019-01-18 10:58:53.653 [INFO (0)] [THREAD(11988)] [imcdm::base64_decode_string()] length of param is: 512
2019-01-18 10:58:53.654 [INFO (0)] [THREAD(11988)] [imcdm::base64_decode_string()] length of param is: 20480
2019-01-18 10:58:53.654 [INFO (-100)] [THREAD(11988)] [CSSHScriptProcessor::init()] Fail to call CSysPara::getPara() to get ssh_client.AdaptName=PhybridgePOLRE
2019-01-18 10:58:53.655 [INFO (-100)] [THREAD(11988)] [CSSHScriptProcessor::init()] Fail to call CSysPara::getPara() to get sftp_client.AdaptName=PhybridgePOLRE
2019-01-18 10:58:53.655 [WARNING (0)] [THREAD(11988)] [CQvDBReaderADP::~CQvDBReaderADP] Cancel current SQL when data have not be fetched out.
2019-01-18 10:58:53.655 [INFO (0)] [THREAD(11988)] [CComponentAdapter::parseVendorAdapter()] Begin to parse ...
2019-01-18 10:58:53.656 [INFO (0)] [THREAD(11988)] [CComponentAdapter::parseVendorAdapter()] Finished to parse!
2019-01-18 10:58:53.860 [INFO (0)] [THREAD(11988)] [CCLIScriptProcessor::login_impl()] Begin ...
2019-01-18 10:58:53.860 [INFO (0)] [THREAD(11988)] [CCLIScriptProcessor::login()] Begin ...
2019-01-18 10:58:53.860 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: spawn plink -telnet 1.2.3.4
2019-01-18 10:58:53.866 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.866 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::gotoMode()] Begin, ip: 1.2.3.4, current mode: connect, new mode: initialize
2019-01-18 10:58:53.866 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::gotoMode()] Begin, ip: 1.2.3.4, current mode: connect, new mode: exec
2019-01-18 10:58:53.867 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: C:/Program Files/iMC/server/bin/../../server/conf/adapters/ICC/U.C.Davis ECE Depts/PhybridgePOLRE/initialize.tcl
2019-01-18 10:58:53.870 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.870 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: C:/Program Files/iMC/server/bin/../../server/conf/adapters/ICC/U.C.Davis ECE Depts/PhybridgePOLRE/enter_exec.tcl
2019-01-18 10:58:53.874 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.874 [INFO (0)] [THREAD(11988)] [CCLIScriptProcessor::login()] End.
2019-01-18 10:58:53.874 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::gotoMode()] Begin, ip: 1.2.3.4, current mode: exec, new mode: exec
2019-01-18 10:58:53.874 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: C:/Program Files/iMC/server/bin/../../server/conf/adapters/ICC/U.C.Davis ECE Depts/PhybridgePOLRE/backup_running_config_tftp.tcl
2019-01-18 10:58:53.878 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.878 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::logout()] Begin, DevIP = 1.2.3.4
2019-01-18 10:58:53.878 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::gotoMode()] Begin, ip: 1.2.3.4, current mode: exec, new mode:
2019-01-18 10:58:53.878 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: C:/Program Files/iMC/server/bin/../../server/conf/adapters/ICC/U.C.Davis ECE Depts/PhybridgePOLRE/exit_exec.tcl
2019-01-18 10:58:53.882 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.882 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Begin to exec: close
2019-01-18 10:58:53.884 [INFO (0)] [THREAD(11988)] [CTclExecutor::exec_impl()] Finished.
2019-01-18 10:58:53.884 [INFO (0)] [THREAD(11988)] [CTelnetScriptProcessor::logout()] End.

2019-01-18 10:58:54.896 [INFO (0)] [THREAD(10748)] [imcscriptttol] log: =============================== End===============================

The scriptool file is deleted from the server/tmp folder so I am unable to view it.

The device itself records 3 login attempts, so not sure how this is happening as device only supports telnet and wireshark shows no telnet activity. I have removed SNMP write.

 

2 REPLIES 2
LindsayHill
Honored Contributor
Solution

Re: Third Party Device Backup Issue


@qos wrote:

The device itself records 3 login attempts, so not sure how this is happening as device only supports telnet and wireshark shows no telnet activity. I have removed SNMP write. 


 

Based on the logs you showed, and the comment that the device is recording 3 login attempts, my guess is that it almost certainly *is* making a connection to the device, but that your Wireshark session is missing it, perhaps due to incorrect filters. E.g. wrong IP, or maybe you're filtering for Telnet, but it's using SSH.

And from the other logs, my guess is that it's trying to do a TFTP backup, but that's failing for some other reason - for example ACLs/firewalls stopping TFTP from the device to the iMC server.

If at all possible, I recommend rewriting your adapter to use SCP to retrieve the backup file. 

qos
Advisor

Re: Third Party Device Backup Issue

I thought I captured the most important part of the log, but for me, what became important was the text prior to this as it showed the telnet session. At one point it showed the execution of the tftp command at login prompt.

There are a lot of unimportant errors in the log that you have to wade through to find what you're looking for.

In the end, I deleted the TCL files and created the most basic script, rather than using files from another vendor.

It;s now working.

Thanks for your help.