Closed rmaeder closed 6 years ago
Could you provide https://github.com/cavaliercoder/zabbix-module-systemd#debugging info, please?
# systemctl show sshd.service | grep ConditionResult
ConditionResult=yes
busctl introspect org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/sshd_2eservice \
| grep ConditionResult
.ConditionResult property b true emits-change
zabbix_get -k systemd.unit[sshd.service,Unit,ConditionResult]
1
but -k 'systemd.service.discovery[]'
gives
{"{#SERVICE.TYPE}":"service","{#SERVICE.NAME}":"sshd.service","{#SERVICE.DISPLAYNAME}":"OpenSSH server daemon","{#SERVICE.PATH}":"/usr/lib/systemd/system/sshd.service","{#SERVICE.STARTUPNAME}":"enabled"}
Try to increase log level of your zabbix agent. You should see more details from the module in the logs. Did you compile master branch?
I did not compile. I took the rpm from here.
# uname -a
Linux XXXX.YYYY 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
rpm -q zabbix-agent
zabbix-agent-3.2.10-2.el7.x86_64
the DebugLevel=4 produced these entries as part of a service discovery:
11538:20171213:131856.938 [systemd] getting property:
service: org.freedesktop.systemd1
object path: /org/freedesktop/systemd1/unit/sshd_2eservice
interface: org.freedesktop.systemd1.Unit
property: Id
11538:20171213:131856.938 [systemd] getting property:
service: org.freedesktop.systemd1
object path: /org/freedesktop/systemd1/unit/sshd_2eservice
interface: org.freedesktop.systemd1.Unit
property: Description
11538:20171213:131856.938 [systemd] getting property:
service: org.freedesktop.systemd1
object path: /org/freedesktop/systemd1/unit/sshd_2eservice
interface: org.freedesktop.systemd1.Unit
property: FragmentPath
11538:20171213:131856.939 [systemd] getting property:
service: org.freedesktop.systemd1
object path: /org/freedesktop/systemd1/unit/sshd_2eservice
interface: org.freedesktop.systemd1.Unit
property: UnitFileState
You need to compile it. Unfortunately, packaged version is only 1.2 where this feature is missing.
I see; but the packaged distribution seems to work fine otherwise. I added a trigger to the template to warn about services not running and tested that successfully. That's all I need for now. Thanks for your help.
On my CentOS 7 system, the results returned by systemd.service.discovery[] do not include the #SERVICE.CONDITIONRESULT property. As a result, no items are created, because the item prototypes in the template include the filter {#SERVICE.CONDITIONRESULT} matches "yes". Once I removed that condition, the items showed up.