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 131: Monitoring fuel prices with Zabbix

Breadcrumbs

Breadcrumb

  • Home
  • Part 131: Monitoring fuel prices with Zabbix

Main page content

By whatsuphome | 7:00 AM EEST, Fri October 17, 2025

TL;DR

I built a Zabbix integration that scrapes fuel station prices from Finland's community-driven polttoaine.net site, parsing the HTML table for station names and 95E10 prices. Using Zabbix HTTP Agent items and dependent items, the data flows into a
What's up, home? part 131 cover image

This will start my blog series which I spoke about at the Zabbix Summit 2025 -- how and why I monitor my surroundings with Zabbix. The reason is partly conceptual, partly real, to showcase how Zabbix can potentially help you to make figuring out what's going on near you much easier. Let's dive in!

Where to get the price data?

In Finland, we have this community-driven fuel station price tracking site, polttoaine.net. It has been around since forever, but for my kind of Zabbix use purposes, has several downsides: 

  • Price updates are not guaranteed to be real-time. It really is community-driven: people who visit the station, will then update the prices if they remember/have the energy to do so. This means that sometimes the prices are updated the very same day, some days they are not updated at all.
  • Not all the fuel stations are there, at least not all the time.
  • No API, has to scrape the HTML.

All this being said, building this integration was and is fun. Let's start pumping data!

Parsing the HTML

If you look for example the listing of fuel stations in Helsinki and its source code, you will notice the table is built with traditional HTML tables. 

Source code

Not surprisingly, the table rows follow the same pattern. In first cell, there's the name and physical address of the station. That's something I'm interested about. I also need 95E10 price, as that is what our car likes to sip. So, for successful Zabbix integration, we need to grab these two cells.

Zabbix template

Enough site parsing, let's move on to Zabbix. 

I created a very small Zabbix template, which just contains the master item which fetches the URL I want, and then the fuel price.

Template items

In master item, one of the my custom Zabbix macros it uses is {CITY}.

Item config

In template macros, I added some self-descriptive macros to be used in triggers etc.

Template macros

Zabbix hosts

But wait, why in that template macros screenshot above the station name is empty? For the simple reason that the logic for my template is not very scaleable, but a quick proof-of-concept hack. How it works is that I have my hosts added like this:

Stations list

... and if I click on any of the hosts and go to its Macros tab, you will see that there's the exactly same longer name that can be found from polttoaine.net station listing.

Station's detailed name

Now, if I open the config for any fuel station host and click on fuel price item, on its preprocessing tab there's this:

Regular expression

The regular expression as plain text:

.*{$STATION}.*</td>.*<td title=\"95E10\" class=\"[^\"]+\">([0-9]+\.[0-9]+)

Might not be pretty, but it works.

Engine warning lights

Of course we need some alerts, too, so I added alerts which will let me know if it's really cheap or expensive.

Fuel price triggers

Zabbix dashboard

But this would not be any good without a dashboard. So, here's the snippet of the dashboard showing the fuel prices inside my Zabbix.

Fuel prices

 

 

whatsuphome
zabbix
fuel price
zabbixsummit2025
  • 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.
I built a Zabbix integration that scrapes fuel station prices from Finland's community-driven polttoaine.net site, parsing the HTML table for station names and 95E10 prices. Using Zabbix HTTP Agent items and dependent items, the data flows into a

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