ConfD User Community

Write commands from Jsch client to confd, to execute cli config command

Hi, everyone

I am trying to work on a java client to access confd via ssh.
Once ssh session is established, I write ‘config t’ cli commands. Code is like following,
session.sendCommand(“config t”)
It is success.
Then I attempt to write ‘top interfaces xx xxx’ commands, code is like following line.
session.sendCommand(“top”)
But this will not give a success, ‘top’ cannot be recognized as a valid command to run.

Coud you please help and take a look at this kind of usage?
Is that possible to get cli commands work with java ssh client to manipulate configurations?

Thanks a lot.
Pete

That must be something in your client. ConfD SSH is commonly used with Expect-like libraries for tasks like test automation; we are using Python’s pexpect, and I successfully tested it with expect4java in Java.

Thank you very much for your reply. I will try with expect4java.

I’m not saying this is the best variant, there is a whole list of Expect-like libraries in Java, I just picked one of them that has clear how-to instructions and looked to be easy to set up in my environment.