Linux SystemD Services

Linux SystemD Services Monitoring

We are recommending you to use Mogie Pete's zabbix-systemd-service-monitoring template for monitoring Linux SystemD services. It has service discovery, blacklisting, whitelisting capabilities and provides alerting when a service stops or restarts.

You can access to the template by clicking this link:

Example blacklist for RHEL,CENTOS,ROCKYLINUX


If you want to check the running enabled services via ssh shell manually, you can use this shell script after installing the template to the server.

/usr/local/bin/ (don't forget to make it executable with chmod +x)


service_list=$(systemctl list-unit-files | grep -E '\.service\s+(generated|enabled)' | awk -F'.service ' '{print $1}')

[[ -r /etc/zabbix/service_discovery_whitelist ]] && {
    service_list=$(echo "$service_list" | grep -E -f /etc/zabbix/service_discovery_whitelist)

[[ -r /etc/zabbix/service_discovery_blacklist ]] && {
    service_list=$(echo "$service_list" | grep -Ev -f /etc/zabbix/service_discovery_blacklist)

echo -n "Services to Monitor:
";for s in ${service_list}; do echo -n "$s --> "
$(systemctl status $s 2>/dev/null | grep -Ei 'running|active \(exited\)|active \(running\)' > /dev/null) && echo OK || echo "$(tput setaf 1)NOT WORKING <========== $(tput sgr 0)"