Rldeckard / sshRunCMD

Used to run concurrent changes to Cisco network devices
1 stars 1 forks source link

Improve go routine implementation #12

Closed infosecwatchman closed 1 year ago

infosecwatchman commented 1 year ago

https://github.com/Rldeckard/sshRunCMD/blob/2106065aa7093beac13efdda05f7a62709e86df9/main.go#L291

The current implementation could use some improvement. Also, could separate the ping check from the ssh login function. Having a separate function would allow you to check the device response while waiting for commands and then only pass an array of online devices.

Rldeckard commented 1 year ago

I agree about the go routine if you want to tackle that, but I think I want the pings done in this fashion. If you want a ping check function for visibility that's fine, but I don't want a separate go routine doing pings. It's already fast enough and I don't want to be stuck waiting for pings instead of applying commands. This method also allows us to have a higher ping timeout since it's only dependent on that 1 individual device instead of the continuity of the program.

infosecwatchman commented 1 year ago

Completed in PR #13