fff-alfred-monitoring-proxy: add package
CC: kratz00@gmx.de Signed-off-by: Tim Niemeyer <tim@tn-x.org> - Changed subject - Changed curl parameters - Added firewall rule - Configure alfred to be master - Add fff-nodewatcher as dep, because we use the alfred config - Change data handling during curl to pipe - Add newline on cron rule Signed-off-by: Fabian Bläse <fabian@blaese.de> - Fix alfred master mode introduced by packaging alfred - Adjust monitoring-proxy waittime to suggestion Reviewed-by: Robert Langhammer <rlanghammer@web.de> Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
3206c0c1c7
commit
9b5d3f1aeb
|
@ -0,0 +1,32 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-alfred-monitoring-proxy
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-alfred-monitoring-proxy
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-alfred-monitoring-proxy
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
TITLE:= Freifunk-Franken Alfred-Monitoring-Proxy
|
||||
URL:=https://www.freifunk-franken.de/
|
||||
DEPENDS:=+micrond +fff-random +curl +alfred-json +fff-nodewatcher
|
||||
endef
|
||||
|
||||
define Package/fff-alfred-monitoring-proxy/description
|
||||
The Alfred-Monitoring-Proxy is used
|
||||
to send node status information to https://monitoring.freifunk-franken.de/
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
echo "all: " > $(PKG_BUILD_DIR)/Makefile
|
||||
endef
|
||||
|
||||
define Package/fff-alfred-monitoring-proxy/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-alfred-monitoring-proxy))
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
uci -q set "alfred.alfred.mode=master"
|
||||
|
||||
uci -q commit alfred
|
||||
|
|
@ -0,0 +1 @@
|
|||
ebtables -P MULTICAST_OUT RETURN
|
|
@ -0,0 +1 @@
|
|||
*/5 * * * * sleep $(/usr/bin/random 70 85); /usr/sbin/alfred-monitoring-proxy
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/ash
|
||||
|
||||
api_url="https://monitoring.freifunk-franken.de/api/alfred"
|
||||
fetch_id="64"
|
||||
|
||||
(echo -n "{\"$fetch_id\": "; alfred-json -r "$fetch_id"; echo -n "}") | \
|
||||
curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data "@-" $api_url
|
Loading…
Reference in New Issue