Background
I have a customer who is using HP Intelligent Management Center (IMC) to monitor their switching environment. Originally they were using all HP Switching, but have slowly moved away during a refresh cycle and now use Cisco Switching, a mix between 2960X and Nexus switching.
The issue
When changing the HP IMC (Basic edition licence) over to manage the Cisco switching, everything went fine, apart from the Nexus 9K switches, which were not detected properly nor could be backed up. We contacted HP, who said the 9K switches are supported, but they would not give us any further details until we had a software support contract in place.
When we ran a manual backup of the switch we would receive the following error message;
Failed to send the configuration file from the device to the iMC Server by TFTP
The cause
The cause is down to the sysOID seen by IMC, it correctly see’s the vendor a Cisco switch, but does not identify it as a Nexus switch. The default settings for a Cisco Switch in IMC is to use CatOS commands for any operation.
Note: copy down your sysOID, we’ll need this.
One thing that people always miss as well, is setting the correct login type for the switch.
If we look at the imccfgbakdm* files we can see in the output that the wrong “adapter” is used to connect to the switch.
[WARNING (2023)] [THREAD(4608)] [CScriptTool::getDevAdapterNameFromDB()] reader no data, sql: select vendor_name,adapter_name,error_code from tbl_dev_adapter where component_name = 'Custom' and dev_id = 74 and adapter_type = 1 [ERROR (18)] [THREAD(4608)] [CComponentAdapter::getDevAdapterName()] fail to call discoverDeviceAdapter() [ERROR (18)] [THREAD(4608)] [CComponentAdapter::isDevSupportServiceAction()] fail to call getDevAdapterName().DevID=74,ServiceName = ConfigBackup
Logs can be found in “%installdir%\program files\imc\server\conf\logs\imccfgbakdm.%DATE%.txt”
The fix
The first thing we should do is manually create a device object so the Nexus 9K switch can be identified correctly.
Go to System > Resource Management > Device Definition
Click Add and fill out the form, making sure your sysOID is correct.
Next up you need to change the adapter.xml file found in;
- %installdir%\program files\imc\server\conf\adapters\cisco\
Make a copy of the XML File, then open the XML file in your prefered editor, which has to be run as the local admin, otherwise you cannot overwrite the file.
Find the line;
- <description>Cisco Nexus 7000 Series</description>
Add your sysOID to the end of this structure as per the below screenshot and save.
Finally, go back to your switch on the HP IMC web browser page, check the device model has changed, click the “synchronise” option for good measure. Ensure your login type is set correctly.
Open up the configure tab, half way down on the right hand side, click “Modify SSH” and ensure your SSH password is correct.
Finally, kick off a backup.
I am not sure why it logs a fail first in the details, then a success, we can see the backup files in HP IMC now. I believe this is because HP IMC uses the default Cisco Adapter first, which is based on CatOS commands, then fails to the NXOS command based Adapter.
This time in the imccfgbakdm* log file, you will see output such as
[INFO (0)] [THREAD(8812)] [qvdm::QvGetLogFileSize] get file size from qvdm.conf: 50 [INFO (0)] [THREAD(8812)] [ScriptTool::execScriptAction()] component_name: ICC, service_name: ConfigBackup, action_name: backup_startup_config, input_vars: TFTPFile=startup_2057518502.cfg?_?TFTPServer=SERVERIP?_?VpnName= 2017-05-08 12:13:59.195 [INFO (2001)] [THREAD(8812)] [CCLIScriptProcessor::init()] Device login type is 2,dev_id=75,AdaptName=CiscoNX7K [INFO (0)] [THREAD(324)] [CComponentAdapter::isDevSupportServiceAction] dev_id: 75, adapter_name: CiscoNX7K [INFO (0)] [THREAD(324)] [CCfgFileRestoreTask::processDeviceBackupCompleted()] New configure file backuped: 75 [INFO (0)] [THREAD(324)] [CCfgFileRestoreTask::processDeviceBackupCompleted()] New configure file backuped: 75
Update
After going live with this post, I came across a website ran by Lindsay Hill, who has some brilliant posts on HP IMC, including a Github page with some custimizations aimed at making life with HP IMC a bit easier.
I reached out to Lindsay to ask him to vet my post, and helpfully he provided a suggestion as to why the backup fails, then is successful.
The bit that you're missing is related to file transfer type. Looks like your default transfer type is set to TFTP. It's first attempting to do the backup via either TFTP or FTP, where the switch is sending the traffic back to the IMC server via TFTP or FTP. For whatever reason, that fails, so it switches to its fallback method of basically doing "show run" and capturing the output. I recommend changing the file transfer type to SCP for those devices. More secure, and more reliable. Off the top of my head, those adapters support SCP, so it should try that first, and it should get rid of that failure message you see there.