Munin Monitoring – Temperature

I’ve written yet another Munin monitoring plugin recently. I am a little bit obsessed with checking the weather, so this latest plugin allows me to see exactly what the temperature is both outside and inside at any given point in time, as well as view graphs for the past week, month, and year. I haven’t figured out how to make Munin store more than 1 year of data (if you know, please post a comment).

Daily temperature:

 

Monthly temperature:

 

Yearly temperature:

 

I wrote this plugin in conjunction with an Arduino script, an Arduino, an Ethernet shield, and two DS18B20 Dallas OneWire sensors. The plugin will send a request over to my Arduino’s URL to get the sensor data once each polling period (5 minutes default). The Arduino will send data as such:

Indoor.value 70.47
Outdoor.value 37.06

When running the script for testing, you should see:

cleteNAS ~ # munin-run arduinotemp
multigraph temperature
Indoor.value 69.69
Outdoor.value 36.84

multigraph temperature.Indoor
Indoor.value 69.69
multigraph temperature.Outdoor
Outdoor.value 36.84

 

The plugin will parse the information (remove the line break) and create a unified graph as well as individual graphs for each sensor. The whole setup is easy to get going once you have the parts and it is easily adaptable. I didn’t write the code for reusability, so each file attached will have to be modified in order to fit your build.

If you want to use this plugin but are having issues, leave a comment below.

arduinotemp (Munin code, Perl)

TempServer.zip (Arduino code, you must have the Dallas OneWire library first)

 

8 thoughts on “Munin Monitoring – Temperature”

  1. Well it looks very much like the data is being stored in RRD files. You need to find where the RRD files are created and ensure you create it with a large enough pool to go over a year. There will be some text describing the RRA’s, see the man pages for the gritty details.

  2. Thanks a bunch! I’ll have to upgrade to 2.x. For now it is alright because I have far less than a year worth of data. In the future I would like to have all data expire yearly except for my temperature monitoring.

  3. Love the Ethernet client concept for temp monitoring. I took your TempServer code as a start for a Solar Pool Monitor. It is very sensitive to adding features that take time blowing up the server to the point that it only pings and spits garbage to the serial port. May be related to Wiznet chip. I’m sure I am causing the problem since it is stable when slimmed down. I would like to add background code that keeps monitoring the pool environment and reports when someone connects rather than having the client wait for the connect and then gather the temps and pump data. If you are interested I can send you the sketch and project plan.

    Planed functions to add:
    LCD serial display for poolside time/temp info (LCD117 board)
    Remote Web page radio button to control Solar System on/off
    ds1307 RTC updated from NTP
    10-min interval Time stamping and min/max temp sensing with recording to Daily CSV file SD card on Ethernet Shield
    Solar Heater Valve positioning based on solar collector and pool temp
    Water level sensing with water add valve control to make up losses
    Pool Level Overflow sensing due to rain
    Updates may need to run on interrupts from ds1307 SQW output

    Thank you for the starting point.

  4. FYI: Output from Current Mods to your code
    (Solar sensor not present yet)
    Serial Port Output:

    Solar Test, cycle valve 2 seconds ON
    Solar Valve OFF
    Water Fill Test, cycle valve 2 seconds ON
    Water Valve OFF
    Testing High Water Warning LED.. ON
    Warning LED should be OFF
    Starting Dallas Temperature IC Control Library
    Locating devices…Found 2 devices.
    Parasite power is: ON
    Device 0 Address: Pool Water 2826848F020000C228D1A7
    Device 1 Address: Ambient Air 28D1A78F0200008328CA7B
    Device 2 Address: Solar Collector 28CA7B8F0200000574067C
    Device 0 Resolution: 12
    Device 1 Resolution: 12
    Device 2 Resolution: 0

    Got a client
    Requesting temperatures…0DONE
    Temp C: 10.06 Temp F: 50.11
    Requesting temperatures…1DONE
    Temp C: 1.25 Temp F: 34.25
    Requesting temperatures…2DONE
    Temp C: 10.06 Temp F: 50.11
    high water 3
    Got a client
    Requesting temperatures…0DONE
    Temp C: 10.06 Temp F: 50.11
    Requesting temperatures…1DONE
    Temp C: 0.69 Temp F: 33.24
    Requesting temperatures…2DONE
    Temp C: 10.06 Temp F: 50.11
    high water 3

    Web Page
    PoolMonitor
    (version Mar 1 2012 15:53:29)
    System ON
    Solar Valve Recirculate
    Water Add Valve OFF
    Water Level High

    Sensor Location Current Temp 24-hr Maximum 24-hr Minimum
    Pool Water 50.60 ° F 60.00 ° F 48.20 ° F
    Ambient Air 64.85 ° F 92.52 ° F 33.24 ° F
    Solar Collector -196.60 ° F 60.00 ° F -196.60 ° F

    Warning
    Water Level Too High
    With pump ON, Open Drain Valve to Remove Excess Water

  5. Chris,
    That is impressive! It sounds like you’re going to have a feature-packed monitoring solution.

    I don’t know about it spitting garbage, as I didn’t experience that myself. I had to re-write the whole thing because I had originally just patched some code together and it would only run stable for a few days at a time. Now, I have had it running solid since early December as you can see by the temperature pages I have (all of the breaks are power outages or server reboots, which you can only see on the daily or weekly view).

    For my purposes, there was no point in gathering data before a request came in; I am only pulling 2 attributes once every 5 minutes. For your purposes, it sounds like you might want to get all of that data in advance, for sure!

    Keep me posted on your progress or I’d like to know if you’re blogging this somewhere, it would be interesting to follow.

Leave a Reply