<?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: Export text file from XMC in ExtremeCloud IQ- Site Engine Management Center</title>
    <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76621#M8598</link>
    <description>&lt;P&gt;Hello Lunee,&lt;/P&gt;&lt;P&gt;you have two options, among others:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For example, you can use the "Activity" mail in the workflow and send the information to you by mail.&lt;/LI&gt;	&lt;LI&gt;Or you can save the text file in the file&amp;nbsp;system of the Linux OS. If you include a network share in the Linux/XMC, then you can also store the text file there.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can realize the whole thing easily with Python as a workflow.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 20:16:17 GMT</pubDate>
    <dc:creator>StephanH</dc:creator>
    <dc:date>2021-09-21T20:16:17Z</dc:date>
    <item>
      <title>Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76620#M8597</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to XMC workflow.&lt;/P&gt;&lt;P&gt;I have created a workflow that list all the Non Eap ports with port name/descriptions. I need to export output in the form of text file for each switch. I can do it manually through workflow input. But I need to automate this process so that I can schedule workflow.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 20:04:50 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76620#M8597</guid>
      <dc:creator>Lunee</dc:creator>
      <dc:date>2021-09-21T20:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76621#M8598</link>
      <description>&lt;P&gt;Hello Lunee,&lt;/P&gt;&lt;P&gt;you have two options, among others:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For example, you can use the "Activity" mail in the workflow and send the information to you by mail.&lt;/LI&gt;	&lt;LI&gt;Or you can save the text file in the file&amp;nbsp;system of the Linux OS. If you include a network share in the Linux/XMC, then you can also store the text file there.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can realize the whole thing easily with Python as a workflow.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 20:16:17 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76621#M8598</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-09-21T20:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76622#M8599</link>
      <description>&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;I am able to save the text file for one switch with the custom input. I need to do it for several switches and need to have a textfile for each switch.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 20:23:29 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76622#M8599</guid>
      <dc:creator>Lunee</dc:creator>
      <dc:date>2021-09-21T20:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76623#M8600</link>
      <description>&lt;P&gt;Ahh,&lt;/P&gt;&lt;P&gt;ok I asume you contact your switches via a python script. You can start your script against the first switch and than you can change the device focus to other switches with:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-python"&gt;cli_result = emc_cli.setIpAddress(switchIp)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and close the session to the switch with&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-python"&gt;emc_cli.close()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In that way you can move thru your switches within a single workflow and you can write a file for every switch.&lt;/P&gt;&lt;P&gt;Does that help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 20:33:14 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76623#M8600</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-09-21T20:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76624#M8601</link>
      <description>&lt;PRE&gt;&lt;CODE class="language-python"&gt;from xmclib import logger&lt;BR /&gt;from xmclib import emc_vars&lt;BR /&gt;import json&lt;BR /&gt;import re&lt;BR /&gt;&lt;BR /&gt;def wf_info(log):&lt;BR /&gt;    print 'INFO:' +log&lt;BR /&gt;    logger.info(log)&lt;BR /&gt;&lt;BR /&gt;def execConfigCmd(cmd,Wait=True):&lt;BR /&gt;    wf_info("running cmd " + str(cmd))&lt;BR /&gt;    cli_results = emc_cli.send(cmd,Wait)&lt;BR /&gt;    if cli_results.isSuccess() is False:&lt;BR /&gt;        wf_error("ERROR EXECUTING COMMANDS")&lt;BR /&gt;    output = cli_results.getOutput()&lt;BR /&gt;    return output&lt;BR /&gt;&lt;BR /&gt;execConfigCmd("enable")&lt;BR /&gt;execConfigCmd("terminal length 0")&lt;BR /&gt;text = execConfigCmd("show eapol multihost interface")&lt;BR /&gt;print(text)&lt;BR /&gt;&lt;BR /&gt;import re&lt;BR /&gt;p = "(?&amp;lt;=Non-EAP RADIUS Authentication)(.*)(?=\n)"&lt;BR /&gt;matches = re.findall(p, text, re.MULTILINE)&lt;BR /&gt;print(matches)&lt;BR /&gt;port_pattern = "(?&amp;lt;=Port)(.*)(?=\n)"&lt;BR /&gt;&lt;BR /&gt;portmatches = re.findall(port_pattern, text, re.MULTILINE)&lt;BR /&gt;#print(portmatches)&lt;BR /&gt;matches1 = [str(x.replace(":","").strip()) for x in portmatches]&lt;BR /&gt;&lt;BR /&gt;count = 1&lt;BR /&gt;non_eap_port = []&lt;BR /&gt;for m in matches:&lt;BR /&gt;    status = m.strip().replace(":","").strip().lower()&lt;BR /&gt;    print("status", status)&lt;BR /&gt;    if str(status) != "disabled":&lt;BR /&gt;        emc_results.put("Finish", "True")&lt;BR /&gt;        non_eap_port.append(matches1[count])&lt;BR /&gt;&lt;BR /&gt;    count +=1&lt;BR /&gt;&lt;BR /&gt;print(non_eap_port) &lt;BR /&gt;&lt;BR /&gt;#varMatchedPorts = non_eap_port&lt;BR /&gt;#varMatchedPorts =[str(x) for x in eval(varMatchedPorts)]&lt;BR /&gt;port = ",".join(non_eap_port)&lt;BR /&gt;print("port", port)&lt;BR /&gt;out = execConfigCmd("show interface name %s"%port)&lt;BR /&gt;print ("out", out)&lt;BR /&gt;&lt;BR /&gt;try:&lt;BR /&gt;    f = open(emc_vars["Attachments"], "w")&lt;BR /&gt;    f.write(execConfigCmd("show interface name %s"%port))&lt;BR /&gt;    f.close()&lt;BR /&gt;except:&lt;BR /&gt;    wf_error("Can't write to file %s" % emc_vars["Attachments"])&lt;BR /&gt;    status = emc_results.Status;&lt;BR /&gt;    emc_results.setStatus( status.ERROR )&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 14:23:46 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76624#M8601</guid>
      <dc:creator>Lunee</dc:creator>
      <dc:date>2021-09-22T14:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76625#M8602</link>
      <description>&lt;P&gt;This is my script for workflow. From here I can save my file to /tmp/Switchname.txt from the custom input.&lt;/P&gt;&lt;P&gt;I want this custom input to be dynamic so that the filename is changed acording to the switch name.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 14:26:50 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76625#M8602</guid>
      <dc:creator>Lunee</dc:creator>
      <dc:date>2021-09-22T14:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76626#M8603</link>
      <description>&lt;P&gt;Hello Lunee,&lt;/P&gt;&lt;P&gt;it is not clear to me What is your question.&lt;BR /&gt;Do you want to know how to read the switch name or its IP?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 14:45:04 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76626#M8603</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-09-22T14:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76627#M8604</link>
      <description>&lt;P&gt;Here is a link to the API documentation:&amp;nbsp;&lt;A href="http://api.extremenetworks.com/" target="_blank" rel="noreferrer noopener nofollow ugc"&gt;http://api.extremenetworks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In addition&amp;nbsp;have a look at Markus Nikulski's last entry here, please.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is discouraged by Extreme to use the xmclibs direct.&lt;/P&gt;&lt;OEMBED url="https://community.extremenetworks.com/extremecloud-iq-site-engine-extreme-management-center-233228/xmc-python-modules-used-in-example-scripts-7805497"&gt;&lt;/OEMBED&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 14:49:22 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76627#M8604</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-09-22T14:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76628#M8605</link>
      <description>&lt;P&gt;I want to export .txt file. for example if it is saved to x.txt file for one switch then next time when the workflow is run&amp;nbsp; I want it to be saved to y.txt file.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 14:50:21 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76628#M8605</guid>
      <dc:creator>Lunee</dc:creator>
      <dc:date>2021-09-22T14:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export text file from XMC</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76629#M8606</link>
      <description>&lt;P&gt;Ah ok,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Workflows can’t save data during different runs. In that case I use a file (in the file system).&lt;/P&gt;&lt;P&gt;At first run I save to the let’s say status.log the info X.&lt;/P&gt;&lt;P&gt;At the second run I save Y to the status.log.&lt;/P&gt;&lt;P&gt;At every run I open the status.log and check what is stored in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 15:00:55 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/export-text-file-from-xmc/m-p/76629#M8606</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-09-22T15:00:55Z</dc:date>
    </item>
  </channel>
</rss>

