Powershell ssh to Cisco
Hey folks,
I am looking at New-PSSession as an option but cant seem to get it to work. And dont was hoping to use something where i dont need to install a module on the collector like posh-ssh.
Im wondering if anyone has had any success using powershell to SSH on to a Cisco device like this, where username and password (##ssh.user## / ##ssh.pass## ) need to passed in to the script?
Been playing with it, and checking out docs. struggling to see something that handles this for me within pssession.
Cheers in advance
birchall
Posted 2 years ago·Last reply 2 years ago
3 comments
Sambhaji Kadam
·2 years agoHi birchallAs Stuart already mentioned Groovy is an option where many network devices can connect via SSH/Telnet and run commands on their CLI. With our Expect methods, you can write Groovy scripts that will interact with processes and devices remotely. See the attached support article to review a few examples:
Support Documentation: https://www.logicmonitor.com/support/terminology-syntax/scripting-support/groovyexpect-text-based-interaction/
LM User
·2 years agoFunny thing: The LM devs don't use Expect anymore. They've moved on to net.schmizz.sshj.SSHClient. It would be nice if there was an actual dev community where the LM devs shared reasons why they use certain libraries, tips and tricks, documentation, and examples. There was a time when LM was trying to be "friends with the developer" (remember Airbrake?). Too bad they're not trying anymore.
LM User
·2 years agoIs there a particular reason you need to do this via SSH? Groovy has several good options for SSH built in:
https://github.com/sweenig/monitoring-recipes/tree/master/DataSources/Groovy/Expect
https://github.com/sweenig/monitoring-recipes/tree/master/DataSources/Groovy/JSCH