initial
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.swp
|
||||
16
README.md
Normal file
16
README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
====== Munin wttr.in plugins ======
|
||||
===== Description =====
|
||||
These plugins will fetch weather data from wttr.in to display them in munin.
|
||||
* temperature
|
||||
* humidity
|
||||
* precipitation
|
||||
* wind speed
|
||||
* barometric pressure
|
||||
|
||||
===== Configuration =====
|
||||
By default, wttr.in will attempt to guess your location based on your IP address. I suggest you create a config in plugin-conf.d/ like this:
|
||||
|
||||
```
|
||||
[wttr_*]
|
||||
env.wttr_location Berlin
|
||||
```
|
||||
16
wttr_humidity
Executable file
16
wttr_humidity
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_category environment
|
||||
graph_title Humidity
|
||||
graph_vlabel %
|
||||
humidity.label humidity
|
||||
graph_args -l 0 --upper-limit 100
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "humidity.value "
|
||||
curl -s https://wttr.in/${wttr_location}\?format="%h\n" 2>&1 | sed 's/\%//'
|
||||
16
wttr_precipitation
Executable file
16
wttr_precipitation
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_category environment
|
||||
graph_title Precipitation
|
||||
graph_vlabel mm
|
||||
precipitation.label precipitation
|
||||
graph_args -l 0
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "precipitation.value "
|
||||
curl -s https://wttr.in/${wttr_location}\?format="%p\n" 2>&1 | sed 's/mm//'
|
||||
16
wttr_pressure
Executable file
16
wttr_pressure
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_category environment
|
||||
graph_title Pressure
|
||||
graph_vlabel hPa
|
||||
graph_scale no
|
||||
pressure.label pressure
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "pressure.value "
|
||||
curl -s https://wttr.in/${wttr_location}\?format="%P\n" 2>&1 | sed 's/hPa//'
|
||||
16
wttr_temperature
Executable file
16
wttr_temperature
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_category environment
|
||||
graph_title Temperature
|
||||
graph_vlabel ° Celsius
|
||||
temperature.label temperature
|
||||
graph_args -l -50 --upper-limit 50
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "temperature.value "
|
||||
curl -s https://wttr.in/${wttr_location}\?format="%t\n" 2>&1 | sed 's/\°C//' | sed 's/\+//'
|
||||
16
wttr_wind
Executable file
16
wttr_wind
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_category environment
|
||||
graph_title Wind speed
|
||||
graph_vlabel km/h
|
||||
windspeed.label wind speed
|
||||
graph_args -l 0
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "windspeed.value "
|
||||
curl -s https://wttr.in/${wttr_location}\?format="%w\n" 2>&1 | sed -r 's/^[^0-9]*([0-9]+).*$/\1/'
|
||||
Reference in New Issue
Block a user