linuxの最近のブログ記事

MRTG インストール その4

| | コメント(0)
 データが取れてるようなのでトラフィック以外にロードアベレージとメモリ使用状況を追加してデータを取ってみます。
 /usr/local/apache2/htdocs/MRTG/cfg/sample.cfgに以下の記述を追加しました。
#----------------------------------------------------------------- # CPUのロードアベレージ x 100 # (グラフ化するのは1分間平均 x 100、および15分平均 x 100) # ShortLegend[la]の値は全角スペースを指定し、単位なしにする #----------------------------------------------------------------- Target[la]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.3:robeam@192.168.1.12: MaxBytes[la]: 100 Title[la]: Load Average PageTop[la]: <H1> Load Average on WebServer</H1> YLegend[la]: Load Average ShortLegend[la]:   LegendI[la]:1分平均 LegendO[la]:15分平均 #----------------------------------------------------------------- # メモリ使用状況(グラフ化するのは実メモリおよびスワップの空き領域) # MaxByteには実験機の総スワップ量を指定 #----------------------------------------------------------------- Target[mem]: .1.3.6.1.4.1.2021.4.4.0&.1.3.6.1.4.1.2021.4.6.0:robeam@192.168.1.12: MaxBytes[mem]: 1052216 Title[mem]: Available Memory ("real" and "swap") PageTop[mem]: <H1>Available Memory "real" and "swap" on WebServer</H1> YLegend[mem]: Available Memory ShortLegend[mem]: kbyte LegendI[mem]:実メモリ利用可能量 LegendO[mem]:Swap利用可能量

 mrtg-rrf.cgiの出力結果です。eucjpを指定しているのですが、漢字が化けています。
rrd-00-01.jpg
rrd-00-02.jpg
rrd-00-03.jpg
rrd-00-04.jpg
 mrtg自体で出力してみました。こちらのほうは漢字もちゃんと出ています。
rrd-mrtg-00-01.jpg
rrd-mrtg-00-02.jpg
rrd-mrtg-00-03.jpg
rrd-mrtg-00-04.jpg
 値は変な感じですが、一応、監視用のグラフが表示できました。後は設定ファイルをいじって自分のほしいデータを表示するようにすればOKだと思います。net-snmp、mrtg、rrdもx86_64で動くようです。
 そのうちMRTGとRRDは合体するようなのでそうなったらもっと簡単に設定できると思います。
 お疲れ様でした。

MRTG インストール その3

| | コメント(0)
 実際にデータが取れてるのかすらはっきりしないので、MRTG単体でデータが取れてるか調べてみます。
 そのためにはMTRGをコンパイルする必要があります。コンパイルに必要なライブラリがインストールされているか調べます。
# rpm -qa | grep zlib zlib-1.2.1.2-1.2 zlib-devel-1.2.1.2-1.2 zlib-1.2.1.2-1.2 # rpm -qa | grep libpng libpng-devel-1.2.7-1 libpng10-1.0.16-1 libpng-1.2.7-1 libpng10-devel-1.0.16-1 libpng-1.2.7-1 # rpm -qa | grep libgd

 libgdが不足しているようです。
 libgdのホームページはGD Graphics Libraryです。ダウンロードしてインストールしましょう。
# cd ~/src # wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz # cd /usr/local/src # tar zxvf ~/src/gd-2.0.33.tar.gz # cd gd-2.0.33/ # ./configure # make # make install

 続けてmrtgのコンパイルです。
# cd ../mrtg-2.12.2/ # ./configure # make # make install

 mrtgのインストールが完了したので動作を確認します。
 設定ファイルをmrtg用に直します。
# su - www # cd /usr/local/apache2/htdocs/MRTG # vi cfg/sample.cfg

 次の設定をコメントにします。
LogFormat: rrdtool PathAdd: /usr/local/rrdtool/bin/ LibAdd: /usr/local/rrdtool/lib/perl/ ↑を↓にします。 #LogFormat: rrdtool #PathAdd: /usr/local/rrdtool/bin/ #LibAdd: /usr/local/rrdtool/lib/perl/

 起動してみましょう。
$ ./scripts/startup.sh Daemonizing MRTG ... Rateup WARNING: /usr/local/mrtg-2/bin//rateup could not read the primary log file for beam_2 Rateup WARNING: /usr/local/mrtg-2/bin//rateup The backup log file for beam_2 was invalid as well Rateup WARNING: /usr/local/mrtg-2/bin//rateup Can't remove beam_2.old updating log file Rateup WARNING: /usr/local/mrtg-2/bin//rateup Can't rename beam_2.log to beam_2.old updating log file $ ps axg PID TTY STAT TIME COMMAND    途中省略 2597 ? Ss 0:00 /usr/local/bin/perl -w /usr/local/mrtg-2/bin/mrtg --user www --

 初めて起動したときはデータファイルが無いのでこのようなワーニングが出ます。データを確認してみましょう。
$ head data/beam_2.log 1129699433 318736999 135743471 1129699433 0 0 0 0 1129699384 0 0 0 0 1129699200 0 0 0 0 1129698900 0 0 0 0 1129698600 0 0 0 0 1129698300 0 0 0 0 1129698000 0 0 0 0 1129697700 0 0 0 0 1129697400 0 0 0 0 $ head data/beam_2.log 1129699733 318767021 135801862 1129699733 0 0 0 0 1129699433 0 0 0 0 1129699200 0 0 0 0 1129698900 0 0 0 0 1129698600 0 0 0 0 1129698300 0 0 0 0 1129698000 0 0 0 0 1129697700 0 0 0 0 1129697400 0 0 0 0

 時間は更新されているんですが、差分が出てませんね。デーモンモードで動かしてるからでしょうか?ためしにデーモンモードを止めてみましょう。
 設定ファイルの以下の部分を変更します。
RunAsDaemon: Yes Interval: 5    ↑を↓に変更する。 #RunAsDaemon: Yes #Interval: 5

 これでどうでしょうか?やってみましょう。
$ rm data/beam_2.log $ rm data/beam_2.old $ ./scripts/startup.sh Rateup WARNING: /usr/local/mrtg-2/bin//rateup could not read the primary log file for beam_2 Rateup WARNING: /usr/local/mrtg-2/bin//rateup The backup log file for beam_2 was invalid as well Rateup WARNING: /usr/local/mrtg-2/bin//rateup Can't remove beam_2.old updating log file Rateup WARNING: /usr/local/mrtg-2/bin//rateup Can't rename beam_2.log to beam_2.old updating log file $ head data/beam_2.log 1129701637 319183222 136415724 1129701637 0 0 0 0 1129701300 0 0 0 0 1129701000 0 0 0 0 1129700700 0 0 0 0 1129700400 0 0 0 0 1129700100 0 0 0 0 1129699800 0 0 0 0 1129699500 0 0 0 0 1129699200 0 0 0 0 $ ./scripts/startup.sh Rateup WARNING: /usr/local/mrtg-2/bin//rateup Can't remove beam_2.old updating log file $head data/beam_2.log 1129702740 319251441 136578663 1129702740 62 148 62 148 1129701637 0 0 0 0 1129701600 0 0 0 0 1129701300 0 0 0 0 1129701000 0 0 0 0 1129700700 0 0 0 0 1129700400 0 0 0 0 1129700100 0 0 0 0 1129699800 0 0 0 0 $ ./scripts/startup.sh $ head data/beam_2.log 1129702910 319311652 136677855 1129702910 354 583 354 583 1129702740 62 148 62 148 1129702500 62 148 62 148 1129702200 62 148 62 148 1129701900 54 129 62 148 1129701600 0 0 0 0 1129701300 0 0 0 0 1129701000 0 0 0 0 1129700700 0 0 0 0

 今度は順調にデータが取得できているようです。それではデーモンモードに戻して様子を見てみましょう。さっきコメントにしたところを有効にすればOKです。
$ ./scripts/startup.sh Daemonizing MRTG ... $ cat data/beam_2.log 1129703546 319390826 136795771 1129703546 351 385 351 385 1129703510 144 198 144 198 1129703400 119 179 144 198 1129703100 179 307 354 583 1129702800 120 235 354 583 1129702500 62 148 62 148 1129702200 62 148 62 148 1129701900 54 129 62 148 1129701600 0 0 0 0 $ cat data/beam_2.log 1129704146 319430278 136874784 1129704146 38 86 38 86 1129703846 94 177 94 177 1129703700 143 209 351 385 1129703400 119 179 144 198 1129703100 179 307 354 583 1129702800 120 235 354 583 1129702500 62 148 62 148 1129702200 62 148 62 148 1129701900 54 129 62 148

 うまくいきましたね。mrtgの起動にコツがあるみたいですね。最初に起動するときはデーモンモードじゃなく手動で2,3回起動して、データファイルが出来てからデーモンモードにすると良いみたいです。

MRTG インストール その2

| | コメント(0)
 先に作成したスクリプトでMRTGを起動します。
$ cd /usr/local/apache2/htdocs/MRTG $ ./script/startup.sh Daemonizing MRTG ... $ ps axg | grep mrtg PID TTY STAT TIME COMMAND 21215 ? Ss 0:00 /usr/bin/perl -w /usr/local/mrtg-2/bin/mrtg --user www --group

 無事に起動したようです。今回のMRTGの役割は、常駐して5分ごとにデータを取得し、rrdtoolのフォーマットでデータをWorkDir(/usr/local/apache2/htdocs/MRTG/data)に溜め込みます。

 溜め込んだデータからrrdtoolを使用してグラフを作成プログラム(CGI)をインストールします。
 ホームページはWelcome to the mrtg-rrd Home Pageです。
$ exit # cd ~/src # wget ftp://ftp.linux.cz/pub/linux/people/jan_kasprzak/mrtg-rrd/mrtg-rrd-0 .7.tar.gz # cd /usr/local/src # tar zxvf ~/src/mrtg-rrd-0.7.tar.gz

 mrtg-rrd.cgiがあるのでこれをコピーして使います。
# su - www $ cd /usr/local/apache2/htdocs/MRTG/ $ cp /usr/local/src/mrtg-rrd-0.7/mrtg-rrd.cgi .

 自分の環境に合わせて2箇所編集します。
 はじめはRRDs.pmへのパスを設定します。
# Location of RRDs.pm, if it is not in @INC # use lib '/usr/lib/perl5/5.00503/i386-linux'; use RRDs; ↑を↓にします。 # Location of RRDs.pm, if it is not in @INC # use lib '/usr/lib/perl5/5.00503/i386-linux'; use lib '/usr/local/rrdtool/lib/perl'; use RRDs;

 次にMRTGのコンフィグレーションファイルの位置を設定します。
# EDIT THIS to reflect all your MRTG config files BEGIN { @config_files = qw(/home/fadmin/mrtg/cfg/mrtg.cfg); } ↑を↓にします。 # EDIT THIS to reflect all your MRTG config files BEGIN { @config_files = qw(/usr/local/apache2/htdocs/MRTG/cfg/sample.cfg); }

 ここまできたら/usr/local/apache2/htdocs/MRTGでcgiを動かせるようになっているかapacheの設定(/usr/local/apache2/conf/httpd.conf)を確認して動かしてみます。
 ブラウザで http://www.tano49.com/MRTG/mrtg-rrd.cgi を見ればグラフが出ると思います。でましたか?
 私の場合は出ませんでした(T_T)
 どこが悪いのか調べるために less で蓄積したデータを見たところ何がなんだかさっぱり分からないデータでした。
$ cat beam_2.rrd RRD0003/%税C+[,ds0GAUGEX亞Ads1GAUGEX亞AAVERAGE 狄AVERAGE 狄AVERAGE 狄AVERAGE 狄MAX 狄MAX 狄MAX 狄MAX 狄洗TCUNKN@UNKN@・・・ ・ ・・・ ・ ・・・ ・・・・・・・・・・・・・・・・・・・ ・・・・・ ↓以下省略

 今日は駄目だったということで、ここまで。また明日、がんばろう(^^)/

MRTG インストールと設定

| | コメント(0)
 MRTGをインストールします。
 ホームページはMRTG: The Multi Router Traffic Grapherです。
 日本語のページはMRTG: The Multi Router Traffic Grapherです。若干、バージョンが古いようですが、日本語のほうが内容を理解するのに助かります(^^;;<俺だけかも
 バージョンは 2.12.2 です。
 ダウンロードです。
# su - # cd src # wget http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/mrtg-2.12.2.tar. gz # cd /usr/local/src # tar zxvf ~/src/mrtg-2.12.2.tar.gz # cd mrtg-2.12.2/

 今回はrrdtoolを使うのでコンパイルは必要ありません。ファイルをコピーするだけでOKです。
# mkdir -p /usr/local/mrtg-2/ # cp -R bin /usr/local/mrtg-2/ # cp -R lib /usr/local/mrtg-2/ # su - www $ mkdir -p /usr/local/apache2/htdocs/MRTG/ $ cp -R images /usr/local/apache2/htdocs/MRTG $ mkdir /usr/local/apache2/htdocs/MRTG/cfg $ mkdir /usr/local/apache2/htdocs/MRTG/data $ mkdir /usr/local/apache2/htdocs/MRTG/script

 設定ファイルを/usr/local/apache2/htdocs/MRTG/cfg/sample.cfgとして作成しました。内容は以下のとおりです。
WorkDir: /usr/local/apache2/htdocs/MRTG/data Language: eucjp IconDir: /MRTG/images/ EnableIPv6: no RunAsDaemon: Yes Interval: 5 LogFormat: rrdtool PathAdd: /usr/local/rrdtool/bin/ LibAdd: /usr/local/rrdtool/lib/perl/ Target[beam_2]: 2:robeam@192.168.1.12: SetEnv[beam_2]: MRTG_INT_IP="192.168.1.13" MRTG_INT_DESCR="eth0" MaxBytes[beam_2]: 1250000 Title[beam_2]: Traffic Analysis for 2 - beam PageTop[beam_2]: <H1>Traffic Analysis for 2 -- beam </H1>

 次に起動用のスクリプトを/usr/local/apache2/htdocs/MRTG/script/startup.shとして作成します。内容は以下のとおりです。
#!/bin/sh /usr/local/mrtg-2/bin/mrtg \ --user www \ --group www \ --logging /usr/local/apache2/htdocs/MRTG/logs/mrtg.log \ --lock-file /tmp/sample.cfg_l \ /usr/local/apache2/htdocs/MRTG/cfg/sample.cfg

 ユーザーとグループはapacheのユーザ、グループとあわせてあります。それに伴い、ログファイルも同じユーザで書き込めるディレクトリということでここにしました。
 設定は以上です。

rrdtool インストール

| | コメント(0)
 snmpで取得したデータをグラフ化するツールと言えばMRTGです。以前、MRTGとrrdtoolを組み合わせると負荷が少なくなってなかなか調子がいいと言う記事をどっかの本で読んだのでそれを試してみます。
 ホームページはRRDtoolです。
 バージョンは 1.2.11 です。
 ダウンロードしてコンパイルです。
# su - # cd src # wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.2.11.tar.gz # cd /usr/local/src # tar zxvf ~/src/rrdtool-1.2.11.tar.gz # cd rrdtool-1.2.11/ # ./configure --prefix=/usr/local/rrdtool checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu |省略 checking for pkg-config... pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cgilib.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cgilib. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcgi and its header files. If you have not installed cgilib, you can get it either from its original home on http://www.infodrom.org/projects/cgilib You can find also find an archive copy on http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs The last tested version of cgilib is 0.5. LIBS=-lfreetype -lpng -lz -lart_lgpl_2 -lm LDFLAGS= CPPFLAGS= -I/usr/include/libart-2.0 -I/usr/include/freetype2 ---------------------------------------------------------------------------- configure: error: Please fix the library issues listed above and try again.

 コンフィグでcgilibが無いって言われました。
 それじゃ入れちゃいましょう。
 ホームページはInfodrom Projects -- cgilibです。
 バージョンは 0.5 です。
 ダウンロードのページに行くと一番上のはバージョン0.1で古いやつです。間違えないでください。
# cd ~/src # wget http://www.infodrom.org/projects/cgilib/download/cgilib-0.5.tar.gz # cd /usr/local/src # tar zxvf ~/src/cgilib-0.5.tar.gz # cd cgilib-0.5/

 cgilibにはconfigureが無くてMakefileがいきなりあります。これを見るとinstallでlibcgiがインストールされるようになってません。make後に手動でインストールします。
# make # cp libcgi.a /usr/local/lib # cp cgi.h /usr/local/include

 rrdtoolのインストールを続けます。
# cd .. # cd rrdtool-1.2.11/ # ./configure --prefix=/usr/local/rrdtool # make # make install

 これでインストールは終了です。

net-snmp 設定

| | コメント(0)
 net-snmp 5.2.2.rc1の設定です。
 まず、ソースディレクトリにあるサンプルをコピーします。これをいじって使います。snmpconfという設定ファイルを出力するユーティリティもありますがsnmpを良くわかってからじゃないと難しいそうなので今回は手動で行きます(^^;;
# cp EXAMPLE.conf /usr/local/share/snmp/snmp.conf

 まずは、net-snmpが動作しているということを確認したいのでセキュリティネームのところだけ変更して試してみます。
# vi /usr/share/snmp/snmp.conf com2sec local localhost COMMUNITY com2sec mynetwork NETWORK/24 COMMUNITY ↑を↓に変えます。 com2sec local localhost beam com2sec mynetwork 192.168.1.0/24 robeam

 設定ファイルが出来たところで動かしてみます。
# /usr/local/sbin/snmpd # ps axg 12629 ? S 0:00 pop3-login 12635 ? S 0:00 /usr/local/sbin/snmpd 12636 pts/2 R+ 0:00 ps axg
 動いてますね。それではデータを取ってみましょう。
# snmpwalk -v 1 -c public localhost /usr/local/share/snmp/snmp.conf: line 62: Warning: Unknown token: com2sec. /usr/local/share/snmp/snmp.conf: line 69: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 70: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 71: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 72: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 73: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 74: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 80: Warning: Unknown token: view. /usr/local/share/snmp/snmp.conf: line 87: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 88: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 105: Warning: Unknown token: syslocation. /usr/local/share/snmp/snmp.conf: line 107: Warning: Unknown token: syscontact. /usr/local/share/snmp/snmp.conf: line 141: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 144: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 147: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 205: Warning: Unknown token: exec. /usr/local/share/snmp/snmp.conf: line 256: Warning: Unknown token: disk. /usr/local/share/snmp/snmp.conf: line 285: Warning: Unknown token: load. Timeout: No Response from localhost #

 エラーです。コミュニティ名を間違いました。こんどこそ(^^;;
# snmpwalk -v 1 -c beam localhost /usr/local/share/snmp/snmp.conf: line 62: Warning: Unknown token: com2sec. /usr/local/share/snmp/snmp.conf: line 69: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 70: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 71: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 72: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 73: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 74: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 80: Warning: Unknown token: view. /usr/local/share/snmp/snmp.conf: line 87: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 88: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 105: Warning: Unknown token: syslocation. /usr/local/share/snmp/snmp.conf: line 107: Warning: Unknown token: syscontact. /usr/local/share/snmp/snmp.conf: line 141: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 144: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 147: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 205: Warning: Unknown token: exec. /usr/local/share/snmp/snmp.conf: line 256: Warning: Unknown token: disk. /usr/local/share/snmp/snmp.conf: line 285: Warning: Unknown token: load. Timeout: No Response from localhost #

 設定ファイルがおかしいって言われてるけどcom2secなんて俺が書き足したわけじゃないから変だな〜。ログはどうなってるでしょう?
# less /var/log/snmpd.log /usr/local/share/snmp/snmp.conf: line 62: Warning: Unknown token: com2sec. /usr/local/share/snmp/snmp.conf: line 69: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 70: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 71: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 72: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 73: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 74: Warning: Unknown token: group. /usr/local/share/snmp/snmp.conf: line 80: Warning: Unknown token: view. /usr/local/share/snmp/snmp.conf: line 87: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 88: Warning: Unknown token: access. /usr/local/share/snmp/snmp.conf: line 105: Warning: Unknown token: syslocation. /usr/local/share/snmp/snmp.conf: line 107: Warning: Unknown token: syscontact. /usr/local/share/snmp/snmp.conf: line 141: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 144: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 147: Warning: Unknown token: proc. /usr/local/share/snmp/snmp.conf: line 205: Warning: Unknown token: exec. /usr/local/share/snmp/snmp.conf: line 256: Warning: Unknown token: disk. /usr/local/share/snmp/snmp.conf: line 285: Warning: Unknown token: load. Warning: no access control information configured. It's unlikely this agent can serve any useful purpose in this state. Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent. Creating directory: /var/net-snmp NET-SNMP version 5.2.2.rc1

 アクセス制御情報が無いって言われてますね。/usr/local/share/snmp/snmp.confの内容がおかしいって!おかしいって言われてもサンプルをそのまま使ってるわけだし、困っちゃうなぁ ̄\(−_−)/ ̄;
 そうだ、きっと最新バージョンがこなれてないせいでちゃんと動かないのかもしれない。一個前のバージョンに戻そう( ^ー゜)b
# wget http://keihanna.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.2 .1.2.tar.gz

 ソースはダウンロードしたんだけど新しいバージョンに上書きインストールしてくれるのかな?makeは日付しか見ないから大丈夫かな?手で消すのめんどくさいなぁ(;´д` )
 そうだ、消す前にsnmpconfを試してみよう。
# snmpconf -g basic_setup The following installed configuration files were found: 1: ./snmp.conf 2: /usr/local/share/snmp/snmp.conf Would you like me to read them in? Their content will be merged with the output files created by this session. Valid answer examples: "all", "none","3","1,2,5" Read in which (default = all): Read in which (default = all): ************************************************ *** Beginning basic system information setup *** ************************************************ Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y): Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y): Configuring: syslocation Description: The [typically physical] location of the system. Note that setting this value here means that when trying to perform an snmp SET operation to the sysLocation.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: location_string The location of the system: The location of the system: beamThe location of the system: bea The location of the system: beaThe location of the system: be The location of the system: beThe location of the system: b The location of the system: bThe location of the system: The location of the system: TOThe location of the system: T The location of the system: Tokyo Finished Output: syslocation Tokyo Configuring: syscontact Description: The contact information for the administrator Note that setting this value here means that when trying to perform an snmp SET operation to the sysContact.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: contact_string The contact information: The contact information: minoru@tano49.com Finished Output: syscontact minoru@tano49.com Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): Configuring: sysservices Description: The proper value for the sysServices object. arguments: sysservices_number does this host offer physical services (eg, like a repeater) [answer 0 or 1]: does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 0 does this host offer datalink/subnetwork services (eg, like a bridge): does this host offer datalink/subnetwork services (eg, like a bridge): 0 does this host offer internet services (eg, supports IP): does this host offer internet services (eg, supports IP): yesdoes this host offer internet services (eg, supports IP): ye does this host offer internet services (eg, supports IP): yedoes this host offer internet services (eg, supports IP): y does this host offer internet services (eg, supports IP): ydoes this host offer internet services (eg, supports IP): does this host offer internet services (eg, supports IP): 0 does this host offer end-to-end services (eg, supports TCP): does this host offer end-to-end services (eg, supports TCP): 1 does this host offer application services (eg, supports SMTP): does this host offer application services (eg, supports SMTP): 1 Finished Output: sysservices 72 ************************************** *** BEGINNING ACCESS CONTROL SETUP *** ************************************** Do you want to configure the agent's access control? (default = y): Do you want to configure the agent's access control? (default = y): Do you want to allow SNMPv3 read-write user based access (default = y): Do you want to allow SNMPv3 read-write user based access (default = y): Configuring: rwuser Description: a SNMPv3 read-write user arguments: user [noauth|auth|priv] [restriction_oid] The SNMPv3 user that should have read-write access: The SNMPv3 user that should have read-write access: minoru The minimum security level required for that user [noauth|auth|priv, default = auth]: The minimum security level required for that user [noauth|auth|priv, default = auth]: noa<uired for that user [noauth|auth|priv, default = auth]: noau <uired for that user [noauth|auth|priv, default = auth]: noauth The OID that this community should be restricted to [if appropriate]: The OID that this community should be restricted to [if appropriate]: Finished Output: rwuser minoru noauth Do another rwuser line? (default = y): Do another rwuser line? (default = y): n Do you want to allow SNMPv3 read-only user based access (default = y): Do you want to allow SNMPv3 read-only user based access (default = y): n Do you want to allow SNMPv1/v2c read-write community access (default = y): Do you want to allow SNMPv1/v2c read-write community access (default = y): Configuring: rwcommunity Description: a SNMPv1/SNMPv2c read-write access community name arguments: community [default|hostname|network/bits] [oid] Enter the community name to add read-write access for: Enter the community name to add read-write access for: beaEnter the community name to add read-write access for: be Enter the community name to add read-write access for: beEnter the community name to add read-write access for: b Enter the community name to add read-write access for: bEnter the community name to add read-write access for: Enter the community name to add read-write access for: beam The hostname or network address to accept this community name from [RETURN for all]: The hostname or network address to accept this community name from [RETURN for all]: loca<s to accept this community name from [RETURN for all]: local <s to accept this community name from [RETURN for all]: localhost The OID that this community should be restricted to [RETURN for no-restriction]: The OID that this community should be restricted to [RETURN for no-restriction]: Finished Output: rwcommunity beam localhost Do another rwcommunity line? (default = y): Do another rwcommunity line? (default = y): n Do you want to allow SNMPv1/v2c read-only community access (default = y): Do you want to allow SNMPv1/v2c read-only community access (default = y): n **************************************** *** Beginning trap destination setup *** **************************************** Do you want to configure where and if the agent will send traps? (default = y): Do you want to configure where and if the agent will send traps? (default = y): n **************************************** *** Beginning monitoring setup *** **************************************** Do you want to configure the agent's ability to monitor various aspects of your system? (default = y): Do you want to configure the agent's ability to monitor various aspects of your system? (default = y): Do you want to configure the agents ability to monitor processes? (default = y): Do you want to configure the agents ability to monitor processes? (default = y): Configuring: proc Description: Check for processes that should be running. proc NAME [MAX=0] [MIN=0] NAME: the name of the process to check for. It must match exactly (ie, http will not find httpd processes). MAX: the maximum number allowed to be running. Defaults to 0. MIN: the minimum number to be running. Defaults to 0. The results are reported in the prTable section of the UCD-SNMP-MIB tree Special Case: When the min and max numbers are both 0, it assumes you want a max of infinity and a min of 1. Name of the process you want to check on: Name of the process you want to check on: hppName of the process you want to check on: hp Name of the process you want to check on: hpName of the process you want to check on: h Name of the process you want to check on: httpd Maximum number of processes named 'httpd' that should be running [default = 0]: Maximum number of processes named 'httpd' that should be running [default = 0]: 200 Minimum number of processes named 'httpd' that should be running [default = 0]: Minimum number of processes named 'httpd' that should be running [default = 0]: 5 Finished Output: proc httpd 200 5 Do another proc line? (default = y): Do another proc line? (default = y): n Do you want to configure the agents ability to monitor disk space? (default = y): Do you want to configure the agents ability to monitor disk space? (default = y): Configuring: disk Description: Check for disk space usage of a partition. The agent can check the amount of available disk space, and make sure it is above a set limit. disk PATH [MIN=100000] PATH: mount path to the disk in question. MIN: Disks with space below this value will have the Mib's errorFlag set. Can be a raw byte value or a percentage followed by the % symbol. Default value = 100000. The results are reported in the dskTable section of the UCD-SNMP-MIB tree Enter the mount point for the disk partion to be checked on: Enter the mount point for the disk partion to be checked on: / Enter the minimum amount of space that should be available on /: Enter the minimum amount of space that should be available on /: Finished Output: disk / Do another disk line? (default = y): Do another disk line? (default = y): n Do you want to configure the agents ability to monitor load average? (default = y): Do you want to configure the agents ability to monitor load average? (default = y): Configuring: load Description: Check for unreasonable load average values. Watch the load average levels on the machine. load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0] 1MAX: If the 1 minute load average is above this limit at query time, the errorFlag will be set. 5MAX: Similar, but for 5 min average. 15MAX: Similar, but for 15 min average. The results are reported in the laTable section of the UCD-SNMP-MIB tree Enter the maximum allowable value for the 1 minute load average: Enter the maximum allowable value for the 1 minute load average: invalid answer! It must match this regular expression: ^[\d\.]+$ Enter the maximum allowable value for the 1 minute load average: Enter the maximum allowable value for the 1 minute load average: 12 Enter the maximum allowable value for the 5 minute load average: Enter the maximum allowable value for the 5 minute load average: 12 Enter the maximum allowable value for the 15 minute load average: Enter the maximum allowable value for the 15 minute load average: 12 Finished Output: load 12 12 12 Do another load line? (default = y): Do another load line? (default = y): n Do you want to configure the agents ability to monitor file sizes? (default = y): Do you want to configure the agents ability to monitor file sizes? (default = y): n The following files were created: snmpd.conf These files should be moved to /usr/local/share/snmp if you want them used by everyone on the system. In the future, if you add the -i option to the command line I'll copy them there automatically for you. Or, if you want them for your personal use only, copy them to /root/.snmp . In the future, if you add the -p option to the command line I'll copy them there automatically for you. # ls mib2c-data mib2c.container.conf mib2c.scalar.conf mib2c.access_functions.conf mib2c.create-dataset.conf mib2c.table_data.conf mib2c.array-user.conf mib2c.genhtml.conf mibs mib2c.check_values.conf mib2c.int_watch.conf snmp.conf mib2c.check_values_local.conf mib2c.iterate.conf snmp_perl_trapd.pl mib2c.column_defines.conf mib2c.iterate_access.conf snmpconf-data mib2c.column_enums.conf mib2c.mfd.conf snmpd.conf mib2c.column_storage.conf mib2c.notify.conf mib2c.conf mib2c.old-api.conf
 あれ?snmpd.confってのが出来てる。もしかしてファイル名を間違っていただけ?それだったら悲しすぎるぜー。
 早速snmp.confをsnmpd.confにリネームしてやってみましょう。
# mv snmpd.conf snmpd.conf.make # mv snmp.conf snmpd.conf # kill 12635 # /use/local/sbin/snmpd # snmpwalk -v 1 -c beam localhost SNMPv2-MIB::sysDescr.0 = STRING: Linux beam.tano49.com 2.6.13-ATI #2 Mon Aug 29 21:02:24 JST 2005 x86_64 SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::org.0.0.0.0.0.0.0.0 SNMPv2-MIB::sysUpTime.0 = Timeticks: (403178) 1:07:11.78 SNMPv2-MIB::sysContact.0 = STRING: Me SNMPv2-MIB::sysName.0 = STRING: beam.tano49.com SNMPv2-MIB::sysLocation.0 = STRING: Right here, right now. SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance SNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementationsSNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP. SNMPv2-MIB::sysORDescr.7 = STRING: The SNMP Management Architecture MIB. SNMPv2-MIB::sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching. SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model. SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.7 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.8 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.9 = Timeticks: (0) 0:00:00.00 IF-MIB::ifNumber.0 = INTEGER: 3 IF-MIB::ifIndex.1 = INTEGER: 1 IF-MIB::ifIndex.2 = INTEGER: 2 IF-MIB::ifIndex.3 = INTEGER: 3 IF-MIB::ifDescr.1 = STRING: lo IF-MIB::ifDescr.2 = STRING: eth0 IF-MIB::ifDescr.3 = STRING: sit0 IF-MIB::ifType.1 = INTEGER: softwareLoopback(24) IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6) IF-MIB::ifType.3 = INTEGER: tunnel(131) IF-MIB::ifMtu.1 = INTEGER: 16436 IF-MIB::ifMtu.2 = INTEGER: 1500 IF-MIB::ifMtu.3 = INTEGER: 1480 IF-MIB::ifSpeed.1 = Gauge32: 10000000 IF-MIB::ifSpeed.2 = Gauge32: 100000000 IF-MIB::ifSpeed.3 = Gauge32: 0 IF-MIB::ifPhysAddress.1 = STRING: IF-MIB::ifPhysAddress.2 = STRING: 0:11:9:14:3b:1b IF-MIB::ifPhysAddress.3 = STRING: IF-MIB::ifAdminStatus.1 = INTEGER: up(1) IF-MIB::ifAdminStatus.2 = INTEGER: up(1) IF-MIB::ifAdminStatus.3 = INTEGER: down(2) IF-MIB::ifOperStatus.1 = INTEGER: up(1) IF-MIB::ifOperStatus.2 = INTEGER: up(1) IF-MIB::ifOperStatus.3 = INTEGER: down(2) IF-MIB::ifInOctets.1 = Counter32: 1984315 IF-MIB::ifInOctets.2 = Counter32: 311060147 IF-MIB::ifInOctets.3 = Counter32: 0 IF-MIB::ifInUcastPkts.1 = Counter32: 7844 IF-MIB::ifInUcastPkts.2 = Counter32: 837021 IF-MIB::ifInUcastPkts.3 = Counter32: 0 IF-MIB::ifInDiscards.1 = Counter32: 0 IF-MIB::ifInDiscards.2 = Counter32: 0 IF-MIB::ifInDiscards.3 = Counter32: 0 IF-MIB::ifInErrors.1 = Counter32: 0 IF-MIB::ifInErrors.2 = Counter32: 0 IF-MIB::ifInErrors.3 = Counter32: 0 IF-MIB::ifOutOctets.1 = Counter32: 1986039 IF-MIB::ifOutOctets.2 = Counter32: 127464678 IF-MIB::ifOutOctets.3 = Counter32: 0 IF-MIB::ifOutUcastPkts.1 = Counter32: 7868 IF-MIB::ifOutUcastPkts.2 = Counter32: 852635 IF-MIB::ifOutUcastPkts.3 = Counter32: 0 IF-MIB::ifOutDiscards.1 = Counter32: 0 IF-MIB::ifOutDiscards.2 = Counter32: 0 IF-MIB::ifOutDiscards.3 = Counter32: 0 IF-MIB::ifOutErrors.1 = Counter32: 0 IF-MIB::ifOutErrors.2 = Counter32: 0 IF-MIB::ifOutErrors.3 = Counter32: 0 IF-MIB::ifOutQLen.1 = Gauge32: 0 IF-MIB::ifOutQLen.2 = Gauge32: 0 IF-MIB::ifOutQLen.3 = Gauge32: 0 IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero RFC1213-MIB::atIfIndex.2.1.192.168.1.3 = INTEGER: 2 RFC1213-MIB::atIfIndex.2.1.192.168.1.30 = INTEGER: 2 RFC1213-MIB::atPhysAddress.2.1.192.168.1.3 = Hex-STRING: 00 0B A2 09 0E 2A RFC1213-MIB::atPhysAddress.2.1.192.168.1.30 = Hex-STRING: 00 01 29 F9 36 0C RFC1213-MIB::atNetAddress.2.1.192.168.1.3 = Network Address: C0:A8:01:03:00:00:00:00 RFC1213-MIB::atNetAddress.2.1.192.168.1.30 = Network Address: C0:A8:01:1E:00:00:00:00 IP-MIB::ipForwarding.0 = INTEGER: notForwarding(2) IP-MIB::ipDefaultTTL.0 = INTEGER: 64 IP-MIB::ipInReceives.0 = Counter32: 761481 IP-MIB::ipInHdrErrors.0 = Counter32: 0 IP-MIB::ipInAddrErrors.0 = Counter32: 0 IP-MIB::ipForwDatagrams.0 = Counter32: 0 IP-MIB::ipInUnknownProtos.0 = Counter32: 0 IP-MIB::ipInDiscards.0 = Counter32: 0 IP-MIB::ipInDelivers.0 = Counter32: 733922 IP-MIB::ipOutRequests.0 = Counter32: 821902 IP-MIB::ipOutDiscards.0 = Counter32: 0 IP-MIB::ipOutNoRoutes.0 = Counter32: 0 IP-MIB::ipReasmTimeout.0 = INTEGER: 0 IP-MIB::ipReasmReqds.0 = Counter32: 0 IP-MIB::ipReasmOKs.0 = Counter32: 0 IP-MIB::ipReasmFails.0 = Counter32: 0 IP-MIB::ipFragOKs.0 = Counter32: 0 IP-MIB::ipFragFails.0 = Counter32: 0 IP-MIB::ipFragCreates.0 = Counter32: 0 IP-MIB::ipAdEntAddr.127.0.0.1 = IpAddress: 127.0.0.1 IP-MIB::ipAdEntAddr.127.0.0.2 = IpAddress: 127.0.0.2 IP-MIB::ipAdEntAddr.192.168.1.12 = IpAddress: 192.168.1.12 IP-MIB::ipAdEntAddr.192.168.1.13 = IpAddress: 192.168.1.13 IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1 IP-MIB::ipAdEntIfIndex.127.0.0.2 = INTEGER: 1 IP-MIB::ipAdEntIfIndex.192.168.1.12 = INTEGER: 2 IP-MIB::ipAdEntIfIndex.192.168.1.13 = INTEGER: 2 IP-MIB::ipAdEntNetMask.127.0.0.1 = IpAddress: 255.0.0.0 IP-MIB::ipAdEntNetMask.127.0.0.2 = IpAddress: 255.0.0.0 IP-MIB::ipAdEntNetMask.192.168.1.12 = IpAddress: 255.255.255.0 IP-MIB::ipAdEntNetMask.192.168.1.13 = IpAddress: 255.255.255.0 IP-MIB::ipAdEntBcastAddr.127.0.0.1 = INTEGER: 0 IP-MIB::ipAdEntBcastAddr.127.0.0.2 = INTEGER: 1 IP-MIB::ipAdEntBcastAddr.192.168.1.12 = INTEGER: 1 IP-MIB::ipAdEntBcastAddr.192.168.1.13 = INTEGER: 1 RFC1213-MIB::ipRouteDest.0.0.0.0 = IpAddress: 0.0.0.0 RFC1213-MIB::ipRouteDest.169.254.0.0 = IpAddress: 169.254.0.0 RFC1213-MIB::ipRouteDest.192.168.1.0 = IpAddress: 192.168.1.0 RFC1213-MIB::ipRouteIfIndex.0.0.0.0 = INTEGER: 2 RFC1213-MIB::ipRouteIfIndex.169.254.0.0 = INTEGER: 2 RFC1213-MIB::ipRouteIfIndex.192.168.1.0 = INTEGER: 2 RFC1213-MIB::ipRouteMetric1.0.0.0.0 = INTEGER: 1 RFC1213-MIB::ipRouteMetric1.169.254.0.0 = INTEGER: 0 RFC1213-MIB::ipRouteMetric1.192.168.1.0 = INTEGER: 0 RFC1213-MIB::ipRouteNextHop.0.0.0.0 = IpAddress: 192.168.1.3 RFC1213-MIB::ipRouteNextHop.169.254.0.0 = IpAddress: 0.0.0.0 RFC1213-MIB::ipRouteNextHop.192.168.1.0 = IpAddress: 0.0.0.0 RFC1213-MIB::ipRouteType.0.0.0.0 = INTEGER: indirect(4) RFC1213-MIB::ipRouteType.169.254.0.0 = INTEGER: direct(3) RFC1213-MIB::ipRouteType.192.168.1.0 = INTEGER: direct(3) RFC1213-MIB::ipRouteProto.0.0.0.0 = INTEGER: local(2) RFC1213-MIB::ipRouteProto.169.254.0.0 = INTEGER: local(2) RFC1213-MIB::ipRouteProto.192.168.1.0 = INTEGER: local(2) RFC1213-MIB::ipRouteMask.0.0.0.0 = IpAddress: 0.0.0.0 RFC1213-MIB::ipRouteMask.169.254.0.0 = IpAddress: 255.255.0.0 RFC1213-MIB::ipRouteMask.192.168.1.0 = IpAddress: 255.255.255.0 RFC1213-MIB::ipRouteInfo.0.0.0.0 = OID: SNMPv2-SMI::zeroDotZero RFC1213-MIB::ipRouteInfo.169.254.0.0 = OID: SNMPv2-SMI::zeroDotZero RFC1213-MIB::ipRouteInfo.192.168.1.0 = OID: SNMPv2-SMI::zeroDotZero IP-MIB::ipNetToMediaIfIndex.2.192.168.1.3 = INTEGER: 2 IP-MIB::ipNetToMediaIfIndex.2.192.168.1.30 = INTEGER: 2 IP-MIB::ipNetToMediaPhysAddress.2.192.168.1.3 = STRING: 0:b:a2:9:e:2a IP-MIB::ipNetToMediaPhysAddress.2.192.168.1.30 = STRING: 0:1:29:f9:36:c IP-MIB::ipNetToMediaNetAddress.2.192.168.1.3 = IpAddress: 192.168.1.3 IP-MIB::ipNetToMediaNetAddress.2.192.168.1.30 = IpAddress: 192.168.1.30 IP-MIB::ipNetToMediaType.2.192.168.1.3 = INTEGER: dynamic(3) IP-MIB::ipNetToMediaType.2.192.168.1.30 = INTEGER: dynamic(3) IP-MIB::ipRoutingDiscards.0 = Counter32: 0 IP-MIB::icmpInMsgs.0 = Counter32: 91 IP-MIB::icmpInErrors.0 = Counter32: 0 IP-MIB::icmpInDestUnreachs.0 = Counter32: 70 IP-MIB::icmpInTimeExcds.0 = Counter32: 3 IP-MIB::icmpInParmProbs.0 = Counter32: 0 IP-MIB::icmpInSrcQuenchs.0 = Counter32: 0 IP-MIB::icmpInRedirects.0 = Counter32: 0 IP-MIB::icmpInEchos.0 = Counter32: 2 IP-MIB::icmpInEchoReps.0 = Counter32: 16 IP-MIB::icmpInTimestamps.0 = Counter32: 0 IP-MIB::icmpInTimestampReps.0 = Counter32: 0 IP-MIB::icmpInAddrMasks.0 = Counter32: 0 IP-MIB::icmpInAddrMaskReps.0 = Counter32: 0 IP-MIB::icmpOutMsgs.0 = Counter32: 157 IP-MIB::icmpOutErrors.0 = Counter32: 0 IP-MIB::icmpOutDestUnreachs.0 = Counter32: 155 IP-MIB::icmpOutTimeExcds.0 = Counter32: 0 IP-MIB::icmpOutParmProbs.0 = Counter32: 0 IP-MIB::icmpOutSrcQuenchs.0 = Counter32: 0 IP-MIB::icmpOutRedirects.0 = Counter32: 0 IP-MIB::icmpOutEchos.0 = Counter32: 0 IP-MIB::icmpOutEchoReps.0 = Counter32: 2 IP-MIB::icmpOutTimestamps.0 = Counter32: 0 IP-MIB::icmpOutTimestampReps.0 = Counter32: 0 IP-MIB::icmpOutAddrMasks.0 = Counter32: 0 IP-MIB::icmpOutAddrMaskReps.0 = Counter32: 0 TCP-MIB::tcpRtoAlgorithm.0 = INTEGER: other(1) TCP-MIB::tcpRtoMin.0 = INTEGER: 200 milliseconds TCP-MIB::tcpRtoMax.0 = INTEGER: 120000 milliseconds TCP-MIB::tcpMaxConn.0 = INTEGER: -1 TCP-MIB::tcpActiveOpens.0 = Counter32: 603 TCP-MIB::tcpPassiveOpens.0 = Counter32: 8830 TCP-MIB::tcpAttemptFails.0 = Counter32: 0 TCP-MIB::tcpEstabResets.0 = Counter32: 82 TCP-MIB::tcpCurrEstab.0 = Gauge32: 2 TCP-MIB::tcpInSegs.0 = Counter32: 637085 TCP-MIB::tcpOutSegs.0 = Counter32: 722934 TCP-MIB::tcpRetransSegs.0 = Counter32: 439 TCP-MIB::tcpConnState.0.0.0.0.21.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.25.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.110.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.111.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.3306.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.0.0.0.0.32769.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.631.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.127.0.0.1.5432.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.192.168.1.12.53.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnState.192.168.1.12.110.192.168.1.30.2782 = INTEGER: timeWait(11) TCP-MIB::tcpConnState.192.168.1.13.53.0.0.0.0.0 = INTEGER: listen(2) TCP-MIB::tcpConnLocalAddress.0.0.0.0.21.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.0.0.0.0.25.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.0.0.0.0.110.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.0.0.0.0.111.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.0.0.0.0.3306.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.0.0.0.0.32769.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnLocalAddress.127.0.0.1.631.0.0.0.0.0 = IpAddress: 127.0.0.1 TCP-MIB::tcpConnLocalAddress.127.0.0.1.5432.0.0.0.0.0 = IpAddress: 127.0.0.1 TCP-MIB::tcpConnLocalAddress.192.168.1.12.53.0.0.0.0.0 = IpAddress: 192.168.1.12 TCP-MIB::tcpConnLocalAddress.192.168.1.12.110.192.168.1.30.2782 = IpAddress: 192.168.1.12 TCP-MIB::tcpConnLocalAddress.192.168.1.13.53.0.0.0.0.0 = IpAddress: 192.168.1.13 TCP-MIB::tcpConnLocalPort.0.0.0.0.21.0.0.0.0.0 = INTEGER: 21 TCP-MIB::tcpConnLocalPort.0.0.0.0.25.0.0.0.0.0 = INTEGER: 25 TCP-MIB::tcpConnLocalPort.0.0.0.0.110.0.0.0.0.0 = INTEGER: 110 TCP-MIB::tcpConnLocalPort.0.0.0.0.111.0.0.0.0.0 = INTEGER: 111 TCP-MIB::tcpConnLocalPort.0.0.0.0.3306.0.0.0.0.0 = INTEGER: 3306 TCP-MIB::tcpConnLocalPort.0.0.0.0.32769.0.0.0.0.0 = INTEGER: 32769 TCP-MIB::tcpConnLocalPort.127.0.0.1.631.0.0.0.0.0 = INTEGER: 631 TCP-MIB::tcpConnLocalPort.127.0.0.1.5432.0.0.0.0.0 = INTEGER: 5432 TCP-MIB::tcpConnLocalPort.192.168.1.12.53.0.0.0.0.0 = INTEGER: 53 TCP-MIB::tcpConnLocalPort.192.168.1.12.110.192.168.1.30.2782 = INTEGER: 110 TCP-MIB::tcpConnLocalPort.192.168.1.13.53.0.0.0.0.0 = INTEGER: 53 TCP-MIB::tcpConnRemAddress.0.0.0.0.21.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.0.0.0.0.25.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.0.0.0.0.110.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.0.0.0.0.111.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.0.0.0.0.3306.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.0.0.0.0.32769.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.127.0.0.1.631.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.127.0.0.1.5432.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.192.168.1.12.53.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemAddress.192.168.1.12.110.192.168.1.30.2782 = IpAddress: 192.168.1.30 TCP-MIB::tcpConnRemAddress.192.168.1.13.53.0.0.0.0.0 = IpAddress: 0.0.0.0 TCP-MIB::tcpConnRemPort.0.0.0.0.21.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.0.0.0.0.25.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.0.0.0.0.110.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.0.0.0.0.111.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.0.0.0.0.3306.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.0.0.0.0.32769.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.127.0.0.1.631.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.127.0.0.1.5432.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.192.168.1.12.53.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpConnRemPort.192.168.1.12.110.192.168.1.30.2782 = INTEGER: 2782 TCP-MIB::tcpConnRemPort.192.168.1.13.53.0.0.0.0.0 = INTEGER: 0 TCP-MIB::tcpInErrs.0 = Counter32: 0 TCP-MIB::tcpOutRsts.0 = Counter32: 518 UDP-MIB::udpInDatagrams.0 = Counter32: 97132 UDP-MIB::udpNoPorts.0 = Counter32: 87 UDP-MIB::udpInErrors.0 = Counter32: 0 UDP-MIB::udpOutDatagrams.0 = Counter32: 99338 UDP-MIB::udpLocalAddress.0.0.0.0.111 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.123 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.161 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.631 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.682 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.32768 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.0.0.0.0.32799 = IpAddress: 0.0.0.0 UDP-MIB::udpLocalAddress.1.0.0.127.53 = IpAddress: 1.0.0.127 UDP-MIB::udpLocalAddress.1.0.0.127.123 = IpAddress: 1.0.0.127 UDP-MIB::udpLocalAddress.2.0.0.127.53 = IpAddress: 2.0.0.127 UDP-MIB::udpLocalAddress.2.0.0.127.123 = IpAddress: 2.0.0.127 UDP-MIB::udpLocalAddress.12.1.168.192.53 = IpAddress: 12.1.168.192 UDP-MIB::udpLocalAddress.12.1.168.192.123 = IpAddress: 12.1.168.192 UDP-MIB::udpLocalAddress.13.1.168.192.53 = IpAddress: 13.1.168.192 UDP-MIB::udpLocalAddress.13.1.168.192.123 = IpAddress: 13.1.168.192 UDP-MIB::udpLocalPort.0.0.0.0.111 = INTEGER: 111 UDP-MIB::udpLocalPort.0.0.0.0.123 = INTEGER: 123 UDP-MIB::udpLocalPort.0.0.0.0.161 = INTEGER: 161 UDP-MIB::udpLocalPort.0.0.0.0.631 = INTEGER: 631 UDP-MIB::udpLocalPort.0.0.0.0.682 = INTEGER: 682 UDP-MIB::udpLocalPort.0.0.0.0.32768 = INTEGER: 32768 UDP-MIB::udpLocalPort.0.0.0.0.32799 = INTEGER: 32799 UDP-MIB::udpLocalPort.1.0.0.127.53 = INTEGER: 53 UDP-MIB::udpLocalPort.1.0.0.127.123 = INTEGER: 123 UDP-MIB::udpLocalPort.2.0.0.127.53 = INTEGER: 53 UDP-MIB::udpLocalPort.2.0.0.127.123 = INTEGER: 123 UDP-MIB::udpLocalPort.12.1.168.192.53 = INTEGER: 53 UDP-MIB::udpLocalPort.12.1.168.192.123 = INTEGER: 123 UDP-MIB::udpLocalPort.13.1.168.192.53 = INTEGER: 53 UDP-MIB::udpLocalPort.13.1.168.192.123 = INTEGER: 123 SNMPv2-MIB::snmpInPkts.0 = Counter32: 341 SNMPv2-MIB::snmpOutPkts.0 = Counter32: 293 SNMPv2-MIB::snmpInBadVersions.0 = Counter32: 0 SNMPv2-MIB::snmpInBadCommunityNames.0 = Counter32: 48 SNMPv2-MIB::snmpInBadCommunityUses.0 = Counter32: 0 SNMPv2-MIB::snmpInASNParseErrs.0 = Counter32: 0 SNMPv2-MIB::snmpInTooBigs.0 = Counter32: 0 SNMPv2-MIB::snmpInNoSuchNames.0 = Counter32: 0 SNMPv2-MIB::snmpInBadValues.0 = Counter32: 0 SNMPv2-MIB::snmpInReadOnlys.0 = Counter32: 0 SNMPv2-MIB::snmpInGenErrs.0 = Counter32: 0 SNMPv2-MIB::snmpInTotalReqVars.0 = Counter32: 303 SNMPv2-MIB::snmpInTotalSetVars.0 = Counter32: 0 SNMPv2-MIB::snmpInGetRequests.0 = Counter32: 0 SNMPv2-MIB::snmpInGetNexts.0 = Counter32: 307 SNMPv2-MIB::snmpInSetRequests.0 = Counter32: 0 SNMPv2-MIB::snmpInGetResponses.0 = Counter32: 0 SNMPv2-MIB::snmpInTraps.0 = Counter32: 0 SNMPv2-MIB::snmpOutTooBigs.0 = Counter32: 0 SNMPv2-MIB::snmpOutNoSuchNames.0 = Counter32: 0 SNMPv2-MIB::snmpOutBadValues.0 = Counter32: 0 SNMPv2-MIB::snmpOutGenErrs.0 = Counter32: 0 SNMPv2-MIB::snmpOutGetRequests.0 = Counter32: 0 SNMPv2-MIB::snmpOutGetNexts.0 = Counter32: 0 SNMPv2-MIB::snmpOutSetRequests.0 = Counter32: 0 SNMPv2-MIB::snmpOutGetResponses.0 = Counter32: 317 SNMPv2-MIB::snmpOutTraps.0 = Counter32: 0 SNMPv2-MIB::snmpEnableAuthenTraps.0 = INTEGER: disabled(2) SNMPv2-MIB::snmpSilentDrops.0 = Counter32: 0 SNMPv2-MIB::snmpProxyDrops.0 = Counter32: 0

 うまくいきました。最新バージョンで大丈夫そうです。
 くれぐれもファイル名を間違えないように(^^;;
 こっちが間違えたのがいけないんだが、せめてファイルが無いって言ってくれ>snmpd そうすればもっと早くに気が付いた。

net-snmp インストール

| | コメント(0)
 ネットワークの監視といえばSNMP(SimpleNetworkManegementProtocol)です。今回はこれをインストールしてみます。
 まず、すでにインストールされていないか調べます。
# rpm -qa | grep snmp

 インストール済みであればここでパッケージが表示されます。古い場合は、アップデートするかここで紹介する方法でインストールしましょう。
 ホームページはNet-SNMPです。
 それではいつものようにダウンロードです。
# su - # cd src # wget http://keihanna.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.2 .2.rc1.tar.gz

 次に展開してコンパイルです。
# cd /usr/local/src # tar zxvf ~/src/net-snmp-5.2.2.rc1.tar.gz # cd net-snmp-5.2.2.rc1/ # ./configure --with-mib-modules="host" # make gcc -g -O2 -Dlinux -I/usr/include/rpm -o .libs/snmpd snmpd.o -L/usr/local/ssl/lib ./.libs/libnetsnmpmibs.so ./.libs/libnetsnmpagent.so helpers/.libs/libnetsnmphelpers.so ../snmplib/.libs/libnetsnmp.so -ldl -lrpm -lrpmio /usr/lib/libpopt.so -lbz2 -lz -lcrypto -lm -Wl,--rpath -Wl,/usr/local/lib /usr/lib/libpopt.so: could not read symbols: File in wrong format collect2: ld returned 1 exit status make[1]: *** [snmpd] エラー 1 make[1]: Leaving directory `/usr/local/src/net-snmp-5.2.2.rc1/agent' make: *** [subdirs] エラー 1
 エラーになっちゃいました。これは前にも経験していて、ライブラリのリンクのときに32ビット版をくっつけちゃうからなんですね。
 多分ライブラリは32ビット版と64ビット版の両方あります。確認してみましょう。
# ls -l /usr/lib/libpopt* -rw-r--r-- 1 root root 30528 4月 9 2005 /usr/lib/libpopt.a -rwxr-xr-x 1 root root 786 4月 9 2005 /usr/lib/libpopt.la lrwxrwxrwx 1 root root 16 8月 29 17:31 /usr/lib/libpopt.so -> libpopt.so.0.0.0 lrwxrwxrwx 1 root root 16 8月 29 17:31 /usr/lib/libpopt.so.0 -> libpopt.so.0.0.0 -rwxr-xr-x 1 root root 28348 4月 9 2005 /usr/lib/libpopt.so.0.0.0 # ls -l /usr/lib64/libpopt* -rw-r--r-- 1 root root 45704 4月 10 2005 /usr/lib64/libpopt.a -rwxr-xr-x 1 root root 788 4月 10 2005 /usr/lib64/libpopt.la lrwxrwxrwx 1 root root 16 8月 29 17:31 /usr/lib64/libpopt.so -> libpopt.so.0.0.0 lrwxrwxrwx 1 root root 16 8月 29 17:31 /usr/lib64/libpopt.so.0 -> libpopt.so.0.0.0 -rwxr-xr-x 1 root root 34144 4月 10 2005 /usr/lib64/libpopt.so.0.0.0

 やっぱり。それでコンフィグを変えてみました。
# ./configure --with-mib-modules="host" --with-libs=/usr/lib 64 checking what to build and install... agent apps man local mibs using default "enterprise.net-snmp" using default enterprise sysOID "NET-SNMP-MIB::netSnmpAgentOIDs..." using default notifications "NET-SNMP-MIB::netSnmpNotifications" using OS default send buffer size for server sockets using OS default recv buffer size for server sockets using OS default send buffer size for client sockets using OS default recv buffer size for client sockets checking if I need to feed myself to ksh... no checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details.

 コンフィグまで失敗しちゃいますね。64ビットに対応していないのでしょうか?
 デフォルトでやってみましょう。
# ./configure # make # make test

 うまくいきました。もしかしたら64ビット対応にもう少しかかるのかもしれません。とりあえずこの状態でやりましょう。HOST-RESOURCESが必要になったら考えましょう。
# make install

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

アーカイブ

Powered by Movable Type 4.1
Sony Style(ソニースタイル)
フェイスインターネットショップ(faith-go.co.jp)
29980円パソコン工房
ioPLAZA【地デジ対応液晶ディスプレイ】
デル株式会社