0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

暑いので OpenWrt デバイスの温度をモニタリングする

Last updated at Posted at 2025-07-07

この記事を書いた理由

シンガポールでは一年を通じて、最低気温 25℃、最高気温 32℃ くらい。

最高気温が 32℃ を超える日が続くと、「シンガポールよりも暑いのか 😵‍💫」と毎回思う。

そしてこの暑さの中、ルーターもかなり熱くなっている。

最近 2 回続けて Beszel をお勧めする記事を見かけたので、Beszel で OpenWrt 機器のモニタリングをしてみた。 🧐

どの程度まで熱くなるか

70℃ 近くまで熱くなっている。💀

Temperature Monitoring of OpenWrt Devices

おまけ

Beszel Hub のインストール方法

compose.yaml
services:
  beszel:
    image: henrygd/beszel
    container_name: beszel
    restart: unless-stopped
    ports:
      - 8090:8090
    volumes:
      - ./beszel_data:/beszel_data

OpenWrt での Beszel Agent のインストール方法

在OpenWrt上手动部署Beszel Agent服务指南

# Determine the architecture of the system
ARCH=$(uname -m \
  | sed -e 's/x86_64/amd64/' \
        -e 's/armv6l/arm/' \
        -e 's/armv7l/arm/' \
        -e 's/aarch64/arm64/')

# Download the latest version of the beszel-agent for the current OS and architecture
wget -qO- "https://github.com/henrygd/beszel/releases/latest/download/beszel-agent_$(uname -s)_${ARCH}.tar.gz" \
  | tar -xz -O beszel-agent \
  | tee ./beszel-agent >/dev/null && chmod +x beszel-agent

# Move the beszel-agent to the /usr/bin/ directory
mv beszel-agent /usr/bin/

1. サービスとして登録せず、一時的に実行してみる場合

beszel-agent -key "<public key>" &

2. サービスとして登録して実行する場合

/etc/init.d/beszel
#!/bin/sh /etc/rc.common

USE_PROCD=1
START=95
STOP=01

APP_NAME="beszel-agent"
APP_PATH="/usr/bin/beszel-agent"
APP_PIDFILE="/var/run/beszel.pid"

start_service() {
    procd_open_instance
    procd_set_param command "$APP_PATH" -listen "45876" -key "<public key>"
    procd_set_param respawn  # Automatically restart after the process crashes
    procd_set_param pidfile "$APP_PIDFILE"
    procd_set_param stdout 1  # Redirect standard output to log
    procd_set_param stderr 1  # Redirect error output to log
    procd_close_instance
}

stop_service() {
    killall "$APP_NAME"
}
  • <public key> の値は Beszel Hub で確認できます。

    Beszel public key

chmod +x /etc/init.d/beszel  # Add executable permissions
/etc/init.d/beszel enable    # Enable auto-start on boot
/etc/init.d/beszel start     # Start the service immediately

個々の OpenWrt の web インターフェース上で温度を表示させたい場合

wget --no-check-certificate \
  -O /tmp/luci-app-temp-status_0.7.1-r2_all.ipk \
  https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-temp-status_0.7.1-r2_all.ipk

opkg install /tmp/luci-app-temp-status_0.7.1-r2_all.ipk
rm /tmp/luci-app-temp-status_0.7.1-r2_all.ipk
service rpcd restart
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?