方法一

查看能否正常显示温度

cut -c1-2 /sys/class/thermal/thermal_zone0/temp

方法二

通过sensors命令

sensors

sensors正常显示为

Adapter: ISA adapter

Package id 0: +38.0°C (high = +82.0°C, crit = +102.0°C)

Core 0: +43.0°C (high = +82.0°C, crit = +102.0°C)

Core 1: +42.0°C (high = +82.0°C, crit = +102.0°C)

驱动状态

通过 ssh 连接到路由器

# 方法一
# 查看能否正常显示温度
cut -c1-2 /sys/class/thermal/thermal_zone0/temp

# 方法二
# 通过sensors命令
sensors

# sensors正常显示为
# Adapter: ISA adapter
# Package id 0:  +38.0°C  (high = +82.0°C, crit = +102.0°C)
# Core 0:        +43.0°C  (high = +82.0°C, crit = +102.0°C)
# Core 1:        +42.0°C  (high = +82.0°C, crit = +102.0°C)

修改文件

若以上任意一种都显示,则

# 打开该文件
vim /usr/lib/lua/luci/view/admin_status/index.htm

# 找到内核版本显示字段 其它字段也可
# 大概位于第747行
<tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr>
# 在下方加入以下内容(任选其一即可)

# 方法一
<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("cut -c1-2 /sys/class/thermal/thermal_zone0/temp")%></td></tr>

# 方法二
# 该方法为静态显示 需手动刷新网页 也可手动定义变量来动态刷新
<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("sensors | tail -n 5")%></td></tr>
最后修改:2023 年 02 月 14 日
如果觉得我的文章对你有用,请随意赞赏