vcthrottled, probe module on power and temperature on Raspberry Pi OS for Xymon

[Japanese page]

Overview

Recently I learned that state of supplied power voltage and temperature can be observed by vcgencmd get_threshold command and special file /sys/class/thermal/thermal_zone0/temp provides temperature degree on Raspberry Pi OS. So I made probe module on them for Xymon.

Components

vcthrottled

The main module. Invoke vcgencmd get_throttled via get_throttled, the wrapper mentioned farther, internally and and observe

See official documentation for detail.

Also obtain temperature from /sys/class/thermal/thermal_zone0/temp. This special file provides ASCII representaion of x1000 of temperature degree in Celsius. Another tactics is to use vcgencmd again with measure_tmp sub command.

Then invoke xymon command twice to report condition to Xymon server. One is on column temperature and another is on column voltage.

Report on temperature contains measured temperature, "Soft temperature limit active" or not, and "Arm frequency capped" or not. According to https://forums.raspberrypi.com/viewtopic.php?f=63&t=147781&start=50#p972790, "Arm frequency capped" occurs when temperature exceeds 80 deg(C) and throttling caused by high temperature occurs at 85 deg(C).

Report on voltage contains just one item, "Under-voltage detected" or not. The criteria is said 4.63V. I'm interested in but don't find the way to observe supplied voltage value yet. Remember that vcgencmd measure_volts brings voltage at core or SDRAM, not supplied to Raspberry Pi from external via USB connector.

get_throttled

Stupid suid'ed wrapper to invoke vcgencmd get_throttled with privilege.

Install

Obtain tar ball and extract it under appropriate working directory.

$ tar xvzf vcthrottled.tar.gz
  

You'll see sub directory named vcthrottled and cd into it.

$ ls
vcthrottled
$ cd vcthrottled
  

Now you have to determine where get_throttled wrapper to locate, say LIBEXECDIR. Saying my case, I put it into directory named /pub/libexec/xymon/vcthrottled. /usr/local/lib or /opt/vcthrottled/lib may comply Filesystem Hierarchy Standard Version 3.0. It is up to you but /usr/lib/xymon/client/local. Xymon client scans there and invoke the contents, so there is right location for vcthrottled but not for get_throttled.

Invoke configure with LIBEXECDIR you determined, or the default is /usr/local/libexec.

$ ./configure --libexecdir=LIBEXECDIR
  

If LIBEXECDIR is not exist yet, you have to make it now. For example,

$ sudo mkdir /pub/libexec/xymon/vcthrottled
  

Of course, with right LIBEXECDIR you determined. Applying -p on mkdir is useful but do it carefully to avoid unwanted result though it may not be fatal.

Okey. Now the time to install.

$ sudo make install
  

vcthrottled goes /usr/lib/xymon/client/local where is right location as long as do with xymon-client package from Debian and whatever you give on configure doesn't affect. If you want to change, you have to tweak Makefile.in and invoke configure again.

get_throttled will go LIBEXECDIR you applied on configure by --libexecdir. If you see the message saying

    
Please
    mkdir /some/where
before
    make install
if the directory is sure.
    
  

the reason must be one of

Invoke

As mentioned above, xymon-client package from Debian invokes modules under /usr/lib/xymon/client/local automatically and RRD related settings on temperature are built in. So no configuration for this module is required.

After a while since make install, columns temperature and voltage will be appeared on your Xymon screen. If it doesn't go well, please analyze under /var/log/xymon.

Screen shots

[temperature][voltage]

Happy monitoring!


[Top page(Japanese only)|Software(Japanese only)]
Copyright(c) 2021, Koh-ichi Ito, All rights reserved
Last update: $Date:: 2021-12-31 18:07:00 +0900#$