| |||
Unable to capture the entire result in expect_out( Posted by rsk (rsk), 7 October 2006 Hi,We are using TCL/Expect to send CLI commands to NE (network element). We see that the expect_out(buffer) does not capture the complete output of the command. This happens for commands with huge output. When we print the buffer we see that it displays only a part of output. The output has totally 67274 lines, but is displays from 66136 to 67117. We get a timed out problem because the script expects to see the prompt (which should be the last line of buffer) after the output which is missing in the buffer. We increased the buffer size (using match_max) and also the timeout value but the problem still exists. Request you to give some pointers. Regards rsk Posted by admin (Graham Ellis), 7 October 2006 I have seen several reports like this ... and I've usually recommended that the expect_out data is captured line by line rather than all into one big buffer.Posted by rsk (rsk), 9 October 2006 We are not able to conclude on this problem, we see that the behaviour is not consistent. Sometimes it writes the complete output of the command into the buffer and sometimes it only writes few lines. what could be the reason.Posted by admin (Graham Ellis), 9 October 2006 Inconsistent results are often caused by timing issues. You set off a spawned process, and then you have your expect process do a bit of housekeeping and say "can I see xxxxx in the buffer". Depending on how the remote operation / timesharing algorithm in your own computer get on, you'll match partial or whole return patterns. The problem is especially common in you end an expect regular expression with a catch-all such as .* or any count, or if you have a near-timeout case.How did you get on with my suggestion of receiving the response back line by line, rather than grabbing the whole response in one go? Expecting up to \r or \n should have done wonders for you, even though it's a bit more coding. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
| |||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |