# Alerting on Recurring process restart

**URL:** <https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834>\
**Category:** Alerting\
**Tags:** problems-classic\
**Created:** [July 13, 2022, 8:54am UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834 "2022-07-13T08:54:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shifu](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@shifu](https://community.dynatrace.com/u/shifu)\
**Post date:** [July 13, 2022, 8:54am UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/1 "2022-07-13T08:54:11Z")

</div>

Hi,

We got a recurring process that restarts every hour and is executed for 30 min, is it possible to create an alert when this process hasn’t restarted for 1 hour?

 ![shifu_0-1657702319676.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/3/83bf333c56b31e630f18dbd863b2242facaeab13.png)

Thanks

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [July 13, 2022, 1:31pm UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/2 "2022-07-13T13:31:15Z")

</div>

Hi Shifu,

Maybe you should use this feature:&nbsp;&nbsp;[Process group availability monitoring and alerting | Dynatrace Docs](https://www.dynatrace.com/support/help/how-to-use-dynatrace/process-groups/monitoring/process-group-availability-monitoring-and-alerting)

It is&nbsp;immediately opens a problem. If you would like to receive for example an e-mail notification after one hour about this issue you should:

1. Create a management zone for this single process (in the settings/preferences),

2. Create an alerting profile (in the settings / alerting) - set the availability alert after 60 mins and the others severities based on your requirements,

3. Create an e-mail problem notification (in the settings / integrarion) - use the created alerting profile above.

I hope this is your request.

 ![processgroup_availability.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/5/059cc791e982d12ee1f2a5304c6b37b7829d19fb.png)

Br, Mizső

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [July 13, 2022, 2:10pm UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/3 "2022-07-13T14:10:36Z")

</div>

Hi Shifu,

I have just realized that my previous comment does not provide solution for your problem…sorry.

Br, Mizső

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [July 13, 2022, 3:08pm UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/4 "2022-07-13T15:08:56Z")

</div>

Hi Shifu,

I have another idea, but it is not a full solution. You can use the events api the get information about events. You can count the process restart of the specific process in a spercific time frame. Please check the environment api v2 events api. You can find a get / events endpoint. On the DT GUI you can test it with a events.read api token.

I have made an exapmle. This curl can be use to fetch the a sepecific process restarts events count for the specific process group in the last 12 hours.

curl -X GET https:// **yourserver** /e/ **yourenvironmentid** /api/v2/events?from=now-12h&eventSelector=eventType%28%22PROCESS\_RESTART%22%29&entitySelector=entityId%28%22PROCESS\_GROUP\_INSTANCE- **yourprocessgroupid** %22%29 -H “accept: application/json; charset=utf-8” -H “Authorization: Api-Token **yourreadeventv2apitoken** ”

With the above curl you can create a script which one could run every hours (change the from now-1h).

The response first line is the events count see an example below (for smtpd process), rest of the lines are unnecessary for you:

response:  
{  
“totalCount”: 21,  
“pageSize”: 100,  
“events”: [  
{  
“eventId”: “-3274538997293409360\_1657721040000”,  
“startTime”: 1657721040000,  
“endTime”: 1657721050000,  
“eventType”: “PROCESS\_RESTART”,  
“title”: “Process restart”,  
“entityId”: {  
“entityId”: {  
“id”: “PROCESS\_GROUP\_INSTANCE-yourprocessid”,  
“type”: “PROCESS\_GROUP\_INSTANCE”  
},  
“name”: “smtpd”  
},  
“properties”: [  
{  
“key”: “dt.event.group\_label”,  
“value”: “Process restart”  
},  
{  
“key”: “dt.event.impact\_level”,  
“value”: “Infrastructure”  
}  
],  
“status”: “CLOSED”,  
“entityTags”: [  
{  
“context”: “CONTEXTLESS”,  
“key”: “X hosts”,  
“stringRepresentation”: “X hosts”  
},  
{  
“context”: “CONTEXTLESS”,  
“key”: “ProcessGroupName”,  
“value”: “smtpd”,  
“stringRepresentation”: “ProcessGroupName:smtpd”  
}  
],  
“managementZones”: [],  
“underMaintenance”: false,  
“suppressAlert”: false,  
“suppressProblem”: false,  
“frequentEvent”: false  
},

It is not a full solution beasue you do not have notification about it. Maybe you can ingest back this metric to DT via the Metrics API, but I do not have experience with it.

I hope it is uesful for you.

Br, Mizső

---

<div class="post-metadata">

**Author:** ![shifu](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@shifu](https://community.dynatrace.com/u/shifu)\
**Post date:** [July 13, 2022, 3:17pm UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/5 "2022-07-13T15:17:14Z")

</div>

Thank you Mizsö for you replies, i’ll try some of your propositions, maybe one will fetch well.

Shifu

---

<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:** [July 14, 2022, 7:35am UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/6 "2022-07-14T07:35:37Z")

</div>

Hi&nbsp;[@Mizső](https://community.dynatrace.com/user/47783)

Yep, your suggestion to ingest the information back to dynatrace with metric/ingest is working.

Attached a small AG extension (v1) that pulls the restart events according to supplied tag and it push the information back to dynatrace.

Here is how the UI is look like

 ![Yosi_Neuman_0-1657783602115.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/7/37ab63b6e62b8ab69b25d49e61e4a72f7d3e4d54.png)

And this is the ingest metric in dynatrace

 ![Yosi_Neuman_1-1657783952253.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7cf4a12782689b4fd2393d187b94ed162fc3e5f5.png)

HTH

Yos&nbsp;  
[custom.remote.python.RestartProcessEvents 2.3.zip](https://community.dynatrace.com/uploads/short-url/qI2cDdqVbxU7qY0SsoOnX3ErxRu.zip) (4.71 KB)

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [July 18, 2022, 7:19am UTC](https://community.dynatrace.com/t/alerting-on-recurring-process-restart/35834/7 "2022-07-18T07:19:19Z")

</div>

Yos,

Thank you very much!!!

Br, Mizső
