Skip to header Skip to main navigation Skip to main content Skip to footer

Search form

Site branding

Home
What's up, home?

Main navigation

  • Home
  • Story mode
  • About
  • Features
  • Hardware list
  • Videos
  • GitHub (opens in new tab)
  • Daily AI generated stories (opens in new tab)

Part 40: Is it raining?

Breadcrumbs

Breadcrumb

  • Home
  • Part 40: Is it raining?

Main page content

By whatsuphome | 6:47 AM EET, Sun March 05, 2023

TL;DR

I embed OpenWeatherMap into the Zabbix UI to create a full weather dashboard with interactive map layers for clouds, precipitation, and temperature. Using leaflet-openweathermap and custom JavaScript, I get layer toggles right inside Zabbix. Combined
Weather dashboard

Can you create a proper weather dashboard with Zabbix? Of course you can! By day, I am a Lead Site Reliability Engineer in a global cyber security company. By night, I monitor my home with Zabbix & Grafana and do some weird experiments with them.

Since Zabbix 6.2 (or 6.0? Cannot remember...) has provided you an official OpenWeatherMap template. It gives you all the standard weather details: temperature, humidity, and so on, for any location you'd like to observe.

But, by default Zabbix does not come with a weather map template. Can we add one? Probably. I say probably, because looks like the free OpenWeatherMap account I created might not have enough credentials to show the layers. Still, let's give this a try!

(And before you ask why I did not just add another custom geomap provider under Zabbix Administration --> General --> Geographical maps -- I wanted to have these layer toggles for clouds etc, and that requires custom JavaScript)

Getting OpenWeatherMap account 

 

Just go to OpenWeatherMap site and create an account for yourself. Soon enough, you'll get an API key you are supposed to use.

Embedding OpenWeatherMap to Zabbix UI

 

I found leaflet-openweathermap, and even though it's abandoned, the demo that comes with it seems to work just fine. Embedding that to Zabbix was not that of a big deal

  • Clone the git project for yourself
  • Copy the example somewhere where you can serve it, I did put it on my Zabbix server under /assets/openweathermap/ directory
  • Load that map in an empty tab to verify you see it works for you
  • With the default App ID that is bundled with the map the layers do work, but it would not be cool to use the author's API key as stated in the code
  • Change the AppID to one you have received ... well, at this point it stopped working for me, but if you really need it, OpenWeatherMap is not that expensive

Then you can add it to Zabbix just by adding a new URL widget and pointing that to your location.

Weather map

How does it look like?

Here we go! And, as an another idea for you, with the URL widget you can embed any camera input to your dashboard, too, some hints on part 21 of this blog I don't want to show you our own camera footage, so I added Lauttasaari, Helsinki location -- that is where Forcepoint has its office.

Dashboard
Now that's a weather dashboard for you.

Get alerted

 

OpenWeatherMap would also support alerts about severe weather conditions, but another option for you would be to find out your local weather data from your nearest provider and use their open data for this; in Finland for example, Finnish Meteorological Institute has their own open data for one to use. Then just add those to Zabbix via HTTP Agent item type for example much like I did in part 32 of this blog, and you're done.

whatsuphome
zabbix
openweathermap
weather
maps
  • Add new comment

Comments (1)

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Dear whatsuphome.fi…

Melissa Falbo (not verified)

3 years 2 months ago
Permalink
New

Dear whatsuphome.fi administrator, Your posts are always well-referenced and credible.

  • Reply
I embed OpenWeatherMap into the Zabbix UI to create a full weather dashboard with interactive map layers for clouds, precipitation, and temperature. Using leaflet-openweathermap and custom JavaScript, I get layer toggles right inside Zabbix. Combined

Search

Who am I?

  • Janne Pikkarainen from Finland 🇫🇮
  • Began with computers in 1986 with C64
  • Doing IT for living since 1999
  • Principal Site Reliability Engineer at Forcepoint
  • A Zabbix Summit speaker every year since 2022
  • Walking, talking Zabbix commercial

Support my project

Buy me a coffee 

Footer menu

  • Contact

What's up, home? | Janne Pikkarainen | contact(at)whatsuphome.fi | 2022 - 2026

Developed and Designed by Janne Pikkarainen