[Japanese page]
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.
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.
Stupid suid'ed wrapper to invoke vcgencmd get_throttled
with privilege.
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/wherebefore make install if the directory is sure.
the reason must be one of
mkdir
in previous step.
configure
with --libexecdir
was wrong.
configure
step with right argument and follow steps again.
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
.
[temperature][voltage]
Happy monitoring!