memo.xight.org

日々のメモ

カテゴリ : Linux

2ページ目 / 全4ページ

lm-sensors でハードウェアモニタリング

Summary

lm-sensors でCPU,M/B,電圧,FANの回転数などの情報が取得可能.

Install

# aptitude install lm-sensors


Setting

# /usr/sbin/sensors-detect

This program will help you determine which I2C/SMBus modules you need to
load to use lm_sensors most effectively. You need to have i2c and
lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-*
files, for most things.
If you have patched your kernel and have some drivers built in, you can
safely answer NO if asked to load some modules. In this case, things may
seem a bit confusing, but they will still work.

It is generally safe and recommended to accept the default answers to all
questions, unless you know what you're doing.

 We can start with probing for (PCI) I2C or SMBus adapters.
 You do not need any special privileges for this.
 Do you want to probe now? (YES/no): yes

長々とメッセージが出ただけだった.

Probing for PCI bus adapters...
Use driver `i2c-viapro' for device 00:11.0: VIA Technologies VT8237 South Bridge
Probe succesfully concluded.

As you are not root, we can't load adapter modules. We will only scan
already loaded adapters.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

 To continue, we need module `i2c-dev' to be loaded.
 If it is built-in into your kernel, you can safely skip this.
 i2c-dev is not loaded. As you are not root, we will just hope you edited
 `/etc/modules.conf' for automatic loading of
 this module. If not, you won't be able to open any /dev/i2c-* file.

 We are now going to do the adapter probings. Some adapters may hang halfway
 through; we can't really help that. Also, some chips will be double detected;
 we choose the one with the highest confidence value in that case.
 If you found that the adapter hung after probing a certain address, you can
 specify that address to remain unprobed. That often
 includes address 0x69 (clock chip).

Some chips are also accessible through the ISA bus. ISA probes are
typically a bit more dangerous, as we have to write to I/O ports to do
this. This is usually safe though.

As you are not root, we shall skip this step.

Some Super I/O chips may also contain sensors. Super I/O probes are
typically a bit more dangerous, as we have to write to I/O ports to do
this. This is usually safe though.

As you are not root, we shall skip this step.

 Sorry, no chips were detected.
 Either your sensors are not supported, or they are
 connected to an I2C bus adapter that we do not support.
 See doc/FAQ, doc/lm_sensors-FAQ.html, or
 http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/lm_sensors-FAQ.html
 (FAQ #4.24.3) for further information.
 If you find out what chips are on your board, see
 http://secure.netroedge.com/~lm78/newdrivers.html for driver status.

実行してみる

$ sensors
Can't access procfs/sysfs file
Unable to find i2c bus information;
For 2.6 kernels, make sure you have mounted sysfs and done
'modprobe i2c_sensor'!
For older kernels, make sure you have done 'modprobe i2c-proc'!

再チャレンジ

# modprobe i2c-viapro
# sensors
No sensors found!

... センサーが見つかりませんでした.

Reference

ずんWiki - lm-sensorsでハードウェアモニタリング
http://www.kawaz.jp/pukiwiki/?lm-sensors%A4%C7%A5%CF%A1%BC%A5%C9%A5%A6%A5%A7%A5%A2%A5%E2%A5%CB%A5%BF%A5%EA%A5%F3%A5%B0

Temperature above threshold

Summary

突然,ターミナルに以下のメッセージが表示された.

Message from syslogd@hostname at Fri Jun 23 21:54:41 2006 ...
hostname kernel: CPU0: Temperature above threshold

Message from syslogd@hostname at Fri Jun 23 21:54:41 2006 ...
hostname kernel: CPU0: Running in modulated clock mode

Message from syslogd@hostname at Fri Jun 23 21:54:47 2006 ...
hostname kernel: CPU0: Temperature above threshold

Message from syslogd@hostname at Fri Jun 23 21:54:47 2006 ...
hostname kernel: CPU0: Running in modulated clock mode

原因はCPU温度が高すぎたため.
CPU温度は64度だった.

Reference

Fedora JP 掲示板 - GNOMEターミナルおかしいです...
http://bbs.fedora.jp/read.php?FID=3&TID=1241

設定ファイルをまとめて管理する

Reference

設定ファイルをまとめて管理する
http://playrecord.org/archive/config-files-on-Unix/myconf.html
uyota 匠の一手 - 2006-03-19 - Single System, Multiple Machines
http://uyota.asablo.jp/blog/2006/03/19/294745
uyota 匠の一手 - 2006-03-20 - Single System, Multiple Machines #2
http://uyota.asablo.jp/blog/2006/03/20/296243

via

void GraphicWizardsLair( void ); // /etcや/usr/local/etcなどを一カ所で管理するテクニック
http://www.otsune.com/diary/2006/06/12/3.html#200606123

irqbalance - マルチCPU環境で複数CPU割り込みを行うためのツール

Summary

Linux Kernelは本来,CPU0のみがハードウエアからの割り込みを処理するが,
irqbalanceを導入することで,マルチCPU環境で2nd CPU以降も割り込み処理を行えるようになる.
1CPUのマシンでは使用する意味は無い.

以下を実行し,複数のCPUが表示されればOK.

% cat /proc/interrupts


2CPUの場合の例

CPU0       CPU1
  0:    8470386    8463949    IO-APIC-edge  timer
  1:          3          3    IO-APIC-edge  keyboard
  2:          0          0          XT-PIC  cascade
  8:          1          0    IO-APIC-edge  rtc
 11:          0          0   IO-APIC-level  usb-ohci
 12:         93         47    IO-APIC-edge  PS/2 Mouse
 14:         64          0    IO-APIC-edge  ide2
 17:      70903      15277   IO-APIC-level  ide0
 19:    1944132          0   IO-APIC-level  eth0
NMI:          0          0
LOC:   16934242   16934259
ERR:          0
MIS:          1

1CPUの場合の例

CPU0
  0: 2609483773    IO-APIC-edge  timer
  1:          9    IO-APIC-edge  i8042
  9:          0   IO-APIC-level  acpi
 14:    3287084    IO-APIC-edge  ide0
 15:          1    IO-APIC-edge  ide1
201:    5996744   IO-APIC-level  eth0
NMI:          0
LOC: 2609834207
ERR:          0
MIS:          0

Reference

技術情報ツリー
http://h50221.www5.hp.com/cgi/service/knavi/production/doc_disp.cgi?category=722&doc=jnav004182

CentOS

Summary

「Red Hat Enterprise Linux 4 Update 3」のソース・コードを,GNU GPLに沿って修正・改変したクローンOS.
基本的に,RHEL4のソース・コードからRed Hat社のロゴやデザインなど,
商標等にかかわる部分を取り除き,コンパイルしてインストールCDにまとめている.
こうすることで,RHEL4との互換性を維持しながら,GNU GPLの規定により自由に配布できる.

- Reference
ITpro - 2006-06-05 - 無償だけど安定稼働するLinux OSを知ってますか
http://itpro.nikkeibp.co.jp/article/OPINION/20060605/239983/

rsync の使い方

#!/bin/sh

RSYNC=/usr/bin/rsync
LOCAL_PATH=/path/to/target/

REMOTE_USER=username
REMOTE_HOST=example.com
REMOTE_PATH=/path/to/backup/

$RSYNC -avz -e ssh $LOCAL_PATH $REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH

watch - プログラムを定期的に実行し,出力をフルスクリーンで表示する

Summary

変更点を強調表示してくれる -d オプションが便利.

Usage (抜粋)

watch [-d] [-n <seconds>] <command>

watch の使い方

メールを監視する

$ watch -n 60 from


ディレクトリの中身の変化を監視する

$ watch -d ls -l


dateコマンドを定期的に発行 (ネットワークが切断されないように)

$ watch -n 10 date


Reference

Debian パッケージディレクトリ検索 (バイナリ) - procps

hook_tcp.so - connect()の接続先を syslog へ記録する

Reference

チームチドリ :: B-Wiki - hook_tcp.so
http://www.t-dori.net/modules/bwiki/?hook_tcp.so

via

にわか鯖管の苦悩日記 - 2005-12-27 - hook_tcp.so リリース
http://kikuz0u.x0.com/td/?date=20051227#p01
cl.pocari.org - LD_PRELOAD を利用して,プログラム中で実行される connect() の接続先を syslog へ記録する hook_tcp.so
http://cl.pocari.org/2005-12-27-10.html