Commit 363946c9 authored by Dominika Liberda's avatar Dominika Liberda 💽
Browse files

* moved checkers back to individual workers

parent e824ee17
......@@ -51,10 +51,10 @@ function notify() {
msg="$label is DOWN"
elif [[ "$2" == "0" ]]; then
msg="$label is back UP"
fi
fi
curl -X POST -H 'Content-Type: application/json'\
-d '{"chat_id": "'"$k"'", "text": "'"$msg"'", "disable_notification": false}'\
"https://api.telegram.org/bot${cfg[telegram_bot_token]}/sendMessage" > /dev/null
"https://api.telegram.org/bot${cfg[telegram_bot_token]}/sendMessage" -vvv > /dev/stderr
done
else
echo "not supported (yet)"
......
......@@ -3,4 +3,7 @@
cfg[useragent]="dtr/1.0 (https://git.sakamoto.pl/domi/dtr)"
worker_add checker 60
worker_add every_1min 60
worker_add every_5min 300
worker_add every_30min 1800
worker_add notify 60
#!/bin/bash
if [[ "$counter5" == '' ]]; then
counter5=5
else
counter5=$((counter5+1))
fi
if [[ "$counter30" == '' ]]; then
counter30=30
else
counter30=$((counter30+1))
fi
source "${cfg[namespace]}/code/ping.sh" every_1min
source "${cfg[namespace]}/code/req.sh" every_1min
source "${cfg[namespace]}/code/port.sh" every_1min
if [[ $counter30 == 30 ]]; then
source "${cfg[namespace]}/code/ping.sh" every_30min
source "${cfg[namespace]}/code/req.sh" every_30min
source "${cfg[namespace]}/code/port.sh" every_30min
counter30=0
fi
if [[ $counter5 == 5 ]]; then
source "${cfg[namespace]}/code/ping.sh" every_5min
source "${cfg[namespace]}/code/req.sh" every_5min
source "${cfg[namespace]}/code/port.sh" every_5min
counter5=0
fi
source "${cfg[namespace]}/code/notify.sh"
#!/bin/bash
source "${cfg[namespace]}/code/ping.sh" every_1min
source "${cfg[namespace]}/code/req.sh" every_1min
source "${cfg[namespace]}/code/port.sh" every_1min
#!/bin/bash
source "${cfg[namespace]}/code/ping.sh" every_30min
source "${cfg[namespace]}/code/req.sh" every_30min
source "${cfg[namespace]}/code/port.sh" every_30min
#!/bin/bash
source "${cfg[namespace]}/code/ping.sh" every_5min
source "${cfg[namespace]}/code/req.sh" every_5min
source "${cfg[namespace]}/code/port.sh" every_5min
#!/bin/bash
source "${cfg[namespace]}/code/notify.sh"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment