wiki:check_systemd_service_running_via_zabbix
Table of Contents
Check if systemd service is running via Zabbix
Zabbix version 4.0.39
Firstly the zabbix agent running on the server must be allowed to execute remote commands, so update your zabbix_agentd.conf by setting
EnableRemoteCommands=1
Restart zabbix agent.
Then you can create an item of type “Zabbix agent”, type of information “Text” and with following expression:
system.run["systemctl is-active myservice.service"]
Now create a trigger from this Item. Add the following Expression and change the hostname to yours
{host1.example.org:system.run["systemctl is-active gobgpd.service"].iregexp(inactive)}=1
If using a template trigger, replace the host with template name:
{Role bgp host:system.run["systemctl is-active myservice.service"].iregexp(inactive)}=1
Tested on
See also
References
wiki/check_systemd_service_running_via_zabbix.txt · Last modified: by antisa
