Skip to content

Commit

Permalink
Include curl to fix healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed May 21, 2024
1 parent 463a2e8 commit 36c4135
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM python:3.12-slim-bookworm
COPY requirements.txt /tmp
RUN apt-get update && apt-get install curl -y
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt

COPY exporter.py /usr/local/bin/homematic_exporter
Expand Down
2 changes: 1 addition & 1 deletion healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
maxage=${1:-60}

# Get the age of the last successful metrics refresh in seconds
age=$(curl -s http://localhost:9040/metrics | grep 'homematic_refresh_age{' | cut -d ' ' -f2 | cut -d '.' -f1)
age=$(curl -s http://localhost:9040/metrics | grep 'homematic_refresh_age_seconds{' | cut -d ' ' -f2 | cut -d '.' -f1)

if [[ $age -lt $maxage ]]; then
exit 0
Expand Down

0 comments on commit 36c4135

Please sign in to comment.