Renomeia referências de health-monitor para health-check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
30e0322907
commit
4a43f21d42
7 changed files with 20 additions and 20 deletions
|
|
@ -11,7 +11,7 @@ PAYLOAD = json.dumps({"name": "Ronaldo Freitas Dias"}).encode()
|
|||
|
||||
|
||||
def load_url_from_config():
|
||||
config_file = Path.home() / ".config" / "health-monitor"
|
||||
config_file = Path.home() / ".config" / "health-check"
|
||||
if config_file.exists():
|
||||
for line in config_file.read_text().splitlines():
|
||||
if line.startswith("HEALTHCHECK_URL="):
|
||||
|
|
@ -19,7 +19,7 @@ def load_url_from_config():
|
|||
return None
|
||||
|
||||
|
||||
HEADERS = {"User-Agent": "health-monitor/1.0", "Content-Type": "application/json"}
|
||||
HEADERS = {"User-Agent": "health-check/1.0", "Content-Type": "application/json"}
|
||||
|
||||
|
||||
def ping(url: str, timeout: int) -> int:
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set SCRIPT_DIR (dirname (realpath (status filename)))
|
||||
set CONFIG_FILE "$HOME/.config/health-monitor"
|
||||
set CONFIG_FILE "$HOME/.config/health-check"
|
||||
|
||||
mkdir -p "$HOME/.config/systemd/user"
|
||||
cp "$SCRIPT_DIR/systemd/health-monitor.service" "$HOME/.config/systemd/user/"
|
||||
cp "$SCRIPT_DIR/systemd/health-monitor.timer" "$HOME/.config/systemd/user/"
|
||||
cp "$SCRIPT_DIR/systemd/health-check.service" "$HOME/.config/systemd/user/"
|
||||
cp "$SCRIPT_DIR/systemd/health-check.timer" "$HOME/.config/systemd/user/"
|
||||
|
||||
echo "Arquivos de unit systemd copiados para ~/.config/systemd/user/."
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now health-monitor.timer
|
||||
systemctl --user status --no-pager health-monitor.timer
|
||||
systemctl --user enable --now health-check.timer
|
||||
systemctl --user status --no-pager health-check.timer
|
||||
|
||||
# Ping de teste imediato para confirmar que tudo funciona
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@
|
|||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
CONFIG_FILE="${HOME}/.config/health-monitor"
|
||||
CONFIG_FILE="${HOME}/.config/health-check"
|
||||
|
||||
mkdir -p "${HOME}/.config/systemd/user"
|
||||
cp "${SCRIPT_DIR}/systemd/health-monitor.service" "${HOME}/.config/systemd/user/"
|
||||
cp "${SCRIPT_DIR}/systemd/health-monitor.timer" "${HOME}/.config/systemd/user/"
|
||||
cp "${SCRIPT_DIR}/systemd/health-check.service" "${HOME}/.config/systemd/user/"
|
||||
cp "${SCRIPT_DIR}/systemd/health-check.timer" "${HOME}/.config/systemd/user/"
|
||||
|
||||
echo "Arquivos de unit systemd copiados para ~/.config/systemd/user/."
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now health-monitor.timer
|
||||
systemctl --user status --no-pager health-monitor.timer
|
||||
systemctl --user enable --now health-check.timer
|
||||
systemctl --user status --no-pager health-check.timer
|
||||
|
||||
# Ping de teste imediato para confirmar que tudo funciona
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set REPO_URL "https://github.com/SantosFC/health-check.git"
|
||||
set INSTALL_DIR "$HOME/src/health-monitor"
|
||||
set CONFIG_FILE "$HOME/.config/health-monitor"
|
||||
set INSTALL_DIR "$HOME/src/health-check"
|
||||
set CONFIG_FILE "$HOME/.config/health-check"
|
||||
|
||||
# 1. Verificar pré-requisitos
|
||||
for cmd in git python3 systemctl loginctl
|
||||
|
|
|
|||
4
setup.sh
4
setup.sh
|
|
@ -2,8 +2,8 @@
|
|||
set -euo pipefail
|
||||
|
||||
REPO_URL="https://github.com/SantosFC/health-check.git"
|
||||
INSTALL_DIR="${HOME}/src/health-monitor"
|
||||
CONFIG_FILE="${HOME}/.config/health-monitor"
|
||||
INSTALL_DIR="${HOME}/src/health-check"
|
||||
CONFIG_FILE="${HOME}/.config/health-check"
|
||||
|
||||
# 1. Verificar pré-requisitos
|
||||
for cmd in git python3 systemctl loginctl; do
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
[Unit]
|
||||
Description=Health Monitor check script
|
||||
Description=Health check script
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=-%h/.config/health-monitor
|
||||
ExecStart=/usr/bin/env python3 %h/src/health-monitor/healthcheck.py
|
||||
EnvironmentFile=-%h/.config/health-check
|
||||
ExecStart=/usr/bin/env python3 %h/src/health-check/healthcheck.py
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Run Health Monitor check every 2 minutes
|
||||
Description=Run health check every 2 minutes
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*:0/2
|
||||
Loading…
Reference in a new issue