Rebooting Central automatically in Oracle Linux

Hello Yaw,
Thank you for your suggestion to automate restarting the Central service guide for ubuntu.
We are using Oracle Linux Server 7.9. Do you have any suggestion to setup automate restarting script for Oracle Linux Server 7.9. If you can share that woule be really helpful for us.

Thanks again for good forum support.


I'm sorry, I don't. Oracle Linux seems to be based on RHEL? So I'd encourage you to look at instructions for how to install monit on RHEL and adjust my instructions accordingly.

Hi Yaw,
Thanks for your response. I am able to sucessfully install monit on Oracle Linux Server 7.9. Below are the steps I follow and yes it is almost similar to ubuntu with few exception.

Step - 1 Install latest epel package using below command:

sudo rpm -ivh

Step - 2 Install monit using below command:

sudo yum install monit

Step - 3 Create central conf file in /etc/monit.d file

check program central-healthcheck with path /usr/local/bin/
  if status > 0 for 2 cycles then exec "/bin/bash -c '/usr/bin/docker restart central_service_1'"

Step - 4 Created file in /usr/local/bin folder


CENTRAL_HTTP_CODE=$(curl --silent --insecure --include --request POST --header "Content-Type: application/json" --data-binary "{\"email\": \"email\",\"password\": \"password\"}" --write-out "%{http_code}" --output /dev/null
if [[ $CENTRAL_HTTP_CODE == 500 ]]; then
  echo "$CENTRAL_HTTP_CODE" > /dev/stderr
  exit 1

Step - 5 Changed permission using below command:

sudo chmod 0755;
sudo chmod 0644 central.conf;

Step - 6 Reload monit service

sudo monit reload;


Glad you figured it out!

Remember that this does not solve the problem, it only hides it.

Be sure to check how often you are restarting with grep restart /var/log/monit.log (or the Oracle equivalent) and adjust your server usage and resources accordingly.