Graphing data from TEMPer USB probes in Cacti, v2.0

I graph the temperature of my server cabinet (at home) and colocation room (at work) in Cacti, using TEMPer USB thermometers. I wrote a handy guide to doing this last year. Unfortunately that guide, and the software I wrote, only worked to query one device. Today I modified it to graph more than one device, and started graphing the ambient temperature of my house.

As you can see, we’re having an unusually warm day in London:


This guide replaces the original one.

1a. Install temper-mon, all dependencies, and udev rules

Users of Debian wheezy/sid or Ubuntu precise should add my precise repository, and run:

That’s it. You now have all the required dependencies, the temper-mon program, and a udev rule that allows unprivileged users to query TEMPer devices.

Alternatively …

1b. Install temper-mon, all dependencies, and udev rules

If you don’t use a recent Debian/Ubuntu release or don’t want to install my package, however, you’ve got more work to do. Follow steps 1-3 of the original guide. However, use this updated version of temper-mon, and copy it to /usr/bin/temper-mon.

2. Verify that temper-mon can read your device

Now disconnect and reconnect the TEMPer. Verify that you have the correct device with lsusb:

Make sure your device has ID 1130:660c, or temper-mon won’t work for you. This USB device must have “rw-rw-rw-” permissions. The udev rule installed by my package ensures this. Verify with:

Now check that the web server user can run temper-mon:

If you get a reading, you’re ready to move on to the next step. If you have more than one device, test each of them as well:

or:

3. Import Cacti templates

Import my “Local – Ambient Temperature” template into Cacti. A copy is also installed by my package in /usr/share/temper-mon.

If you want to modify this template, such as for graphing in degrees in Fahrenheit, see this how-to for graphing data from a script in Cacti.

4. Create Cacti graphs

We are finally ready to create a graph.

  1. “Management” -> “Devices” -> Select your Cacti server
  2. Click “Create Graphs for this Host”
  3. “Graph Templates” -> “Create:” -> select “Local – Ambient Temperature” from pull-down
  4. Under “Custom Data”, Set “Number of device (default is 1)” to the number of the device. If you have one device, leave this blank or set it to 1. For other devices use 2 and up, as you found in step 2 above.
  5. Press “Create”

That’s it! You now have a temperature graph. I recommend using the threshold plugin to issue a warning alert if your server area gets too hot.

Tags: , , , ,

  1. Karel’s avatar

    This guide looks to be EXACTLY what I need, however I cannot seem to locate the ‘temper-mon’ package for the Raspberry Pi, and the cpan method didn’t work.

    Do you have plans to update the Temper-mon Package to allow it to function on the Raspberry Pi? The ability to run more than one sensor from a single PC is awesome!

    Karel

    Reply

    1. Tyler Wagner’s avatar

      That’s a great idea. I’ve just added the temper-mon package to my wheezy repository for Raspberry Pi. I’m not in a position to test with a Temper device right now. The dependencies install, however. Would you mind testing?

      Reply

      1. Karel’s avatar

        I do, and it installed successfully, however for some reason I do not get the device appearing when I run the lsusb command, I may have a different version…. Checking the logs mine is a different version to what yours is/was :(

        usb 1-1.3: new low-speed USB device number 48 using dwc_otg
        usb 1-1.3: New USB device found, idVendor=0c45, idProduct=7401
        usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
        usb 1-1.3: Product: TEMPerV1.4
        usb 1-1.3: Manufacturer: RDing
        input: RDing TEMPerV1.4 as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input168

        I may have a look at modifying the code and seeing if I can get it to work anyway

        Reply

        1. Tyler Wagner’s avatar

          My code doesn’t do any of the USB work. It just uses the existing HIDtemper perl libraries. If they don’t support your device, temper-mon won’t.

          Reply

        2. Tyler Wagner’s avatar

          I tested the TEMPer (1130:660c) with my Raspberry Pi, and it works:

          Good luck with the USB HID support for model 0c45:7401. Did you check the changelog for the HIDtemper perl libraries to see if it is supported? You might need to get the latest build with CPAN. It’s not a fun task, but there are guides to help you.

          Reply

        3. CRIMUVI’s avatar

          I did your tutarial and it wors, but now only give me 0 every time, please help (sorry about my english)

          Reply

          1. Tyler Wagner’s avatar

            I’m glad it worked. This hardware isn’t particularly reliable. Try unplugging and reinserting the device.

            Reply

Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">