|
|
@ -26,16 +26,16 @@ RESOLVE="\ |
|
|
|
JSON_HEADER="Content-Type: application/json" |
|
|
|
JSON_HEADER="Content-Type: application/json" |
|
|
|
POSTURL="https://events.pagerduty.com/v2/enqueue" |
|
|
|
POSTURL="https://events.pagerduty.com/v2/enqueue" |
|
|
|
|
|
|
|
|
|
|
|
# Bingo check constants |
|
|
|
# Validation check constants |
|
|
|
if [[ -f "triggered" ]] |
|
|
|
if [[ -f "triggered" ]] |
|
|
|
then |
|
|
|
then |
|
|
|
triggered=$(< triggered) |
|
|
|
triggered=$(< triggered) |
|
|
|
else |
|
|
|
else |
|
|
|
triggered=false |
|
|
|
triggered=false |
|
|
|
fi |
|
|
|
fi |
|
|
|
lastbingo=$(tail -n 1000 latest/*.log | tac | grep -ai -m 1 bingo) |
|
|
|
validation=$(tail -n 1000 $LOGFILE | tac | grep -ai -m 1 "bingo\|hooray") |
|
|
|
bingotime=$(echo $lastbingo | cut -f 2 -d 'r' | cut -c 16-34 | tr T \ ) |
|
|
|
timestamp=$(echo $validation | cut -f 3 -d 't' | cut -c 4-22 | tr T \ ) |
|
|
|
latest=$(date -d "$bingotime" +%s) |
|
|
|
latest=$(date -d "$timestamp" +%s) |
|
|
|
curtime=$(date +%s) |
|
|
|
curtime=$(date +%s) |
|
|
|
delay=60 |
|
|
|
delay=60 |
|
|
|
|
|
|
|
|
|
|
@ -54,4 +54,4 @@ if [[ $(($curtime - $latest)) -gt $delay ]] |
|
|
|
triggered=false |
|
|
|
triggered=false |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
echo "$triggered" > triggered |
|
|
|
echo "$triggered" > triggered |
|
|
|