No description
Find a file
Claude 2f3efa8dac
docs: adicionar guia de instalação completo do zero
Inclui instalação do git e python3, configuração de identidade git,
clone do repositório e execução do setup.sh, para cobrir um servidor
recém-instalado sem nenhum pré-requisito.
2026-06-08 10:17:17 +00:00
systemd Renomeia referências de health-monitor para health-check 2026-06-07 03:14:23 -03:00
.gitignore Criação do .gitignore 2026-06-06 10:09:37 -03:00
.shellcheckrc Adiciona linting config e body JSON no ping 2026-06-07 03:01:14 -03:00
healthcheck.py fix: atualizar User-Agent para 1.0.1 2026-06-07 14:39:36 -03:00
install_systemd.fish Renomeia referências de health-monitor para health-check 2026-06-07 03:14:23 -03:00
install_systemd.sh Renomeia referências de health-monitor para health-check 2026-06-07 03:14:23 -03:00
pyproject.toml Adiciona linting config e body JSON no ping 2026-06-07 03:01:14 -03:00
README.md docs: adicionar guia de instalação completo do zero 2026-06-08 10:17:17 +00:00
setup.fish feat: solicitar nome do device na instalação e enviar body no ping 2026-06-07 03:37:50 -03:00
setup.sh feat: solicitar nome do device na instalação e enviar body no ping 2026-06-07 03:37:50 -03:00

Chamado Health

Simple health check script for Healthchecks.io, designed to run every minute using a systemd timer.

Installation

1. Install Git

# Debian/Ubuntu
sudo apt update && sudo apt install -y git python3

# RHEL/CentOS/Fedora
sudo dnf install -y git python3

2. Configure Git identity

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

3. Clone the repository

mkdir -p ~/src
git clone https://github.com/SantosFC/health-check.git ~/src/health-monitor
cd ~/src/health-monitor

4. Run the setup script

bash setup.sh

The script will:

  1. Ask for your HEALTHCHECK_URL (Healthchecks.io ping endpoint) and validate it.
  2. Ask for a DEVICE_NAME to identify this machine.
  3. Save the configuration to ~/.config/health-monitor.
  4. Install and enable the systemd timer.
  5. Run a test ping to confirm everything works.

Both HEALTHCHECK_URL and DEVICE_NAME can be pre-set as environment variables to skip the interactive prompts:

HEALTHCHECK_URL=https://hc-ping.com/<your-uuid> DEVICE_NAME=my-machine bash setup.sh

Configuration

The configuration file is ~/.config/health-monitor:

HEALTHCHECK_URL=https://hc-ping.com/<your-uuid>
DEVICE_NAME=my-machine

You can also pass the URL as a command-line argument to the script:

./healthcheck.py https://hc-ping.com/<your-uuid>

Systemd units

The unit files installed to ~/.config/systemd/user/ are:

  • health-check.service
  • health-check.timer

To reload and restart after changes:

systemctl --user daemon-reload
systemctl --user restart health-check.timer
systemctl --user list-timers --all | grep health-check
journalctl --user -u health-check.service -n 10 --no-pager

Script behavior

  • Sends an HTTP GET to the configured Healthchecks.io URL.
  • Exits with code 0 when the request succeeds with 2xx.
  • Logs diagnostic errors to journal if the request fails.