<?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: Error(No module named 'mysql') in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173366#M1729</link>
    <description>&lt;P&gt;You never initiated a variable that you're using in your script. Did you mean to add&lt;/P&gt;&lt;P&gt;logger = logging.getLogger(__name__)&lt;/P&gt;&lt;P&gt;maybe?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 11:02:01 GMT</pubDate>
    <dc:creator>Mike_L</dc:creator>
    <dc:date>2021-10-04T11:02:01Z</dc:date>
    <item>
      <title>Help needed for error: no module named 'mysql'</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173310#M1726</link>
      <description>&lt;P&gt;Could anyone help me with this error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RodrigoBiaggio_0-1633103452931.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/2543iEA7D046B5DD6F906/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RodrigoBiaggio_0-1633103452931.png" alt="RodrigoBiaggio_0-1633103452931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;mysql.connector&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;mysql.connector &lt;SPAN&gt;import &lt;/SPAN&gt;Error&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;requests&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;ruxit.api.base_plugin &lt;SPAN&gt;import &lt;/SPAN&gt;RemoteBasePlugin&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;logging&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class &lt;/SPAN&gt;PluginDBQuerySQL(RemoteBasePlugin):&lt;BR /&gt;    &lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;initialize&lt;/SPAN&gt;(&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;**kwargs):&lt;BR /&gt;        logger.info(&lt;SPAN&gt;"Config: %s"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;.config)&lt;BR /&gt;        &lt;SPAN&gt;self&lt;/SPAN&gt;.url = &lt;SPAN&gt;self&lt;/SPAN&gt;.config[&lt;SPAN&gt;"url"&lt;/SPAN&gt;]&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;    con = mysql.connector.connect(&lt;SPAN&gt;host&lt;/SPAN&gt;=&lt;SPAN&gt;'localhost'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;database&lt;/SPAN&gt;=&lt;SPAN&gt;'database'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;=&lt;SPAN&gt;'biaggio'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;=&lt;SPAN&gt;''&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    consulta_sql = &lt;SPAN&gt;"select * from database.tb_activegate"&lt;BR /&gt;&lt;/SPAN&gt;    cursor = con.cursor()&lt;BR /&gt;    cursor.execute(consulta_sql)&lt;BR /&gt;    linhas = cursor.fetchall()&lt;BR /&gt;    totalLinhas = cursor.rowcount&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;(self&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;**kwargs&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;        &lt;SPAN&gt;#Create topology&lt;BR /&gt;&lt;/SPAN&gt;        url = self.url + &lt;SPAN&gt;"/topology"&lt;BR /&gt;&lt;/SPAN&gt;        topology = requests.get(url).json()&lt;BR /&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;group_t &lt;SPAN&gt;in &lt;/SPAN&gt;topology:&lt;BR /&gt;            group_name = group_t[&lt;SPAN&gt;'name'&lt;/SPAN&gt;]&lt;BR /&gt;            group = self.topology_builder.create_group(group_name&lt;SPAN&gt;, &lt;/SPAN&gt;group_name)&lt;BR /&gt;            &lt;SPAN&gt;for &lt;/SPAN&gt;device_t &lt;SPAN&gt;in &lt;/SPAN&gt;group_t[&lt;SPAN&gt;'devices'&lt;/SPAN&gt;]:&lt;BR /&gt;                device_name = device_t[&lt;SPAN&gt;'name'&lt;/SPAN&gt;]&lt;BR /&gt;                device = group.create_device(device_name&lt;SPAN&gt;, &lt;/SPAN&gt;device_name)&lt;BR /&gt;                logger.info(&lt;SPAN&gt;"Topology: group name=%s, device name=%s"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;group.name&lt;SPAN&gt;, &lt;/SPAN&gt;device.name)&lt;BR /&gt;                &lt;SPAN&gt;#Collect stats&lt;BR /&gt;&lt;/SPAN&gt;                stats = device_t[&lt;SPAN&gt;'stats'&lt;/SPAN&gt;]&lt;BR /&gt;                device.absolute(&lt;SPAN&gt;key&lt;/SPAN&gt;=&lt;SPAN&gt;'totalLinhas'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;=stats[&lt;SPAN&gt;'counter'&lt;/SPAN&gt;])&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;Error &lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Erro ao acessar tabela"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;e)&lt;BR /&gt;&lt;SPAN&gt;finally&lt;/SPAN&gt;:&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(con.is_connected()):&lt;BR /&gt;        con.close()&lt;BR /&gt;        cursor.close()&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Conexao fechada"&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 12:00:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173310#M1726</guid>
      <dc:creator>RodrigoBiaggio</dc:creator>
      <dc:date>2023-05-18T12:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error(No module named 'mysql')</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173313#M1727</link>
      <description>&lt;P&gt;How does the install_requires look like in the plugin.json and are you building the extension with oneagent_build_plugin?&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 15:55:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173313#M1727</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2021-10-01T15:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error(No module named 'mysql')</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173318#M1728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/11520"&gt;@Mike_L&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put the:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;"install_requires"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;    &lt;SPAN&gt;"mysql-connector"&lt;BR /&gt;&lt;/SPAN&gt;  ]&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now it's OK for mysql, but now it returns the message to the logger module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RodrigoBiaggio_0-1633108438108.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/2545iA854788D86EC943A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RodrigoBiaggio_0-1633108438108.png" alt="RodrigoBiaggio_0-1633108438108.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm making the plugin with the activegate SDK&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 17:14:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173318#M1728</guid>
      <dc:creator>RodrigoBiaggio</dc:creator>
      <dc:date>2021-10-01T17:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error(No module named 'mysql')</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173366#M1729</link>
      <description>&lt;P&gt;You never initiated a variable that you're using in your script. Did you mean to add&lt;/P&gt;&lt;P&gt;logger = logging.getLogger(__name__)&lt;/P&gt;&lt;P&gt;maybe?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 11:02:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/173366#M1729</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2021-10-04T11:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for error: no module named 'mysql'</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256103#M5148</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/44799"&gt;@RodrigoBiaggio&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In simple steps:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;stop the activegate service.&lt;/LI&gt;&lt;LI&gt;configure the required module.&lt;/LI&gt;&lt;LI&gt;restart the activegate&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:59:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256103#M5148</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-09-17T11:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for error: no module named 'mysql'</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256104#M5149</link>
      <description>&lt;P&gt;Refer to Dynatrace URL:&amp;nbsp; &lt;A href="https://docs.dynatrace.com/docs/shortlink/activegate-capabilities#functional_tbl" target="_self"&gt;activegate Purposes&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:00:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256104#M5149</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-09-17T12:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for error: no module named 'mysql'</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256106#M5150</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/44799"&gt;@RodrigoBiaggio&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly check:&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/setup-and-configuration/dynatrace-activegate/configuration/configure-activegate#modules" target="_self"&gt;configure activegate modules&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:01:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256106#M5150</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-09-17T12:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for error: no module named 'mysql'</title>
      <link>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256107#M5151</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/44799"&gt;@RodrigoBiaggio&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;open cutom.properties file&lt;/LI&gt;&lt;LI&gt;create a section called&amp;nbsp;Section: [mysql_monitoring]&lt;/LI&gt;&lt;LI&gt;configure a new property called mysql_monitoring_enabled=true&lt;/LI&gt;&lt;LI&gt;ensure extension execution controller is enabled.&lt;/LI&gt;&lt;LI&gt;don't configure it through config.properties file, it's overwritten during AG Update.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:08:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Help-needed-for-error-no-module-named-mysql/m-p/256107#M5151</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-09-17T12:08:02Z</dc:date>
    </item>
  </channel>
</rss>

