HI Kai.
When running this command via Ansible I am getting the following:
The full traceback is:
File
"/tmp/ansible_expect_payload__etk4d92/ansible_expect_payload.zip/ansible/modules/commands/expect.py",
line 123, in wrapped
fatal: [######]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"chdir": null,
"command": "ssh admin@#########",
"creates": null,
"echo": false,
"removes": null,
"responses": {
"#": [
"show xcode load -detail",
"exit"
],
"(?i)password": "#######"
},
"timeout": 30
}
},
"msg": "No remaining responses for '#', output was 'Sess Current
Maximum\r\n === === ===== ======= =======\r\n 00 0 14
3.33% 29.28%\r\n 00 1 17 2.97% 29.02%\r\n 01 0 -
- -\r\n 01 1 - - -\r\n 02 0 -
- -\r\n 02 1 - - -\r\n 03 0 - -
-\r\n 03 1 - - -\r\n 04 0 - -
-\r\n 04 1 - - -\r\n 05 0 - -
-\r\n 05 1 - - -\r\n 06 0 - -
-\r\n 06 1 - - -\r\n 07 0 - -
-\r\n 07 1 - - -\r\n 08 0 - -
-\r\n 08 1 - - -\r\n 09 0 - -
-\r\n 09 1 - - -\r\n 10 0 - -
-\r\n 10 1 - - -\r\n 11 0 - -
-\r\n 11 1 - - -\r\nSBCHA1#'"
}
The output of the command is as below:
HA1# show xcode load -detail
12:37:54
Total Sessions: 334
----- Load -----
TCM DSP #Sess Current Maximum
=== === ===== ======= =======
00 0 85 18.78% 32.74%
00 1 82 18.80% 32.80%
01 0 82 18.58% 32.70%
01 1 85 18.56% 32.68%
02 0 - - -
02 1 - - -
03 0 - - -
03 1 - - -
04 0 - - -
04 1 - - -
05 0 - - -
05 1 - - -
06 0 - - -
06 1 - - -
07 0 - - -
07 1 - - -
08 0 - - -
08 1 - - -
09 0 - - -
09 1 - - -
10 0 - - -
10 1 - - -
11 0 - - -
11 1 - - -
I am guessing it is the - character that may be causing an issue?
On Thursday, 13 February 2020 12:14:49 UTC+2, Kai Stian Olstad wrote:
>
> On Thu, Feb 13, 2020 at 01:22:37AM -0800, Gerhard Van Der Wath wrote:
> > Thank you Kai.
> >
> > I think I am making progress, is this the output that is expected:
> >
> > "*
>
> > *",
> > "* Disconnect IMMEDIATELY if you are not an authorized user!
>
> > *",
> > "* All access and use may be monitored and/or recorded.
> *
> > ",
> > "*
>
> > *",
> >
> > "******************************************************************",
> > "",
> > "",
> > "SBCHA1# show sessions",
> > "11:17:24-107 Capacity=4000",
> > "Session Statistics -- Period -- -------- Lifetime
> > --------",
> > " Active High Total Total PerMax
>
> > High",
> > "Total Sessions 1606 1661 3346 128530803 15238
>
> > 2452",
> > "SIP Sessions 1606 1661 3346 128530803 15238
>
> > 2452",
> > "H.323 Calls 0 0 0 0 0
>
> > 0",
> > "",
> > "SIP Audio/Video Statistics -- Period -- -------- Lifetime
> > --------",
> > " Active High Total Total PerMax
>
> > High",
> > "Audio Calls 1541 1592 2582 90699117 8060
>
> > 2096",
> > "Video Calls 0 0 0 113 7
>
> > 2",
> > "Messaging Sessions 0 0 0 0 0
>
> > 0",
> > "SBCHA1# sh platform cpu-load",
> > "Timestamp: 11:17:24 Thu 2020-02-13",
> > "Total load : 9%",
> > "CPU 00 load : 9%",
> > "CPU 01 load : 9%",
> > "CPU 02 load : 10%",
> > "CPU 03 load : 9%",
> > "SBCHA1# exit",
> > "SBCHA1> "
> > ]
>
> It is as expected.
> Expect doesn't do any magic it only looks for the key in the output and
> types
> the response an hit enter and shows all the output.
>
>
> >
> > As a note, the SBC does have a ASCII banner, not sure if it may cause
> > issues.
>
> If the banner contain the same string as in our responses it will. That
> why
> it's important that the responses are unique.
>
>
> --
> Kai Stian Olstad
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/336bc837-745c-423f-b5f3-c1cdd4f703ed%40googlegroups.com.