Automatic service restart when some service down in Zabbix

Maciej
3 min readOct 7, 2020

Introduction

In this post I will show you how to easily restart services using the Zabbix monitoring system.

Environment

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…

--

--

Maciej
Maciej

Written by Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

No responses yet