<?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: Create a list of unmonitored processes. in Alerting</title>
    <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/267535#M5392</link>
    <description>&lt;P&gt;I Tried importing the JSON for the Dashboard. It gives the error. Can I get a DQL for the same in order make the Dashboard.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2025 14:09:41 GMT</pubDate>
    <dc:creator>RagavendranSelv</dc:creator>
    <dc:date>2025-01-15T14:09:41Z</dc:date>
    <item>
      <title>Create a list of unmonitored processes and alert when the monitoring for process stops</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241649#M4300</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How can I create a chart or metric to know which processes are not monitored by Dynatrace?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm facing the issue that suddenly there are processes not being monitored and they need to be monitored. I have to manually check each Dynatrace deployment.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ellery_0-1712084183973.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18629iFC6C9C433C46408C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ellery_0-1712084183973.png" alt="Ellery_0-1712084183973.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And having a metric or a query, I can create alerts that notify us when a process stops being monitored.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 12:43:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241649#M4300</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2025-12-18T12:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241668#M4301</link>
      <description>&lt;P&gt;Hi Ellery,&lt;/P&gt;&lt;P&gt;Sorry I have just relaized that this is a DQL question for Saas...Maybe you can reuse some part of the Managed way.&lt;/P&gt;&lt;P&gt;You can create a list about the PROCESS_GROUP_INSTANCE stauses in the Environment API v2&amp;nbsp; Monitored entities - Monitoring state endpoint:&lt;/P&gt;&lt;P&gt;In my case the example status is different...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mizs_1-1712093663433.png" style="width: 780px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18635i8CFC4C8382BC3225/image-dimensions/780x67?v=v2" width="780" height="67" role="button" title="Mizs_1-1712093663433.png" alt="Mizs_1-1712093663433.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mizs_2-1712093752319.png" style="width: 732px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18636iD38202C30C37045E/image-dimensions/732x312?v=v2" width="732" height="312" role="button" title="Mizs_2-1712093752319.png" alt="Mizs_2-1712093752319.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;query result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mizs_3-1712093832610.png" style="width: 768px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18637i1A648BB69AD08A86/image-dimensions/768x144?v=v2" width="768" height="144" role="button" title="Mizs_3-1712093832610.png" alt="Mizs_3-1712093832610.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mizső&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 21:46:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241668#M4301</guid>
      <dc:creator>Mizső</dc:creator>
      <dc:date>2024-04-02T21:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241709#M4305</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you very much for your help, but what I'm looking for is to have a grid or list with the processes that are not monitored or need to be restarted, so that I can add alarms to them and be notified. On the other hand, I don't want to have to check host by host if their processes are being monitored.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 11:55:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/241709#M4305</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-04-03T11:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245077#M4459</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, good morning. Could someone help me with this issue? Yesterday, for some reason, one of the processes was left unmonitored, and we couldn't use the 'window.dyantrace()' command, which impacted us as the traces we are sending didn't arrive.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:44:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245077#M4459</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-05-08T12:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245098#M4461</link>
      <description>&lt;P&gt;So the endgame here would to be able to create an alert?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 15:19:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245098#M4461</guid>
      <dc:creator>Dant3</dc:creator>
      <dc:date>2024-05-08T15:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245124#M4464</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Create an alert, a KPI that indicates the number of UNMONITORED processes, in order to regularize them. Any of these methods would serve us, but unfortunately, the only way I have found is to constantly check the deployment status and review the nodes and each of their processes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ellery_0-1715194759086.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/19714i0AACB7E69FAEBA11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ellery_0-1715194759086.png" alt="Ellery_0-1715194759086.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 18:59:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245124#M4464</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-05-08T18:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245142#M4467</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/65321"&gt;@Ellery&lt;/a&gt;, If you are on SaaS as well as the new Platform - you could possibly leverage a workflow to generate an alert for the process that need a restart:&lt;BR /&gt;&lt;BR /&gt;Here is an example of the 2 tasks that I have in a workflow that can possibly help alert on process that need to be restarted, one thing to preface is there since there is ingest and querying of data - there are costs associated with just running this and is really just meant to serve as an example.&lt;BR /&gt;&lt;BR /&gt;I will upload a copy of the Workflow json so you can upload it into your environment.&lt;BR /&gt;&lt;BR /&gt;1. DQL Query tile: to fetch a list of hosts - the results from this is to be used in a subsequent task&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rkdy_0-1715222053660.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/19720i3A57399B250E8D7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rkdy_0-1715222053660.png" alt="rkdy_0-1715222053660.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp; The second task is going to use a JavaScript action:&amp;nbsp;The code fetches information about process group instances associated with a given hostname from Dynatrace. It checks the monitoring states of these instances, and if any state indicates a need for restart (e.g., contains "restart"), it logs information about the processes and ingests an event into Dynatrace indicating the need for restart, including the reason for restart as a property.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { queryExecutionClient } from '@dynatrace-sdk/client-query';
import { monitoredEntitiesMonitoringStateClient } from "@dynatrace-sdk/client-classic-environment-v2";
import { actionExecution } from "@dynatrace-sdk/automation-utils";
import { EventIngest, EventIngestEventType, eventsClient } from '@dynatrace-sdk/client-classic-environment-v2';

async function getProcessInformation(hostname) {
  const timeout = 60;

  const query = `
      fetch dt.entity.process_group_instance 
      | lookup [fetch dt.entity.host], sourceField:belongs_to[dt.entity.host], lookupField:id 
      | filter lookup.entity.name == "${hostname}"
  `;

  const response = await queryExecutionClient.queryExecute({
    body: {
      query,
      requestTimeoutMilliseconds: timeout * 1000,
      fetchTimeoutSeconds: timeout,
    },
  });

  return response.result.records || [];
}

export default async function ({ action_execution_id }) {
  try {
    const pageSize = 500;
    const results = [];
    const actionExe = await actionExecution(action_execution_id);
    const hostname = actionExe.loopItem.hostname_variable["entity.name"];

    const processInfoList = await getProcessInformation(hostname);

    for (const processInfo of processInfoList) {
      const config = {
        entitySelector: `type("PROCESS_GROUP_INSTANCE"),entityId("${processInfo.id || ''}")`,
        nextPageKey: undefined,
        pageSize,
      };

      const monitoringStatesData = await monitoredEntitiesMonitoringStateClient.getStates(config);

      if (!monitoringStatesData || !monitoringStatesData.monitoringStates || monitoringStatesData.monitoringStates.length === 0) {
        continue;
      }

      const entityName = processInfo['entity.name'] || '';

      for (const state of monitoringStatesData.monitoringStates) {
        if (state.state.includes("restart")) {
          const result = {
            processId: processInfo.id || '',
            processName: entityName,
            monitoringState: state.state || '',
            severity: state.severity || '',
          };
          results.push(result);

          const processRestartEvent: EventIngest = {
            eventType: EventIngestEventType.CustomAlert,
            title: 'Process restart needed',
            entitySelector: `type("PROCESS_GROUP_INSTANCE"),entityId("${processInfo.id || ''}")`,
             properties: {
              'reason.for.restart':  state.state || ''
            },
          };
          await eventsClient.createEvent({ body: processRestartEvent });

          break;
        }
      }
    }
    
    console.log(results);
    
    return results;
  } catch (error) {
    console.error("Error:", error);
    return "Failed to fetch process information and monitoring states";
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This is how that would look like in Dynatrace&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rkdy_2-1715222660204.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/19722i6A4D7C7E442F227E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rkdy_2-1715222660204.png" alt="rkdy_2-1715222660204.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If all that you are trying to do is have this data displayed on a dashboard you can upload the dashboard json attached and see if that would work for your use case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 02:51:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/245142#M4467</guid>
      <dc:creator>rkdy</dc:creator>
      <dc:date>2024-05-09T02:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/267535#M5392</link>
      <description>&lt;P&gt;I Tried importing the JSON for the Dashboard. It gives the error. Can I get a DQL for the same in order make the Dashboard.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 14:09:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/267535#M5392</guid>
      <dc:creator>RagavendranSelv</dc:creator>
      <dc:date>2025-01-15T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a list of unmonitored processes.</title>
      <link>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/283208#M5802</link>
      <description>&lt;P&gt;I have this query, it is the closest to the result I want, but I think it still needs improvement, for example, the version of One Agent would have to be changed manually.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.process_group_instance
| lookup [fetch dt.entity.host], sourceField:belongs_to[dt.entity.host], lookupField:id
| fieldsAdd installerVersion
| filter isNotNull(installerVersion)
| filter installerVersion != "1.319.55.20250725-104938"
| fieldsRemove id, lookup.id
| sort installerVersion desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 23:45:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/Create-a-list-of-unmonitored-processes-and-alert-when-the/m-p/283208#M5802</guid>
      <dc:creator>YeudyGomez</dc:creator>
      <dc:date>2025-08-06T23:45:15Z</dc:date>
    </item>
  </channel>
</rss>

