Input Linux IPMI Data to InfluxDB via Node Red

Greetings,

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...

40
47

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...

https://nodered.org/docs/user-guide/messages

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:

https://flows.nodered.org/node/node-red-contrib-func-exe

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 https://kifarunix.com/install-and-configure-snmp-on-debian-10-buster/

  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.3.6.1.2.1.1.1.0 = STRING: "Linux pi4modelb0.[redacted] 5.4.50-v8+ #1324 SMP PREEMPT Wed Jul 1 17:13:08 BST 2020 aarch64"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (10448) 0:01:44.48
iso.3.6.1.2.1.1.4.0 = STRING: "[redacted].com" <- administrative email address
iso.3.6.1.2.1.1.5.0 = STRING: "[redacted].org" <- DNS domain for server

Say query system load status? Reference https://www.charlie27.com/2019/08/snmp-get-cpu-usage-and-memory-usage/

# snmpwalk -v2c -c [redacted] localhost  1.3.6.1.4.1.2021.11
iso.3.6.1.4.1.2021.11.1.0 = INTEGER: 1
iso.3.6.1.4.1.2021.11.2.0 = STRING: "systemStats"
iso.3.6.1.4.1.2021.11.3.0 = INTEGER: 0
iso.3.6.1.4.1.2021.11.4.0 = INTEGER: 0
iso.3.6.1.4.1.2021.11.5.0 = INTEGER: 10
iso.3.6.1.4.1.2021.11.6.0 = INTEGER: 0
iso.3.6.1.4.1.2021.11.7.0 = INTEGER: 1169
iso.3.6.1.4.1.2021.11.8.0 = INTEGER: 2015
iso.3.6.1.4.1.2021.11.9.0 = INTEGER: 1
iso.3.6.1.4.1.2021.11.10.0 = INTEGER: 0
iso.3.6.1.4.1.2021.11.11.0 = INTEGER: 98
iso.3.6.1.4.1.2021.11.50.0 = Counter32: 1331622
iso.3.6.1.4.1.2021.11.51.0 = Counter32: 68177
iso.3.6.1.4.1.2021.11.52.0 = Counter32: 342486
iso.3.6.1.4.1.2021.11.53.0 = Counter32: 97383177
iso.3.6.1.4.1.2021.11.54.0 = Counter32: 24171
iso.3.6.1.4.1.2021.11.55.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.56.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.57.0 = Counter32: 2372786
iso.3.6.1.4.1.2021.11.58.0 = Counter32: 875170
iso.3.6.1.4.1.2021.11.59.0 = Counter32: 316538457
iso.3.6.1.4.1.2021.11.60.0 = Counter32: 550624126
iso.3.6.1.4.1.2021.11.61.0 = Counter32: 23183
iso.3.6.1.4.1.2021.11.62.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.63.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.64.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.65.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.66.0 = Counter32: 0
iso.3.6.1.4.1.2021.11.67.0 = INTEGER: 4

Pi 4 has 4 cores, the above shows stats for all cores. For tighter reporting, see below. Reference http://www.debianadmin.com/linux-snmp-oids-for-cpumemory-and-disk-statistics.html

CPU Statistics

Load
1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1
5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2
15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3

CPU
percentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0
raw user cpu time: .1.3.6.1.4.1.2021.11.50.0
percentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0
raw system cpu time: .1.3.6.1.4.1.2021.11.52.0
percentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0
raw idle cpu time: .1.3.6.1.4.1.2021.11.53.0
raw nice cpu time: .1.3.6.1.4.1.2021.11.51.0

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