Only *one* CLI connection is allowed to be opened by the DIS to a specific device. That is, the DIS will not open multiple connections to the same device. This prevents us from overwhelming the device, etc.

If you don't close the CLI connection, it will have to time out. Until it does, no other DIS session will be able to open a connection to the device.

There is also a limit on the number of open DIS sessions. I believe the default is somewhere on the order of 25.

Closing the DIS session will automatically close all the open CLI connections for that DIS session. You should explicitly close the CLI connection when you are done with it to be sure, as well as the DIS session.

Hi Mike,

Thanks a ton for your reply. Since I am not able to run the script externally, I used your logic to run using netmri_easy. I could successfully close

and reopen session. But please help me resolve a timeout issue that puts my script into error state. The actual reload of the box can take around 3 minutes but I expect depending on the config it might take upto a good 10 minutes. My script errors out while waiting for ping to be successful. There is no error status or any details in the process logs. My script is as below.

If you leave the dis open, but close the cli_session, does the same occur? This should still work, as another cli connection session should be able to be opened after closing the first, within the same dis.

I'm not sure, until I test, if the session log is tied to cli session or the dis itself.

Hi Mike,

Yes. I tried executing only the open_cli and close_cli but I wasn't able to succeed. I got the message "Unable to connect to device:5787 " message. Perhaps my program was written incorrectly. I have to get back to this task and will ping you again soon.

Hi Mike,

Finally I got some bandwidth to work on this again... While the previous method worked fine, the problem was when you close the session, the session_logs are unavailable. This is important to me because I want to see what exactly was configured on the router. Since a session is separate from a CLI connection as you suggested, I am trying to close and reopen a cli connection. I could succesfully close a CLI connection, but unable to reopen it again. I think I have to rewrite some variables manually or passing the arguments wrong. Please help.

My logic is as follows.

$netmri->send_command() // seems to open a cli connection if there is none for the first time. later it checks the variabel cli_connection to prevent multiple connections to the box.

I close the connection using $netmri->client->broker-dissession->close()

And the next $netmri->send_command() should automatically open a new connection since there is no active connection.

Hmmm.. That's not good to know. But atleast I have one way of getting around.

If you look at the log output carefully, I still see "NetMRI::API::Broker::V2_10_0:" even though I had called out for "use NetMRI_Easy({ api_version => 2.6 })". Why is this happening? I want to be able to force run the script using the same API version since my prod and test netmri are on different versions. Let me know.