Cacti

Graphing the ENVIROMUX-MINI Temperature Probe with Cacti

We use an ENVIROMUX-MINI to monitor temperature in the server room. This unit makes its data available over ethernet via SNMP. You can get the current temperature recorded by its probe with:

snmpget -c secret -v 1 192.168.1.10 1.3.6.1.4.1.3699.1.1.3.1.2.1.0

where secret is the SNMP community name, 1 is the version of SNMP, 192.168.1.10 is the IP address of the ENVIROMUX-MINI, and 1.3.6.1.4.1.3699.1.1.3.1.2.1.0 is the indexed OID of the temperature probe.

You can see the hierarchy in this screenshot of the iReasoning MIB Browser with the ENVIROMUX-MINI MIB file loaded.

I wanted to make a nice graph of the temperature using Cacti. An overview of the process is:

  1. Download Cacti templates for the ENVIROMUX-MINI (does it bother anyone else that they had the caps lock down when they named this unit?)

  2. Import the templates into Cacti
  3. Create a new device within Cacti
  4. Add a data source
  5. Create a graph
  6. Edit the graph

Download the Templates

Thanks to user fletch, you can download the templates as a .zip file here.

Import the templates into Cacti

Import all four templates using the Import Templates link in the Cacti console.

Create a New Device

Under Devices, click Add and add the Enviromux-mini as a new device. (Yes, I've stopped capitalizing it because it hurts my eyes.)

Add a Data Source

After adding it as a device, click on the Data Source List link:

Select the Data Template named ENVIROMUX - Temperature and click Create.

Create a Graph

Click on Create Graphs for this Host. It will ask you to select a Graph Template. Choose the ENVIROMUX - Environment graph template.

When you do this, it will list the OID for both the temperature and humidity probes. I only have the temperature probe on my unit, but adding both here is not a problem -- they can be removed in the graph template later.

Edit the Graph

If, like me, you do not have the humidity probe, the setup that we've just created will not produce a very nice graph. That's because the nonexistent humidity probe will return a value of 65535. This will make Cacti create a graph with a vertical axis that accommodates that value, making your temperature values crawl along the horizontal axis. My solution was to simply remove the humidity data sources from the graph template. To do that, click on Graph Templates in Cacti and click on the title of your graph. Humidity can be removed by clicking on the red X to the right of items 5-8. Before:

After:

To make this change persist, click Save at the bottom of the page.

Smile

Here's the resulting graph. Yes, it's hot in the server room. The air handlers are offline at the moment and we're watching things closely. Also, I'm wearing shorts in the office in February.

Topic: 

Cacti Segfaulting on CentOS5

I was getting Cacti set up and was having trouble with PHP. Specifically, it appeared that enabling the Cacti cron job caused a PHP segfault. I looked in /etc/cron.d/cacti to see what was being run:

cat /etc/cron.d/cacti
#*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Then I ran it from the command line myself:

# php -v
PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

# php /usr/share/cacti/poller.php
Segmentation fault

Sure enough, an ugly error was recorded in /var/log/messages:

kernel: php[5250]: segfault at bf29ce64 ip b788cbf3 sp bf29cdc4 error 6 in libc-2.5.so[b7851000+13f000]

It turns out that this is what happens when you bork the permissions on cacti's MySQL table. After issuing a command like the following to MySQL, my segfault went away.

GRANT ALL ON cacti.* TO 'cactiusername'@'localhost' IDENTIFIED BY 'secret';
Topic: 
Subscribe to RSS - Cacti