RSSAmplifier

jutty.dev · Jul 26, 2026

yoself: Podman monitoring & status page

0
Sign in to vote or save

nykula · Codeberg.org

Podman monitoring & status page using EviKit.

  • Monitor host unless MONITOR_HOST=false
    • Uptime
    • Load average: 1 minute, 5 minutes, 15 minutes
    • CPU usage per core, total time
    • Used memory, total memory
    • Mounts: path, size, used
    • Network: name, total over period, receive rate, transmit rate
  • Monitor servers once a minute
    • Name and URL from environment variable SERVER_EXAMPLE=https://example.org
    • Optionally check response with JMESPath if e.g. JMESPATH_EXAMPLE="json.status == 'healthy'"
      • If a check for 200 OK is enough, do not set this variable
  • Monitor containers unless DOCKER_SOCKET=
    • Name, CPU percentage, used memory, block read/written, network received/sent, pids
    • Health status
  • Volumes: name, size. Images: repository, tag, size
    • List unused, otherwise group with containers
  • Period
    • 1 hour, minute resolution
    • 24 hours, 30-minute resolution
    • 7 days, hour resolution
    • 31 days, 6-hour resolution
  • Export 24h static html once a minute if STATIC_HTML=/home/user/public_html/yoself.html
    • Install build from npm without dev dependenices
  • Notify EMAIL_STATUS=admin@example.org on status change
    • Status metrics: load average, free memory, free disk, container health, server health and milliseconds
    • Use SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD
    • Allow SMTP_IP if SMTP_HOST resolves incorrectly
  • Fetch incident updates every 10 minutes from Mastodon RSS if INCIDENT=https://example.org/@mastodon.rss

Install

Option 1. compose.yaml

For the main server, the containers on which you want to monitor.

services:
  yoself:
    image: codeberg.org/nykula/yoself:latest
    restart: unless-stopped
    network_mode: host
    environment:
      PORT: 5173
    volumes:
      - yoself-data:/root/.local/share/yoself-nodejs
      - /run/podman/podman.sock:/var/run/docker.sock

For each container without a built-in health check command but with an HTTP API, add to environment: SERVER_CONTAINER: https://container.example.org/path/to/health. Instead of CONTAINER, write the name of your container.

Now do:

systemctl enable --now podman.socket
podman-compose up

And go to http://localhost:5173. If it works ok, set up an HTTPS reverse proxy and firewall the HTTP port.

If using rootless podman, the path in volumes is instead /run/user/1000/podman/podman.sock for user 1000, and the commands are slightly more complicated:

loginctl enable-linger
systemctl --user enable --now podman.socket
podman-compose up

Option 2. npm

For the server that checks if your main server is up.

npm config set prefix ~/.local
mkdir -p ~/public_html
npm i -g yoself
cd ~/.local/lib/node_modules/yoself
cat >>.env <<EOF
MONITOR_HOST=false
SERVER_MAIN=https://yoself.example.org/api
JMESPATH_MAIN="json.status == 'healthy'"
STATIC_HTML="$HOME/public_html/yoself.html"
EOF
npm start

Note: backup ~/.local/lib/node_modules/yoself/.env before upgrading with npm up -g yoself, and restore it after upgrade.

Make a systemd user service at ~/.config/systemd/user/yoself.service for automatic restart on reboot and/or crash:

[Unit]
Description=URL monitoring & status page
[Service]
WorkingDirectory=%h/.local/lib/node_modules/yoself
ExecStart=/usr/bin/npm start
Restart=on-failure
[Install]
WantedBy=default.target

Then:

loginctl enable-linger
systemctl --user daemon-reload
systemctl --user enable --now yoself

Email variables

  • SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD - sender
  • EMAIL_STATUS=admin@example.org - whom to notify

That's it, you start getting emails on every tracked status change.

Development

git clone https://codeberg.org/nykula/yoself
cd yoself
cp .env.example .env
npm i
npm run dev

Build for production:

npm run build
npm start

Format:

npm run format

License

SPDX-License-Identifier: AGPL-3.0-or-later

Copyright (C) 2026 Denys Nykula

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Read the original on codeberg.org

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.