netdata httpcheck if site is down

460 Views Asked by At

I am new to netdata, and trying to configure netdata so that i can trigger an alarm if the website is down. My choice fell on httpcheck (if there is a better alternative please let me know) and it successfully checks against the website, but i cant find an alarm that specifically notifies the admins when the site is down. The httpcheck.py file sends two parameters; response time and a boolean "status". So far i have tried this, but it doesnt seem to work

alarm: server_down
families: *
on:  httpcheck.status
every: 10s
warn: $this == false
crit: $this == false
info: triggers if server is down
to: sysadmin

If anyone has experience with netdata and knows how to solve this issue, i would be very grateful.

here is the github repo for httpcheck https://github.com/netdata/netdata/tree/master/collectors/python.d.plugin/httpcheck

1

There are 1 best solutions below

0
On

Try the below config. It worked for me

template: web_service_down_status

families: *

on: httpcheck.status

lookup: max -10s absolute of bad_status

every: 10s

crit: $this == 1

delay: up 20s down 5m multiplier 2 max 1h

info: when http status returns 1

to: webmaster