[comment]: # translation:outdated

[comment]: # ({1825d7ea-ec525f2f})
# 8 Discovery van systemd services

[comment]: # ({/1825d7ea-ec525f2f})

[comment]: # ({f72274ad-6e5dadb8})
### Overzicht

Het is mogelijk om systemd-units (standaard services) te [ontdekken](/manual/discovery/low_level_discovery) met Zabbix.

[comment]: # ({/f72274ad-6e5dadb8})

[comment]: # ({1f2028b1-e655c9cf})
### Item sleutel

Het item dat moet worden gebruikt in de [ontdekkingsregel](/manual/discovery/low_level_discovery#discovery_rule) is het

    systemd.unit.ontdekking

::: noteimportant
Deze
[item](/manual/config/items/itemtypes/zabbix_agent/zabbix_agent2) sleutel wordt
alleen ondersteund in Zabbix-agent 2.
:::

Dit item retourneert een JSON met informatie over systemd-eenheden, bijvoorbeeld:

    [{
        "{#UNIT.NAAM}": "mysqld.service",
        "{#UNIT.BESCHRIJVING}": "MySQL-server",
        "{#UNIT.LAADTOESTAND}": "geladen",
        "{#UNIT.ACTIVETOESTAND}": "actief",
        "{#UNIT.SUBTOESTAND}": "uitgevoerd",
        "{#UNIT.VOLGEND}": "",
        "{#UNIT.PAD}": "/org/freedesktop/systemd1/unit/mysqld_2eservice",
        "{#UNIT.JOBID}": 0,
        "{#UNIT.JOBTYPE}": "",
        "{#UNIT.JOBPAD}": "/",
        "{#UNIT.EENHEIDSFILETOESTAND}": "ingeschakeld"
    }, {
        "{#UNIT.NAAM}": "systemd-journald.socket",
        "{#UNIT.BESCHRIJVING}": "Journal Socket",
        "{#UNIT.LAADTOESTAND}": "geladen",
        "{#UNIT.ACTIVETOESTAND}": "actief",
        "{#UNIT.SUBTOESTAND}": "uitgevoerd",
        "{#UNIT.VOLGEND}": "",
        "{#UNIT.PAD}": "/org/freedesktop/systemd1/unit/systemd_2djournald_2esocket",
        "{#UNIT.JOBID}": 0,
        "{#UNIT.JOBTYPE}": "",
        "{#UNIT.JOBPAD}": "/",
        "{#UNIT.EENHEIDSFILETOESTAND}": "ingeschakeld"
    }]

[comment]: # ({/1f2028b1-e655c9cf})

[comment]: # ({86dfc2a0-2d3b32d7})
##### Discovery of disabled systemd units

Since Zabbix 6.0.1 it is also possible to discover **disabled** systemd units. In this case 
three macros are returned in the resulting JSON: 

-    {#UNIT.PATH}
-    {#UNIT.ACTIVESTATE}
-    {#UNIT.UNITFILESTATE}. 

::: noteimportant
To have items and triggers created from prototypes for disabled systemd units, make sure to 
adjust (or remove) prohibiting LLD filters for {#UNIT.ACTIVESTATE} and {#UNIT.UNITFILESTATE}.
:::

[comment]: # ({/86dfc2a0-2d3b32d7})

[comment]: # ({85c44d09-0272b801})
### Ondersteunde macro's

De volgende macro's worden ondersteund voor gebruik in de [filter van de ontdekkingsregel](/manual/discovery/low_level_discovery#discovery_rule_filter) en prototypen van items, triggers en grafieken:

|Macro|Omschrijving|
|-----|-----------|
|{\#UNIT.NAAM}|Primaire eenheid naam.|
|{\#UNIT.BESCHRIJVING}|Menselijk leesbare beschrijving.|
|{\#UNIT.LAADTOESTAND}|Laadtoestand (bijv. of het eenheidsbestand succesvol is geladen)|
|{\#UNIT.ACTIVETOESTAND}|Actieve toestand (bijv. of de eenheid momenteel gestart is of niet)|
|{\#UNIT.SUBTOESTAND}|Subtoestand (een meer gedetailleerde versie van de actieve toestand die specifiek is voor het eenheidstype, wat de actieve toestand niet is)|
|{\#UNIT.VOLGEND}|Eenheid die in zijn toestand gevolgd wordt door deze eenheid, als er een is; anders een lege string.|
|{\#UNIT.PAD}|Eenheid objectpad.|
|{\#UNIT.JOBID}|Numeriek taak-ID als er een taak in de wachtrij staat voor de taakeenheid; anders 0.|
|{\#UNIT.JOBTYPE}|Type taak.|
|{\#UNIT.JOBPAD}|Taak objectpad.|
|{\#UNIT.EENHEIDSFILETOESTAND}|De installatietoestand van het eenheidsbestand.|

[comment]: # ({/85c44d09-0272b801})

[comment]: # ({6a2f07e2-c8363d40})
### Item-prototypen

Item-prototypen die kunnen worden aangemaakt op basis van systemd service-ontdekking zijn onder andere:

-   Itemnaam: `{#UNIT.DESCRIPTION} actieve toestand info`; item sleutel:
    `systemd.unit.info["{#UNIT.NAME}"]`
-   Itemnaam: `{#UNIT.DESCRIPTION} laadtoestand info`; item sleutel:
    `systemd.unit.info["{#UNIT.NAME}",LaadToestand]`

`systemd.unit.info` [agentitems](/manual/config/items/itemtypes/zabbix_agent/zabbix_agent2) worden ondersteund vanaf Zabbix 4.4.

[comment]: # ({/6a2f07e2-c8363d40})
