SSブログ

Net-SNMP 5.7アップデート [FreeBSD]

久々にportupgrade(実際はpkg_replacceですが)を実行したら、いろいろとアップデートされました。特に問題もなく終わったのですが、一つだけ大きな問題が発生しました。5.4から5.7にアップデートしたNet-SNMPです。
何が問題かと言うと、
 ・5.4から引き継いだsnmpd.confがそのまま使えない(起動しない)
 ・snmpd.confがそのまま使えないばかりでなく、5.7用のsnmpd.conf.exampleを指定しても起動しない
 ・エラーメッセージがどこにも残らない
といった感じです。
エラーメッセージが残らない件については、/usr/local/etc/rc.d/機構を使わずに手動オプション指定で起動させることにより、表示されるようになったのですが、これまた表示される意味が分からない。(ググったけど解決策が?)
man snmpd.confを見ると、コンフィグ作成のためのsnmpconfというツールがあるようなので、それを使うことにしました。
atom# snmpconf -g basic_setup

そしてできあがったのが、このコンフィグ。後でちょっと手動編集していますが、sampleに比べえらくあっさりしてしまいました。とりあえずrrdtool用にgetしていたmibがgetできるようになりました。
atom# cat /usr/local/share/snmp/snmpd.conf
###########################################################################
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
###############################################################################
#
#  AGENT BEHAVIOUR
#

#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161

# SECTION: System Information Setup
#
#   This section defines some of the information reported in
#   the "system" mib group in the mibII tree.

# syslocation: 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

syslocation  "snmpd location"

# syscontact: 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

syscontact  me

# sysservices: The proper value for the sysServices object.
#   arguments:  sysservices_number

sysservices 72



###########################################################################
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rocommunity  public

# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
#   arguments:  community [default|hostname|network/bits] [oid]

タグ:Net-SNMP

共通テーマ:日記・雑感