Part 56: Track product prices with Zabbix

Image created by DALL-E

In December, my wife told my how she's annoyed about one Finnish company which tends to change its product prices out of nowhere all the time. To visualize this, of course I added a random product from that company's website to my dear What's up, home? monitoring.

The products in question are not complex to manufacture, and are not dependent on terribly fluctuating things like chip availability, oil prices or similar factors. Anyway, the price randomness is very real - the price varies between 23.90 EUR and 59.90 EUR.

How did I add this to monitoring?

As my first step, I did browse to a random product on the website and did inspect its source code with the browsers' usual developer mode inspector tools -- view source, inspect, all that. From there, I gathered the bits and pieces I need to be able to grab via Zabbix.

Of course, the easiest way to add this random product to my monitoring was just to use Zabbix HTTP Agent item type, make that fetch the particular URL and extract the info I need by using the pre-processing. As the website is very ... errm... modern in its source code, just extracting pieces of JSONPath or similar was not possible. Luckily, this regular expression used in item pre-processing did manage to catch the price from the web page.

Item pre-processing

Other than that, this was just a regular HTTP agent item.

HTTP agent item type

Now that I got this far, I added a new trigger to inform me every time the price does change.

Trigger which alerts if the value changes

And, that's really all to it. If you want to track a random product price for any item you'd like to get for a low price, here's a simple way to do it. Inspect the page source code, add HTTP agent item type, point it to URL, use item preprocessing, add a trigger, you are done. Zabbix can be really powerful whilst actually very simple.

 

 

Add new comment

Restricted HTML

  • 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.
Buy me a coffee

Like these posts? Support the project and Buy me a coffee