Ntfy support

NTFY support added.
This commit is contained in:
kake26 2022-12-24 15:50:10 -06:00
parent 601575e1c0
commit 9a19c25dff

View file

@ -1,21 +1,18 @@
#!/bin/bash #!/bin/bash
# Requires vnstat to be running on target system # Requires vnstat to be running on target system
# initial values # initial values
mtotal=1000 # monthly total in GB for high end cut off
# Note comcast caps at 1.2 TB dmax=40 # daily max usage value
mtotal=1000 # Monthly warning threshold
dmax=40 # daily max usage value, trouble might arise if I go past 40 GB a day
md=`date +%d` # day of the month numerically md=`date +%d` # day of the month numerically
cmd=$(($dmax * $md)) # computed max daily, not hard value but can indicate a problem cmd=$(($dmax * $md)) # computed max daily
wif="eth1.2" # interface to ask vnstat for, in my case the default wan vlan in Openwrt wif="wan"
# now vnstat stuff, some of this is specific to openwrt # now vnstat stuff, some of this is specific to openwrt
vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total daily usage vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total monthly usage
vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # monthly total usage vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # daily total usage
logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly"; # Remeber the local syslog on OpenWrt is setup to log to a remote system logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly";
# therefore this is a lazy way to send the data out curl -d "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly" 192.168.1.168:83/bandmon