# Graphing / Alerting on systemd service status

**URL:** <https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22>\
**Category:** Help\
**Tags:** agent\
**Created:** [November 15, 2020, 3:18am UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22 "2020-11-15T03:18:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![belcast](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/belcast/32/218_2.png) [@belcast](https://community.netdata.cloud/u/belcast)\
**Post date:** [November 15, 2020, 3:18am UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/1 "2020-11-15T03:18:46Z")

</div>

Hi Everyone,

Sorry for the beginner question but loving the platform so far. I’ve been scratching my head trying to get this working for a while. I’m looking to get the status of a service into the dashboard.

I’ve enabled systemd monitoring on the go.d file. Configured updated the `go.d/systemdunits.conf` and verified with the debug that this is now tracked and set to 1 indicating active which is perfect.

```auto
[DEBUG] systemdunits[myservice] collect.go:68 got total/loaded 1/1 units
BEGIN 'systemdunits_myservice.service_unit_state' 9999861
SET 'myservice.service' = 1
END

```

My question is, how can I get a graph into the dashboard, I couldn’t find the relevant metric when searching the drop down box.

Also, which .conf file under `/usr/lib/netdata/conf.d/health.d/` would I use to track its state and alert if it ever is stopped?

Thanks!

---

<div class="post-metadata">

**Author:** ![belcast](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/belcast/32/218_2.png) [@belcast](https://community.netdata.cloud/u/belcast)\
**Post date:** [November 16, 2020, 9:37pm UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/2 "2020-11-16T21:37:48Z")

</div>

Will do, thanks again mate!

---

<div class="post-metadata">

**Author:** ![Thiago\_Marques\_0](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/thiago_marques_0/32/281_2.png) [@Thiago\_Marques\_0](https://community.netdata.cloud/u/Thiago_Marques_0)\
**Post date:** [November 16, 2020, 11:37am UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/3 "2020-11-16T11:37:34Z")

</div>

I am very happy with these news @belcast

Please, let us know if you need any help. 🙂

---

<div class="post-metadata">

**Author:** ![belcast](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/belcast/32/218_2.png) [@belcast](https://community.netdata.cloud/u/belcast)\
**Post date:** [November 16, 2020, 3:48am UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/4 "2020-11-16T03:48:03Z")

</div>

Hey @Thiago-Marques-0 ,

Ah, I didn’t realise the lack of a space in `go.d.conf` would invalidate the attribute. I had totally missed it when I was troubleshooting but after you prompted me to look at the log and the spacing of the config file I noticed it still hadn’t initialised. Thanks for that  
I changed  
` systemdunits:yes` to  
` systemdunits: yes`  
Made a reload and it worked!

I got alerting working as well by creating a new `health.d/abc.conf`

```auto
 alarm: abc_status
 on: systemdunits_abc.service_unit_state
 lookup: max -1
 every: 5m
 green: $this = 1
 warn: $this > 1
 crit: $this > 1
 info: The status of the abc service.

```

I tuned it down to 1 second and tested and its working perfectly 🙂 it was literally just the missing space in the attribute. Thanks so much for your help Thiago!

---

<div class="post-metadata">

**Author:** ![Thiago\_Marques\_0](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/thiago_marques_0/32/281_2.png) [@Thiago\_Marques\_0](https://community.netdata.cloud/u/Thiago_Marques_0)\
**Post date:** [November 15, 2020, 5:23pm UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/5 "2020-11-15T17:23:17Z")

</div>

Hello @belcast ,

You do not need to say sorry, it is always a pleasure to help our users.

When the chart is enabled, you will see a chart like this:

!

 ![1605460183757-units.png](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/f2800ee5dfacfb0640bcd38ac5e3f73a1cd28e8b.png)

To have this chart, I executed the following steps:

```auto
$ cd /etc/netdata/
$ ./edit-config go.d.conf

```

When the editor is open, I remove the comment from the line ` systemdunits: yes`, please, pay attention that I only removed the channel (`#`), I kept all the spaces that were in front the name.

After the first step, I enabled the chart with the following steps:

```auto
cd /etc/netdata
./edit-config go.d/systemdunits.conf

```

And I removed the comments of the lines I wanted, my final configuration file is:

```auto
jobs:
  - name: service-units
    include:
      - '*.service'

```

Again I only removed the comments without to remove the spaces.

If a necessary space was removed or some wrong character is added, you will have error messages like this inside your `/var/log/netdata/error.log`:

```auto
$ grep systemdunits /var/log/netdata/error.log
2020-11-15 13:37:14: go.d WARNING: discovery[file reader] parse '/etc/netdata/go.d/systemdunits.conf': yaml: unmarshal errors:

```

Finally, for you create an alarm for these charts, you can follow our [guide](https://learn.netdata.cloud/docs/agent/health/quickstart), but before to go deep on this, my suggestion is we fix the chart load. Please, take a look in your error log as I showed and adjust the config files. After we fix this first problem, I will also help you with the alarm.

Best regards!

---

<div class="post-metadata">

**Author:** ![Docarly\_Romero](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/docarly_romero/32/4001_2.png) [@Docarly\_Romero](https://community.netdata.cloud/u/Docarly_Romero)\
**Post date:** [August 7, 2025, 6:24pm UTC](https://community.netdata.cloud/t/graphing-alerting-on-systemd-service-status/22/6 "2025-08-07T18:24:09Z")

</div>

Hi Thiago

How I can implemented this in Windows? Because I need monitoring when a service por example sqlagent is stopped.

Regards
