Input Linux IPMI Data to InfluxDB via Node Red


I have a conundrum I hope someone way smarter than me can solve :slight_smile:

I have a centos 8 linux system and I use the ipmitool application to query the onboard server IPMI board to obtain sensor information, such as CPU temperatures etc. For example, the code below provides the temperatures for CPU1 and CPU2.

ipmitool sdr elist full | grep CPU | grep Temp | cut -d "|" -f 5 | cut -d " " -f 2

The values returned are the same as below...


The first value is CPU1 and the second value is CPU2.

I would really love to be able to collect these and other values from the IPMI board and feed them into Node Red so I can add them to an InfluxDB for Grafana, but also to enable alerting via Node Red i.e. when certain thresholds are reached.

Is there an easy way to use Node Red to take the data from the ipmitool query and input into Node Red?

Ideas appreciated :slight_smile:

Wow... IPMI... that brings back a lot of memories! There are a few ways to do this... maybe the easiest is to use an NR 'exec' node, and just capture and parse the IPMI CLI results returned, and feed it to whatever you want. It might take a bit of JavaScript to do the parse and formulate the insert to the DB of course.

Which or what IPMI tool are you using, for the initial query? Total sample output? You can limit the output of course, but as a discussion point might be a good idea to show the raw output as a reference before you grep it down to specifics, just a thought.

I did a lot of engineering around IPMI, HP Lights-out (iLO), Dell iDRAC, etc., event worked with Dell years ago to rework their design to improve its enterprise level design for iDRAC, so I know what IPMI feature set and reporting presented varies from vendor to vendor. We, my team at the time, automated IPMI configuration as part of the post PXE OS load over wire solution. Was fun, getting a solution that adapted to each of the server vendors! Ah, but I digress.

I did a quick search via Google and did not find any canned NR solution or flows applicable, it was a quick search, so apparently this is a create from scratch type of thing.

You will want to be sure to protect any credentials used, NR does this, in that simple export and import of any IPMI based flows you create will not carry forward the credentials by default. So if you have or plan to use multiple NR instances, credentials for IPMI access will be an issue you will need to address as part of your overall design/implementation.

Unfortunately, now that I am retired, I don't have access to IPMI equipped hardware, so I can't assist in any direct manner. But if you provide sample output from the CLI, that may suggest a few things we could do. As I recall, HP iLO could export a 'data' file, that had the IPMI setup and such in a less than human friendly format, that was easy to parse via programmatic methods, thus convert to something we could forward to other solutions, if your applicable IPMI solution can create such? That would be a step in the right direction.

And... Just to learn about how NR works in general, suggest you read the following as well...

Review the details on the exec node, and how to design flows that loop, so that you can query each system, in turn, via a schedule, right? There is a cron like module for NR that you will want to use as well. So, your homework, if you will, is read about the following:

Have you considered using SNMP versus IPMI? SNMP can report the same type of information, and tends to be easier to feed into various systems.

Hi Nodi,

Unfortunately the only use of SNMP is to send traps i.e. an alert is sent when something goes wrong. In other words, the IPMI cannot be queried via snmp, which would be awesome because I could query things like temperature etc. Unfortunately it is not available.

Thanks, Mark

Well, you could query SNMP directly as well... SNMP Get queries. You don't have to rely on SNMP trap sends. You can use SNMP walk to explicitly query SNMP OIDs. Various enterprise monitoring systems do explicit SNMP get queries under the hood at times, if SNMP is enabled on the remote servers.

Just for anyone that might interested, on how SNMP can do explicit queries. Below is an example. I am using a Pi 4, running Pi OS latest (debian buster image may 2020).

  1. Install SNMP daemon/service - make sure you setup security as needed, for this example, left SNMP at -v2 level, did not implement -v3 (to much work for just an example). Reference

  2. Install SNMP client tools on different system (or same for testing), snmpwalk for example. # apt install snmp

So once installed and configured, as per the reference above... You can explicitly query SNMP via the snmpwalk cli command...

# snmpwalk -v2c -c [redacted] localhost | head -5
iso. = STRING: "Linux pi4modelb0.[redacted] 5.4.50-v8+ #1324 SMP PREEMPT Wed Jul 1 17:13:08 BST 2020 aarch64"
iso. = OID: iso.
iso. = Timeticks: (10448) 0:01:44.48
iso. = STRING: "[redacted].com" <- administrative email address
iso. = STRING: "[redacted].org" <- DNS domain for server

Say query system load status? Reference

# snmpwalk -v2c -c [redacted] localhost
iso. = INTEGER: 1
iso. = STRING: "systemStats"
iso. = INTEGER: 0
iso. = INTEGER: 0
iso. = INTEGER: 10
iso. = INTEGER: 0
iso. = INTEGER: 1169
iso. = INTEGER: 2015
iso. = INTEGER: 1
iso. = INTEGER: 0
iso. = INTEGER: 98
iso. = Counter32: 1331622
iso. = Counter32: 68177
iso. = Counter32: 342486
iso. = Counter32: 97383177
iso. = Counter32: 24171
iso. = Counter32: 0
iso. = Counter32: 0
iso. = Counter32: 2372786
iso. = Counter32: 875170
iso. = Counter32: 316538457
iso. = Counter32: 550624126
iso. = Counter32: 23183
iso. = Counter32: 0
iso. = Counter32: 0
iso. = Counter32: 0
iso. = Counter32: 0
iso. = Counter32: 0
iso. = INTEGER: 4

Pi 4 has 4 cores, the above shows stats for all cores. For tighter reporting, see below. Reference

CPU Statistics

1 minute Load: .
5 minute Load: .
15 minute Load: .

percentage of user CPU time: .
raw user cpu time: .
percentages of system CPU time: .
raw system cpu time: .
percentages of idle CPU time: .
raw idle cpu time: .
raw nice cpu time: .

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.