{"id":13438698,"url":"https://github.com/zabbix-tools/zabbix-module-systemd","last_synced_at":"2026-03-11T10:36:11.690Z","repository":{"id":79498702,"uuid":"88643035","full_name":"zabbix-tools/zabbix-module-systemd","owner":"zabbix-tools","description":"Native systemd monitoring for Zabbix","archived":false,"fork":false,"pushed_at":"2020-04-03T09:03:59.000Z","size":87,"stargazers_count":90,"open_issues_count":13,"forks_count":19,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-13T00:03:11.349Z","etag":null,"topics":["dbus","systemd","zabbix","zabbix-loadable"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zabbix-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-18T15:48:06.000Z","updated_at":"2025-06-24T15:00:40.000Z","dependencies_parsed_at":"2023-07-16T02:46:31.262Z","dependency_job_id":null,"html_url":"https://github.com/zabbix-tools/zabbix-module-systemd","commit_stats":null,"previous_names":["cavaliercoder/zabbix-module-systemd"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zabbix-tools/zabbix-module-systemd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabbix-tools%2Fzabbix-module-systemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabbix-tools%2Fzabbix-module-systemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabbix-tools%2Fzabbix-module-systemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabbix-tools%2Fzabbix-module-systemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zabbix-tools","download_url":"https://codeload.github.com/zabbix-tools/zabbix-module-systemd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabbix-tools%2Fzabbix-module-systemd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30378215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbus","systemd","zabbix","zabbix-loadable"],"created_at":"2024-07-31T03:01:07.661Z","updated_at":"2026-03-11T10:36:11.652Z","avatar_url":"https://github.com/zabbix-tools.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Native Zabbix systemd monitoring [![Build Status](https://travis-ci.org/cavaliercoder/zabbix-module-systemd.svg?branch=master)](https://travis-ci.org/cavaliercoder/zabbix-module-systemd)\n\nZabbix module that enables Zabbix to query the systemd D-Bus API for native and\ngranular system state monitoring + relative cgroup (CPU, MEM, IO, ...) metrics.\n\n## Download\n\nThe following packages are available:\n\n- [Sources](http://s3.cavaliercoder.com/zabbix-contrib/release/zabbix-module-systemd-1.2.0.tar.gz)\n- [Zabbix 3.2 - EL7 x86_64 RPM](http://s3.cavaliercoder.com/zabbix-contrib/rhel/7/x86_64/zabbix-module-systemd-1.2.0-1.x86_64.rpm)\n\n## Install\n\n```bash\n# Required CentOS/RHEL apps:   yum install -y libtool make autoconf automake dbus-devel\n# Required Debian/Ubuntu apps: apt-get install -y libtool make autoconf automake libdbus-1-dev\n# Required Fedora apps:        dnf install -y libtool make autoconf automake dbus-devel\n# Required openSUSE apps:      zypper install -y libtool make autoconf automake dbus-1-devel gcc\n# Required Gentoo apps 1:      emerge sys-devel/libtool sys-devel/make sys-devel/autoconf\n# Required Gentoo apps 2:      emerge sys-devel/automake sys-devel/gcc\n# Source, use your version:    \n# git clone https://git.zabbix.com/scm/zbx/zabbix.git --depth 1 --single-branch --branch 4.2.6 /usr/src/zabbix\n# Generate config.h: bash -c \"cd /usr/src/zabbix; ./bootstrap.sh; ./configure\"\n./autogen.sh\n./configure --with-zabbix=/usr/src/zabbix\nmake\nsudo make install\n```\n\nIf you are using a packaged version of Zabbix, you may wish to redirect the\ninstallation directories as follows:\n\n```bash\nsudo make prefix=/usr sysconfdir=/etc libdir=/usr/lib64 install\n```\n\n[Configure Zabbix agent to load module](https://www.zabbix.com/documentation/3.4/manual/config/items/loadablemodules)\n`libzbxsystemd.so`.\n\n## Available keys\n\nNote: `systemd.cgroup.*` keys require the cgroup accounting. The system default\nfor this setting may be controlled with `Default*Accounting` settings in\n[systemd-system.conf](https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html).\n\nExample how to enable cgroup accounting for Zabbix systemd monitoring:\n\n```bash\nsed -i -e \"s/.*DefaultCPUAccounting=.*/DefaultCPUAccounting=yes/g\" /etc/systemd/system.conf\nsed -i -e \"s/.*DefaultBlockIOAccounting=.*/DefaultBlockIOAccounting=yes/g\" /etc/systemd/system.conf\nsed -i -e \"s/.*DefaultMemoryAccounting=.*/DefaultMemoryAccounting=yes/g\" /etc/systemd/system.conf\nsystemctl daemon-reexec\nsystemctl restart zabbix-agent\n```\n\n| Key | Description |\n| ------------------------------ | ----------- |\n| **systemd[\\\u003cproperty\\\u003e]** | Return the given property of the systemd Manager interface. |\n| **systemd.unit[unit,\\\u003cinterface\\\u003e,\\\u003cproperty\\\u003e]** | Return the given property of the given interface of the given system unit name. For a list of available unit interfaces and properties, see the [D-Bus API of systemd/PID 1](https://www.freedesktop.org/wiki/Software/systemd/dbus) or [Debugging](#debugging) |\n| **systemd.unit.discovery[\\\u003ctype\\\u003e]** | Discovery all known system units of the given type (default: `all`). |\n| **systemd.service.info[service,\\\u003cparam\\\u003e]** | Query various system service stats (state, displayname, path, user, startup, description), similar to `service.info` on the Windows agent. |\n| **systemd.service.discovery[]** | Discovery all known system services. |\n| **systemd.cgroup.cpu[\\\u003cunit\\\u003e,\\\u003ccmetric\\\u003e]** | **CPU metrics:**\u003cbr\u003e**cmetric** - any available CPU metric in the pseudo-file cpuacct.stat/cpu.stat, e.g.: *system, user, total (current sum of system/user* or cgroup [throttling metrics](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-cpu.html): *nr_throttled, throttled_time*\u003cbr\u003eNote: CPU user/system/total metrics must be recalculated to % utilization value by Zabbix - *Delta (speed per second)*. |\n| **systemd.cgroup.dev[\\\u003cunit\\\u003e,\\\u003cbfile\\\u003e,\\\u003cbmetric\\\u003e]** | **Blk IO metrics:**\u003cbr\u003e**bfile** - cgroup blkio pseudo-file, e.g.: *blkio.io_merged, blkio.io_queued, blkio.io_service_bytes, blkio.io_serviced, blkio.io_service_time, blkio.io_wait_time, blkio.sectors, blkio.time, blkio.avg_queue_size, blkio.idle_time, blkio.dequeue, ...*\u003cbr\u003e**bmetric** - any available blkio metric in selected pseudo-file, e.g.: *Total*. Option for selected block device only is also available e.g. *'8:0 Sync'* (quotes must be used in key parameter in this case)\u003cbr\u003eNote: Some pseudo blkio files are available only if kernel config *CONFIG_DEBUG_BLK_CGROUP=y*. |\n| **systemd.cgroup.mem[\\\u003cunit\\\u003e,\\\u003cmmetric\\\u003e]** | **Memory metrics:**\u003cbr\u003e**mmetric** - any available memory metric in the pseudo-file memory.stat, e.g.: *cache, rss, mapped_file, pgpgin, pgpgout, swap, pgfault, pgmajfault, inactive_anon, active_anon, inactive_file, active_file, unevictable, hierarchical_memory_limit, hierarchical_memsw_limit, total_cache, total_rss, total_mapped_file, total_pgpgin, total_pgpgout, total_swap, total_pgfault, total_pgmajfault, total_inactive_anon, total_active_anon, total_inactive_file, total_active_file, total_unevictable*.\u003cbr\u003eNote: if you have problem with memory metrics, be sure that memory cgroup subsystem is enabled - kernel parameter: *cgroup_enable=memory* |\n| **systemd.modver[]** | Version of the loaded systemd module. |\n\n## Templates\n\nAvailable examples of monitoring templates:\n\n- [Template App systemd services.xml](https://raw.githubusercontent.com/cavaliercoder/zabbix-module-systemd/master/templates/Template%20App%20systemd%20services.xml) - the discovery of enabled systemd services with True condition result\n\n## Examples\n\n```bash\n# return the system architecture\n$ zabbix_get -k systemd[Architecture]\nx86-64\n\n# discover all units - filtering for sockets\n$ zabbix_get -k systemd.unit.discovery[socket]\n{\n  \"data\": [\n    {\n      \"{#UNIT.NAME}\": \"dbus.socket\",\n      \"{#UNIT.DESCRIPTION}\": \"D-Bus System Message Bus Socket\",\n      \"{#UNIT.LOADSTATE}\": \"loaded\",\n      \"{#UNIT.ACTIVESTATE}\": \"active\",\n      \"{#UNIT.SUBSTATE}\": \"running\",\n      \"{#UNIT.OBJECTPATH}\": \"/org/freedesktop/systemd1/unit/dbus_2esocket\",\n      \"{#UNIT.FRAGMENTPATH}\": \"/usr/lib/systemd/system/dbus.socket\",\n      \"{#UNIT.UNITFILESTATE}\": \"static\",\n      \"{#UNIT.CONDITIONRESULT}\": \"yes\"\n    },\n    ...\n  ]\n}\n\n# return the location of a mount unit\n$ zabbix_get -k systemd.unit[dev-mqueue.mount,Mount,Where]\n/dev/mqueue\n\n# return the number of open connections on a socket unit\n$ zabbix_get -k systemd.unit[dbus.socket,Socket,NConnections]\n1\n\n# discover all services\n$ zabbix_get -k systemd.service.discovery[service]\n{\n  \"data\": [\n    {\n      \"{#SERVICE.TYPE}\": \"service\",\n      \"{#SERVICE.NAME}\": \"dbus.service\",\n      \"{#SERVICE.DISPLAYNAME}\": \"D-Bus System Message Bus\",\n      \"{#SERVICE.PATH}\": \"/usr/lib/systemd/system/dbus.service\",\n      \"{#SERVICE.STARTUPNAME}\": \"static\",\n      \"{#SERVICE.CONDITIONRESULT}\": \"yes\"\n    },\n    ...\n  ]\n}\n\n# return the state of a service as an integer\n$ zabbix_get -k systemd.service.info[sshd]\n0\n\n# return the startup state of a service as an integer\n$ zabbix_get -k systemd.service.info[sshd,startup]\n0\n\n# total cpu usage of dbus.service\n$ zabbix_get -k systemd.cgroup.cpu[dbus.service,total]\n44\n\n# resident set size (RSS) mem usage of dbus.service\n$ zabbix_get -k systemd.cgroup.mem[dbus.service,rss]\n663552\n\n# total queued iops of dbus.service\n$ zabbix_get -k systemd.cgroup.dev[dbus.service,blkio.io_queued,Total]\n0\n```\n\n## Debugging\n\nPlease use `systemctl`, `gdbus`, `busctl`, `zabbix_get` utilities for debugging\nsystemd unit properties and their values. For example debugging of\n`ConditionResult` property value for sshd service:\n\n```\n$ systemctl show sshd.service | grep ConditionResult\nConditionResult=yes\n$ gdbus introspect --system --dest org.freedesktop.systemd1 --object-path \\\n  /org/freedesktop/systemd1/unit/sshd_2eservice \\\n  /org/freedesktop/systemd1/unit/sshd_2eservice | grep ConditionResult\n      readonly b ConditionResult = true;\n$ busctl introspect org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/sshd_2eservice \\\n  | grep ConditionResult\n.ConditionResult                    property  b              true               emits-change\n$ zabbix_get -k systemd.unit[sshd.service,Unit,ConditionResult]\n1\n```\n\nEnable `DebugLevel=5` in the Zabbix agent config to see systemd module debug\noutput in the zabbix-agent log file.\n\n## SELinux\n\nIf you have configured SELinux in enforcing mode, you might see the following\nerror in your Zabbix logs, when attempting to use item keys from this module:\n\n```text\n[systemd] org.freedesktop.DBus.Error.AccessDenied: SELinux policy denies access\n```\n\nThis is because the SELinux policy that ships with RedHat/CentOS does not\nexplicitly allow the Zabbix agent to communicate with D-Bus. This package\nincludes an extension module to grant Zabbix only the permissions it requires\nfor read-only access.\n\nTo build the SELinux module, add `--enable-semodule` to the build configuration:\n\n```bash\n./configure --with-zabbix=/usr/src/zabbix-3.2.6 --enable-semodule\nmake\nsudo make prefix=/usr sysconfdir=/etc libdir=/usr/lib64 install\n```\n\nAfter installing this package, the SELinux module `libzbxsystemd.pp` can be\nenabled by running:\n\n```bash\nsemodule -v -i /usr/share/selinux/packages/zabbix-module-systemd/libzbxsystemd.pp\n```\n\n## Built-in Zabbix systemd support\n\nZabbix agent 2 supports systemd from version 4.4+ ([ZBXNEXT-2871](https://support.zabbix.com/browse/ZBXNEXT-2871)).\nKeys: `systemd.unit.discovery`, `systemd.unit.info`. However this module still\noffers more options for systemd monitoring.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzabbix-tools%2Fzabbix-module-systemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzabbix-tools%2Fzabbix-module-systemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzabbix-tools%2Fzabbix-module-systemd/lists"}