Twitterに投稿 はてなブックマークに追加 Google Bookmarksに追加

目次 >> MRTG

MRTGによる計算機の状態監視

MRTGを使って、サーバの状態をウェブ上から確認できるようにする。なお、計算機クラスターのように、複数台ある場合は、gangliaが便利である。

下記のパッケージをインストールする。Fedora、CentOSの場合、すべてyumでインストールできる。また、openSUSE 10、11の場合も、yastですべてインストールできる。なお、Suseの場合は共にはじめからインストールされている場合もある。ubuntuではapt-getを使う。

mrtg
net-snmp
(net-snmp-utils)
# yum install mrtg
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* updates: www.ftp.ne.jp
* addons: www.ftp.ne.jp
* extras: www.ftp.ne.jp
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mrtg.x86_64 0:2.14.5-2 set to be updated
--> Processing Dependency: perl-Socket6 for package: mrtg
--> Processing Dependency: perl-IO-Socket-INET6 for package: mrtg
--> Running transaction check
---> Package perl-IO-Socket-INET6.noarch 0:2.51-2.fc6 set to be updated
---> Package perl-Socket6.x86_64 0:0.19-3.fc6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mrtg x86_64 2.14.5-2 base 840 k
Installing for dependencies:
perl-IO-Socket-INET6 noarch 2.51-2.fc6 base 13 k
perl-Socket6 x86_64 0.19-3.fc6 base 21 k

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 875 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): mrtg-2.14.5-2.x86_ 100% |=========================| 840 kB 00:00
(2/3): perl-Socket6-0.19- 100% |=========================| 21 kB 00:00
(3/3): perl-IO-Socket-INE 100% |=========================| 13 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: perl-Socket6 ######################### [1/3]
Installing: perl-IO-Socket-INET6 ######################### [2/3]
Installing: mrtg ######################### [3/3]

Installed: mrtg.x86_64 0:2.14.5-2
Dependency Installed: perl-IO-Socket-INET6.noarch 0:2.51-2.fc6 perl-Socket6.x86_64 0:0.19-3.fc6
Complete!
# yum install net-snmp
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* updates: www.ftp.ne.jp
* addons: www.ftp.ne.jp
* extras: www.ftp.ne.jp
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package net-snmp.x86_64 1:5.3.1-24.el5_2.2 set to be updated
--> Processing Dependency: libsensors.so.3()(64bit) for package: net-snmp
--> Running transaction check
---> Package lm_sensors.x86_64 0:2.10.0-3.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
net-snmp x86_64 1:5.3.1-24.el5_2.2 updates 702 k
Installing for dependencies:
lm_sensors x86_64 2.10.0-3.1 base 504 k

Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): lm_sensors-2.10.0- 100% |=========================| 504 kB 00:00
(2/2): net-snmp-5.3.1-24. 100% |=========================| 702 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: lm_sensors ######################### [1/2]
Installing: net-snmp ######################### [2/2]

Installed: net-snmp.x86_64 1:5.3.1-24.el5_2.2
Dependency Installed: lm_sensors.x86_64 0:2.10.0-3.1
Complete!
# yum install net-snmp-utils
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* updates: www.ftp.ne.jp
* addons: www.ftp.ne.jp
* extras: www.ftp.ne.jp
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package net-snmp-utils.x86_64 1:5.3.1-24.el5_2.2 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
net-snmp-utils x86_64 1:5.3.1-24.el5_2.2 updates 182 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 182 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): net-snmp-utils-5.3 100% |=========================| 182 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: net-snmp-utils ######################### [1/1]

Installed: net-snmp-utils.x86_64 1:5.3.1-24.el5_2.2
Complete!

まずは、snmpのセットアップ。/etc/snmp/snmp.confの設定を(openSUSE 10.0の場合は、/etc/snmp.conf)書き換える。下のリンクを参考に書き換える。今回は下記のように設定。

com2sec local localhost private
com2sec mynetwork 192.168.11.0/24 public

group MyRWGroup any local
group MyROGroup any mynetwork

view all included .1 80

access MyROGroup "" any noauth 0 all none none
access MyRWGroup "" any noauth 0 all all all

disk / 10000

そして、

#/etc/init.d/snmpd start

でsnmpデーモンを起動する。毎回ブート時に起動するように、

# chkconfig snmpd on

と打ち、さらに

# chkconfig --list snmpd

と打ってみて

snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

のように出るか確かめる。(openSUSE 10.0の場合はsnmpd 0:off 1:off 2:on 3:on 4:off 5:on 6:off

つづいて、MRTGの設定をする。
適当なディレクトリ(例えばユーザのホームディレクトリなど)で

cfgmaker --no-down private@localhost > mrtg.cfg

と打ち、設定ファイルを生成する。

できたmrtg.cfgファイルの中の、WorkDirの項目だけ、コメント#をはずして、下記のように書き換える。具体的には、htmlファイルが生成される場所を指定する。

WorkDir: /www/foo/mrtg

この場所は、apacheで公開しているディレクトリでないと、外部からブラウザで読めない。

このmrtg.cfgファイルを、/etc/mrtg/mrtg.cfgにおく。(openSUSE 10.0の場合は、デフォルトでmrtg.cfgが存在しないので、/usr/local/mrtg/というフォルダを作成して、そこにmrtg.cfgファイルをおく。)

# mrtg /etc/mrtg/mrtg.cfg
# mrtg /etc/mrtg/mrtg.cfg
# mrtg /etc/mrtg/mrtg.cfg

とエラーが出ても三回打つ。(openSUSE 10.0の場合は、mrtg /usr/local/mrtg/mrtg.cfg)三回目でエラーが出なくなるはず。具体的には下記のような感じになる。

# mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_2
Rateup WARNING: /usr/bin/rateup The backup log file for localhost_2 was invalid as well
Rateup WARNING: /usr/bin/rateup Can't remove localhost_2.old updating log file
Rateup WARNING: /usr/bin/rateup Can't rename localhost_2.log to localhost_2.old updating log file
Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_4
Rateup WARNING: /usr/bin/rateup The backup log file for localhost_4 was invalid as well
Rateup WARNING: /usr/bin/rateup Can't remove localhost_4.old updating log file
Rateup WARNING: /usr/bin/rateup Can't rename localhost_4.log to localhost_4.old updating log file
[root@ckme ~]# mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup Can't remove localhost_2.old updating log file
Rateup WARNING: /usr/bin/rateup Can't remove localhost_4.old updating log file
# mrtg /etc/mrtg/mrtg.cfg

あとはMRTGをyumからインストールした場合、/etc/cron.d/内に、mrtgというファイルができていて、自動的に5分ごとにmrtgが実行されるはず。

openSUSE 10.0の場合は、cronファイルが自動生成されないので、手動で作成する。MRTGというファイルを/etc/cron.d/内に下記の内容で作成する。

*/5 * * * * root /usr/bin/mrtg /usr/local/mrtg/mrtg.cfg

そしてchmodで下記のように変更しておく。(しないとエラーが出て実行してくれない。)

# chmod 644 mrtg

初期設定では左から右にグラフが成長してしまうので、mrtg.cfg内の最初の方に

Options[_]: growright, noinfo

を追加する。

その他、CPU使用率などについてはここここここここを参照。また、

# /usr/bin/indexmaker --columns=1 /etc/mrtg/mrtg.cfg > /home/ckme/public_html/mrtg/index.html

と打つことにより、一ページで確認できるインデックスページが作成される。日本語が文字化けする場合は、手動でindex.htmlを書き換えて、文字化けを防ぐ。

CPUの温度を監視する - Suse 10.2

ほかのディストリビューションでは、lm_sensorsというものであるが、Suseではsensorsというパッケージ名となっている。これは通常デフォルトでインストールされている。

rootでsensors-detectを実行する。

# sensors-detect

するといろいろ聞かれるが、基本的にデフォルト値(リターンキーを押していけばよい)でよい。そして最後に

I will now generate the commands needed to load the required modules.
Just press ENTER to continue:

To make the sensors modules behave correctly, add these lines to
/etc/modprobe.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----
# I2C adapter drivers
# modprobe unknown adapter NVIDIA i2c adapter 0 at 2:00.0
# modprobe unknown adapter NVIDIA i2c adapter 1 at 2:00.0
# modprobe unknown adapter NVIDIA i2c adapter 2 at 2:00.0
modprobe i2c-nforce2
# Chip drivers
# no driver for Analog Devices ADT7473 yet
modprobe eeprom
# Warning: the required module k8temp is not currently installed
# on your system. For status of 2.6 kernel ports check
# http://www.lm-sensors.org/wiki/Devices. If driver is built
# into the kernel, or unavailable, comment out the following line.
modprobe k8temp
modprobe smsc47b397
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----

If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones! You really
should try these commands right now to make sure everything is
working properly. Monitoring programs won't work until the needed
modules are loaded.

Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): y

の様に表示されるはずである。この指示は最後の、/etc/sysconfig/lm_sensorsでyesを選択している場合は無視して良い。

mrtg.cfgには、

Target[cputemp]: `/usr/bin/sensors | grep temp | awk '{print $2}' | sed -e 's/+//' -e 's/[^0-9+\.].*//'`
MaxBytes[cputemp]: 100
Title[cputemp]: CPU and Motherboard Temperature
PageTop[cputemp]: <h1>CPU and Motherboard Temperature</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

のように追加する。最初の行は、$2を例えば$3などに変更する必要があるかもしれない。

$ /usr/bin/sensors | grep temp | awk '{print $2}' | sed -e 's/+//' -e 's/[^0-9+\.].*//'

と打ってみて、温度が+や-記号なしで出力されればよい。

ubuntuでのセットアップ

まず、apt-getを使い、MRTGをインストールする。

$ sudo apt-get install mrtg

すると、下記のような質問が行われる。

                            Configuring mrtg
If your MRTG configuration file is readable by users other than the user
MRTG runs as (typically either 'mrtg' or 'root') it can present a 
security risk, as this file contains SNMP community names. 
It is recommended that you make the file owned by and readable only by
the MRTG user, unless you have specific reasons not to.
Make /etc/mrtg.cfg owned by and readable only by the MRTG user?

                   <Yes>                       <No>       

これは、とりあえずYesを選択。
次に、snmpdとsnmpをインストール。

$ sudo apt-get install snmpd
$ sudo apt-get install snmp

これで、インストールはおしまい。

次に設定であるが、設定ファイルは

/etc/snmp/snmpd.conf
/etc/mrtg.cfg

の2つである。

まず、/etc/snmp/snmpd.confであるが、

com2sec local localhost private
com2sec mynetwork 192.168.11.0/24 public

group MyRWGroup any local
group MyROGroup any mynetwork

view all included .1 80

access MyROGroup "" any noauth 0 all none none
access MyRWGroup "" any noauth 0 all all all

disk / 10000

を設定する。このとき、

#com2sec paranoid  default         public
#access MyROGroup ""      any       noauth    exact  all    none   none
#access MyRWGroup ""      any       noauth    exact  all    all    none

の各行はコメントアウトしておいた。ここでとりあえずsnmpdを再起動。

$ sudo /etc/init.d/snmpd restart
Restarting network management services: snmpd.

次に、mrtg.cfgを作成する。

$ sudo cfgmaker --no-down private@localhost > mrtg.cfg

で作成し、/etc/mrtg.cfgにコピーする。作成されたmrtg.cfgファイルは下記のようになっているはずであるが、取消線で示した部分は削除する。

# Created by 
# /usr/bin/cfgmaker --no-down private@localhost


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  for Debian
WorkDir: /var/www/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no

######################################################################
# System: ubu
# Description: Linux ubu 2.6.24-19-generic #1 SMP Wed Jun 4 15:10:52 UTC 2008 x86_64
# Contact: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
# Location: Unknown (configure /etc/snmp/snmpd.local.conf)
######################################################################


### Interface 1 >> Descr: 'lo' | Name: 'lo' | Ip: '127.0.0.1' | Eth: '' ###
### The following interface is commented out because:
### * it is a Software Loopback interface
# 
# Target[localhost_lo]: #lo:private@localhost:
# SetEnv[localhost_lo]: MRTG_INT_IP="127.0.0.1" MRTG_INT_DESCR="lo"
# MaxBytes[localhost_lo]: 1250000
# Title[localhost_lo]: Traffic Analysis for lo -- ubu
# PageTop[localhost_lo]: <h1>Traffic Analysis for lo -- ubu</h1>
#               <div id="sysdetails">
#                       <table>
#                               <tr>
#                                       <td>System:</td>
#                                       <td>ubu in Unknown (configure /etc/snmp/snmpd.local.conf)</td>
#                               </tr>
#                               <tr>
#                                       <td>Maintainer:</td>
#                                       <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmpd.local.conf)</td>
#                               </tr>
#                               <tr>
#                                       <td>Description:</td>
#                                       <td>lo  </td>
#                               </tr>
#                               <tr>
#                                       <td>ifType:</td>
#                                       <td>softwareLoopback (24)</td>
#                               </tr>
#                               <tr>
#                                       <td>ifName:</td>
#                                       <td>lo</td>
#                               </tr>
#                               <tr>
#                                       <td>Max Speed:</td>
#                                       <td>1250.0 kBytes/s</td>
#                               </tr>
#                               <tr>
#                                       <td>Ip:</td>
#                                       <td>127.0.0.1 (localhost)</td>
#                               </tr>
#                       </table>
#               </div>


### Interface 2 >> Descr: 'eth0' | Name: 'eth0' | Ip: '10.42.136.231' | Eth: '00-1f-c6-0b-53-d7' ###

Target[localhost_eth0]: #eth0:private@localhost:
SetEnv[localhost_eth0]: MRTG_INT_IP="10.42.136.231" MRTG_INT_DESCR="eth0"
MaxBytes[localhost_eth0]: 1250000
Title[localhost_eth0]: Traffic Analysis for eth0 -- ubu
PageTop[localhost_eth0]: <h1>Traffic Analysis for eth0 -- ubu</h1>
                <div id="sysdetails">
                        <table>
                                <tr>
                                        <td>System:</td>
                                        <td>ubu in Unknown (configure /etc/snmp/snmpd.local.conf)</td>
                                </tr>
                                <tr>
                                        <td>Maintainer:</td>
                                        <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmpd.local.conf)</td>
                                </tr>
                                <tr>
                                        <td>Description:</td>
                                        <td>eth0  </td>
                                </tr>
                                <tr>
                                        <td>ifType:</td>
                                        <td>ethernetCsmacd (6)</td>
                                </tr>
                                <tr>
                                        <td>ifName:</td>
                                        <td>eth0</td>
                                </tr>
                                <tr>
                                        <td>Max Speed:</td>
                                        <td>1250.0 kBytes/s</td>
                                </tr>
                                <tr>
                                        <td>Ip:</td>
                                        <td>10.42.136.231 (ubu.local)</td>
                                </tr>
                        </table>
                </div>

さらに、グラフを右から左へ進むようにするために、

Options[_]: growright, noinfo

を追加する。

CPU使用率監視のためには

Target[cpu]: .1.3.6.1.4.1.2021.11.50.0&.1.3.6.1.4.1.2021.11.52.0:private@localhost
MaxBytes[cpu]: 100
Options[cpu]: growright, noinfo, nopercent
YLegend[cpu]: CPU usage(%)
ShortLegend[cpu]: (%)
LegendI[cpu]: user
LegendO[cpu]: system
Legend1[cpu]: CPU usage(user)(%)
Legend2[cpu]: CPU usage(system)(%)
Title[cpu]: CPU usage
PageTop[cpu]: <h1>CPU usage</h1>

を追加する。

メモリ使用率監視のためには、

Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.4.0:private@localhost
MaxBytes1[mem]: 4054440
MaxBytes2[mem]: 7815612
Unscaled[mem]: dwmy
Options[mem]: gauge, absolute, growright, noinfo
YLegend[mem]: Mem Free(Bytes)
ShortLegend[mem]: Bytes
kilo[mem]: 1024
kMG[mem]: k,M,G,T,P
LegendI[mem]: Real
LegendO[mem]: Swap
Legend1[mem]: free physical memory[MBytes]
Legend2[mem]: free swap[MBytes]
Title[mem]: free memory
PageTop[mem]: <h1>free memory</h1>

MaxBytes1[mem]:およびMaxBytes2[mem]:の値は、下記のようにfreeコマンドで取得した値を使うこと。

$ free
total used free shared buffers cached
Mem: 4054440 526688 3527752 0 40064 319604
-/+ buffers/cache: 167020 3887420
Swap: 7815612 0 7815612

ディスク使用率の監視には

Target[disk]: .1.3.6.1.4.1.2021.9.1.9.1&.1.3.6.1.4.1.2021.9.1.9.1:private@localhost
MaxBytes[disk]: 100
Unscaled[disk]: dwmy
Options[disk]: gauge, absolute, growright, nopercent, noinfo
YLegend[disk]: Disk Used(%)
ShortLegend[disk]: (%)
LegendI[disk]: / Disk used
LegendO[disk]: / Disk Used
Legend1[disk]: / Disk used
Legend2[disk]: / Disk used
Title[disk]: Disk usage
PageTop[disk]: <h1>Disk usage</h1>

を追加する。

初期設定では、mrtgが生成した結果ファイルは/var/www/mrtgに保存される。

WorkDir: /var/www/mrtg

この項目を変えれば、別のディレクトリに作成することもできる。

それからインデックスページを作るために

$ indexmaker --columns=1 /etc/mrtg.cfg > index.html

を実行し、できたindex.htmlを/var/www/mrtgに持って行く。

sudo mv index.html /var/www/mrtg/

なお、別の項目(CPU温度など)を追加した場合は、もう一度インデックスページを作成しなおす必要がある。

実行間隔に関しては、

 /etc/cron.d/mrtg

で変更できる。

CPU温度を監視する

まずは、lm_sensors(lm-sensors)のインストール

Fedoraなどではパッケージ名がlm_sensorsであるが、ubuntuではパッケージ名がlm-sensorsであるので注意

$ sudo apt-get install lm-sensors
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libsensors4
Suggested packages:
i2c read-edid sensord
The following NEW packages will be installed:
libsensors4 lm-sensors
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 253kB of archives.
After this operation, 942kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.us.kernel.org hardy/main libsensors4 1:3.0.0-4ubuntu1 [41.8kB]
Get:2 http://mirrors.us.kernel.org hardy/main lm-sensors 1:3.0.0-4ubuntu1 [212kB]
Fetched 253kB in 15s (16.5kB/s)
Selecting previously deselected package libsensors4.
(Reading database ... 120217 files and directories currently installed.)
Unpacking libsensors4 (from .../libsensors4_1%3a3.0.0-4ubuntu1_amd64.deb) ...
Selecting previously deselected package lm-sensors.
Unpacking lm-sensors (from .../lm-sensors_1%3a3.0.0-4ubuntu1_amd64.deb) ...
Setting up libsensors4 (1:3.0.0-4ubuntu1) ...
udev active, devices will be created in /dev/.static/dev/

Setting up lm-sensors (1:3.0.0-4ubuntu1) ...

Creating config file /etc/sensors3.conf with new version

Processing triggers for libc6 ...
ldconfig deferred processing now taking place

そして、sensors-detectを実行する。

$ sudo sensors-detect

そうすると、いろいろと聞かれるが、基本的にデフォルト値のYESで良いはずである(リターンキーを押していけばよい)。そして最後に、

To load everything that is needed, add this to /etc/modules:

#----cut here----
# I2C adapter drivers
# modprobe unknown adapter NVIDIA i2c adapter
# modprobe unknown adapter NVIDIA i2c adapter
# modprobe unknown adapter NVIDIA i2c adapter
# Chip drivers
# Warning: the required module smartbatt is not currently installed
# on your system. For status of 2.6 kernel ports check
# http://www.lm-sensors.org/wiki/Devices. If driver is built
# into the kernel, or unavailable, comment out the following line.
smartbatt
w83627ehf
#----cut here----

Do you want to add these lines automatically? (yes/NO)yes

このように聞かれるので、yesすれば設定は完了である。ここでシステムを再起動する必要がある。
そしてsensorsを実行すると、各種データを取得できるようになる。

$ sensors
w83627dhg-isa-0290
Adapter: ISA adapter
VCore: +1.12 V (min = +0.00 V, max = +1.74 V)
in1: +11.40 V (min = +6.76 V, max = +7.66 V) ALARM
AVCC: +3.33 V (min = +2.13 V, max = +3.01 V) ALARM
3VCC: +3.33 V (min = +2.32 V, max = +2.26 V) ALARM
in4: +1.46 V (min = +1.26 V, max = +1.42 V) ALARM
in5: +1.73 V (min = +1.46 V, max = +1.44 V) ALARM
in6: +4.71 V (min = +6.37 V, max = +2.20 V) ALARM
VSB: +3.33 V (min = +2.26 V, max = +3.68 V)
VBAT: +3.25 V (min = +3.82 V, max = +1.22 V) ALARM
Case Fan: 0 RPM (min = 310 RPM, div = 128) ALARM
CPU Fan: 1074 RPM (min = 1318 RPM, div = 8) ALARM
Aux Fan: 0 RPM (min = 210 RPM, div = 128) ALARM
fan5: 0 RPM (min = 178 RPM, div = 128) ALARM
Sys Temp: +38.0 C (high = +10.0 C, hyst = +96.0 C) sensor = thermistor
CPU Temp: +40.0 C (high = +80.0 C, hyst = +75.0 C) sensor = diode
AUX Temp: +127.0 C (high = +80.0 C, hyst = +75.0 C) ALARM sensor = thermistor
cpu0_vid: +1.550 V

mrtg.cfgには下記のように追加する。

Target[cputemp]: `/usr/bin/sensors | grep Temp | awk '{print $3}' | sed -e 's/+//' -e 's/[^0-9+\.].*//'`
MaxBytes[cputemp]: 100
Title[cputemp]: CPU and Motherboard Temperature
PageTop[cputemp]: <h1>CPU and Motherboard Temperature</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

ハードディスクの温度

hddtempをインストールする。ubuntuでは

$ sudo apt-get install hddtemp

とすると、

 lqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring hddtemp tqqqqqqqqqqqqqqqqqqqqqqqqqqk  
 x                                                                           x  
 x hddtemp can be run as a daemon, listening on port 7634 for incoming       x  
 x connections. It is used some by software such as gkrellm to get the       x  
 x temperature of the hard drives.                                           x  
 x                                                                           x  
 x You have the option of starting the hddtemp daemon automatically on the   x  
 x computer startup. If in doubt, it is suggested to not start it            x  
 x automatically on startup. If you later change your mind, you can run:     x  
 x 'dpkg-reconfigure hddtemp'.                                               x  
 x                                                                           x  
 x Do you want to start the hddtemp daemon on startup?                       x  
 x                                                                           x  
 x                    <Yes>                       <No>                       x  
 x                                                                           x  
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  

と尋ねられるので、yesを選択し、つぎとつぎもokを選択するとインストール完了である。
使い方はhddtemp デバイス名である。

sudo hddtemp /dev/sda
/dev/sda: Hitachi HDP725050GLA360: 35 C

mrtg.cfgには下記のように追加する。

Target[hddtemp]: `/usr/sbin/hddtemp /dev/sda | awk '{print $4}'`
MaxBytes[hddtemp]: 100
Title[hddtemp]: HDD Temperature
PageTop[hddtemp]: <h1>HDD Temperature</h1>
Options[hddtemp]: growright,absolute,gauge,nopercent,noinfo
WithPeak[hddtemp]: ymw
YLegend[hddtemp]: Temperature
ShortLegend[hddtemp]: C
LegendI[hddtemp]: Temp:
LegendO[hddtemp]:
Legend1[hddtemp]: HDD Temperature in Degrees Celcius
Legend2[hddtemp]:


最終更新日


本文中のFC4はFedora ProjectのFedora Core 4を、FC5はFedora Core 5を、FC6はFedora Core 6をopenSUSEはNovellのSUSE Linux OSSを表します。Fedora7以降は、単にFedora7、Fedora8、Fedora9、Fedora10、Fedora11、Fedora12、Fedora13、Fedora14、Fedora15と表示しています。Ubuntuは、必要に応じて20.04、21.04のようにバージョン番号をつけて区別しています。

ここに登場するドメイン名やIPアドレスなどはフィクションです。実在の人物・団体等とは一切関係がありません。
実際に使用する際は、各自の環境に合わせて書き換えてください。
もし何か間違いなどありましたらこちらからご連絡ください
リンクに許可は不要です。
Copyright (C) 2021 Chikuma Engineering Co., Ltd. All Rights Reserved.