Server Administration

  Home arrow Server Administration arrow Page 3 - Monitoring Temperatures with Cacti
SERVER ADMINISTRATION

Monitoring Temperatures with Cacti
By: Barzan 'Tony' Antal
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2009-10-14

    Table of Contents:
  • Monitoring Temperatures with Cacti
  • Monitoring Windows Systems
  • Monitoring Linux Systems
  • Final Thoughts

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Monitoring Temperatures with Cacti - Monitoring Linux Systems


    (Page 3 of 4 )

    At the beginning of this article we spoke of how we’re planning to grab those values to draw pretty charts with them, right? Therefore, we first need lm-sensors. We’d be getting beyond ourselves explaining how to set up this tool, especially since it has great documentation along with useful FAQs targeting common problems with installation and management; it also comes with an install-wizard.

    The latest lm-sensors also sports a net-snmp patch; you can find it here. If you’re planning to take this route, then don’t forget to configure with the following switches:

    --with-mib-modules="ucd-snmp/lmsensorsMib" --with-ldflags="-lsensors"

    We don’t want to confuse you. All right, let’s assume you have lm-sensors installed and configured according to your setup. Typing “sensors” into a console prompt should make it report the information gathered. The configuration file is “etc/sensors.conf” while the “sensors” is found in “/usr/bin.”

    We need to format this output to a recognizable format in order to load the information into Cacti. We suggest creating either a Perl or bash script to do this. First we chomp() the output to remove any trailing string. Then we split() the output into a list of strings. This means it should look like this: temp1: __, temp2: __, fan1: __, fan2: __, and so forth with voltages as well, depending on how many sensors are configured.

    On Waikato Linux Users Group you can find this Perl script. It follows the above approach and simply separates the gathered sensor values into unique variables. You should extend it with voltages as well, but it all depends on your own lm-sensors configuration. First find out what your “sensors” output looks like, and then you can strip the unnecessary tags and split the values, thereafter parsing them into variables.

    Now that you have everything listed to the standard output separated by a space or something similar (as long as you implement everything in the correct way), you can configure Cacti to “work with” those values. First you add the data input. Name that field the way you want it and specify the path for the Perl or Bash script you wrote. And there you also need to specify how you’ve formatted the output string.

    After this, Cacti knows how to parse the received values; you just need to help it realize those plots. To do this, you need to add the data source. Add a minimum and maximum value; this depends on your configuration (it differs from fans to temperatures and voltages, obviously!), set the name of the data input source (the one we created in the paragraph above), and set “Gauge” as the type of the data input.

    And now finally, it’s time to add the graphs. Select their type and location the way you want, set the notes, legend, and names as well as colors for the reported values. You shouldn’t encounter any further problems as long as the values are retrieved appropriately. If the values don’t seem to update at all, or they seem random, then first troubleshoot lm-sensors; check how it outputs everything to the stdout.

    More Server Administration Articles
    More By Barzan 'Tony' Antal

    blog comments powered by Disqus

    SERVER ADMINISTRATION ARTICLES

    - Server Responses to Client Communication
    - Authentication in Client/Server Communication
    - Client/Server Communication
    - Understanding Awk in the UNIX Shell
    - Stream Editor in the UNIX Shell
    - Processes in the UNIX Shell
    - Migrating from Windows to Wine
    - Wine: Not Another Emulator
    - Preventive Measures to Block SSH Attacks
    - Monitoring Temperatures with Cacti
    - Cacti: RRDTool-based Graphing Solution
    - Network Magic 5.0 Review
    - Netfilter and Iptables Overview
    - Installing and Configuring Squid
    - Clickfree PC Backup Systems Compared


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap