Added a BASH Script (Crontab) to Check STEEM Container Running

I've running 5 steemd nodes - including two RPC nodes: api.justyy.com and api2.justyy.com

Sometimes the node crashed but I didn't notice for a long time. I then added a simple script that will be executed every 10 minutes in crontab.

#!/bin/bash

# Check if Docker is installed
if ! command -v docker &> /dev/null; then
  echo "Docker is not installed. Please install Docker to run this script."
  exit 2
fi

# check if steem container is running
container_name="steem"
exist=$(docker ps | grep $container_name | wc -l)
if [ "$exist" -eq 0 ]; then
  echo "$container_name container is not running."
  ## send email using php /var/www/mail.php
  msg="Steem container is not running on $(hostname) at $(date)."
  ### TO ADD: send email here.....
  exit 1
else
  echo "$container_name container is running."
  exit 0
fi

image.png

Steem to the Moon🚀!

Sort:  

@justyy, this is incredibly valuable! Running Steem nodes is critical infrastructure, and sharing your practical monitoring script is a fantastic contribution to the community. The simplicity of the crontab approach and the clear Docker check make this easily adaptable for other node operators. It's great to see you proactively addressing potential downtime.

The inclusion of your various Steem tools and swapping services at the end further solidifies your commitment to the Steem ecosystem. Thank you for sharing this! I'm sure many will find this script useful. Have you considered adding email alerting? Keep up the excellent work!