Newer
Older
icinga-plugins / flightradar / check_radarbox24
paulchen on 8 Nov 434 bytes added plugins for flight trackers
#!/bin/bash

DATE=`grep 'Packets sent' /var/log/rbfeeder.log|tail -n 1|sed -e "s/^.//;s/\].*$//"`
UNIXDATE1=`date -d "$DATE" +%s`
UNIXDATE2=`date +%s`
AGE=$((UNIXDATE2 - UNIXDATE1))

WARN=300
CRITICAL=600

if [ "`date +%H`" -lt 6 ] || [ "`date +%H`" -gt 21 ]; then
	WARN=5400
	CRITICAL=7200
fi

echo "Last update $AGE seconds ago"
if [ "$AGE" -gt "$CRITICAL" ]; then
	exit 2
elif [ "$AGE" -gt "$WARN" ]; then
	exit 1
else
	exit 0
fi