Cacti: Graphing XML data from HTTP GET

Posted on 2009-04-30
Last Modified: 2012-05-06
I have a MeteoHub device that connects to our weather station in the office and stores the sensor values from various hygrometers in our office. They have an HTTP data request model that seems to be pretty extensive in what you can request (located here: ).

What I want to do is get some way of parsing this data from the MeteoHub in a Cacti data source so I can graph the temperature and ambient humidity in the office. I'd want to break down the data for the 4 sensors we have: thb0, th0, th5, and th6.

One caveat is that some of the sensors check in every 90 seconds and not every 60, so in order to poll the source every minute, it would have to request a broader time range in the HTTP GET and use only the most recent value.

Also, the data is stored on a filesystem in a plain-text document, so if accessing the log file and parsing for the data would be an easier path let me know. I can close this question and open a new one with that in mind.
Example XML return from the HTTP GET on


  <THB date=20090501001207 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>

  <TH date=20090501001209 id=th5 temp=21.5 hum=59 dew=13.2>

  <THB date=20090501001217 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>

  <THB date=20090501001227 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>

  <THB date=20090501001237 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>

  <UV date=20090501001244 id=uv0 index=0.0>

  <THB date=20090501001247 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>

  <THB date=20090501001257 id=thb0 temp=22.4 hum=51 dew=11.8 press=988.0 seapress=1011.5 fc=2>


Open in new window

Question by:drbill1
    LVL 16

    Accepted Solution

    Cacti is not suited. You'd spend more time in customizing it to accept your parsed data than finding something simpler to fullfill your goal.
    I suggest using a php to to parse the xml and then using php built in graphic functions to draw the graphs, storing the old data in a rdbms for historical purposes.

    php parser:
    simple graphics in php:

    Author Closing Comment

    Not a complete solution, but it set me down the right path.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now