I have several devices running SSH on custom port. "SSH port" field in device modeling information is updated with required value, information is available in the attribute "SshPortNumber"
I need to pass this specific SSH port number information to NCM configuration capture script.Would it be possible to send value as additional script parameter or access as device attribute?
Thanks and best regards
There is not really any configuration in NCM to set SSH port number. There is no setting on NCM model, Device Families, or the scripts themselves. Assuming the device is configured to accept SSH connections on whatever port you choose, and there is no firewall blocking the port, setting the port number in Spectrum on device attribute SshPortNum 0x12c06 should be sufficient.
If you're seeing communication issues, then would recommend to run netstat to verify the port is open, and Sniffer Trace / Packet Capture to verify communication to the device on that port.
As a side note, here is an IDEA post on using multiple SSH ports in NCM - not exactly the answer to your question, but figure this can get some exposure here: NCM - Multiple SSH ports
There are no communication issues, port is open, I can reach device on custom SSH port and configuration retrieval script can connect on custom port when I modify target port by IP address within the script.
Script written python and use netmiko library.I have also verified that that netmiko happily ignores specific values in SshPortNum 0x12c06 and attempts connection on port 2022 regardless SshPortNum value.
I have considered dedicated device group with modified script but would prefer to keep devices in the same "SSH capable" group. Send SshPortNum value as an additional argument to the script would be preferred solution.
"I have also verified that that netmiko happily ignores specific values in SshPortNum 0x12c06 and attempts connection on port 2022 regardless SshPortNum value."
How did you verify this?
I would recommend a sniffer trace and to open a ticket with Support, and upload the sniffer trace to the ticket.