Forum Discussion
Thank you for helping me learn more about groovy and expect.
----------------------------
cli=Expect.open(host, user, pass);
println(cli.before())
cli.expect("#");
Results in the same error.
-----------------------------
println(cli.before())
cli=Expect.open(host, user, pass);
cli.expect("#");
Results:
The script failed, elapsed time: 0 seconds - No such property: cli for class: Script129 Possible solutions: class groovy.lang.MissingPropertyException: No such property: cli for class: Script129 Possible solutions: class at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:66) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:310) at Script129.run(Script129.groovy:7)
So I don't think it works there.
--------------------------------
Noticed I didn't put a ; after the println(cli.before()) so tried
cli=Expect.open(host, user, pass);
cli.expect("#");
println(cli.before());
and got:
The script failed, elapsed time: 60 seconds - Timeout com.santaba.agent.groovyapi.expect.expectj.TimeoutException: Timeout
--------------------------------- (Surprised it ran without the semicolon)
I did something similar to your PuTTY suggestion when I was checking if the password worked. I logged in with the user I made for LogicMonitor to verify the password and it goes to: "<ISE-hostname>/<username>#". So I believe cli.expect("#") would be correct. I also noted that "show logins cli" shows the LogicMonitor account logging in from the LogicMonitor IP for 00:01 a few times (Probably from running the test script).
Related Content
- 2 years ago
- 4 months ago
- 2 years ago