4
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.

SNMPv3 の Trap受信設定をしてみる(CentOS7)

Last updated at Posted at 2019-10-28

1. はじめに

Centos7のサーバー上でLBからのSNMPv3 Trap受信設定をした際の備忘録です。
SNMPv3関連の情報があまり見当たらなかったので記事にします。

2. サーバーへのTrap受信設定方法

1.まずはfirewalldをオフにする
systemctl stop firewalld
or
systemctl disable firewalld

2.「/etc/snmp/snmptrapd.conf」に設定を追加

# Example configuration file for snmptrapd
#
# No traps are handled by default, you must edit this file!
#
# authCommunity   log,execute,net public
# traphandle SNMPv2-MIB::coldStart    /usr/bin/bin/my_great_script cold

createUser -e <EngineID> <UserName> SHA <Password> AES
authuser log <UserName>

3.SNMP Trapの動作確認


[daikon@CentOS7 ~]$ sudo snmptrapd -f -C -c /etc/snmp/snmptrapd.conf -Le
NET-SNMP version 5.7.2
~Trap受信時にログが出力される~

4. trapが出力されない時。。。

1.「No access configuration」が出力される場合
「/etc/snmp/snmptrapd.conf」の設定内容が不足しています。

[root@CentOS7-149 snmp]#  snmptrapd -f -C -c /etc/snmp/snmptrapd.conf -Le
Warning: no access control information configured.
  (Config search path: /etc/snmp:/usr/share/snmp:/usr/lib64/snmp:/root/.snmp)
This receiver will *NOT* accept any incoming notifications.
NET-SNMP version 5.7.2
No access configuration - dropping trap.
No access configuration - dropping trap.

2.「Authentication failed」が出力される場合
設定するパスワードが間違っています。

[disaito@CentOS7-149 ~]$ sudo snmptrapd -f -C -c /etc/snmp/snmptrapd.conf -Le
NET-SNMP version 5.7.2
Authentication failed for SNMPv3userMD5

3.何も出力されない場合
ユーザーID,Engine IDを間違えています。

[disaito@CentOS7-149 ~]$ sudo snmptrapd -f -C -c /etc/snmp/snmptrapd.conf -Le
NET-SNMP version 5.7.2



5. 参考

[公式ドキュメント]
http://www.net-snmp.org/wiki/index.php/TUT:Configuring_snmptrapd_to_receive_SNMPv3_notifications#Configuring_a_SNMPv3_TRAP_User

4. 終わりに

参考になれば幸いです。

4
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
4
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?