XMC TCL script results with 'javax.script.ScriptException: *** Script Error *** null'

  • 0
  • 1
  • Problem
  • Updated 2 months ago
  • Solved
  • (Edited)
Hello,

Couple of days ago I was trying to play with XMC scripting capabilities to combine it with VOSS device (VSP4K).
To start with something simple to check if it works, I did a script to enable a port.
CLI script type with exact port specified worked:
enable
configure terminal
interface GigabitEthernet 1/1
no shutdown
exit
I wanted to do the same but with $port variable instead of a fixed port number. I've created a TCL script to be able to do that, and then during the execution XMC did 'configure terminal', I see some standard output about 'CTRL/Z' but then the script didn't continue, there was an error instead:
javax.script.ScriptException:
*** Script Error ***
null
The same if I try a TCL script but with fixed port number instead of $port.
What do I do wrong with that TCL script?
That looks more like a bug but perhaps there's something I don't know.
I've selected a port with $port version obviously. ;)

Regards,
Tomasz


Photo of Tomasz

Tomasz

  • 1,642 Points 1k badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Pala, Zdenek

Pala, Zdenek, Employee

  • 9,824 Points 5k badge 2x thumb
Hi Tomek.

I suggest to check some examples available at GitHub. There are two ways how you can enter the port. Option 1 is to use the input form. Option 2 is to select the port from the list.

Good luck and if you create some useful script feel free to share!

Z.


Photo of Tomasz

Tomasz

  • 1,640 Points 1k badge 2x thumb
Hi Zdenek,

Thank you for the examples. I planned to use the port list approach.
I see there's a lot of things around that small simple $port variable. I'll drill it down to spot the issue on my side.

Apparently, I would like to clone some stuff from EFO for creating VSNs on VSP/ERS devices - unless I get any info that it is already planned for XMC for implementation. ;)

Kind regards,
Tomasz
Photo of Pala, Zdenek

Pala, Zdenek, Employee

  • 9,824 Points 5k badge 2x thumb
Create VSNs on VSP/ERS is already available. With Fabric Management introduced in XMC 8.2 you will have much more robust tool.

of course you can create your own scripts/workflows. feel free to share.
(Edited)
Photo of Tomasz

Tomasz

  • 1,640 Points 1k badge 2x thumb
Fabric Management? Sounds EXTREMEly good! :)
Photo of Pala, Zdenek

Pala, Zdenek, Employee

  • 9,824 Points 5k badge 2x thumb
We had sneak preview of that in July. It will be demonstrated at the partner conference to the broad audience.
Photo of Pala, Zdenek

Pala, Zdenek, Employee

  • 9,824 Points 5k badge 2x thumb
I suggest to start to move to Python from TCL. It is much easier to troubleshoot and much more powerful. Some examples are at GitHub also.
Photo of Tomasz

Tomasz

  • 1,410 Points 1k badge 2x thumb
But does that Python in XMC drive the scripts server-side, or is it a Python that goes to the switch and executes there? If the latter, I agree with you in case of EXOS. For VOSS I didn't see Python support yet...?
Photo of Pala, Zdenek

Pala, Zdenek, Employee

  • 9,824 Points 5k badge 2x thumb
Python works the same as TCL there. Executed in XMC and output is sent to the CLI.