2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS6でSNMPの設定をするとき最低限必要なもの

Last updated at Posted at 2015-11-24

#前提
・CentOSでsnmpをしゃべらせてみたいなと思ったとき
 最低限これだけすればできるとというものをまとめてみた
・アカウントはすべて管理者としています

#インストールするもの

コマンド
# yum -y install net-snmp net-snmp-utils

#/etc/snmp/snmpd.confを以下のように記載

confの中身
 15 ###############################################################################
 16 # Access Control
 17 ###############################################################################
 18
 19 # As shipped, the snmpd demon will only respond to queries on the
 20 # system mib group until this file is replaced or modified for
 21 # security purposes.  Examples are shown below about how to increase the
 22 # level of access.
 23
 24 # By far, the most common question I get about the agent is "why won't
 25 # it work?", when really it should be "how do I configure the agent to
 26 # allow me to access it?"
 27 #
 28 # By default, the agent responds to the "public" community for read
 29 # only access, if run out of the box without any configuration file in
 30 # place.  The following examples show you other ways of configuring
 31 # the agent so that you can change the community names, and give
 32 # yourself write access to the mib tree as well.
 33 #
 34 # For more information, read the FAQ as well as the snmpd.conf(5)
 35 # manual page.
 36
 37 ####
 38 # First, map the community name "public" into a "security name"
 39
 40 #       sec.name  source          community
 41 com2sec local  default       home_public
 42
 43 ####
 44 # Second, map the security name into a group name:
 45
 46 #       groupName      securityModel securityName
 47 group   local_group v1           local
 48 group   local_group v2c           local
 49
 50 ####
 51 # Third, create a view for us to let the group have rights to:
 52
 53 # Make at least  snmpwalk -v 1 localhost -c public system fast again.
 54 #       name           incl/excl     subtree         mask(optional)
 55 view    view_all    included   .1
 56
 57 ####
 58 # Finally, grant the group read-only access to the systemview view.
 59
 60 #       group          context sec.model sec.level prefix read   write  notif
 61 access  local_group ""      any       noauth    exact  view_all none none
 62
 63 # -----------------------------------------------------------------------------

41、47、48、55、61行目をそのままコピペでOK
※各項目は後日説明したいかと思う

#コマンド実行

qiita.rb
# service snmpd start
# service snmpd status

#snmpwalkで値が帰ってくるか確認
出力結果が文字列と数字の混在

コマンド
# snmpwalk -c home_public -v2c localhost .1

出力結果がOID

コマンド
# snmpwalk -On -c home_public -v2c localhost .1

#参考サイト
Net-SNMP のインストールと設定 〜 CentOS6

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?