From 0bf9659577b3ed5be54759a79170b57317c7bba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=2ES=20=C2=AB=20Benpro=20=C2=BB?= Date: Thu, 14 Jan 2016 21:55:52 +0100 Subject: [PATCH 1/2] fr24 - Plugin to monitor your flightradar24.com feeder. --- plugins/fr24/fr24 | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 plugins/fr24/fr24 diff --git a/plugins/fr24/fr24 b/plugins/fr24/fr24 new file mode 100755 index 00000000..cef2ae55 --- /dev/null +++ b/plugins/fr24/fr24 @@ -0,0 +1,49 @@ +#!/bin/bash +# +: <<=cut + +=head1 NAME + +fr24 - Plugin to monitor your flightradar24.com feeder. + +=head1 APPLICABLE SYSTEMS + +All Linux systems. + +=head1 CONFIGURATION + +The following is default configuration: + + [fr24] + env.MONITOR http://192.168.1.1:8754/monitor.json + +Set the right URL according to your FR24 Feeder. + +=head1 VERSION + + 1 + +=head1 AUTHOR + +Benoît.S « Benpro » + +=head1 LICENSE + +WTFPL + +=cut + +MONITOR=${MONITOR:-http://192.168.1.1:8754/monitor.json} + +case $1 in + config) + echo "graph_title Number of planes in sight +graph_info Number of planes in sight with DVB-T receiver. +graph_category fr24 +graph_vlabel Number of planes +planes.label planes" + exit 0;; +esac + +planes=$(curl -qs $MONITOR | grep -Eo '"d11_map_size":"[0-9]+"' | grep -Eo '[0-9]+' | tail -1) +echo "planes.value $planes" From 187545eabec9ee5250a98c14056d9438add65f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoit=2ES=20=C2=AB=C2=A0Benpro=C2=A0=C2=BB?= Date: Sat, 30 Apr 2016 17:23:23 +0200 Subject: [PATCH 2/2] Added double quote to prevent globbing and word splitting --- plugins/fr24/fr24 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fr24/fr24 b/plugins/fr24/fr24 index cef2ae55..6e93266b 100755 --- a/plugins/fr24/fr24 +++ b/plugins/fr24/fr24 @@ -45,5 +45,5 @@ planes.label planes" exit 0;; esac -planes=$(curl -qs $MONITOR | grep -Eo '"d11_map_size":"[0-9]+"' | grep -Eo '[0-9]+' | tail -1) +planes=$(curl -qs "$MONITOR" | grep -Eo '"d11_map_size":"[0-9]+"' | grep -Eo '[0-9]+' | tail -1) echo "planes.value $planes"