Skip to content

flashtyper/check_weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check_weather

Short Icinga Plugin which checks the current weather in a user defined city

Usage:

./weather -c [CITY] -t [API TOKEN]

Example

lukas@ubuntu:~/wetter$ ./wetter -c Regensburg -t foobar
Current weather in Regensburg | temp=25.500000 pressure=1017 humidity=60 wind=3.050000 clouds=1 rain=0.000000 snow=0.000000l

Installation

Create a account at https://openweathermap.org/api and subscribe to the "Current Weather Data" API. Set up your icinga:

object CheckCommand "weather" {
  command = [ CustomPluginDir + "/check_weather" ]
  arguments = {
    "-c" = "$city$"
    "-t" = "YOUR TOKEN"
  }
}
apply Service "Regensburg" {
  import "generic-service"
  check_command = "weather"
  vars.city = "Regensburg"
  assign where host.name == "Wetter"
}
object Host "Wetter" {
  import "generic-host"
  address = "127.0.0.1"
}

I recommend using a seperate host for this.

After that you can create a grafana dashboard if you want to: grafik

I am using influxDB with grafana and this dashboard regex works for me:
grafik

About

short icinga plugin which checks the current weather using api.openweathermap.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages