<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: XMC TCP Script - got Exception error &amp;quot;null&amp;quot; in ExtremeCloud IQ- Site Engine Management Center</title>
    <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86182#M9302</link>
    <description>Additionally there are some other experiences:&lt;BR /&gt;
&lt;BR /&gt;
+ XMC uses not a native tcl engine - it uses TclJava (&lt;A href="https://tcljava.sourceforge.net" target="_blank" rel="nofollow noreferrer noopener"&gt;tcljava.sourceforge.net)&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
+ notepad++ can be used for TCL syntax highlighting&lt;BR /&gt;
&lt;BR /&gt;
+ tcl for windows (active state tcl = activeTCL) can be used for better syntax checking - &lt;BR /&gt;
howexer XMC syntax for Loops "IF (condition) THEN then_action ELSE else_action ENDIF" is not possible and have to be rewritten to TCL native style "if { condition } { then_action } else | elseif { else_action }"&lt;BR /&gt;
&lt;BR /&gt;
+ temporary printing of variables values during the script run will help to check what's good and what's bad ...</description>
    <pubDate>Thu, 09 May 2019 14:00:19 GMT</pubDate>
    <dc:creator>M_Nees</dc:creator>
    <dc:date>2019-05-09T14:00:19Z</dc:date>
    <item>
      <title>XMC TCP Script - got Exception error "null"</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86180#M9300</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
i write this kind of TCL Script to configure easily the switche uplink ports with a new VLAN:&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# @DetailDescriptionStart&lt;BR /&gt;#############################################################################&lt;BR /&gt;# Modify Uplink VLAN Configuration on EXOS Switch - device-based&lt;BR /&gt;#&lt;BR /&gt;# Script        : EXOS UPL VLAN Modification&lt;BR /&gt;# Revision      : 1.0&lt;BR /&gt;# History #1    : make script running&lt;BR /&gt;# Last Updated  : 02.05.2019&lt;BR /&gt;# Author        : M.Nees (BELL)&lt;BR /&gt;#&lt;BR /&gt;#####################################################################&lt;BR /&gt;#&lt;BR /&gt;#######################################################################################&lt;BR /&gt;# @DetailDescriptionEnd&lt;BR /&gt;#######################################################################################&lt;BR /&gt;&lt;BR /&gt;# @ScriptDescription "Device-based Uplink VLAN Configuration for EXOS Switches"&lt;BR /&gt;&lt;BR /&gt;# @SectionStart (description = VLAN Informationen)&lt;BR /&gt;#&lt;BR /&gt;# @VariableFieldLabel (description = "Uplink Kennzeichner",&lt;BR /&gt;# type = String,&lt;BR /&gt;# scope = global,&lt;BR /&gt;#)&lt;BR /&gt;set var UPL_name UPLINK&lt;BR /&gt;&lt;BR /&gt;# @VariableFieldLabel (description = "Neues VLAN (max. 1 VLAN) - VLAN-ID",&lt;BR /&gt;# type = String,&lt;BR /&gt;# scope = global,&lt;BR /&gt;#)&lt;BR /&gt;set var VLAN_ID ""&lt;BR /&gt;&lt;BR /&gt;# @VariableFieldLabel (description = "VLAN Mode: Untagged (UT) oder Tagged (T)",&lt;BR /&gt;# type = String,&lt;BR /&gt;# validValues=[UT,T],&lt;BR /&gt;# scope = global,&lt;BR /&gt;#)&lt;BR /&gt;set var VLAN_mode "T"&lt;BR /&gt;# @MetaDataEnd&lt;BR /&gt;&lt;BR /&gt;###########################################################&lt;BR /&gt;# Get the list of Uplink Ports&lt;BR /&gt;&lt;BR /&gt;# Define Variable a fix start-point&lt;BR /&gt;set var UPL_port "x"&lt;BR /&gt;&lt;BR /&gt;echo "****************************************************"&lt;BR /&gt;echo "*List device port information: "&lt;BR /&gt;CLI show ports description&lt;BR /&gt;echo "****************************************************"&lt;BR /&gt;regexp  ".*${UPL_name}.*" ${CLI.OUT} isUPL_LABELexists&lt;BR /&gt;IF ([info exists isUPL_LABELexists]) THEN&lt;BR /&gt;    puts "Some Ports are labeled as $UPL_name"&lt;BR /&gt;&lt;BR /&gt;    # Add new VLAN additionally to Uplink Port&lt;BR /&gt;    CLI create vlan $VLAN_id&lt;BR /&gt;&lt;BR /&gt;    # Lets try to catch port number of uplink port&lt;BR /&gt;    set content $CLI_OUT&lt;BR /&gt;    set records [split $content "\n"]&lt;BR /&gt;    foreach line $records {&lt;BR /&gt;        IF ([regexp ".*${UPL_name}.*" $line match]) THEN&lt;BR /&gt;            set UPL_port [lindex $line 0]&lt;BR /&gt;            # Add new VLAN addiotionally to Uplink Port&lt;BR /&gt;            IF ([string equal $VLAN_mode "UT"]) THEN&lt;BR /&gt;                CLI conf vlan $VLAN_id add $UPL_port untagged&lt;BR /&gt;            ELSE&lt;BR /&gt;                CLI conf vlan $VLAN_id add $UPL_port tagged&lt;BR /&gt;            ENDIF&lt;BR /&gt;        ENDIF&lt;BR /&gt;    }&lt;BR /&gt;ENDIF&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
This is the resulting CLI Output if i run the script:&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;EMC User: root&lt;BR /&gt;EMC User Domain:&lt;BR /&gt;CLI Login: cli-admin&lt;BR /&gt;TEST-SW    10.1.1.210    05/02/2019 12:26:47 PM at 12:26:47 PM&lt;BR /&gt;****************************************************&lt;BR /&gt;*List device port information:&lt;BR /&gt;TEST-SW.1 # show ports description&lt;BR /&gt;Port   Display String        Description String                                &lt;BR /&gt;=====  ====================  ==================================================&lt;BR /&gt;1                            &lt;BR /&gt;2                            &lt;BR /&gt;3                            &lt;BR /&gt;4                            &lt;BR /&gt;5                            &lt;BR /&gt;6      UPLINK                UPLINK&lt;BR /&gt;7                            &lt;BR /&gt;8                            &lt;BR /&gt;9                            &lt;BR /&gt;10                           &lt;BR /&gt;11                           &lt;BR /&gt;12                           &lt;BR /&gt;13                           &lt;BR /&gt;14                           &lt;BR /&gt;15                           &lt;BR /&gt;16                           &lt;BR /&gt;=====  ====================  ==================================================&lt;BR /&gt;TEST-SW.2 #&lt;BR /&gt;&lt;BR /&gt;****************************************************&lt;BR /&gt;Some Ports are labeled as UPLINK&lt;BR /&gt;javax.script.ScriptException:&lt;BR /&gt;*** Script Error ***&lt;BR /&gt;null&lt;BR /&gt;&lt;BR /&gt;-&amp;gt; if { [info exists isUPL_LABELexists] } {&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
i check my script several times but i cannot recognize the error.&lt;BR /&gt;
&lt;BR /&gt;
i the past if i get such error there is a mistake in defining IF THEN Statements or i forget a paranthesis ...&lt;BR /&gt;
&lt;BR /&gt;
i start XMC debuging - does not help to find the error ...</description>
      <pubDate>Thu, 02 May 2019 18:00:20 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86180#M9300</guid>
      <dc:creator>M_Nees</dc:creator>
      <dc:date>2019-05-02T18:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: XMC TCP Script - got Exception error "null"</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86181#M9301</link>
      <description>Thanks to excellence GTAC Support. &lt;BR /&gt;
&lt;BR /&gt;
He show me several point why are problematic or errorness:&lt;BR /&gt;
&lt;BR /&gt;
+ Variables are case-sensitive  - i used $VLAN_id and $VLAN_ID - that a difference&lt;BR /&gt;
&lt;BR /&gt;
+ i use $CLI.OUT which contains the last EXOS command output - later in the script i used $CLI_OUT - this could be working because build-in script uses this too, but should be also corrected&lt;BR /&gt;
&lt;BR /&gt;
+ i had a logical error that $CLI.OUT should be filled with "show ports description" but i copy a "create vlan $VLAN_id" before which overwrite this variable with wrong input.&lt;BR /&gt;
&lt;BR /&gt;
I correct this issues and the script is running now.</description>
      <pubDate>Thu, 09 May 2019 13:51:53 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86181#M9301</guid>
      <dc:creator>M_Nees</dc:creator>
      <dc:date>2019-05-09T13:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: XMC TCP Script - got Exception error "null"</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86182#M9302</link>
      <description>Additionally there are some other experiences:&lt;BR /&gt;
&lt;BR /&gt;
+ XMC uses not a native tcl engine - it uses TclJava (&lt;A href="https://tcljava.sourceforge.net" target="_blank" rel="nofollow noreferrer noopener"&gt;tcljava.sourceforge.net)&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
+ notepad++ can be used for TCL syntax highlighting&lt;BR /&gt;
&lt;BR /&gt;
+ tcl for windows (active state tcl = activeTCL) can be used for better syntax checking - &lt;BR /&gt;
howexer XMC syntax for Loops "IF (condition) THEN then_action ELSE else_action ENDIF" is not possible and have to be rewritten to TCL native style "if { condition } { then_action } else | elseif { else_action }"&lt;BR /&gt;
&lt;BR /&gt;
+ temporary printing of variables values during the script run will help to check what's good and what's bad ...</description>
      <pubDate>Thu, 09 May 2019 14:00:19 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/xmc-tcp-script-got-exception-error-quot-null-quot/m-p/86182#M9302</guid>
      <dc:creator>M_Nees</dc:creator>
      <dc:date>2019-05-09T14:00:19Z</dc:date>
    </item>
  </channel>
</rss>

