Forum Discussion
Expect can be used to obtain any data through an SSH connection. Here's an example: https://github.com/sweenig/monitoring-recipes/blob/master/DataSources/Groovy/Expect/Groovy_Expect_Example.groovy
If we're talking about the same Linux_SSH logicmodule, then that uses JSch, which is great, but all the examples I've seen only execute one command per session. With Expect, you can control the entire back and forth of the SSH session. Log in, set some parameters (like terminal width and height to 0), enter privileged exec mode and execute some commands. Then it's just a matter of figuring out how to do it manually through SSH and then programming Expect to do it. Once you have the command output, you can parse through the data however you need.
Related Content
- 3 months ago