<?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: can any one help with custom plugin that fetches database statistics using a SQL-query? in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110139#M6990</link>
    <description>&lt;P&gt;Thank &lt;A rel="user" href="https://answers.dynatrace.com/users/4119/view.html" nodeid="4119"&gt;@Michael L.&lt;/A&gt; i will review and revert &lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 12:39:08 GMT</pubDate>
    <dc:creator>cochagwu</dc:creator>
    <dc:date>2020-03-13T12:39:08Z</dc:date>
    <item>
      <title>can any one help with custom plugin that fetches database statistics using a SQL-query?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110137#M6988</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.dynatrace.com/users/28178/view.html"&gt;@Mattias W.&lt;/A&gt; &lt;A rel="user" href="https://answers.dynatrace.com/users/35573/view.html"&gt;@Mattias W.&lt;/A&gt; can you help with the Above please?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 12:22:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110137#M6988</guid>
      <dc:creator>cochagwu</dc:creator>
      <dc:date>2020-03-13T12:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: can any one help with custom plugin that fetches database statistics using a SQL-query?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110138#M6989</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you have a OneAgent installed on the box I recommend you to follow these instructions to create a OneAgent plugin:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="https://dynatrace.github.io/plugin-sdk/readme.html" target="_blank"&gt;https://dynatrace.github.io/plugin-sdk/readme.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For ActiveGate plugins we have a help page, but it is quite similar to the OneAgent plugin, except for where it is executed from:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="https://www.dynatrace.com/support/help/extend-dynatrace/plugins/activegate-plugins/" target="_blank"&gt;https://www.dynatrace.com/support/help/extend-dynatrace/plugins/activegate-plugins/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you do not have the time to dive into the above material to create it yourself, you can also reach out to your delivery or account manager and they can reach out to our services team for helping out.&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 12:28:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110138#M6989</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2020-03-13T12:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: can any one help with custom plugin that fetches database statistics using a SQL-query?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110139#M6990</link>
      <description>&lt;P&gt;Thank &lt;A rel="user" href="https://answers.dynatrace.com/users/4119/view.html" nodeid="4119"&gt;@Michael L.&lt;/A&gt; i will review and revert &lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 12:39:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110139#M6990</guid>
      <dc:creator>cochagwu</dc:creator>
      <dc:date>2020-03-13T12:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: can any one help with custom plugin that fetches database statistics using a SQL-query?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110140#M6991</link>
      <description>&lt;P&gt;Take a look at my example:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;def collectStatsFromDB(self, device):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;try:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection&amp;nbsp;=&amp;nbsp;mysql.connector.connect(host=self.databaseUrl,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;database=self.dbName,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;user=self.dbUsername,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;password=self.dbPasswd)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sql_select_Query&amp;nbsp;=&amp;nbsp;"""&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select metric from my_table&lt;BR /&gt;            """&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor&amp;nbsp;=&amp;nbsp;connection.cursor()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.execute(sql_select_Query)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; record&amp;nbsp;=&amp;nbsp;cursor.fetchone()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;if&amp;nbsp;cursor.rowcount&amp;nbsp;&amp;gt;&amp;nbsp;0:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result&amp;nbsp;=&amp;nbsp;[record[0]]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result&amp;nbsp;=&amp;nbsp;[0]&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;# report stat counter&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device.stat_counter(key='count',&amp;nbsp;value=StatCounterDataPoint(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result[0], result[0], result[0],&amp;nbsp;1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;except&amp;nbsp;Error&amp;nbsp;as&amp;nbsp;e:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; logger.exception(e)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;finally:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;if&amp;nbsp;(connection.is_connected()):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.close()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.close()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("MySQL connection is closed")&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 13:00:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/110140#M6991</guid>
      <dc:creator>Radoslaw_Szulgo</dc:creator>
      <dc:date>2020-03-13T13:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: can any one help with custom plugin that fetches database statistics using a SQL-query?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/185783#M20747</link>
      <description>&lt;P&gt;There is now a generic way to do this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.dynatrace.com/t5/Dynatrace-tips/Custom-Database-Queries/td-p/185781" target="_blank"&gt;https://community.dynatrace.com/t5/Dynatrace-tips/Custom-Database-Queries/td-p/185781&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 15:43:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/can-any-one-help-with-custom-plugin-that-fetches-database/m-p/185783#M20747</guid>
      <dc:creator>AntonioSousa</dc:creator>
      <dc:date>2022-05-01T15:43:55Z</dc:date>
    </item>
  </channel>
</rss>

