****************************
S.M.A.R.T システムサービスの起動
[root@falcon21 ~]# service smartd start
smartd を起動中: [ OK ]
[root@falcon21 ~]# chkconfig smartd on
-----------
S.M.A.R.T 情報を取得
[root@falcon21 ~]# smartctl -a /dev/sda
smartctl 5.43 2016-09-28 r4347 [i686-linux-2.6.32-696.1.1.el6.i686] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Western Digital Caviar SE Serial ATA
Device Model: WDC WD2500JS-22NCB1
Serial Number: WD-WCANKH293486
Firmware Version: 10.02E02
User Capacity: 250,058,268,160 bytes [250 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Fri May 26 23:37:12 2017 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.
General SMART Values:
Offline data collection status: (0x84) Offline data collection activity
was suspended by an interrupting command from host.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 7680) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 90) minutes.
Conveyance self-test routine
recommended polling time: ( 6) minutes.
SCT capabilities: (0x103f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
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 0x000f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0003 195 183 021 Pre-fail Always - 5225
4 Start_Stop_Count 0x0032 095 095 000 Old_age Always - 5944
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 200 200 051 Pre-fail Always - 0
9 Power_On_Hours 0x0032 088 088 000 Old_age Always - 8901
10 Spin_Retry_Count 0x0013 100 100 051 Pre-fail Always - 0
11 Calibration_Retry_Count 0x0012 100 100 051 Old_age Always - 0
12 Power_Cycle_Count 0x0032 095 095 000 Old_age Always - 5806
190 Airflow_Temperature_Cel 0x0022 062 031 045 Old_age Always In_the_past 38
194 Temperature_Celsius 0x0022 112 081 000 Old_age Always - 38
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 8
200 Multi_Zone_Error_Rate 0x0009 200 200 051 Pre-fail Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
--------------------
/etc/mrtg/mrtg.cfg を追加編集 ### CPUとマザーボードの温度 ### Target[cputemp]: `/usr/bin/sensors | grep Temp | awk '{print $3}' | sed -e 's/+//' -e 's/[^0-9+\.].*//'` MaxBytes[cputemp]: 100 Title[cputemp]: CPUとマザーボードの温度 PageTop[cputemp]: <h1>CPUとマザーボードの温度</h1> Options[cputemp]: growright,absolute,gauge,nopercent,noinfo WithPeak[cputemp]: ymw #unscaled[cputemp]: dwmy YLegend[cputemp]: Temperature ShortLegend[cputemp]: C LegendI[cputemp]: M/B LegendO[cputemp]: CPU Legend1[cputemp]: M/B Legend2[cputemp]: CPU
### ハードディスクの温度 ### #Target[hddtemp]: `/usr/sbin/hddtemp /dev/sda -n` Target[hddtemp]: `hddtemp -n /dev/sda; hddtemp -n /dev/sda; uptime | awk '{$1=""; $2=""; print}'` MaxBytes[hddtemp]: 100 Title[hddtemp]: ハードディスクの温度 PageTop[hddtemp]: <h1>ハードディスクの温度</h1> Options[hddtemp]: growright,absolute,gauge,nopercent,noinfo WithPeak[hddtemp]: ymw YLegend[hddtemp]: Temperature ShortLegend[hddtemp]: ℃ LegendI[hddtemp]: 温度: LegendO[hddtemp]: 温度: Legend1[hddtemp]: ハードディスクsdaの温度 Legend2[hddtemp]: |
*** HDD追加・再起動で、デバイス名が変わってしまうので注意 ***
USB disk が、設定した時は、/dev/sdbで認識され、
OSを再起動した後は、/dev/sdaと変っていた。 usb 電源が入っている場合、こちらが
優先されるらしい。
********************************************************************************:
hddtemp はOS起動ディスクのみ表示、USBディスクはスマート情報が得られず、設定修正
Target[hddtemp]: `hddtemp -n /dev/sda; ーー>Target[hddtemp]: `hddtemp -n /dev/sdb;
********************************************
システムの文字コードがUTF-8の場合
設定ファイルの文字コードをEUCに変換
[root@falcon21 ~]# cp /etc/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg.org
[root@falcon21 ~]# nkf -e /etc/mrtg/mrtg.cfg.org > /etc/mrtg/mrtg.cfg
***********************************************************************
MRTG起動スクリプト作成
[root@falcon21 ~]# vi mrtg.sh
#!/bin/bash
LOCK=/var/lock/mrtg/mrtg_l
CONFCACHE=/var/lib/mrtg/mrtg.ok
export LANG=ja_JP.eucJP
mrtg /etc/mrtg/mrtg.cfg --lock-file $LOCK --confcache-file $CONFCACHE
[root@falcon21 ~]# chmod 755 mrtg.sh
--------------------------------
[root@falcon21 ~]# ./mrtg.sh
[root@falcon21 ~]# ./mrtg.sh
[root@falcon21 ~]# ./mrtg.sh
--------------------------------
アクセス設定
[root@falcon21 ~]# vi /etc/httpd/conf.d/mrtg.conf
#
# This configuration file maps the mrtg output (generated daily)
# into the URL space. By default these results are only accessible
# from the local host.
#
Alias /mrtg /var/www/mrtg
<Location /mrtg>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168 ← 追加
Allow from ::1
# Allow from .example.com
</Location>
---------------------------
[root@falcon21 ~]# /etc/rc.d/init.d/httpd reload
httpd を再読み込み中:
***************************
MRTGインデックスページ作成
[root@falcon21 ~]# indexmaker --columns=1 \
--addhead="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=euc-jp\">" \
/etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
MRTGインデックスページ編集
[root@falcon21 ~]# vi /var/www/mrtg/index.html
<!-- <meta http-equiv="content-type" content="text/html; charset=iso-8859-15" > -->
[root@falcon21 ~]# /etc/init.d/httpd restart
-----------------------------------
MRTG自動起動設定
[root@falcon21 ~]# vi /etc/cron.d/mrtg
#*/5 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
*/5 * * * * root /root/mrtg.sh
*****************************
CPUの温度
コマンドでは、
[root@falcon21 ~]# sensors
nouveau-pci-0200
Adapter: PCI adapter
temp1: +54.0°C (high = +95.0°C, hyst = +3.0°C)
(crit = +105.0°C, hyst = +5.0°C)
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: +22.0°C
Core0 Temp: +12.0°C
Core1 Temp: +36.0°C
Core1 Temp: +25.0°C
-----------------------------------
[root@falcon21 ~]# service crond restart
crond を停止中: [ OK ]
crond を起動中: [ OK ]
************************************
確認 ・・・mrtg にアクセス
https://falcon21.space/mrtg/ OK
------------------
CPU冷却ファン回転数など別項目を調べたい場合は、 Lm_sensors の設定 Lm_sensors の設定コマンド sensors-detect 実行 [root@falcon21 ~]# sensors-detect [root@falcon21 ~]# sensors-detect # sensors-detect revision 1.1 # System: Gigabyte Technology Co., Ltd. M68SM-S2
This program will help you determine which kernel modules you need to load to use lm_sensors most effectively. It is generally safe and recommended to accept the default answers to all questions, unless you know what you're doing.
Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): y Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... Success! (driver `k8temp') AMD Family 11h thermal sensors... No Intel digital thermal sensor... No Intel AMB FB-DIMM thermal sensor... No VIA C7 thermal and voltage sensors... No
Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): y Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... Yes Found `ITE IT8716F Super IO Sensors' Success! (address 0x290, driver `it87') Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No
Some systems (mainly servers) implement IPMI, a set of common interfaces through which system health data may be retrieved, amongst other things. We first try to get the information from SMBIOS. If we don't find it there, we have to read from arbitrary I/O ports to probe for such interfaces. This is normally safe. Do you want to scan for IPMI interfaces? (YES/no): y Probing for `IPMI BMC KCS' at 0xca0... No Probing for `IPMI BMC SMIC' at 0xca8... No
Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): y
Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): n Now follows a summary of the probes I have just done. Just press ENTER to continue:
Driver `it87': * ISA bus, address 0x290 Chip `ITE IT8716F Super IO Sensors' (confidence: 9)
Driver `k8temp' (autoloaded): * Chip `AMD K8 thermal sensors' (confidence: 9)
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): y
Starting lm_sensors: loading module it87 [ OK ]
******************************************************** sensors コマンドにより、センサー一覧を表示 [root@falcon21 ~]# sensors nouveau-pci-0200 Adapter: PCI adapter temp1: +51.0°C (high = +95.0°C, hyst = +3.0°C) # SYSTEM 温度 (crit = +105.0°C, hyst = +5.0°C)
k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +20.0°C Core0 Temp: +9.0°C Core1 Temp: +34.0°C Core1 Temp: +24.0°C
it8716-isa-0290 Adapter: ISA adapter in0: +1.10 V (min = +0.00 V, max = +4.08 V) in1: +1.87 V (min = +0.00 V, max = +4.08 V) in2: +3.31 V (min = +0.00 V, max = +4.08 V) in3: +3.31 V (min = +0.00 V, max = +4.08 V) in4: +3.01 V (min = +0.00 V, max = +4.08 V) in5: +3.20 V (min = +0.00 V, max = +4.08 V) in6: +1.12 V (min = +0.00 V, max = +4.08 V) in7: +3.31 V (min = +0.00 V, max = +4.08 V) Vbat: +3.02 V fan1: 1128 RPM (min = 0 RPM) # CPU ファン回転数 fan2: 0 RPM (min = 0 RPM) temp1: +36.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor # CPU 温度 temp2: +30.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor temp3: +12.0°C (low = +127.0°C, high = +127.0°C) sensor = thermal diode cpu0_vid: +1.100 V -------------------------------- |