02-10-2020 07:16 AM
Hello,
I am running a XMC script to receive the output of show config/sh run against different devices:
XOS, VSP, EOS (B-Series, S-Series, ...).
cli_result = emc_cli.send("sh config")
wfile(devname,cli_result.getOutput())
It works fine except if I started the script with the S-Series. Whit S-Series I receive a
"Error: session exceeded timeout: 30 secs"
In difference to the other devices a “show conf” on CLI lasts more the 30 seconds (approximatly 55 seconds). I think thats the problem here.
I tried to cover that with a change to:
cli_result = emc_cli.send("sh config, True, 80")
wfile(devname,cli_result.getOutput())
In my opinion this should lead the script to wait for 80 secondes for a response of the send commend.
But there is no difference. I receive the same error. The hole script timeout is larger than the 120 seconds and should not be a problem here.
My questions.
Is it correct that a emc_cli.send("sh config, True, 80") leads the script to wait for 80 secondes for an answer?
Best regards
Stephan
Solved! Go to Solution.
06-23-2020 11:13 AM
Hi,
I just found that Scripting forum!
If this is still a topic, I *think* the timeout you are setting (80) is for the CLI command, but there’s also a Script Timeout in XMC. You may need to tweak it also…
There’s a key in the emc_vars dictionary for that (scriptTimeout).
You can also add a session timeout in the code, like so:
# update the session timeout in seconds
emc_cli.setSessionTimeout(60)
07-01-2020 08:31 PM
Hello Stephane,
yes it's still a topic but in another application. I will try your hints.
My inital problem with S-Serie was caused by the small "buffer" in workflows. Therefore I can't read the hole config.
Thank you very much.
Stephan
06-23-2020 11:13 AM
Hi,
I just found that Scripting forum!
If this is still a topic, I *think* the timeout you are setting (80) is for the CLI command, but there’s also a Script Timeout in XMC. You may need to tweak it also…
There’s a key in the emc_vars dictionary for that (scriptTimeout).
You can also add a session timeout in the code, like so:
# update the session timeout in seconds
emc_cli.setSessionTimeout(60)
02-10-2020 08:25 AM
Hello Ludovico,
thank you for your answer.
This is why I think there is a relation with time needed for the “show Config” output.
Best regards
Stephan
02-10-2020 08:07 AM
Make sure that XMC can login correctly (without requiring user/password) to the S-Series; right click the device and run Terminal against it.
Another thing to consider is disabling more paging on the device, before you dump the config. XMC has a CLIrules.xml file to work out how to handle a more prompt per device type, but maybe it is getting mixed up on your S-series ? Best is to disable more paging on the device upfront, before executing and show commands.