FreeBSD SNMP
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* Can't locate SNMP_util.pm in @INC [#bdd13988]
Jan 18 09:38:19 guard kernel: Starting mrtg_daemon.
Jan 18 09:38:21 guard kernel: Can't locate SNMP_util.pm ...
/usr/local/bin/../lib/mrtg2 /usr/local/bin /usr/local/li...
/usr/local/lib/perl5/site_perl/5.8.9 /usr/local/lib/perl...
/usr/local/lib/perl5/5.8.9 .) at /usr/local/bin/mrtg lin...
Jan 18 09:38:25 guard kernel: Performing sanity check on...
cpan[1]> install SNMP::Util
Enter the IP address of the Device: 218.44.228.159
Enter the SNMP community string: PUBLIC
Checking if your kit is complete...
Looks good
*&SIZE(25){''SNMP''}; &lastmod;[#j813eb7c]
Net-SNMPとはSNMP(Simple Network Management Protocol)を使...
ルータにSNMPで情報を取得したい場合、ルータの設定変更を一...
SNMPでトラフィックやディスクの情報を取り出して、MRTGなど...
+[[''環境''>#A]]
+[[''インストール''>#B]]
+[[''/etc/rc.confの編集''>#C]]
+[[''snmp設定ファイル編集''>#D]]
+[[''/etc/snmpd.configの設定''>#t3570e0a]]
+[[''hosts.allowファイル編集''>#n3bd60be]]
+[[''確認''>#E]]
//+[[''初期設定''>#F]]
**''環境''&aname(A); [#pcc5c313]
FreeBSD 6.2~
FreeBSD CoolMaster.smb.net 6.2-RELEASE-p7 FreeBSD 6.2-RE...
net-snmpd 5.3.1~
**''インストール''&aname(B); [#c834ef0d]
# cd /usr/ports/net-mgmt/net-snmp
# make install
**** This port installs snmp daemon, header files and li...
invokes snmpd by default.
If you want to invoke snmpd and/or snmptrapd at star...
lines into /etc/rc.conf.
snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
**** You may specify the following make variables:
NET_SNMP_SYS_CONTACT="kuriyama@FreeBSD.org"
NET_SNMP_SYS_LOCATION="Tokyo, Japan"
DEFAULT_SNMP_VERSION=3
NET_SNMP_MIB_MODULES="host smux mibII/mta_sendmai...
NET_SNMP_LOGFILE=/var/log/snmpd.log
NET_SNMP_PERSISTENTDIR=/var/net-snmp
to define default values (or overwriting defaults). ...
setting first two variables, you will not be prompte...
configuration process. You may also set
BATCH="yes"
to avoid interactive configuration.
===> Installing rc.d startup script(s)
===> Compressing manual pages for net-snmp-5.3.1_3
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for net-snmp-5.3.1_3
===> SECURITY REPORT:
This port has installed the following files which m...
servers and may therefore pose a remote security ri...
/usr/local/lib/libnetsnmp.so.10
/usr/local/lib/libnetsnmpagent.so.10
This port has installed the following startup scrip...
these network services to be started at boot time.
/usr/local/etc/rc.d/snmpd
/usr/local/etc/rc.d/snmptrapd
If there are vulnerabilities in these programs ther...
risk to the system. FreeBSD makes no guarantee abou...
ports included in the Ports Collection. Please type...
to deinstall the port if this is a concern.
For more information, and contact details about the...
status of this software, see the following webpage:
http://net-snmp.sourceforge.net/
**''/etc/rc.confの編集''&aname(C); [#oc5fee5c]
■下記を追加して再起動時に自動起動させます
#SNMP
snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
#snmpd_conffile="/usr/local/etc/snmpd.conf"
>snmpdのデフォルトの設定ファイルは、/usr/local/share/snmp...
// CoolMaster:root {50} % ps aux|grep snmpd
// root 811 0.0 0.2 6628 5116 ?? S 6:10AM ...
CoolMaster:root {50} % ps aux|grep snmpd
root 815 0.0 0.2 6620 5104 ?? S 4:17PM ...
**''snmp設定ファイル編集''&aname(D); [#c97fb964]
■snmpの設定ファイル「/usr/local/share/snmp/snmpd.conf.exa...
# cp /usr/local/share/snmp/snmpd.conf.example /usr/local...
# vi /usr/local/share/snmp/snmpd.conf
下記のような感じでコミュニティ名とネットワークを設定する。
コミュニティー名とはパスワードみたいなものです。
# sec.name source community
com2sec local localhost PRIVATE
com2sec mynetwork 219.117.246.192/27 PUBLIC
# Second, map the security names into group names:
# sec.model sec.name
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork
# incl/excl subtree m...
view all included .1 80
# context sec.model sec.level match read...
access MyROGroup "" any noauth exact all ...
access MyRWGroup "" any noauth exact all ...
syslocation SMB.
syscontact Root <hostmaster@smb.net>
proc mountd
proc ntalkd 4
# disk checks
# least 10 megs.
disk / 10000
# 1MAX: If the 1 minute load average is above this lim...
# 5MAX: Similar, but for 5 min average.
# 15MAX: Similar, but for 15 min average.
# Check for loads:
#load 12 14 14
// com2sec local localhost COMMUNITY
// com2sec mynetwork 219.117.246.192/27 PUBLIC
http://journal.mycom.co.jp/column/yetanother/080/index.html
// # sec.name source community
// com2sec local localhost PRIVATE
// com2sec mynetwork 192.168.0.0/24 PUBLIC
// ***追加***
// proc httpd #httpプロセス監視の為
// disk /var #diskの容量を取得する為
// disk /home
// disk /usr
// ***追加***
**''/etc/snmpd.configの設定'' [#t3570e0a]
# cp /etc/snmpd.config /etc/snmpd.config-dist
# Set some common variables
#
host := piano.smb.net #ホスト名を記入
#host := foobar
location := "Room 200"
contact := "root@smb.net"
#contact := "sysmeister@example.com"
system := 1 # FreeBSD
traphost := localhost
trapport := 162
**hosts.allowの設定 [#n3bd60be]
■snmp接続したいIPを通るようにしておく
# vi /etc/hosts.allow
snmpd : 219.117.246.192/255.255.255.224 : allow
snmpd : 127.0.0.1 : allow
**''確認''&aname(E); [#u1796e66]
■snmpdプロセスを立ち上げて確認
# /usr/local/sbin/snmpd
// # /usr/local/etc/rc.d/snmpd.sh start
// # /usr/local/etc/rc.d/snmptrapd.sh start
# /usr/local/bin/snmpwalk -v1 -c PUBLIC piano.smb.net
MIB情報が出力されればOKです。~
//MRTGでのグラフ表示は ⇒ [[こちら>FreeBSD/MRTG]]
SNMPv2-MIB::sysDescr.0 = STRING: FreeBSD CoolMaster.smb....
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAg...
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (119928...
SNMPv2-MIB::sysContact.0 = STRING: Me <me@somewhere.org>
SNMPv2-MIB::sysName.0 = STRING: CoolMaster.smb.net
SNMPv2-MIB::sysLocation.0 = STRING: Right here, right now.
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (4) 0:00:00.04
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.3 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.4 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::va...
SNMPv2-MIB::sysORID.6 = OID: SNMP-FRAMEWORK-MIB::snmpFra...
SNMPv2-MIB::sysORID.7 = OID: SNMP-MPD-MIB::snmpMPDCompli...
SNMPv2-MIB::sysORID.8 = OID: SNMP-USER-BASED-SM-MIB::usm...
SNMPv2-MIB::sysORID.9 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SN...
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Con...
SNMPv2-MIB::sysORDescr.6 = STRING: The SNMP Management A...
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB for Message P...
SNMPv2-MIB::sysORDescr.8 = STRING: The management inform...
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB module to des...
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (3) 0:00:00.03
----
http://matsui.homeunix.com/index.php?FreeBSD%2FSNMP#C
終了行:
* Can't locate SNMP_util.pm in @INC [#bdd13988]
Jan 18 09:38:19 guard kernel: Starting mrtg_daemon.
Jan 18 09:38:21 guard kernel: Can't locate SNMP_util.pm ...
/usr/local/bin/../lib/mrtg2 /usr/local/bin /usr/local/li...
/usr/local/lib/perl5/site_perl/5.8.9 /usr/local/lib/perl...
/usr/local/lib/perl5/5.8.9 .) at /usr/local/bin/mrtg lin...
Jan 18 09:38:25 guard kernel: Performing sanity check on...
cpan[1]> install SNMP::Util
Enter the IP address of the Device: 218.44.228.159
Enter the SNMP community string: PUBLIC
Checking if your kit is complete...
Looks good
*&SIZE(25){''SNMP''}; &lastmod;[#j813eb7c]
Net-SNMPとはSNMP(Simple Network Management Protocol)を使...
ルータにSNMPで情報を取得したい場合、ルータの設定変更を一...
SNMPでトラフィックやディスクの情報を取り出して、MRTGなど...
+[[''環境''>#A]]
+[[''インストール''>#B]]
+[[''/etc/rc.confの編集''>#C]]
+[[''snmp設定ファイル編集''>#D]]
+[[''/etc/snmpd.configの設定''>#t3570e0a]]
+[[''hosts.allowファイル編集''>#n3bd60be]]
+[[''確認''>#E]]
//+[[''初期設定''>#F]]
**''環境''&aname(A); [#pcc5c313]
FreeBSD 6.2~
FreeBSD CoolMaster.smb.net 6.2-RELEASE-p7 FreeBSD 6.2-RE...
net-snmpd 5.3.1~
**''インストール''&aname(B); [#c834ef0d]
# cd /usr/ports/net-mgmt/net-snmp
# make install
**** This port installs snmp daemon, header files and li...
invokes snmpd by default.
If you want to invoke snmpd and/or snmptrapd at star...
lines into /etc/rc.conf.
snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
**** You may specify the following make variables:
NET_SNMP_SYS_CONTACT="kuriyama@FreeBSD.org"
NET_SNMP_SYS_LOCATION="Tokyo, Japan"
DEFAULT_SNMP_VERSION=3
NET_SNMP_MIB_MODULES="host smux mibII/mta_sendmai...
NET_SNMP_LOGFILE=/var/log/snmpd.log
NET_SNMP_PERSISTENTDIR=/var/net-snmp
to define default values (or overwriting defaults). ...
setting first two variables, you will not be prompte...
configuration process. You may also set
BATCH="yes"
to avoid interactive configuration.
===> Installing rc.d startup script(s)
===> Compressing manual pages for net-snmp-5.3.1_3
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for net-snmp-5.3.1_3
===> SECURITY REPORT:
This port has installed the following files which m...
servers and may therefore pose a remote security ri...
/usr/local/lib/libnetsnmp.so.10
/usr/local/lib/libnetsnmpagent.so.10
This port has installed the following startup scrip...
these network services to be started at boot time.
/usr/local/etc/rc.d/snmpd
/usr/local/etc/rc.d/snmptrapd
If there are vulnerabilities in these programs ther...
risk to the system. FreeBSD makes no guarantee abou...
ports included in the Ports Collection. Please type...
to deinstall the port if this is a concern.
For more information, and contact details about the...
status of this software, see the following webpage:
http://net-snmp.sourceforge.net/
**''/etc/rc.confの編集''&aname(C); [#oc5fee5c]
■下記を追加して再起動時に自動起動させます
#SNMP
snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
#snmpd_conffile="/usr/local/etc/snmpd.conf"
>snmpdのデフォルトの設定ファイルは、/usr/local/share/snmp...
// CoolMaster:root {50} % ps aux|grep snmpd
// root 811 0.0 0.2 6628 5116 ?? S 6:10AM ...
CoolMaster:root {50} % ps aux|grep snmpd
root 815 0.0 0.2 6620 5104 ?? S 4:17PM ...
**''snmp設定ファイル編集''&aname(D); [#c97fb964]
■snmpの設定ファイル「/usr/local/share/snmp/snmpd.conf.exa...
# cp /usr/local/share/snmp/snmpd.conf.example /usr/local...
# vi /usr/local/share/snmp/snmpd.conf
下記のような感じでコミュニティ名とネットワークを設定する。
コミュニティー名とはパスワードみたいなものです。
# sec.name source community
com2sec local localhost PRIVATE
com2sec mynetwork 219.117.246.192/27 PUBLIC
# Second, map the security names into group names:
# sec.model sec.name
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork
# incl/excl subtree m...
view all included .1 80
# context sec.model sec.level match read...
access MyROGroup "" any noauth exact all ...
access MyRWGroup "" any noauth exact all ...
syslocation SMB.
syscontact Root <hostmaster@smb.net>
proc mountd
proc ntalkd 4
# disk checks
# least 10 megs.
disk / 10000
# 1MAX: If the 1 minute load average is above this lim...
# 5MAX: Similar, but for 5 min average.
# 15MAX: Similar, but for 15 min average.
# Check for loads:
#load 12 14 14
// com2sec local localhost COMMUNITY
// com2sec mynetwork 219.117.246.192/27 PUBLIC
http://journal.mycom.co.jp/column/yetanother/080/index.html
// # sec.name source community
// com2sec local localhost PRIVATE
// com2sec mynetwork 192.168.0.0/24 PUBLIC
// ***追加***
// proc httpd #httpプロセス監視の為
// disk /var #diskの容量を取得する為
// disk /home
// disk /usr
// ***追加***
**''/etc/snmpd.configの設定'' [#t3570e0a]
# cp /etc/snmpd.config /etc/snmpd.config-dist
# Set some common variables
#
host := piano.smb.net #ホスト名を記入
#host := foobar
location := "Room 200"
contact := "root@smb.net"
#contact := "sysmeister@example.com"
system := 1 # FreeBSD
traphost := localhost
trapport := 162
**hosts.allowの設定 [#n3bd60be]
■snmp接続したいIPを通るようにしておく
# vi /etc/hosts.allow
snmpd : 219.117.246.192/255.255.255.224 : allow
snmpd : 127.0.0.1 : allow
**''確認''&aname(E); [#u1796e66]
■snmpdプロセスを立ち上げて確認
# /usr/local/sbin/snmpd
// # /usr/local/etc/rc.d/snmpd.sh start
// # /usr/local/etc/rc.d/snmptrapd.sh start
# /usr/local/bin/snmpwalk -v1 -c PUBLIC piano.smb.net
MIB情報が出力されればOKです。~
//MRTGでのグラフ表示は ⇒ [[こちら>FreeBSD/MRTG]]
SNMPv2-MIB::sysDescr.0 = STRING: FreeBSD CoolMaster.smb....
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAg...
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (119928...
SNMPv2-MIB::sysContact.0 = STRING: Me <me@somewhere.org>
SNMPv2-MIB::sysName.0 = STRING: CoolMaster.smb.net
SNMPv2-MIB::sysLocation.0 = STRING: Right here, right now.
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (4) 0:00:00.04
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.3 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.4 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::va...
SNMPv2-MIB::sysORID.6 = OID: SNMP-FRAMEWORK-MIB::snmpFra...
SNMPv2-MIB::sysORID.7 = OID: SNMP-MPD-MIB::snmpMPDCompli...
SNMPv2-MIB::sysORID.8 = OID: SNMP-USER-BASED-SM-MIB::usm...
SNMPv2-MIB::sysORID.9 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SN...
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for ma...
SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Con...
SNMPv2-MIB::sysORDescr.6 = STRING: The SNMP Management A...
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB for Message P...
SNMPv2-MIB::sysORDescr.8 = STRING: The management inform...
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB module to des...
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (3) 0:00:00.03
----
http://matsui.homeunix.com/index.php?FreeBSD%2FSNMP#C
ページ名: