VineLinux4.x/サーバ管理/Muninで温度監視

Last-modified: 2018-02-03 (土) 09:34:03 (2266d)

HDDの温度監視

smartmontoolsのインストール。

# apt-get install smartmontools

smartdの起動。

# /etc/init.d/smartd start
Starting smartd:                                           [  OK  ]

自動起動の設定。

# chkconfig smartd on
# chkconfig --list smartd
smartd          0:off   1:off   2:off   3:on    4:on    5:on    6:off

/dev/hdaの情報を表示。

# smartctl -a /dev/hda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Hitachi Travelstar 5K100 series
Device Model:     HTS541040G9AT00
Serial Number:    MPB210X2G0BLJB
Firmware Version: MB2OA56J
User Capacity:    40,007,761,920 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   6
ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 3a
Local Time is:    Sat Nov 29 11:10:27 2008 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
:
略
:
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   062    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   040    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0007   188   188   033    Pre-fail  Always       -       1
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       126
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   040    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0012   031   031   000    Old_age   Always       -       30503
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       112
191 G-Sense_Error_Rate      0x000a   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       10
193 Load_Cycle_Count        0x0012   001   001   000    Old_age   Always       -       5051923
194 Temperature_Celsius     0x0002   166   166   000    Old_age   Always       -       33 (Lifetime Min/Max 15/56)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0
 :
 略

194 Temperature_Celsius・・・が表示されればOKです。右側の33という数字が現在の温度です。

シンボリックリンク作成。

# ln -s /usr/share/munin/plugins/hddtemp_smartctl /etc/munin/plugins/hddtemp_smartctl

設定ファイル変更。

# vi /etc/munin/plugin-conf.d/munin-node
[hddtemp_smartctl]
user root
env.drives hda
env.args_hda --all -d ata

hdaは環境によって適宜変更する。

munin-nodeの再起動。

# /etc/init.d/munin-node restart
Stopping Munin Node agents:                                [  OK  ]
Starting Munin Node:                                       [  OK  ]

CPUの温度監視(ACPI対応パソコンの場合)

Vine Seedより、acpi-0.09-1vl5.src.rpmをダウンロード。

注:Vine Seedには、ビルド済みrpmも用意されていますが、自分の環境では「浮動小数点演算例外です」と表示され実行できなかったため、SRPMよりビルドしています。

# cd /usr/src/vine/SRPMS/
# wget http://www.ring.gr.jp/pub/linux/Vine/VineSeed/SRPMS.plus/acpi-0.09-1vl5.src.rpm

ビルド。

# rpmbuild --rebuild acpi-0.09-1vl5.src.rpm

インストール。

# cd ../RPMS/i386/
# rpm -Uvh acpi-0.09-1vl4.i386.rpm

acpiコマンドにて値が取得できるか確認。

# acpi -t
     Battery 1: charged, 99%
     Thermal 1: ok, 42.0 degrees C

↑42.0 degrees C はCPUの温度。

シンボリックリンク作成。

# ln -s /usr/share/munin/plugins/acpi /etc/munin/plugins/acpi

munin-nodeの再起動。

# /etc/init.d/munin-node restart
Stopping Munin Node agents:                                [  OK  ]
Starting Munin Node:                                       [  OK  ]

ページを確認して正常に表示されていればOK。

sensors.png

コメント



添付ファイル: filesensors.png 419件 [詳細]