<?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: Add file to mail on a workflow in ExtremeCloud IQ- Site Engine Management Center</title>
    <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85599#M9259</link>
    <description>&lt;P&gt;Sure,&lt;/P&gt;&lt;P&gt;is in the workflows page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/extremenetworks/ExtremeScripting/tree/master/Netsight/oneview_workflows" target="_blank" rel="noreferrer noopener nofollow ugc"&gt;https://github.com/extremenetworks/ExtremeScripting/tree/master/Netsight/oneview_workflows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the workflow:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/extremenetworks/ExtremeScripting/blob/master/Netsight/oneview_workflows/xwf/Link_Aggregate_Alarm-8.4.0.115v8.xwf?raw=true" target="_blank" rel="noreferrer noopener nofollow ugc"&gt;https://github.com/extremenetworks/ExtremeScripting/blob/master/Netsight/oneview_workflows/xwf/Link_Aggregate_Alarm-8.4.0.115v8.xwf?raw=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is one example that I use. It sends me a csv file with the alarms for the last 24 hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 16:08:25 GMT</pubDate>
    <dc:creator>Jose_Chaves</dc:creator>
    <dc:date>2021-06-22T16:08:25Z</dc:date>
    <item>
      <title>Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85595#M9255</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How can I add a file to mail in a workflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JChaves&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 20:55:51 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85595#M9255</guid>
      <dc:creator>Jose_Chaves</dc:creator>
      <dc:date>2021-06-21T20:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85596#M9256</link>
      <description>&lt;P&gt;Hello Jose,&lt;/P&gt;&lt;P&gt;as far as I know that’s not possible with&amp;nbsp;onboard resources but you can use tools from python. Here is a working example with smtplib:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-python"&gt;import smtplib&lt;BR /&gt;from email.mime.text import MIMEText&lt;BR /&gt;from email.mime.multipart import MIMEMultipart&lt;BR /&gt;from email.mime.base import MIMEBase&lt;BR /&gt;from email import encoders&lt;BR /&gt;import os.path&lt;BR /&gt;&lt;BR /&gt;email = 'sender@domain.com'&lt;BR /&gt;send_to_email = 'receiver1@domain.com,receiver1@domain.com'&lt;BR /&gt;subject = 'My message'&lt;BR /&gt;message = 'My text'&lt;BR /&gt;file_location = '/var/log/myAttachment.txt'&lt;BR /&gt;&lt;BR /&gt;msg = MIMEMultipart()&lt;BR /&gt;msg['From'] = email&lt;BR /&gt;msg['To'] = send_to_email&lt;BR /&gt;msg['Subject'] = subject&lt;BR /&gt;&lt;BR /&gt;msg.attach(MIMEText(message, 'plain'))&lt;BR /&gt;&lt;BR /&gt;# Setup the attachment&lt;BR /&gt;filename = os.path.basename(file_location)&lt;BR /&gt;attachment = open(file_location, "rb")&lt;BR /&gt;part = MIMEBase('application', 'octet-stream')&lt;BR /&gt;part.set_payload(attachment.read())&lt;BR /&gt;encoders.encode_base64(part)&lt;BR /&gt;part.add_header('Content-Disposition', "attachment; filename= %s" % filename)&lt;BR /&gt;&lt;BR /&gt;# Attach the attachment to the MIMEMultipart object&lt;BR /&gt;msg.attach(part)&lt;BR /&gt;&lt;BR /&gt;server = smtplib.SMTP('1.1.1.1',25)&lt;BR /&gt;text = msg.as_string()&lt;BR /&gt;server.sendmail(email, send_to_email.split(','), text)&lt;BR /&gt;server.quit()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 23:56:31 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85596#M9256</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-06-21T23:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85597#M9257</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the extreme git there are some workflows, like the Aggregate report Alarm History, were you generate for example a csv file, and then in mail activity you send the mail with the csv file in attached.&lt;/P&gt;&lt;P&gt;What I don’t understand is who to put the csv file in the mail activity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;José Chaves&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 15:44:46 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85597#M9257</guid>
      <dc:creator>Jose_Chaves</dc:creator>
      <dc:date>2021-06-22T15:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85598#M9258</link>
      <description>&lt;P&gt;Hello José,&lt;/P&gt;&lt;P&gt;can you tell us what workflow on git do you meen?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 16:02:26 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85598#M9258</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-06-22T16:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85599#M9259</link>
      <description>&lt;P&gt;Sure,&lt;/P&gt;&lt;P&gt;is in the workflows page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/extremenetworks/ExtremeScripting/tree/master/Netsight/oneview_workflows" target="_blank" rel="noreferrer noopener nofollow ugc"&gt;https://github.com/extremenetworks/ExtremeScripting/tree/master/Netsight/oneview_workflows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the workflow:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/extremenetworks/ExtremeScripting/blob/master/Netsight/oneview_workflows/xwf/Link_Aggregate_Alarm-8.4.0.115v8.xwf?raw=true" target="_blank" rel="noreferrer noopener nofollow ugc"&gt;https://github.com/extremenetworks/ExtremeScripting/blob/master/Netsight/oneview_workflows/xwf/Link_Aggregate_Alarm-8.4.0.115v8.xwf?raw=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is one example that I use. It sends me a csv file with the alarms for the last 24 hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 16:08:25 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85599#M9259</guid>
      <dc:creator>Jose_Chaves</dc:creator>
      <dc:date>2021-06-22T16:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85600#M9260</link>
      <description>&lt;P&gt;The File is put to the location configured with the variable “FilePath”. Per default it is /tmp.&lt;/P&gt;&lt;P&gt;Have a look to the workflow Variables.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 16:12:51 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85600#M9260</guid>
      <dc:creator>StephanH</dc:creator>
      <dc:date>2021-06-22T16:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add file to mail on a workflow</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85601#M9261</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand, if a variable exists with a file it is automatically add to the email.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;José Chaves&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 16:41:15 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/add-file-to-mail-on-a-workflow/m-p/85601#M9261</guid>
      <dc:creator>Jose_Chaves</dc:creator>
      <dc:date>2021-06-22T16:41:15Z</dc:date>
    </item>
  </channel>
</rss>

