added config generation
This commit is contained in:
parent
6b0cade9e2
commit
83ce82e72f
@ -9,6 +9,8 @@ $CatchmentId = shift @ARGV;
|
|||||||
|
|
||||||
print "Decoding...\n" if $DEBUG;
|
print "Decoding...\n" if $DEBUG;
|
||||||
$in = decode_json(<>) or die;
|
$in = decode_json(<>) or die;
|
||||||
|
|
||||||
|
print "# ln -s /path/to/river_levels_ /etc/munin/plugins/river_levels_$CatchmentId\n\n[river_levels_$CatchmentId]\nenv.urlbase http://path.to/service\nenv.catchmentname Name\nenv.stations " unless $DEBUG;
|
||||||
foreach $station (@{$in->{data}}) {
|
foreach $station (@{$in->{data}}) {
|
||||||
if ($station->{url} =~ /CatchmentId=$CatchmentId$/) {
|
if ($station->{url} =~ /CatchmentId=$CatchmentId$/) {
|
||||||
print "$station->{id}", $DEBUG ? ": $station->{station} on $station->{river}\n" : " ";
|
print "$station->{id}", $DEBUG ? ": $station->{station} on $station->{river}\n" : " ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user