+ -
当前位置:首页 → 问答吧 → [解决]帮忙贴个conky的温度监视的配置

[解决]帮忙贴个conky的温度监视的配置

时间:2007-08-13

来源:互联网

以前用2.6.18,用这个配置:
引用:
CPU:$color ${i2c 9191-0290 temp 2}C${color grey} - MB:$color ${i2c 9191-0290 temp 1}C
现在用了2.6.22内核,那个温度不在I2C目录下。现在在
引用:
/sys/devices/pci0000:00/0000:00:18.3/temp1_input
/sys/devices/platform/w83627hf.656/temp3_type
/sys/devices/platform/w83627hf.656/temp3_max_hyst
/sys/devices/platform/w83627hf.656/temp3_max
/sys/devices/platform/w83627hf.656/temp3_input
/sys/devices/platform/w83627hf.656/temp2_type
/sys/devices/platform/w83627hf.656/temp2_max_hyst
/sys/devices/platform/w83627hf.656/temp2_max
/sys/devices/platform/w83627hf.656/temp2_input
/sys/devices/platform/w83627hf.656/temp1_type
/sys/devices/platform/w83627hf.656/temp1_max_hyst
/sys/devices/platform/w83627hf.656/temp1_max
/sys/devices/platform/w83627hf.656/temp1_input
怎么写conkyrc?谢谢。

作者: blackwhite   发布时间: 2007-08-13

cat 下面的文件内容出来, 再说

/sys/devices/pci0000:00/0000:00:18.3/temp1_input
/sys/devices/platform/w83627hf.656/temp3_type
/sys/devices/platform/w83627hf.656/temp3_max_hyst
/sys/devices/platform/w83627hf.656/temp3_max
上传的图像
screenshot.png (35.8 KB, 23 次查看)
screenshot1.png (103.0 KB, 15 次查看)

作者: nainaide   发布时间: 2007-08-13

我用原配置文件,升级内核之22,发现其他正常,就是侦测cpu风扇出现问题,加上vmware-moudles无法编译通过,也就没升内核。据gentoo官方论坛说,某个接口好像是acpi什么的存在内存泄露的bug,但是我也没用到啊

作者: 三翻领   发布时间: 2007-08-13

这是我显示CPU\风扇\电池的配置

cpu1 ${exec echo $(cat /sys/class/hwmon/hwmon1/device/temp1_input) / 1000 | bc}°C

风扇转速$alignr${exec echo $(cat /proc/acpi/ibm/fan |grep -Po [0-9+])} /分钟
电池:${exec battery_charge.pl}$alignr${exec battery_check.pl}
${execbar (exec battery_check.pl)}

电池状态的文件内容稍微复杂,我写了一个小perl程序, 放到了 /usr/bin/中

@localhost ~ $ cat /usr/bin/battery_charge.pl
#!/usr/bin/perl
#test mode match
$state_battery = undef;
open STATE, " <", "/proc/acpi/battery/BAT0/state";
while (<STATE>) {
chomp;
if (/charging state:\s+(.*)/) {
$state_battery = $1;
last;
}
}

print "$state_battery";

@localhost ~ $ cat /usr/bin/battery_check.pl
#!/usr/bin/perl
#test mode match
#
$remaining_capacity = undef;
$total_capacity = undef;
open STATE, " <", "/proc/acpi/battery/BAT0/state";
while (<STATE>) {
chomp;
if (/remaining capacity:\s+(\d+)/) {
$remaining_capacity = $1;
}
}

open INFO, " <", "/proc/acpi/battery/BAT0/info";
while (<INFO>) {
chomp;
if (/design capacity:\s+(\d+)/) {
$total_capacity = $1;
}
}
if ($total_capacity == 0) {
print "没有安装电池";
} else {
printf "%2.2f %", $remaining_capacity/$total_capacity*100;
}

作者: nainaide   发布时间: 2007-08-13

谢谢,原来你们用了cat,而不是我用从其它人配置里边的I2C方法(18和22的区别就是那个监视数据不在/sys/bus/i2c下面了,尽管现在这个目录还在。)。

作者: blackwhite   发布时间: 2007-08-13

我也是i2c,cat就行了?

作者: 三翻领   发布时间: 2007-08-13

引用:
作者: 三翻领
我也是i2c,cat就行了?
用cat就好。
追加问个问题,怎么那个°C,在我的conky里边显示不正常?是不是我用字体里边没有这个字符造成的?

作者: blackwhite   发布时间: 2007-08-14

可能,我用的是STHeiti。

作者: nainaide   发布时间: 2007-08-14

引用:
作者: nainaide
可能,我用的是STHeiti。
我用了这个字体,也不行,怪了。果真是因为我的LC_CTYPE=zh_CN的缘故。如果用LC_CTYPE=zh_CN.UTF-8就好了。

作者: blackwhite   发布时间: 2007-08-14

引用:
作者: blackwhite
我用了这个字体,也不行,怪了。果真是因为我的LC_CTYPE=zh_CN的缘故。如果用LC_CTYPE=zh_CN.UTF-8就好了。
正是如此, 我的locale:
@localhost ~ $ locale
LANG=en_US.utf8
LC_CTYPE=zh_CN.utf8
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

作者: nainaide   发布时间: 2007-08-14

可能是台机的原因或者是哪里的问题,貌似我这里用cat现实cpu转速不行

frank@localhost ~ $ cd /proc/acpi/fan/
frank@localhost /proc/acpi/fan $ ls
FAN
frank@localhost /proc/acpi/fan $ cd FAN/
frank@localhost /proc/acpi/fan/FAN $ ls
state
frank@localhost /proc/acpi/fan/FAN $ cat state
status: on

作者: 三翻领   发布时间: 2007-08-15

引用:
作者: 三翻领
可能是台机的原因或者是哪里的问题,貌似我这里用cat现实cpu转速不行

frank@localhost ~ $ cd /proc/acpi/fan/
frank@localhost /proc/acpi/fan $ ls
FAN
frank@localhost /proc/acpi/fan $ cd FAN/
frank@localhost /proc/acpi/fan/FAN $ ls
state
frank@localhost /proc/acpi/fan/FAN $ cat state
status: on
去这个地方看看:
cat /sys/class/hwmon/hwmon0/device/fan1_input 如果没有检查一下 kernel config有没有CONFIG_ACPI_FAN=y

作者: nainaide   发布时间: 2007-08-15

引用:
作者: nainaide
这是我显示CPU\风扇\电池的配置

cpu1 ${exec echo $(cat /sys/class/hwmon/hwmon1/device/temp1_input) / 1000 | bc}°C

风扇转速$alignr${exec echo $(cat /proc/acpi/ibm/fan |grep -Po [0-9+])} /分钟
我用了你的设置,挺好的。刚看了一下官方说明,发现ibm还可以用变量查看。你的风扇里写着有ibm,估摸着对你也有用。变量如下:

ibm_fan --- If running the IBM ACPI, displays the fan speed.
ibm_temps N --- If running the IBM ACPI, displays the temperatures from the IBM temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the GPU.

作者: zhou3345   发布时间: 2007-08-16

引用:
作者: zhou3345
我用了你的设置,挺好的。刚看了一下官方说明,发现ibm还可以用变量查看。你的风扇里写着有ibm,估摸着对你也有用。变量如下:

ibm_fan --- If running the IBM ACPI, displays the fan speed.
ibm_temps N --- If running the IBM ACPI, displays the temperatures from the IBM temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the GPU.
我用的的确是IBM 是thinkpad t60. 我没注意$ibm_fan之类,谢谢提醒。

作者: nainaide   发布时间: 2007-08-16

引用:
作者: nainaide
去这个地方看看:
cat /sys/class/hwmon/hwmon0/device/fan1_input 如果没有检查一下 kernel config有没有CONFIG_ACPI_FAN=y
多谢多谢,有救了
请教temp1_input和temp2_input分别指哪个温度,尽管从经验上看temp2_input是cpu温度

作者: 三翻领   发布时间: 2007-08-16

引用:
作者: 三翻领
多谢多谢,有救了
请教temp1_input和temp2_input分别指哪个温度,尽管从经验上看temp2_input是cpu温度
这个问题似乎比较难回答,可能因机器不同而异。也许grep 一下kernel source 匹配temp1_input,会有答案。

比如,
(http://www.thinkwiki.org/wiki/Thermal_Sensors)

ThinkPad R51

The ibm-acpi documentation includes the report by Thomas Gruber:

EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 Mini-PCI
0x7A 3 HDD
0x7B 4 GPU
0x7C 5 System battery
0x7D 6 UltraBay battery
0x7E 7 System battery
0x7F 8 UltraBay battery
0xC0 none ?
0xC1 none ?
0xC2 none ?

[edit] ThinkPad T40

The location of one of the sensors is identified here.

EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 System board under rear left corner of Mini-PCI module
0x7A 3 ?
0x7B 4 GPU
0x7C 5 Battery
0x7D 6 n/a
0x7E 7 Battery
0x7F 8 n/a
0xC0 none n/a
0xC1 none n/a
0xC2 none n/a

[edit] ThinkPad T43, T43p

Found by Shmidoax using cooling spray to cool down components and observe the effect on the sensors.

EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 Between PCMCIA slot and CPU (same as HDAPS module)
0x7A 3 PCMCIA slot
0x7B 4 GPU
0x7C 5 System battery (front left = charging circuit)
0x7D 6 UltraBay battery?
0x7E 7 System battery (rear right)
0x7F 8 UltraBay battery?
0xC0 none Bus between Northbridge and DRAM
0xC1 none Southbridge, WLAN and clock generator (under Mini-PCI card, under touchpad)
0xC2 none Power circuitry, on underside of system board under F2 key

作者: nainaide   发布时间: 2007-08-16

热门下载

更多