systemd in Zabbix ################# :date: 2015-01-17 12:00:00 +0000 :category: Linux :tags: systemd, zabbix If you use Zabbix to monitor your servers you may want to monitor systemd services with it especially if you have some custom services. These simple checks were enough for me: .. code-block:: sh systemd.unit.is-active[] # 1 if unit is active, 0 if inactive systemd.unit.is-failed[] # 1 if unit if in failed state, 0 if not systemd.unit.is-enabled[] # 1 if unit is enabled, 0 if not It's very simple. Just place ``userparameter_systemd.conf`` to your zabbix config dir (usually ``/etc/zabbix_agentd.conf.d``) with the following content: .. code-block:: ini # checks to determine if specified unit is active, failed or enabled UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet '$1' && echo 1 || echo 0 UserParameter=systemd.unit.is-failed[*],systemctl is-failed --quiet '$1' && echo 1 || echo 0 UserParameter=systemd.unit.is-enabled[*],systemctl is-enabled --quiet '$1' && echo 1 || echo 0