# Alerting on a process needing a restart

**URL:** <https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261>\
**Category:** Alerting\
**Tags:** problems-classic\
**Created:** [May 24, 2022, 10:10am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261 "2022-05-24T10:10:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulraj\_Atwal](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kulraj\_Atwal](https://community.dynatrace.com/u/Kulraj_Atwal)\
**Post date:** [May 24, 2022, 10:10am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/1 "2022-05-24T10:10:09Z")

</div>

When a process needs restarting for injection to complete, there’s no way of us knowing until we manually check via the UI or an API call.&nbsp; Is there a way to alert on this issue so we know when processes are not correctly monitored.

---

<div class="post-metadata">

**Author:** ![jiri\_stefanek](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jiri\_stefanek](https://community.dynatrace.com/u/jiri_stefanek)\
**Post date:** [May 24, 2022, 11:53am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/2 "2022-05-24T11:53:55Z")

</div>

hi,&nbsp;I’d be very interested to know how to find this out, by pure coincidence we’ve noticed this issue on a couple of processes - See below  
**Process isn’t monitored**  
**Process is ready to be monitored, waiting for injection status…**  
If there is some way to be informed of this status, I would appreciate it.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 24, 2022, 12:35pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/3 "2022-05-24T12:35:21Z")

</div>

Hi&nbsp;[@Kulraj\_Atwal](https://community.dynatrace.com/user/4893),

You can check your processes that need to be restart with&nbsp;[Processes API - GET all processes](https://www.dynatrace.com/support/help/shortlink/api-processes-get-all)&nbsp;which returns under MonitoringState a Boolean element called&nbsp;restartRequired.

You can set alert into dynatrace with [Events API v2 - POST an event](https://www.dynatrace.com/support/help/shortlink/api-events-v2-post-event)

In order to run it automatically&nbsp;every minute you can create&nbsp;[Active Gate extension](https://www.dynatrace.com/support/help/shortlink/activegate-extensions-intro#what-is-the-activegate-extensions-architecture)&nbsp;(v1).

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Kulraj\_Atwal](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kulraj\_Atwal](https://community.dynatrace.com/u/Kulraj_Atwal)\
**Post date:** [May 24, 2022, 12:58pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/4 "2022-05-24T12:58:45Z")

</div>

Problem with that is that (apart from creating the extension) is that it also shows true for processes that are injected but need a restart due to the agent being updated.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 24, 2022, 1:28pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/5 "2022-05-24T13:28:51Z")

</div>

Good point&nbsp;[@Kulraj\_Atwal](https://community.dynatrace.com/user/4893)

To eliminate those you can check if the&nbsp;agent version of the process instance is different&nbsp;then the one on the host.&nbsp;🙄

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Kulraj\_Atwal](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kulraj\_Atwal](https://community.dynatrace.com/u/Kulraj_Atwal)\
**Post date:** [May 24, 2022, 1:58pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/6 "2022-05-24T13:58:26Z")

</div>

Thanks&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931), worst case we may have to develop that solution.

Although being as we pay Dynatrace so much i was hoping they might develop something we can all use to alert on it ootb 🙂

---

<div class="post-metadata">

**Author:** ![jiri\_stefanek](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jiri\_stefanek](https://community.dynatrace.com/u/jiri_stefanek)\
**Post date:** [May 25, 2022, 8:26am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/7 "2022-05-25T08:26:07Z")

</div>

How would you work with this status below?  
**Process isn’t monitored**  
**Process is ready to be monitored, waiting for injection status…**

Is there any way to list only these processes via API and create an alert for them?

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 25, 2022, 9:45am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/8 "2022-05-25T09:45:21Z")

</div>

Hi&nbsp;[@jiri\_stefanek](https://community.dynatrace.com/user/30685)

IMO Its a combination of&nbsp;_expectedMonitoringState_ and&nbsp;_actualMonitoringState_ elements under&nbsp;_monitoringState_

**Process isn’t monitored** = _expectedMonitoringState_&nbsp;= OFF

**Process is ready to be monitored, waiting for injection status =** &nbsp;&nbsp;_actualMonitoringState_&nbsp;= OFF &&nbsp;_expectedMonitoringState_ = ON

 ![Yosi_Neuman_0-1653471881760.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/7/c78ec3228d67658b1008b87ae36609b0d34416de.png)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 25, 2022, 3:50pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/9 "2022-05-25T15:50:42Z")

</div>

Hi&nbsp;[@Kulraj\_Atwal](https://community.dynatrace.com/user/4893)

Please check the attached AG extension.

**\*\* Please be aware that its a quick and dirty one ,which checked only on sand box environment \*\***

It browses all processes and if there is a a process marked as&nbsp; **restartRequired** &nbsp;its look for the Host OA version and compere it with the process OA version,&nbsp;if the versions are not equals CUSTOM\_ALERT is set with ‘Need to restart’ message,&nbsp;if the version are equals&nbsp;AVAILABILITY\_EVENT is set with 'Must restart" message.

Both events are set for 2 minutes timeout so it will close automatically&nbsp;after&nbsp; **restartRequired** &nbsp;is change to False.

Here is one problem open after upgrading&nbsp; OA and not restating&nbsp;the Outlook

 ![Yosi_Neuman_1-1653493759136.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/2/f2e4609f8bf79552a00a210a6401b051a50a3dc6.png)

HTH

Yos&nbsp;  
[custom.remote.python.CheckIfProcessNeedRestart.zip](https://community.dynatrace.com/uploads/short-url/zLGrhUvylKTrKVKsncDkzwuYTzY.zip) (5.1 KB)

---

<div class="post-metadata">

**Author:** ![techean](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/techean/32/227_2.png) [@techean](https://community.dynatrace.com/u/techean)\
**Post date:** [May 26, 2022, 4:18am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/10 "2022-05-26T04:18:22Z")

</div>

Alerts on availability using the alerting profiles.

[https://www.dynatrace.com/support/help/how-to-use-dynatrace/problem-detection-and-analysis/notificat…](https://www.dynatrace.com/support/help/how-to-use-dynatrace/problem-detection-and-analysis/notifications-and-alerting/alerting-profiles/)

[https://www.dynatrace.com/support/help/how-to-use-dynatrace/problem-detection-and-analysis/basic-con…](https://www.dynatrace.com/support/help/how-to-use-dynatrace/problem-detection-and-analysis/basic-concepts/event-types/availability-events/)

---

<div class="post-metadata">

**Author:** ![Kulraj\_Atwal](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kulraj\_Atwal](https://community.dynatrace.com/u/Kulraj_Atwal)\
**Post date:** [May 26, 2022, 9:49am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/11 "2022-05-26T09:49:18Z")

</div>

Yeah those 2 links dont answer my question, thanks though 🙂

---

<div class="post-metadata">

**Author:** ![Kulraj\_Atwal](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kulraj\_Atwal](https://community.dynatrace.com/u/Kulraj_Atwal)\
**Post date:** [May 26, 2022, 5:43pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/12 "2022-05-26T17:43:44Z")

</div>

Thanks&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;i will have&nbsp; a look at this and report back.

---

<div class="post-metadata">

**Author:** ![Jack\_Stuart](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jack_stuart/32/34583_2.png) [@Jack\_Stuart](https://community.dynatrace.com/u/Jack_Stuart)\
**Post date:** [August 30, 2022, 10:35am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/13 "2022-08-30T10:35:41Z")

</div>

Hi&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931),

This is a good suggestion however the process/topology api is deprecated and to be replaced by the v2 entity api. The v2 entity api does not return those properties when you query processes so unless the v2 api is changed this solution isn’t viable.

Thanks  
Jack

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [August 30, 2022, 11:21am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/14 "2022-08-30T11:21:39Z")

</div>

Hi&nbsp;[@Jack\_Stuart](https://community.dynatrace.com/user/15202)

Process API is not listed (yet) as deprecated one in&nbsp;[Deprecated APIs](https://www.dynatrace.com/support/help/shortlink/api-deprecated)

IMO its still OK to use it till Entity API will show also this information.

Yos

---

<div class="post-metadata">

**Author:** ![Jack\_Stuart](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jack_stuart/32/34583_2.png) [@Jack\_Stuart](https://community.dynatrace.com/u/Jack_Stuart)\
**Post date:** [August 30, 2022, 11:51am UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/15 "2022-08-30T11:51:56Z")

</div>

Thanks&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931). My bad, I misinterpreted the yellow banner. Do you have any suggestions on how we would use the entity api to show the information? it doesn’t look to get returned in the entities properties.

---

<div class="post-metadata">

**Author:** ![jiri\_stefanek](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jiri\_stefanek](https://community.dynatrace.com/u/jiri_stefanek)\
**Post date:** [August 30, 2022, 12:07pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/16 "2022-08-30T12:07:19Z")

</div>

Is there any way to list only these processes via API and create an alert for them?  
**Process isn’t monitored**  
**Process is ready to be monitored, waiting for injection status…**

Any tips how to do it?

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [August 30, 2022, 1:26pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/17 "2022-08-30T13:26:12Z")

</div>

Hi&nbsp;[@jiri\_stefanek](https://community.dynatrace.com/user/30685)

Please look at my answer [below](https://community.dynatrace.com/post/187217)&nbsp;its includes an active gate extension that you can play with and change in order to get what you are looking for.

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [August 30, 2022, 1:36pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/18 "2022-08-30T13:36:47Z")

</div>

Hi&nbsp;[@Jack\_Stuart](https://community.dynatrace.com/user/15202)

Sorry, as you noticed I also did not find a way to get this information, regarding the state of the process, from entity api.&nbsp;:roll\_eyes:

Yos

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [April 16, 2023, 3:21pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/19 "2023-04-16T15:21:04Z")

</div>

[@jiri\_stefanek](https://community.dynatrace.com/user/30685)&nbsp;/&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp; there is a new API (/monitoringstate) which, I guess, will replace the legacy process groups API v1 for querying the states. I guess it still needs [some improvements](https://community.dynatrace.com/post/209932), but it looks promising.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 16, 2023, 3:48pm UTC](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261/20 "2023-04-16T15:48:07Z")

</div>

This is what happens when dynatrace is keep evolving all the time&nbsp;:dynaspin:

In other words: The enemy of the good is better&nbsp;:dancing\_blob:

Thanks&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;!!

Yos

[Next page](https://community.dynatrace.com/t/alerting-on-a-process-needing-a-restart/35261.md?page=2)
