<?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: PRO TIP: Alert on OneAgent running outdated version in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286391#M1768</link>
    <description>&lt;P&gt;&lt;A title="Email Connector - Format syntax" href="https://docs.dynatrace.com/docs/shortlink/automation-workflows-email#format-syntax" target="_self"&gt;Email Connector - Dynatrace Docs&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/reference" target="_blank"&gt;Expression reference — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://jinja.palletsprojects.com/en/stable/" target="_blank"&gt;Jinja — Jinja Documentation (3.1.x)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2025 16:01:11 GMT</pubDate>
    <dc:creator>mosharref_hossn</dc:creator>
    <dc:date>2025-09-18T16:01:11Z</dc:date>
    <item>
      <title>PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/281706#M1703</link>
      <description>&lt;P&gt;EDIT:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Davis Anomaly Detected rule ended up generating too many alerts since it checks often.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We moved this query to Workflow and run it once a week to send a notification via Send Email action.&amp;nbsp;&lt;/P&gt;&lt;P&gt;*****&lt;/P&gt;&lt;P&gt;Our team needed a way to alert when the OneAgent fails to upgrade to the latest available version and running an outdated version.&lt;/P&gt;&lt;P&gt;To address this, we created the following DQL query to be used with Davis Anomaly Detection.&lt;/P&gt;&lt;P&gt;Notifications can be configured using a Management Zone in combination with an Alert Profile.&lt;/P&gt;&lt;P&gt;Alternatively, tags can also be used to help route alerts to the appropriate team.&lt;/P&gt;&lt;P&gt;We also needed to exclude hosts that could not be upgraded due to unsupported OS version (lookup sub-query).&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can exclude the subquery if that is not required.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;// Fetch hosts with installed agent versions and sort asc by Installer Version
// Sort order will help filter out any hosts that are not running the latest version in next sub-query
fetch dt.entity.host
| filter isNotNull(installerVersion) 
| fields id, entity.name, installerVersion, lifetime
// Coverting lifetime[end] value to "timestamp" enables the user to create a timeseries metric at the end to run in Davis Anomaly Detection
| fieldsAdd timestamp=toTimestamp(lifetime[end])
| fieldsRemove lifetime
// NOTE: sorted in ascending order to get oldest agent versions
| sort installerVersion asc
| limit 30
| summarize {installerVersion=max(installerVersion)}, by:{entity.name, id, timestamp}
 
// Fetch hosts with installed agent version, sort desc by Installer Version and return matching host IDs
| join [
fetch dt.entity.host
| filter isNotNull(installerVersion)
| fields  installerVersion, id
// NOTE: sorted in descending order to get latest agent versions
| sort installerVersion desc
| limit 30
], on:{id}, kind: leftOuter, fields:{latestAgentVersion=installerVersion}
// Filter out hosts matching the latest Agent version
| filter isNull(latestAgentVersion)
| fieldsRemove latestAgentVersion
 
// Fetch logs &amp;amp; lookup hosts with failed installation due to unsupported platform (dynamically)
// And exclude matched hosts.
| lookup [
    fetch logs, from:now()-48h
    | filter matchesValue(log.source, "Windows Application Log") and loglevel == "ERROR"
    | filter contains(content, "unsupported platform") and contains(content, "Dynatrace OneAgent")
    | dedup dt.entity.host
    | sort timestamp desc
| fields dt.entity.host
], sourceField: id, lookupField: dt.entity.host
 
// Exclude agents running in unsupported OS version
| filter isNull(lookup.dt.entity.host)
 
// Remove unnecessary fields
| fieldsRemove lookup.dt.entity.host

// Create timeseries metric
| maketimeseries Count=count(default:0), by:{dt.entity.host=entity.name, installerVersion}, interval:1m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps the community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 16:49:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/281706#M1703</guid>
      <dc:creator>mosharref_hossn</dc:creator>
      <dc:date>2025-09-03T16:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version with Davis Anomaly Detection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/281739#M1704</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@9BD876A77FEF3D5EF4BC972CF8A97CB1/images/emoticons/take_my_money.png" alt=":take_my_money:" title=":take_my_money:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 08:11:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/281739#M1704</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2025-07-17T08:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285338#M1747</link>
      <description>&lt;P&gt;Can you help me with the output of this query to send email? Can we have the output table in the body message when it send to email?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 14:36:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285338#M1747</guid>
      <dc:creator>joyce-regions</dc:creator>
      <dc:date>2025-09-03T14:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285348#M1748</link>
      <description>&lt;P&gt;We ended up add these additional lines of query after the timeseries. This creates a link to the Host OneAgent settings page and add the process name via lookup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the Send Email action in Workflow and add the email body markdown table to format all fields into tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query update:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Look up One Agent System monitoring process group instance which can be used as dt.source_entity, if needed for management zone. 
| lookup [
    fetch dt.entity.process_group_instance
    | fields id, entity.name, belongs_to
    | fieldsAdd process.belongs_to.dt.entity.host=belongs_to[dt.entity.host]
    | filter contains(entity.name, "OneAgent system monitoring")
], sourceField: dt.entity.host, lookupField: process.belongs_to.dt.entity.host, fields:{dt.entity.process_group_instance=id} 
| fieldsAdd process.name = entityName(dt.entity.process_group_instance)
// Create a link to host OneAgent settings
| fieldsAdd OneAgentSettings = concat("https://{environmentid}.apps.dynatrace.com/ui/apps/dynatrace.classic.hosts/ui/settings/", dt.entity.host, "/builtin:deployment.oneagent.updates?gtf=-2h&amp;amp;gf=all")
| fields host.name, installerVersion, process.name, OneAgentSettings&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;Email body markdown table:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;|      host.name       |      process.name                   |     installerVersion              |    OneAgentSettings    |
|----------------------------|----------------------------------|-----------------------------------|----------------------------------------|
{% for e in result("get_outdated_oneagent")["records"] %}
|  {{e["host.name"][:35]}}     | {{e["process.name"][:35]}}  | {{e["installerVersion"][:30]}}       | {{e["OneAgentSettings"][:160]}} |
{% endfor %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 16:56:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285348#M1748</guid>
      <dc:creator>mosharref_hossn</dc:creator>
      <dc:date>2025-09-03T16:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285738#M1756</link>
      <description>&lt;P&gt;It is super super helpful....I can retrieve the table in the email. Thank you so much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 19:59:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285738#M1756</guid>
      <dc:creator>joyce-regions</dc:creator>
      <dc:date>2025-09-10T19:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285775#M1757</link>
      <description>&lt;P&gt;Very useful query, thank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 09:24:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/285775#M1757</guid>
      <dc:creator>g_kat</dc:creator>
      <dc:date>2025-09-11T09:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286324#M1763</link>
      <description>&lt;P&gt;I am back with an issue with email body again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was success to create the email with query above, but when I apply for another query - simpler, the email was failed with error as no find out&amp;nbsp;&lt;/P&gt;&lt;P&gt;like I create query&amp;nbsp;&lt;/P&gt;&lt;P&gt;fetch dt.system.events&lt;BR /&gt;| filter event.kind == "BILLING_USAGE_EVENT" and event.type == "Full-Stack Monitoring"&lt;BR /&gt;|fieldsAdd event.type, event.billing.category&lt;BR /&gt;| summarize billed_gibibyte = sum(billed_gibibyte_hours),&lt;BR /&gt;&lt;BR /&gt;by:{event.type, dt.entity.host, dt.cost.product, dt.cost.costcenter}&lt;BR /&gt;//join two tables details with id as same conditon to look up&lt;BR /&gt;| lookup [fetch dt.entity.host&lt;BR /&gt;| fields hosts = entity.name, id, hostGroupName, dt.security_context], lookupField:id,sourceField:dt.entity.host&lt;/P&gt;&lt;P&gt;| fieldsAdd cost = (billed_gibibyte * 0.0057)&lt;BR /&gt;| summarize cost_weekly = sum(cost), by:{ dt.cost.product, dt.cost.costcenter}&lt;BR /&gt;| fields App = dt.cost.product, Costcenter = dt.cost.costcenter, cost_weekly&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then apply with the email body&lt;/P&gt;&lt;P&gt;| dt.cost.product | dt.cost.costcenter | Cost Weekly |&lt;BR /&gt;|----------------------------|-----------------------------------|----------------------------------------|&lt;BR /&gt;{% for e in result("full_stack_cost")["records"] %}&lt;/P&gt;&lt;P&gt;| {{e["App"][:30]}} | {{e["Costcenter"][:35]}} | {{e["cost_weekly"][:30]}} |&lt;BR /&gt;{% endfor %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error comes as&amp;nbsp;&lt;SPAN&gt;We couldn't preview: Undefined variables: App.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Do you know any idea?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 21:48:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286324#M1763</guid>
      <dc:creator>joyce-regions</dc:creator>
      <dc:date>2025-09-17T21:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286368#M1764</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/94658"&gt;@joyce-regions&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To preview the results of another workflow action using markdown code in the Email Action, you must provide a sample result to that previous action like this:&lt;BR /&gt;&lt;BR /&gt;You can get the raw response data by running the previous action and viewing the action execution results or running the query in Notebook and looking at the "Raw response" visualization.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mosharref_hossn_0-1758200361133.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/30146i687595892D25264A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mosharref_hossn_0-1758200361133.png" alt="mosharref_hossn_0-1758200361133.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 13:01:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286368#M1764</guid>
      <dc:creator>mosharref_hossn</dc:creator>
      <dc:date>2025-09-18T13:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286371#M1765</link>
      <description>&lt;P&gt;thank you for replying...I still cannot find out what issue is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the raw response of previous DQL task and screenshot of error. Please help!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joyceregions_0-1758201610677.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/30147i7A18F013705AC2C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joyceregions_0-1758201610677.png" alt="joyceregions_0-1758201610677.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 13:27:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286371#M1765</guid>
      <dc:creator>joyce-regions</dc:creator>
      <dc:date>2025-09-18T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286379#M1766</link>
      <description>&lt;P&gt;The results contains two data type: double, string&lt;/P&gt;&lt;P&gt;In the Jinja/markdown code,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{{e["cost_weekly"][:35]}} &lt;/LI-CODE&gt;&lt;P&gt;the slice operator like [:35] &lt;STRONG&gt;does not work on a float (double) data type&lt;/STRONG&gt; in Jinja. That explains the error in the preview.&lt;/P&gt;&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{{ "%-30s"|format(e["dt.cost.product"][:30]) }}  |   $ {{ "%-30s"|format(e["cost_weekly"]) }}&lt;/LI-CODE&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{{ "%-30s"|format(e["dt.cost.product"][:30]) }}   |  $ {{ "%.2f"|format(e["cost_weekly"]) }}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Sep 2025 14:01:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286379#M1766</guid>
      <dc:creator>mosharref_hossn</dc:creator>
      <dc:date>2025-09-18T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286383#M1767</link>
      <description>&lt;P&gt;It is worked as expect. Thanks again so much. You mentioned that syntax using jinja, Can you please share with me any docs that I can learn about this? since I need to work a lot on flow to send out email with fully table info.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 14:45:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286383#M1767</guid>
      <dc:creator>joyce-regions</dc:creator>
      <dc:date>2025-09-18T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: PRO TIP: Alert on OneAgent running outdated version</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286391#M1768</link>
      <description>&lt;P&gt;&lt;A title="Email Connector - Format syntax" href="https://docs.dynatrace.com/docs/shortlink/automation-workflows-email#format-syntax" target="_self"&gt;Email Connector - Dynatrace Docs&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/reference" target="_blank"&gt;Expression reference — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://jinja.palletsprojects.com/en/stable/" target="_blank"&gt;Jinja — Jinja Documentation (3.1.x)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 16:01:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Alert-on-OneAgent-running-outdated-version/m-p/286391#M1768</guid>
      <dc:creator>mosharref_hossn</dc:creator>
      <dc:date>2025-09-18T16:01:11Z</dc:date>
    </item>
  </channel>
</rss>

