Introduction
In this post I will show you how to easily restart services using the Zabbix monitoring system.
Environment
- Vagrant +Ubuntu 18.04
- Zabbix 4.0 LTS
Instruction how install Zabbix
Adjust zabbix-agent configuration
If we want to use zabbix to restart services automatically, we need to enable some options in the zabbix -agent configuration.
Edit file /etc/zabbix/zabbix_agentd.conf
and enable this two options
### Option: EnableRemoteCommands
# Whether remote commands from Zabbix server are allowed.
# 0 - not allowed
# 1 - allowed
#
# Mandatory: no
# Default:
EnableRemoteCommands=1### Option: LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled
# 1 - enabled
#
# Mandatory: no
# Default:
LogRemoteCommands=1
Save file and restart service
root@vagrant:/home/vagrant# systemctl restart zabbix-agent
root@vagrant:/home/vagrant# systemctl restart…