THAT moment when you realize that the webinterface of the access point in a Devolo dLAN® 1200+ Powerline gets updated via jQuery from a json file!
curl 'http://10.xxx.yyy.zzz/cgi-bin/htmlmgr?_file=getjson&service=hpdevices'
[{"loc":"local","type":"hp200","name":"dLAN 1200+ WiFi ac","mac":"F4:06:ab:ab:ab:ab","tx":"","rx":"","ustr":"teh remote"},{"loc":"remote","type":"hp200","name":"dLAN 1200+","mac":"F4:06:aa:bb:cc:dd","tx":"85.3125","rx":"254.625","ustr":"teh master"},{}]
To make use of tht information this gist integrates a custom script return value into luci_statistics. Installation of the plugin like:
opkg install collectd-mod-exec
It is best NOT fo follow tutorials on the internet but rather copy files or contents of files in these locations:
- /usr/lib/lua/luci/statistics/rrdtool/definitions/*.lua (copy to exec.lua)
- /usr/share/collectd/types.db needs to be amended by own "types"
- and in the webfront the plugin needs to be enabled plus a command added (see screenshot below)
# grep powerlan /usr/share/collectd/types.db
powerlan_rx value:GAUGE:0:4294967295
powerlan_tx value:GAUGE:0:4294967295
The attached script checkwifipowerlan.py must run standalone, producing lines in Collectd's plain text protocol https://collectd.org/wiki/index.php/Plain_text_protocol .
After changes to these files a
/etc/init.d/luci_statistics restart
also restarts collectd.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
CHAOS CALMER (15.05.1, r48532)
-----------------------------------------------------
* 1 1/2 oz Gin Shake with a glassful
* 1/4 oz Triple Sec of broken ice and pour
* 3/4 oz Lime Juice unstrained into a goblet.
* 1 1/2 oz Orange Juice
* 1 tsp. Grenadine Syrup
-----------------------------------------------------
Not sure what is the best way to publish pictures in the description above ;)
Sure, when downloaded they won't show. But I prefer to document this Gist not just with text.