bundles/{netdata,pppd,radvd,vmhost,vnstat,wide-dhcp6c}: add monitoring
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
9d3d0bcc69
commit
5935aed0db
8 changed files with 100 additions and 0 deletions
28
bundles/pppd/files/check_dyndns_update
Normal file
28
bundles/pppd/files/check_dyndns_update
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
statusfile="/var/tmp/dyndns.monitoring"
|
||||
if ! [[ -f "$statusfile" ]]
|
||||
then
|
||||
echo "Status file not found"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
mtime=$(stat -c %Y $statusfile)
|
||||
now=$(date +%s)
|
||||
if (( $now - $mtime > 60*60*24*8 ))
|
||||
then
|
||||
echo "Status file is older than 8 days!"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
statuscode=$(cat $statusfile)
|
||||
case "$statuscode" in
|
||||
200)
|
||||
echo "OK"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Last statuscode was $statuscode"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue