Skip to content
atori.tech

System overview

Difficulty: Easy Tested v0.18.5.3

A small script that shows, at a glance, whether everything on your node is healthy.

Install

sudo nano /usr/local/bin/monerobox
#!/usr/bin/env bash
# MoneroBox: quick system overview

bold=$(tput bold); green=$(tput setaf 2); red=$(tput setaf 1); reset=$(tput sgr0)

echo "${bold}MoneroBox — $(hostname) — $(date '+%F %T')${reset}"
echo "Uptime: $(uptime -p)   Load: $(cut -d' ' -f1-3 /proc/loadavg)"
echo "Memory: $(free -h | awk '/Mem/ {print $3 " / " $2}')"
echo "Disk /data: $(df -h /data | awk 'NR==2 {print $3 " used, " $4 " free (" $5 ")"}')"
temp=$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null | sort -n | tail -1)
[ -n "$temp" ] && echo "CPU temp: $((temp / 1000)) °C"
echo

echo "${bold}Services${reset}"
for svc in monerod tor p2pool xmrig; do
  if systemctl list-unit-files "$svc.service" >/dev/null 2>&1 \
     && systemctl cat "$svc.service" >/dev/null 2>&1; then
    if systemctl is-active --quiet "$svc"; then
      printf "  %-8s %s\n" "$svc" "${green}running${reset}"
    else
      printf "  %-8s %s\n" "$svc" "${red}stopped${reset}"
    fi
  fi
done
echo

echo "${bold}Monero${reset}"
info=$(curl -s --max-time 5 http://127.0.0.1:18081/get_info)
if [ -n "$info" ]; then
  echo "$info" | jq -r '"  Height: \(.height) / \(.target_height // .height)   Synced: \(.synchronized)\n  Peers: \(.outgoing_connections_count) out, \(.incoming_connections_count) in\n  DB size: \(.database_size / 1e9 | floor) GB"'
else
  echo "  ${red}monerod RPC not reachable${reset}"
fi

if [ -r /data/p2pool/api/local/stratum ]; then
  echo
  echo "${bold}P2Pool${reset}"
  jq -r '"  Hashrate (15m): \(.hashrate_15m) H/s   Miners: \(.connections)   Shares found: \(.shares_found)"' /data/p2pool/api/local/stratum
fi
sudo chmod +x /usr/local/bin/monerobox

Use

monerobox

Show it on every login

echo "monerobox" >> ~/.bashrc

The P2Pool block only shows when nodeadmin can read /data/p2pool. If you want that, add nodeadmin to the group with sudo adduser nodeadmin p2pool and log in again.