<?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: Script UPM to trigger ports in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87590#M20862</link>
    <description>Hi Fred! thanks a lot..&lt;BR /&gt;
I recieved the following details when Upm profile was running....&lt;BR /&gt;
Really I need to make the condition: if port 1:9 and 2:9 and 2:10 status are UP then enable port 1:15 if no don't do anything.&lt;BR /&gt;
OR condition already done by another UPM profile (MnLinkDn)  without script, I mean it is enough filter just the 3 ports and when upm profile will run just read "disable port 1:15" into the script..Easy... Problem still in AND condition!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Really what I don't understand where take the other 2 ports status. I mean in the UPM's log target I can find the setted var just related to the event begin the UPM profile (point 2--&amp;gt; 15 below) but in the script I need to put a "path" for port 2:9 and 2:10&lt;BR /&gt;
&lt;BR /&gt;
UPM Profile: MnLinkUp&lt;BR /&gt;
Event: Log-Message(MnLinkUp)&lt;BR /&gt;
Profile Execution start time: 2019-08-17 04:28:58&lt;BR /&gt;
Profile Execution Finish time: 2019-08-17 04:28:59&lt;BR /&gt;
Execution Identifier: 1385     Execution Status: Fail&lt;BR /&gt;
&lt;BR /&gt;
Execution Information:&lt;BR /&gt;
2 # enable cli scripting&lt;BR /&gt;
3 # configure cli mode non-persistent&lt;BR /&gt;
4 # set var EVENT.NAME LOG_MESSAGE&lt;BR /&gt;
5 # set var EVENT.LOG_FILTER_NAME "MnLinkUp"&lt;BR /&gt;
6 # set var EVENT.LOG_DATE "08/17/2019"&lt;BR /&gt;
7 # set var EVENT.LOG_TIME "04:28:58.96"&lt;BR /&gt;
8 # set var EVENT.LOG_COMPONENT_SUBCOMPONENT "vlan.msgs"&lt;BR /&gt;
9 # set var EVENT.LOG_EVENT "portLinkStateUp"&lt;BR /&gt;
10 # set var EVENT.LOG_SEVERITY "Info"&lt;BR /&gt;
11 # set var EVENT.LOG_MESSAGE "Port %0% link UP at speed %1% and %2%"&lt;BR /&gt;
12 # set var EVENT.LOG_PARAM_0 "1:9"&lt;BR /&gt;
13 # set var EVENT.LOG_PARAM_1 "1 Gbps"&lt;BR /&gt;
14 # set var EVENT.LOG_PARAM_2 "full-duplex"&lt;BR /&gt;
15 # set var EVENT.PROFILE MnLinkUp&lt;BR /&gt;
16 # enable cli scripting&lt;BR /&gt;
17 # IF (!$MATCH($http://EVENT.LOG_COMPONENT_SUBCOMPONENT,http://vlan.msgs) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_EVENT,portLinkStateUp)) THEN&lt;BR /&gt;
$http://EVENT.LOG_COMPONENT_SUBCOMPONENT not found&lt;BR /&gt;
Error: Match syntax&lt;BR /&gt;
18 # IF (!$MATCH($http://EVENT.LOG_PARAM_0,1:9)) THEN&lt;BR /&gt;
$http://EVENT.LOG_PARAM_0 not found&lt;BR /&gt;
Error: Match syntax&lt;BR /&gt;
19 # enable port 1:15&lt;BR /&gt;
20 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF&lt;BR /&gt;
21 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF&lt;BR /&gt;
22 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF</description>
    <pubDate>Sat, 17 Aug 2019 11:56:58 GMT</pubDate>
    <dc:creator>cyrano1978</dc:creator>
    <dc:date>2019-08-17T11:56:58Z</dc:date>
    <item>
      <title>Script UPM to trigger ports</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87588#M20860</link>
      <description>Scenario is:&lt;BR /&gt;
if all port A,B,C, are UP than enable port D&lt;BR /&gt;
&lt;BR /&gt;
If one of port A,B,C are Down do anything&lt;BR /&gt;
&lt;BR /&gt;
create upm profile MnLinkUp&lt;BR /&gt;
enable cli scripting&lt;BR /&gt;
IF (!$MATCH($EVENT.LOG_COMPONENT_SUBCOMPONENT,vlan.msgs) &amp;amp;&amp;amp; !$MATCH($EVENT.LOG_EVENT,portLinkStateUp)) THEN&lt;BR /&gt;
IF (!$MATCH($EVENT.LOG_PARAM_0,1:9)) &amp;amp;&amp;amp; !$MATCH($EVENT.LOG_PARAM_0,2:9) &amp;amp;&amp;amp; !$MATCH($EVENT.LOG_PARAM_0,2:10) THEN&lt;BR /&gt;
enable port 1:15&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
create log filter MnLinkUp&lt;BR /&gt;
configure log filter MnLinkUp add events vlan.msgs.PortLinkStateUp&lt;BR /&gt;
configure log filter MnLinkUp add events vlan.msgs.PortLinkState&lt;BR /&gt;
create log target upm MnLinkUp&lt;BR /&gt;
enable log target upm MnLinkUp&lt;BR /&gt;
configure log target upm MnLinkUp filter MnLinkup severity info&lt;BR /&gt;
&lt;BR /&gt;
scritp run with out error, but never enable port 1:15</description>
      <pubDate>Fri, 16 Aug 2019 13:44:43 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87588#M20860</guid>
      <dc:creator>cyrano1978</dc:creator>
      <dc:date>2019-08-16T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script UPM to trigger ports</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87589#M20861</link>
      <description>Hi!&lt;BR /&gt;
&lt;BR /&gt;
It seems you used &amp;amp;&amp;amp; believing it was a logical OR, but it means logical AND. Change this to ||, which is logical OR. You can try it like this first (unless you already have):&lt;BR /&gt;
&lt;BR /&gt;
create upm profile MnLinkUp&lt;BR /&gt;
 enable cli scripting&lt;BR /&gt;
 IF (!$MATCH($http://EVENT.LOG_COMPONENT_SUBCOMPONENT,http://vlan.msgs) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_EVENT,portLinkStateUp)) THEN&lt;BR /&gt;
 IF (!$MATCH($http://EVENT.LOG_PARAM_0,1:9)) THEN&lt;BR /&gt;
 enable port 1:15&lt;BR /&gt;
 ENDIF&lt;BR /&gt;
 ENDIF&lt;BR /&gt;
 ENDIF&lt;BR /&gt;
&lt;BR /&gt;
If downing port 1:9 brings up 1:15, the script works on a basic level. From there, you can add more ports and see if the script still works.&lt;BR /&gt;
&lt;BR /&gt;
I saw the IF was incorrectly formatted with the ending parenthesis (violation ")" highlighted with space):&lt;BR /&gt;
&lt;BR /&gt;
IF (!$MATCH($http://EVENT.LOG_PARAM_0,1:9)       )         &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_PARAM_0,2:9) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_PARAM_0,2:10) THEN&lt;BR /&gt;
&lt;BR /&gt;
change to:&lt;BR /&gt;
&lt;BR /&gt;
IF (!$MATCH($http://EVENT.LOG_PARAM_0,1:9) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_PARAM_0,2:9) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_PARAM_0,2:10)) THEN&lt;BR /&gt;
&lt;BR /&gt;
You need to move one parenthesis from (!$MATCH($http://EVENT.LOG_PARAM_0,1:9)) to just before THEN.&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik</description>
      <pubDate>Fri, 16 Aug 2019 23:19:45 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87589#M20861</guid>
      <dc:creator>FredrikB</dc:creator>
      <dc:date>2019-08-16T23:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script UPM to trigger ports</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87590#M20862</link>
      <description>Hi Fred! thanks a lot..&lt;BR /&gt;
I recieved the following details when Upm profile was running....&lt;BR /&gt;
Really I need to make the condition: if port 1:9 and 2:9 and 2:10 status are UP then enable port 1:15 if no don't do anything.&lt;BR /&gt;
OR condition already done by another UPM profile (MnLinkDn)  without script, I mean it is enough filter just the 3 ports and when upm profile will run just read "disable port 1:15" into the script..Easy... Problem still in AND condition!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Really what I don't understand where take the other 2 ports status. I mean in the UPM's log target I can find the setted var just related to the event begin the UPM profile (point 2--&amp;gt; 15 below) but in the script I need to put a "path" for port 2:9 and 2:10&lt;BR /&gt;
&lt;BR /&gt;
UPM Profile: MnLinkUp&lt;BR /&gt;
Event: Log-Message(MnLinkUp)&lt;BR /&gt;
Profile Execution start time: 2019-08-17 04:28:58&lt;BR /&gt;
Profile Execution Finish time: 2019-08-17 04:28:59&lt;BR /&gt;
Execution Identifier: 1385     Execution Status: Fail&lt;BR /&gt;
&lt;BR /&gt;
Execution Information:&lt;BR /&gt;
2 # enable cli scripting&lt;BR /&gt;
3 # configure cli mode non-persistent&lt;BR /&gt;
4 # set var EVENT.NAME LOG_MESSAGE&lt;BR /&gt;
5 # set var EVENT.LOG_FILTER_NAME "MnLinkUp"&lt;BR /&gt;
6 # set var EVENT.LOG_DATE "08/17/2019"&lt;BR /&gt;
7 # set var EVENT.LOG_TIME "04:28:58.96"&lt;BR /&gt;
8 # set var EVENT.LOG_COMPONENT_SUBCOMPONENT "vlan.msgs"&lt;BR /&gt;
9 # set var EVENT.LOG_EVENT "portLinkStateUp"&lt;BR /&gt;
10 # set var EVENT.LOG_SEVERITY "Info"&lt;BR /&gt;
11 # set var EVENT.LOG_MESSAGE "Port %0% link UP at speed %1% and %2%"&lt;BR /&gt;
12 # set var EVENT.LOG_PARAM_0 "1:9"&lt;BR /&gt;
13 # set var EVENT.LOG_PARAM_1 "1 Gbps"&lt;BR /&gt;
14 # set var EVENT.LOG_PARAM_2 "full-duplex"&lt;BR /&gt;
15 # set var EVENT.PROFILE MnLinkUp&lt;BR /&gt;
16 # enable cli scripting&lt;BR /&gt;
17 # IF (!$MATCH($http://EVENT.LOG_COMPONENT_SUBCOMPONENT,http://vlan.msgs) &amp;amp;&amp;amp; !$MATCH($http://EVENT.LOG_EVENT,portLinkStateUp)) THEN&lt;BR /&gt;
$http://EVENT.LOG_COMPONENT_SUBCOMPONENT not found&lt;BR /&gt;
Error: Match syntax&lt;BR /&gt;
18 # IF (!$MATCH($http://EVENT.LOG_PARAM_0,1:9)) THEN&lt;BR /&gt;
$http://EVENT.LOG_PARAM_0 not found&lt;BR /&gt;
Error: Match syntax&lt;BR /&gt;
19 # enable port 1:15&lt;BR /&gt;
20 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF&lt;BR /&gt;
21 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF&lt;BR /&gt;
22 # ENDIF&lt;BR /&gt;
Error: Mismatched ENDIF</description>
      <pubDate>Sat, 17 Aug 2019 11:56:58 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87590#M20862</guid>
      <dc:creator>cyrano1978</dc:creator>
      <dc:date>2019-08-17T11:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script UPM to trigger ports</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87591#M20863</link>
      <description>Hi!&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure about the syntax in the UPM scripting. Perhaps you cannot use &amp;amp;&amp;amp; for and, so try this:&lt;BR /&gt;
&lt;BR /&gt;
if [something] then&lt;BR /&gt;
 if [something else] then&lt;BR /&gt;
 bla bla&lt;BR /&gt;
 endif&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
This will be equal to AND-ing all the port statuses.&lt;BR /&gt;
&lt;BR /&gt;
Another thought: If you only apply a script to the ports you want to monitor, you only need to check the status of the three ports. If the condition is met, you enable or disable the fourth port.&lt;BR /&gt;
&lt;BR /&gt;
configure cli mode scripting abort-on-error&lt;BR /&gt;
set var CLI.OUT 0&lt;BR /&gt;
# Execute the command&lt;BR /&gt;
show ports 1:9,2:9,2:10 information | include ready&lt;BR /&gt;
# Read the CLI text output from the command&lt;BR /&gt;
set var input $TCL(split ${CLI.OUT} "\n")&lt;BR /&gt;
# Search for the text ready within the CLI output &lt;BR /&gt;
set var ready $TCL(lsearch -glob $input "*ready*")&lt;BR /&gt;
# If no ports (of 1:9, 2:9, and 2:10) are in state ready, disable port 1:15&lt;BR /&gt;
if ($ready == -1) then&lt;BR /&gt;
disable port 1:15&lt;BR /&gt;
else&lt;BR /&gt;
enable port 1:15&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Not tested, but try it out if you like!&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik</description>
      <pubDate>Thu, 29 Aug 2019 00:22:56 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-upm-to-trigger-ports/m-p/87591#M20863</guid>
      <dc:creator>FredrikB</dc:creator>
      <dc:date>2019-08-29T00:22:56Z</dc:date>
    </item>
  </channel>
</rss>

