Read current slice setting
jangaraj opened this issue · 1 comments
Some units can use custom slice setting. Use that one for reading of cgroup performance counters (cpu, mem, ....) instead of hardcoded system.slice
path. For example:
$ zabbix_get -s 127.0.0.1 -k systemd.unit[getty@tty1.service,Service,Slice]
system-getty.slice
Reference: #5
I am experiencing the exact same issue with postfix.
root@zabbix:/home/steffen# systemctl show postfix@- | grep ^ControlGroup
ControlGroup=/system.slice/system-postfix.slice/postfix@-.service
root@zabbix:/home/steffen#
The module however, tries to lookup the following paths:
Jan 01 20:06:06 zabbix.lan zabbix_agentd[31148]: [systemd] cannot open metric file: '/sys/fs/cgroup/memory/system.slice/postfix@-.service/memory.stat' Jan 01 20:06:13 zabbix.lan zabbix_agentd[31149]: [systemd] cannot open metric file: '/sys/fs/cgroup/memory/system.slice/postfix.service/memory.stat' Jan 01 20:15:40 zabbix.lan zabbix_agentd[31148]: [systemd] cannot open metric file: '/sys/fs/cgroup/cpu,cpuacct/system.slice/postfix@-.service/cpuacct.stat' Jan 01 20:15:47 zabbix.lan zabbix_agentd[31149]: [systemd] cannot open metric file: '/sys/fs/cgroup/cpu,cpuacct/system.slice/postfix.service/cpuacct.stat' Jan 01 20:15:50 zabbix.lan zabbix_agentd[31148]: [systemd] cannot open metric file: '/sys/fs/cgroup/cpu,cpuacct/system.slice/networking.service/cpuacct.stat' Jan 01 20:16:06 zabbix.lan zabbix_agentd[31149]: [systemd] cannot open metric file: '/sys/fs/cgroup/memory/system.slice/postfix@-.service/memory.stat' Jan 01 20:16:13 zabbix.lan zabbix_agentd[31147]: [systemd] cannot open metric file: '/sys/fs/cgroup/memory/system.slice/postfix.service/memory.stat'
Any chance to get a fix on this? Unfortunately, I have no idea of the DBus API at all - otherwise I'd fix it myself.