VMware: How to extract Temperature information from ESXi for ARM, send it to InfluxDB, and display it with Grafana

Greetings friends, I told you a few weeks ago what VMware had just launched, and that it was going to revolutionize the world of virtualization and make it, even more, accessible in many new use cases with the new ESXi for ARM.

Well, one of the things that worried me the most, I think I mentioned it in the video, was being able to control the temperature of the Raspberry Pi with ESXi for ARM, as ESXi usually gets all this data from the IPMI, iDRAC, iLO, etc.

But luckily we have a hero (Tom Hebel) who works in VMware and who has compiled a native driver to extract this information, besides being able to interact with many more things.

Diagram of how this solution works

It’s fine, I think, just creating a .json that telegraf then parses and writes to InfluxDB, but if I find a better way to do it, everything will get better, here the diagram:

Download and install the ESXi for ARM Native Driver for Raspberry Pi

I don’t know if it needs to be said, but all these steps are obviously for an unsupported product, created by the Community 🙂

To download the plugin from our ESXi over SSH, we will first have to disable the firewall so that it can connect through the ESXi http client, as well as having to download the system security so that we can install this plugin:

Once we have made these changes, we will proceed to download the package, directly from Tom’s GitHub, take a look at it for you, as it may have new versions:

Fantastic, let’s proceed with the installation of the Raspberry Pi driver for ESXi for ARM:

This should show you something similar to this, after a few seconds or even a minute:

Although the VIB says not to reboot, it is really recommended, so you know:

Once we reboot, we check that we have a new device in /dev/vmgfxXX in my case is /dev/vmgfx32.

Note: Put this in a scratch partition or in some datastore where the ESXi can access to keep it even if we reboot.

Now we will download the example of monitoring the RPi that our friend Tom has:

Before launching the script, we will go with vi to edit the following file /scratch/downloads/thpimon-main/pyUtil/pimonLib/__init__.py

And we will modify the line called PIMON_DEVICE_PATH with our new device, like this:

We are going to test that everything works, we will launch the following script, which should give us the necessary information:

We already have the most important part! Thank you very much, again Tom Hebel for your great work.

Download Script to collect information and produce the .json

It’s time to download and configure the simple script I created, we can download it from here, directly to the ESXi for ARM:

Some values must be edited in order to make it work properly, these values:

We will make the script executable, as always:

And we will launch the script to see what works:

With this done, now you have a valid .json ANYTHING can take and parse, as long as they have access over HTTPS to the ESXi for ARM. Example of the .JSON:

I am using telegraf, so let’s take a look.

How to create a cron to run the script every minute

Many of the changes we have made will be lost when restarting, including the cron, but I leave it for you to have it at hand, we will go to the file /var/spool/cron/crontabs/root and edit it:

We will add the following at the end of it, you can point to the route where you have the script:

Okay, that’s it, every minute we will have a fresh .json ready to be parsed.

Telegraf configuration to parse the new .json and send it to InfluxDB

This time I am going to use the always versatile inputs.http, to parse directly from the .json, the config can not be easier, I have created a new file under /etc/telegraf/telegraf.d/pimonarm.conf with this inside:

Then we can test it with the next command:

If all good, you will see something like this:

If we go to our Grafana – Explorer, we can see that we have data!

Grafana Dashboard to see everything in a centralized way

Now that we have all this information, we probably want to show it in a more elegant way. I have used the well-known vSphere Hosts Dashboard I already had and added the ESXi ARM part at the end of it.

Just by importing it using the Grafana URL, you will have something similar to this:

At the end of it all, in case you have ESXi for ARM, they will appear to you. Remember that you need vCenter for all this to work:That’s all friends, thank you for the following links that have helped me a lot:

Endnote – Using CGI to get a JSON on Demand

Florian from virten.net has published a similar process using a CGI that ESXi runs every time this URL is called:

It seems a very simple and elegant process, the only thing that makes me a little nervous is that it is using hostd-operation.cgi that is supposed to be reserved for the system, although we don’t know much about it, if it was hardcoded, it might be a reason. Anyway, Florian steps are very cool and there is no need for cron, now you have another option 🙂

Author: jorgeuk

Father, writing in https://www.jorgedelacruz.es and https://jorgedelacruz.uk Blogger, Systems Engineer @veeam - vExpert 2014/2020 & NTC 2018/19

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.