Webサーバ構築済みが前提
1.NET-SNMPのインストール
# yum -y install net-snmp Setting up Install Process Setting up Repos base 100% |=========================| 1.1 kB 00:00 updates-released 100% |=========================| 951 B 00:00 Reading repository metadata in from local files base : ################################################## 2622/2622 primary.xml.gz 100% |=========================| 349 kB 00:00 MD Read : ################################################## 899/899 updates-re: ################################################## 899/899 Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for net-snmp to pack into transaction set. net-snmp-5.2.1-10.FC3.i38 100% |=========================| 41 kB 00:00 ---> Package net-snmp.i386 0:5.2.1-10.FC3 set to be updated --> Running transaction check --> Processing Dependency: libsensors.so.3 for package: net-snmp --> Processing Dependency: libnetsnmpmibs.so.5 for package: net-snmp --> Processing Dependency: libnetsnmptrapd.so.5 for package: net-snmp --> Processing Dependency: libnetsnmpagent.so.5 for package: net-snmp --> Processing Dependency: libnetsnmp.so.5 for package: net-snmp --> Processing Dependency: libnetsnmphelpers.so.5 for package: net-snmp --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for net-snmp-libs to pack into transaction set. net-snmp-libs-5.2.1-10.FC 100% |=========================| 21 kB 00:00 ---> Package net-snmp-libs.i386 0:5.2.1-10.FC3 set to be updated ---> Downloading header for lm_sensors to pack into transaction set. lm_sensors-2.8.7-2.i386.r 100% |=========================| 22 kB 00:00 ---> Package lm_sensors.i386 0:2.8.7-2 set to be updated --> Running transaction check Dependencies Resolved Transaction Listing: Install: net-snmp.i386 0:5.2.1-10.FC3 - updates-released Performing the following to resolve dependencies: Install: lm_sensors.i386 0:2.8.7-2 - base Install: net-snmp-libs.i386 0:5.2.1-10.FC3 - updates-released Total download size: 2.8 M Downloading Packages: (1/3): net-snmp-libs-5.2. 100% |=========================| 1.8 MB 00:05 (2/3): lm_sensors-2.8.7-2 100% |=========================| 426 kB 00:00 (3/3): net-snmp-5.2.1-10. 100% |=========================| 585 kB 00:01 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: lm_sensors 100 % done 1/3 Installing: net-snmp-libs 100 % done 2/3 Installing: net-snmp 100 % done 3/3 Installed: net-snmp.i386 0:5.2.1-10.FC3 Dependency Installed: lm_sensors.i386 0:2.8.7-2 net-snmp-libs.i386 0:5.2.1-10.FC3 Complete! # yum clean packages Cleaning up Packages 14 packages removed |
2.NET-SNMPの設定
NET-SNMPの起動 # /etc/init.d/snmpd start snmpd を起動中: [ OK ] |
3.MRTGのインストール
# yum -y install mrtg Setting up Install Process Setting up Repos base 100% |=========================| 1.1 kB 00:00 updates-released 100% |=========================| 951 B 00:00 Reading repository metadata in from local files base : ################################################## 2622/2622 updates-re: ################################################## 899/899 Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for mrtg to pack into transaction set. mrtg-2.10.15-1.i386.rpm 100% |=========================| 57 kB 00:00 ---> Package mrtg.i386 0:2.10.15-1 set to be updated --> Running transaction check Dependencies Resolved Transaction Listing: Install: mrtg.i386 0:2.10.15-1 - base Total download size: 914 k Downloading Packages: (1/1): mrtg-2.10.15-1.i38 100% |=========================| 914 kB 00:01 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: mrtg 100 % done 1/1 Installed: mrtg.i386 0:2.10.15-1 Complete! # yum clean packages Cleaning up Packages 1 packages removed |
4.MRTGの設定
MRTG設定ファイル作成 # cfgmaker --ifref=descr --ifdesc=descr public@192.168.1.1 > /etc/mrtg/mrtg.cfg MRTG設定ファイル編集
|
5.MRTGの起動
# mrtg /etc/mrtg/mrtg.cfg (1回) Rateup WARNING: /usr/bin//rateup could not read the primary log file for disk Rateup WARNING: /usr/bin//rateup The backup log file for disk was invalid as well Rateup WARNING: /usr/bin//rateup Can't remove disk.old updating log file Rateup WARNING: /usr/bin//rateup Can't rename disk.log to disk.old updating log file # mrtg /etc/mrtg/mrtg.cfg (2回) Rateup WARNING: /usr/bin//rateup Can't remove disk.old updating log file # mrtg /etc/mrtg/mrtg.cfg (3回) *3回以上は起動しましょうね。 |
6.MRTGの確認
# vi /etc/httpd/conf.d/mrtg.conf (外部アクセス可能にする場合)
# /etc/init.d/httpd reload httpd を再読み込み中: [ OK ] |
7.Indexページの作成
# indexmaker --columns=1 --addhead="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=euc-jp\">" /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html *以上でhttp://(ドメイン)/mrtg/にて閲覧ができれば成功です。 |
Copyright (C) 2005 ataru