# Examples of OS service monitoring best practices

**URL:** <https://community.dynatrace.com/t/examples-of-os-service-monitoring-best-practices/44902>\
**Category:** Open Q&A\
**Tags:** windows, linux, hosts-classic, best-practices\
**Created:** [March 28, 2024, 2:09pm UTC](https://community.dynatrace.com/t/examples-of-os-service-monitoring-best-practices/44902 "2024-03-28T14:09:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [March 28, 2024, 6:13pm UTC](https://community.dynatrace.com/t/examples-of-os-service-monitoring-best-practices/44902/2 "2024-03-28T18:13:34Z")

</div>

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

I have multiple use cases for OS service monitoring, especially for Windows OS, and one of the important use cases is related to the MSSQL service monitoring on multiple servers, which in my case should be up and running all the time.

so I have configured it for the MSSQL services with the alerting condition if the service status is not in a running state same as the following screenshot

 ![Mohamed_Hamdy_1-1711649371086.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/8/e805c090b1afb15ab93bebc93dc298e0b6c8b0c0.png)

also, I have added all configured OS services in a dashboard using the below query in Data Explorer with Honeycomb and enabled show labels to get the availability percentage, hostname, and service name.

Note: you can change the status based on the configured status in your case

(builtin:osservice.availability:filter(prefix(“dt.entity.os:service”,CUSTOM\_DEVICE-)):filter(or(eq(“dt.osservice.status”,running),eq(“dt.osservice.status”,active))):sum:auto:sort(value(sum,descending)):splitBy(“dt.entity.host”,“dt.entity.os:service”)/builtin:osservice.availability:filter(prefix(“dt.entity.os:service”,CUSTOM\_DEVICE-)):sum:auto:sort(value(sum, descending)):splitBy(“dt.entity.host”,“dt.entity.os:service”)\*100):setUnit(Percent):splitBy(“dt.entity.host”,“dt.entity.os:service”):sort(value(auto,ascending)):limit(100)

Best regards,

Mohamed

---

_[View the full topic](https://community.dynatrace.com/t/examples-of-os-service-monitoring-best-practices/44902)._
