IPMI Sensor Data on Dell 1850s and 2850s via SNMP and Cacti

I use Cacti to monitor a lot of Dell servers, primarily 1850s and 2850s but also the newer models of same (1950s and 2950s). One itch that I’ve meant to scratch for a while is graphing some of the information available through the servers’ IPMI interface; specifically the servers’ various temperatures and and fan speeds.

IPMI Details

There are patches available for the Linux kernel to allow the IPMI information to be read via the lm_sensors project but I chose to avoid this (at least for now) as I’d have to schedule downtime to reboot the servers for a new kernel. It’d also ruin their uptime – most of the servers (serving many thousands of users daily) have almost two years of uptime. (The kernels are monolithic.)

Instead, I went with the already compiled in Linux IPMI Driver (see kernel source: Documentation/IPMI.txt) which is available in the ‘Character Devices’ menu. I specifically needed the following options for the Dells:

  • drivers/char/ipmi/ipmi_msghandler
  • drivers/char/ipmi/ipmi_devintf
  • drivers/char/ipmi/ipmi_si

In order to read information from the IPMI, you need the ipmitool utility which is available on most recent Linux distributions or from here.

Lastly, I needed to create a character special file to interface with the IPMI:

mknod /dev/ipmi0 c 254 0       

The sensor information was then available via:

# ipmitool sensor
Temp             | 30.000     | degrees C  | ok    | na        | na        | na        | 85.000    | 90.000    | na
Temp             | 34.000     | degrees C  | ok    | na        | na        | na        | 85.000    | 90.000    | na
Ambient Temp     | 16.000     | degrees C  | ok    | na        | 3.000     | 8.000     | 42.000    | 47.000    | na
...

Making IPMI Sensor Information Available via SNMP

I make the IPMI sensor information available over SNMP by adding the following to the snmpd.conf file:

# Monitor IPMI Temperature and Fan stats
exec    .1.3.6.1.4.1.X.1000 ipmitemp        /usr/local/sbin/ipmi-temp-stats
exec    .1.3.6.1.4.1.X.1001 ipmifan         /usr/local/sbin/ipmi-fan-stats

(Replace X above as appropriate.)

The scripts referenced are: /usr/local/sbin/ipmi-temp-stats:

#! /bin/sh

PATH=/usr/bin:/bin
STATS=/tmp/ipmisensor-snmp

printf "%f\n" `cat $STATS | grep Temp | cut -s -d "|" -f 2`

And /usr/local/sbin/ipmi-fan-stats:

#! /bin/sh

PATH=/usr/bin:/bin
STATS=/tmp/ipmisensor-snmp

printf "%f\n" `cat $STATS | grep FAN | cut -s -d "|" -f 2`

The file they reference is generated every 5mins (Cacti polling interval) via a cron entry in the file /etc/cron.d/ipmitool:

*/5 * * * * root /usr/bin/ipmitool sensor >/tmp/ipmisensor-snmp

After restarting SNMP and allowing the cron job to execute at least once, you can test the results via:

# snmpwalk -c <community> -v <version> <ip/hostname> .1.3.6.1.4.1.X.1000
SNMPv2-SMI::enterprises.X.1000.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.X.1000.2.1 = STRING: "ipmitemp"
SNMPv2-SMI::enterprises.X.1000.3.1 = STRING: "/usr/local/sbin/ipmi-temp-stats"
SNMPv2-SMI::enterprises.X.1000.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.X.1000.101.1 = STRING: "37.000000"
SNMPv2-SMI::enterprises.X.1000.101.2 = STRING: "39.000000"
SNMPv2-SMI::enterprises.X.1000.101.3 = STRING: "23.000000"
SNMPv2-SMI::enterprises.X.1000.101.4 = STRING: "36.000000"
...
SNMPv2-SMI::enterprises.X.1000.102.1 = INTEGER: 0
SNMPv2-SMI::enterprises.X.1000.103.1 = ""

Graphing This Information in Cacti

Finally, I graph this information on Cacti (see end of post for examples).

I am making six templates available here which can be imported into Cacti (these were generated using version 0.8.6j) for graphing the above:

  1. Cacti graph template for Dell 1850 temperatures (see first image below);
  2. Cacti graph template for Dell 2850 temperatures (see second image below);
  3. Cacti graph template for Dell 1850 fan speeds (see third image below);
  4. Cacti graph template for Dell 2850 fan speeds (see fourth image below);
  5. Cacti host template for Dell 1850; and
  6. Cacti host template for Dell 2850.

The last two templates available are host templates for Dell 1850s and 2850s (I’m sure they’ll work fine with 1950s and 2950s also). These templates include:

  • Host MIB – Logged in Users;
  • Host MIB – Processes;
  • IPMI Fan Speeds (Dell x850) (from above);
  • IPMI Temperatures (Cel) (Dell x850) (from above);
  • ucd/net – CPU Usage;
  • ucd/net – Load Average;
  • ucd/net – Memory Usage;
  • SNMP – Get Mounted Partitions (data query); and
  • SNMP – Interface Statistics (data query).

Example graphs are shown below; they’re not the cleanest given the amount of information they contain but they serve my purposes.

[Dell 1850 Temps]

[Dell 2850 Temps]

[Dell 1850 Fan Speeds]

[Dell 2850 Fan Speeds]

© 2007 Barry O’Donovan. All text is licensed under a Creative Commons Attribution 3.0 License. All scripts and Cacti templates are licensed under the MIT License.

GCC Optimisations per CPU

Pádraig Brady wrote a very useful script for getting the optimum gcc options for your CPU which I keep coming back to (and forgetting where to find it).

The last version can be found at http://www.pixelbeat.org/scripts/gcccpuopt along with a lot of other useful scripts and scripting examples here.

IPv6 Blasts Into Orbit

http://www.dmcii.com/news.htm:

On Thursday, 29 March 2007, a Cisco Systems router, flying in low Earth Orbit onboard the UK-DMC satellite built by Surrey Satellite Technology Ltd (SSTL), was successfully configured by NASA Glenn Research Center to use IPsec and IPv6 technologies in space.

The five DMC satellites in orbit rely on standard IP networking to send mission-critical imagery to ground stations and to interact with terrestrial networks.

Working together, Cisco Systems, NASA Glenn Research Center and SSTL are the first to configure and test IPsec and IPv6 on a satellite.

Sangoma Inconsistancies with Latest Zaptel-1.4

I’m on a tight deadline and the last thing I need right now is kernel/Asterisk/Zaptel/Sangoma issues… This post may just help someone else save some time:

When running Sangoma’s Setup script from their wanpipe-2.3.4-7 release, the following error occurs when it tries to patch the latest zaptel (version 1.4 checked from SVN revision 2399):

Enable TDMV DCHAN Native HDLC Support & Patch Zaptel ? (y/n) y

Did NOT find the seached str:chan->writen\[chan->inwritebuf\] = amnt;
search_and_replace(zaptel-base.c) failed

Applying the following diff to Setup should solve the problem:

1c1
< #!/bin/sh
---
> #!/bin/bash
6128c6128
< ZAPTEL_C_SEARCH_STR="chan->writen\[chan->inwritebuf\] = amnt;"
---
> ZAPTEL_C_SEARCH_STR="chan->writen\[res\] = amnt;"
6134c6134
<                       chan->writen[chan->inwritebuf] = amnt;"
---
>                       chan->writen[res] = amnt;"

The change from sh to bash was to overcome the following error:

./Setup: 1014: Syntax error: Bad substitution

Finally, it looks like Sangoma’s current wanpipe will not work with linux-2.6.20.x:

/usr/src/wanpipe/kdrvtmp/sdla_xilinx.c:636:62: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/usr/src/wanpipe/kdrvtmp/sdla_xilinx.c: In function ‘wp_xilinx_init’:
/usr/src/wanpipe/kdrvtmp/sdla_xilinx.c:636: error: ‘INIT_WORK’ undeclared (first use in this function)
/usr/src/wanpipe/kdrvtmp/sdla_xilinx.c:636: error: (Each undeclared identifier is reported only once
/usr/src/wanpipe/kdrvtmp/sdla_xilinx.c:636: error: for each function it appears in.)

It works fine with linux-2.6.19.x.

I have let Sangoma’s support team know of these issues so hopefully they’ll be resolved before anyone has to actually use this post.

Interesting UKNOF Talks

In reviewing the agenda from UKNOF which I was regrettably unable to attend, three talks of an Irish origin stood out.

  • The realities of LLU in Ireland from Colin Whittaker of Magnet (the title says it all). There was also a British view offered: LLU in the UK;
  • NOC Tools from Donal O’Cearbhaill where he discussed the many tools they use at HEAnet to manage, provision and monitor the Broadband for Schools project; and
  • Network Architecture of Joost by Colm MacCarthaigh. This one is really interesting in terms of how they plan to manage the massive data transmission requirements of on-demand video and the design of a fault tolerant network service. I really like the way they their code is prefix aware and are planning AS-level awareness. Nice. Actually an interesting thread broke out about this on NANOG at the start of the year.

SNMP Polling Cisco AS5300’s for E1 Channel Usage (with Cacti)

This post is as much a reference for myself as it is for others. I had a need today to start graphing E1/PRI channel usage on some Cisco AS5300’s. The current priority is a simple graphical representation of the actual usage:

AS5300 E1 Channels in Use

Hopefully at some point over the next couple of weeks I may expand this to other more interesting information such as average call duration, etc that can be useful to diagnosing issues almost as they happen.

The Cacti XML can be found here and I just posted the same to Cacti’s own forums here.

The CISCO-POP-MGMT-MIB provides the MIBs for this information and the ones I specifically used (for my AS5300 which are all identical with 4 E1/PRI ports) are cpmDS1ActiveDS0s.0.x (or .1.3.6.1.4.1.9.10.19.1.1.9.1.3.0.x). Replace x with the appropriate port number (0-3) as required.

Explore the available information yourself with:

$ snmpwalk -Os -c <community> <host> .1.3.6.1.4.1.9.10.19

Make room PLEASE!

I had to get the Dart last Wednesday as I was going to the Irish match in Croker. It was rush hour and I experienced what I face the very odd time I get the Luas when I don’t cycle to the office: assholes clogging the door.

It seems to be an Irish mentality to congregate around the doors in case you get trapped. I’ve used public transport in New York for months a few years ago and believe me, they’d go through you for a shortcut if you were blocking the doors. I wouldn’t mind if the bloody Dart/Luas was full, but there’s plenty of room mid-carriage.

I was once on the Luas at rush hour (having squashed my way through these same assholes to centre-carriage) when a man tried to get on a couple of stops later. There was plenty of room around me but the area around the doors was wedged. He shouted for people to move into the carriage… no one moved. In fact, they made faces at each other to indicate that this guy was a nutter.

He was nothing of the sort. He was dead fucking right. Next time I’ll go through you assholes for a shortcut. Make room PLEASE!

An Apology to Wesley… ish…

I wrote in my last blog (and first for quite a while) that “to be clear – I always hated Acting-Ensign Wesley Crusher.” Strong words. So Wil’s book arrived from Amazon yesterday and I finished it this morning. And, 267 pages later, I’m feeling a little guilty about my clarity above.

[Just A Geek] Wil’s book is good. Very good – it’s the first book in a long time and only auto-biography that I read cover to cover over the course of a evening/morning. It’s very much about the battle between embracing the legacy of being a Star Trek actor and trying to get away from it. About coming to terms with the decision to leave the show and dealing with the consequences. In Wil’s words, it’s about angst. But I’m not writing a review here. It’s about far more than his experiences with Star Trek and if you were even remotely a Trekkie or just interested in a good and true story, go buy it. The link/image to the right for the book I’m talking about is taken from Wil’s own site and so hopefully he’s up for merchant royalties if you choose to buy via clicking here.

A recurring theme in the book is the many many times Wil took shit for all the people that hated Wesley. From his own blog and also reproduced in the book:

“So you didn’t like my fucking character on a fucking TV show I haven’t even worked on in Ten. Fucking. Years. Thank you for blaming ME for the writing of a fictional character, on a fictional TV show. That makes complete sense, considering all the input the writers would take from a 15 year old kid. Have you ever bothered to ask? Did it ever occur to you that I just said the lines I was given? I’m sorry Wesley messed up your precious television show. Fortunately, there were whole seasons after I quit, without me. So you can watch them, and feel better. But don’t take it out on me. I’m just an actor, doing the best job he could with what he was given. So I worked on a TV show. So I have made a living as an actor. Big deal. I’m no better than anyone else, and I have never said I was, or thought I was…

“Congratulations, sir. I’m glad that your empty, pathetic existence is made whole by shitting on a person who you’ve never even met.

“You know, I promised myself that I wouldn’t get into this. I promised myself that I wouldn’t get sucked in to the mire with the lowest common denominators. Well, guess what, guys? I don’t care if you’re “The Guy From TV” or if you’re “The kid from math class”. Being personally attacked hurts. It sucks. I wonder, do you spend a fifth of the time you spend dumping on me doing something constructive with your life? I certainly hope so.”

Now, I don’t feel guilty about the above. I clearly made the distinction between character and actor in my post. But I do feel a bit guilty and I empathise with Wil that there are so-called Trekkies out there that wouldn’t or couldn’t make this distinction and, furthermore and worse, would take it out on the actor. Gobshites.

I also stand over my cringe and credibility comments about Wesley yesterday but I didn’t go on to say that, to be fair, the character grew up over the years. In particular, I thought The First Duty was a great episode and it showed Wesley as a real person. It also had a fantastic scene between Picard and Wesley where Picard lectures Wesley about duty and truth. We saw the boy become a man and face his fears on the Battle Bridge in possibly the best two-part TNG episode of all time, The Best of Both Worlds. The Game was also a good episode but that may have had more to do with Robin Lefler (Ashley Judd) than Wesley 😉

My inner geek awakened…

Now, to be clear – I always hated Ensign Wesley Crusher (sorry Wil!). While well known among my various groups of friends as a “trekkie”, few of them ever watched it. The occasional times that my parents, brothers or friends would happen to sit down in the sitting room while ST:TNG was on, I’d often try and talk the show up. Then, along comes this lanky geeky child character navigating the fucking USS Enterprise and saving the bloody universe. Credibility, please try not to break the glass as you fly out the window. Thanks.

While googling around the other day, I came across a couple of blogs by Wil Wheaton – better known among us geeks as Ensign Wesley Crusher. I never knew what became of him since ST:TNG and my curiosity was aroused (if you don’t know what ST:TNG means then stop reading now!) .

Now, to be clear – I always hated Acting-Ensign Wesley Crusher (sorry Wil!). While well known among my various groups of friends as a “trekkie”, few of them ever watched it. The occasional times that my parents, brothers or friends would happen to sit down in the sitting room while ST:TNG was on, I’d often try and talk the show up. Then, along comes this lanky geeky child character navigating the fucking USS Enterprise and saving it at the last bloody minute. Credibility, please try not to break the glass as you fly out the window. Thanks.

There were so many blood curdling and embarrassing scenes containing Wesley Crusher that I only prayed and hoped that the actor shared my embarrassment as I watched through slitted eyes.

Turns out, he sort of did! Well, some of the time. While Wesley Crusher was never the object of “hero worship” for this particular geek, he was still on ST:TNG and as such he carries a certain currency with me. And this is why it was so… exciting (yes, I’ve admitted it!) for me to stumble across his sites. It’s rare to be able to get so “close” to the actors we watch or have watched so often on screen and I’ve even gone and purchased his two books from Amazon – what the hell, in for a penny, in for a pound.

From what I’ve read so far, he seems interesting, a Linux user and a geek (!), very open and honest and he throws in the odd story about Star Trek too; in particular WILLIAM FUCKING SHATNER Part I and Part II – well worth a read if you’re a trekkie. He’s now earned a spot on my (small and insignificant) Blogroll. You’ll find Wil’s old stuff at www.wilwheaton.net and his newer stuff at WWdN: In Exile.

As an aside: Unfortunately for Wil, the producers went and got it right for the next series in the character of Jake Cisco played by Cirroc Lofton.

The Not So Short Introduction to LaTeX

Following a recent thread on ILUG, I was reminded of what I consider an invaluable resource for LaTeX: The Not So Short Introduction to LaTeX (or LaTeX in 139 minutes – you’ll have to read it to discover why 139).

This document held a place of esteem on my desk during my research years in UCD and I am very grateful to its author, Tobias Oetiker. I think I still have a coffee stained version somewhere in the house…