ucs-snmp に関するインストールメモ(2002/07/20)
ucs-snmp ですが、2003/05現在というか新しい "net-snmp" という名称となっていますので、そちらをインストールすることをお勧めします。
1) 既存の snmpマネージャを起動しない様に、管理者メニューから snmpの起動を停止します。設定終了後、ps コマンドで snmpサービスが起動されていない事を確認してください。
2) ucd-snmp のインストールを行う。./configure をかけると、問いかけがあります。(時間かかります)
% cd ./src
% wget http://unc.dl.sourceforge.net/sourceforge/net-snmp/ucd-snmp-4.2.6.tar.gz
% gzip -cd ucd-snmp-4.2.6.tar.gz | tar xf -
% cd ucd-snmp-4.2.6
% ./configure
checking if you have run configure before...
************** Configuration Section **************
You are about to be prompted with a series of questions. Answer
them carefully, as they determine how the snmp agent and related
applications are to function.
After the configure script finishes, you can browse the newly
created config.h file for further - less important - parameters to
modify. Be careful if you re-run configure though, since config.h will
be overwritten.
-Press return to continue- ←Enterを押します
disabling above prompt for future runs... yes
checking System Contact Information...
*** System Contact Information:
Describes who should be contacted about the host the agent is
running on. This information is available in the MIB-II tree. This
can also be over-ridden using the "syscontact" syntax in the agent's
configuration files.
System Contact Information (hoge@hoge.co.jp): ←管理者のメールアドレスを入力します
setting System Contact Information to... hoge@hoge.co.jp
checking System Location...
*** System Location:
Describes the location of the system. This information is
available in the MIB-II tree. this can also be over-ridden using the
"syslocation" syntax in the agent's configuration files.
System Location (Unknown): Qube3J Server
setting System Location to... Intel-Solaris8 Server
checking Location to write logfile...
*** Logfile location:
Enter the default location for the snmpd agent to dump
information & errors to. If not defined (enter the keyword "none"
at the prompt below) the agent will use stdout and stderr instead.
(Note: This value can be over-ridden using command line options.)
Location to write logfile (/var/log/snmpd.log): ←お好きな場所に♪
setting Location to write logfile to... /var/log/snmpd.log
checking Location to write persistent information...
*** snmpd persistent storage location:
Enter a directory for the snmp library to store persistent
data in the form of a configuration file.
Location to write persistent information (/var/ucd-snmp): ←こちらも (^o^)丿 な
setting Location to write persistent information to... /var/ucd-snmp
3) コンパイルと動作テストをします。(すげー時間かかります)
% make
% make test
Summary: 33 / 33 succeeded. ←こう表示されれば ok ♪
make[1]: Leaving directory `/home/hoge/src/ucd-snmp-4.2.6/testing'4) インストールをするだす。
% su
# umask 022
# make install5) ucd-snmpエージェントの起動前設定をします。
# cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf
# vi /usr/local/share/snmp/snmpd.conf
変更点
# sec.name source community
com2sec local localhost PRIVATE
com2sec mynetwork 192.xxx.xxx.xxx/24 HOME
# Second, map the security names into group names:
#group MyRWGroup v1 local
#group MyRWGroup v2c local
#group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork
# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file:
syslocation Intel-Solaris8 Unix Server
syscontact Me <hoge@hoge.co.jp>
# Make sure mountd is running
#proc mountd
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
#proc ntalkd 4
# Make sure at least one sendmail, but less than or equal to 10 are running.
#proc sendmail 10 1
# a simple hello world
#exec echotest /bin/echo hello world
# Check the / partition and make sure it contains at least 10 megs.
disk / 497829
disk /usr/local 25220486) ucd-snmpエージェントの起動をします。
# /usr/local/sbin/snmpd
# ps -ef | grep snmpd
root 26880 26734 0 16:22:25 pts/2 0:00 grep -n snmpd
root 26878 1 0 16:22:18 pts/2 0:00 /usr/local/sbin/snmpd7) 動作チェックを行います。下のコマンドを実行し、山の様になんか帰ってくれば ok です。
# snmpwalk -v 1 SNMPエージェントのIPアドレス HOME .1.3.6.1.2.1
8) 自動起動するように設定します。
# cd /etc/rc.d/init.d
# vi ucd-snmp
# chmod +x ucd-snmp
# cd /etc/rc.d/rc3.d
# ln -s /etc/rc.d/init.d/ucd-snmp S77ucd-snmp