追加Mibを読み取らせる方法(Ver3.0)

アプライアンスのZS-5300(Ver3.0.5)を構築しており質問があります。

WebUIでトラップを受信していることを確認出来るとこまでは構築できたのですが
拡張Mibが読まれていない様に見受けられます。

そこで色々と調べた結果SNMPTTをインストールしていないからかと思ったのですが
Ver3.0以降ではSNMPTTがインストール出来ないと同僚に聞きました。

perlをインストールしようと下記サイトで確認したのですがperlのファイルが
どこにあるか分かりません。
https://tech-mmmm.blogspot.jp/2016/05/zabbixesxisnmp-trap.html

perlのインストール方法を教えてもらえませんでしょうか。

<補足>
下記の通り追加のMibを格納するディレクトリを用意し、読み込みに行くようにはしています。

# cat /usr/share/snmp/snmp.conf
mibdirs /usr/share/snmp/mibs:/usr/share/snmp/vendor_mibs
mibs all

以上、宜しくお願いします。

コメント表示オプション

お好みのコメント表示方法を選び「設定の保存」をクリックすると変更が反映されます。
ユーザー ぼん-公認 の写真

すみません、下記サイトのURLが漏れていましたので下記に記載します。

https://tech-mmmm.blogspot.jp/2016/05/zabbixesxisnmp-trap.html

以上、宜しくお願いします。

ユーザー TNK の写真

ZS-5300であれば、SNMP Trapを受信できるようになっていたはずで
す。
http://enterprise.zabbix.co.jp/products/zs5300
http://enterprise.zabbix.co.jp/products/zs5300/function

ZS-5300がsnmpttを使用しているのかzabbix_trap_receiver.plを使
用しているのかわかりませんが、snmpttを使用しているのであれば、
snmpttが使用するMIBの変換ファイルに設定の追加が必要なのでは
ないでしょうか?

アプライアンスの内容に関しては、一般には公開されていませんの
で、ZS-5300のサポート窓口に問い合わせされた方がよいと思いま
す。

Ver3.0以降ではSNMPTTがインストール出来ないと同僚に聞きました。

通常のIntelアーキテクチャのRHELやCentOSならインストールできます。

ただし、アプライアンスと通常のIntelアーキテクチャ上のRHELや
CentOS上で構築するものとは別なので、アプライアンスはアプライ
アンスに適した環境構築が必要だったはずです。

ご確認ください。

ユーザー ぼん-公認 の写真

ご返信ありがとうございます。

残念なことにサポートは問い合わせが出来ない契約となっています・・・

ZS-5300でベンダーMibを追加し読み取らせることは可能なのか?!
そこから確認しなければなりませんね(-_-)

ユーザー TNK の写真

まずは、snmpttを使用しているのかzabbix_trap_receiver.plを使
用しているのか、それとも他の方法を使用しているのかから確認
されてみてはいかがでしょうか?

ユーザー ぼん-公認 の写真

アドバイスありがとうございます。

find / -name で探してみましたがありませんでした。

お手数ですがsnmpttとzabbix_trap_receiver.plは通常どこのディレクトリにあるかご教授いただけないでしょうか。

ユーザー TNK の写真

findで何を探されたのですか?
パッケージ管理でインストールされているかもしれないので、それ
らでsnmp関連でどのようなパッケージがインストールされているか
を確認してみましたか?

snmptt関連の設定ファイルは、RHELやCentOSの場合、私は/etc/snmp
ディレクトリ以下に置くようにしています。
しかし、そのディレクトリに配置するのが標準かどうかはわかりま
せん。
パッケージではなくソースからインストールする場合もあるでしょ
うから、ものによっては、/usr/localの下に配置する場合もあると
思います。

zabbix_trap_receiver.plに関しては、特に配置場所に関する標準
はなかったはずです。

snmptrapdの設定はどのようになっているのでしょうか?

ユーザー ぼん-公認 の写真

>findで何を探されたのですか?

⇒find / -name zabbix_trap_receiver.pl

snmptrapd.confの設定は下記の様になってします。

root@:/etc/snmp# cat snmptrapd.conf
###############################################################################
#
# EXAMPLE-trap.conf:
# An example configuration file for configuring the Net-SNMP snmptrapd agent.
#
###############################################################################
#
# This file is intended to only be an example. If, however, you want
# to use it, it should be placed in /etc/snmp/snmptrapd.conf.
# When the snmptrapd agent starts up, this is where it will look for it.
#
# All lines beginning with a '#' are comments and are intended for you
# to read. All other lines are configuration commands for the agent.

#
# PLEASE: read the snmptrapd.conf(5) manual page as well!
#

disableAuthorization yes
traphandle default /usr/sbin/snmptraphandler
traphandle default snmptt

root@:/etc/snmp# ll
total 19
drwxr-xr-x 1 root root 80 Dec 9 16:27 ./
drwxr-xr-x 1 root root 260 Dec 9 16:27 ../
-rw-r--r-- 1 root root 255 Oct 14 23:46 snmp.conf
-rw------- 1 root root 7116 Apr 13 2016 snmpd.conf
-rwxrwxrwx 1 root root 775 Dec 2 18:10 snmptrapd.conf*
-rw-r--r-- 1 root root 2595 May 30 2016 snmptrapfmt.conf

ユーザー TNK の写真

traphandle default snmptt

とあるので、snmpttを使っているのではないでしょうか?

snmptt.confとかsnmptt.iniとかを探してみてください。

ユーザー ぼん-公認 の写真

説明が足らずすみませんtraphandle default snmpttは私が書き込みました。

snmptt.iniもなかったので作成したのですが機能していない様に見受けられたので消しました。

ユーザー TNK の写真

もともとあったものと新規に作成したり変更したものとは、明確に
区別できるようにして頂きたいです。

/etc/snmp/snmptrapfmt.confというファイルがあるので、もしかし
たら、snmptrapfmtを使っているのかもしれません。

そうすると、snmpttは関係なくて、snmptrapdがOIDを解釈できるか
になると思います。
snmptrapdの設定で、追加したMIBファイルを読み込むように設定さ
れているかを確認してみてください。

ご参考:【NET-SNMP】ベンダーMIBファイル追加設定
https://genchan.net/server/4526/

ユーザー ぼん-公認 の写真

>もともとあったものと新規に作成したり変更したものとは、明確に
>区別できるようにして頂きたいです。

⇒失礼しました。仰る通りです…
  末尾に*等付けると後で見た時も分かり易くなりますね。

下記、snmptrapfmt.confの中身となります。
拡張Mibを見にいく設定はなさそうに見えます。

# -----------------------------------------------------------------------------
# Configuration file for snmptrapfmt-1.0
#
# Comment lines start with the character '#'
# Blank lines are ignored
#
# In order to configure the log output, use the following keywords.
# -----------------------------------------------------------------------------

# - SUBST=\a\b\
# substitute char 'a' with 'b' in variable values
# Default: \;\ \
SUBST=\#\ \

# NOTE: The OID Format has to be set in the /etc/snmp/snmp.conf.
# See SNMP.CONF(5). It is valid for all snmp programs of package SNMPD.
# You can specify it with: printNumericOids (1|yes|true|0|no|false)
#
# snmptrapfmt uses it in formats $e $*

# NODEFMT=ip | fqdn | name
# print nodenames as IP address (ip), as fully qualified domain name (fqdn)
# or in the short form (name);
# used in formats $A $R $r $*
# Default: fqdn
NODEFMT=ip

# VARFMT="format string for variables"
# specify the output of variables when using the '$*' format specifier
# in the logfile format;
# special chars recognized:
# %s ... sequence number of the variable
# %n ... the name of the variable (see OIDFMT)
# %t ... the type of the variable
# %v ... the value of the variable
# used in format $*
# Default: ";[%s] %n (%t) : %v"
#VARFMT="\n\t[%s] %n (%t) : %v"
VARFMT="#[%s] %n (%t) : %v"

# LOGFMT="format string for logfile entry"
# specify the output of the logfile entry;
# special char recognized:
# \n ... newline
# \r ... carriage return
# \t ... horizontal tab
# \\ ... backslash
# $# ... number of variables in the trap
# $* ... print all variables of the trap as specified in VARFMT
# $x ... date the trap was received (YYYYMMDD.HHMMSS)
# $r ... the implied source of the trap (agent address) (see NODEFMT)
# $R ... the true source of the trap (via transport layer) (see NODEFMT)
# $$ ... the character '$'
# $e ... the enterprise of the trap as specified in OIDFMT
# $A ... the trap agent address as specified in NODEFMT
# $G ... the trap generic number
# $S ... the trap specific number
# $T ... the trap's sysUpTime timestamp (in seconds)
# ordinary characters represent themselfes
# Default: "$x;$A;$e;$G;$S$*"
#LOGFMT="\n$$x=$x\n$$r=$r\n$$R=$R\n$$e=$e\n$$A=$A\n$$G=$G\n$$S=$S\n$$T=$T\n$$#=$#$*"
LOGFMT="$x#$A#$e#$G#$S#$T$*"

# LOGFILE="path to logfile"
# specify the pathname of the logfile; if none or the empty string "" is
# given, use the syslog() mechanism to log the traps
# Default: ""
LOGFILE="/var/log/snmptrapfmt.log"

ユーザー TNK の写真

先ほどの回答に書かせていただきましたが、伝わっていないようで
すので、もう一度書かせていただきます。

snmptrapdの設定で、追加したMIBファイルを読み込むように設定さ
れているかを確認してみてください。

参考リンクを書いたのは、そのURLのページの最後の方に、起動オ
プションでMIBのディレクトリを指定する例があったからです。

ユーザー heya の写真

横から失礼します。
といっても状況がよく分からないので一般論だけ。

snmptt を使う場合は、snmptt.ini で mibs_environment = ALL として、追加したい MIB ファイルを他の(元からある)MIB ファイルと同じ場所に置いておけば、読んでくれます。
CentOS で yum から net-snmp をインストールしたときは /usr/share/snmp/mibs が MIB 置き場です。

zabbix_trap_receiver.pl は、Zabbix のソースをダウンロードしてきて展開したら、その中にあります。MIB ファイルを読ませたいなら、やはり MIB 置き場に置いて、snmp.conf で設定すればよさそうな気がしますが、zabbix_trap_receiver.pl は使ったことがないのでよく分かりません。

ユーザー ぼん-公認 の写真

ご教授頂きありがとうございます。

基本的な設定について承知しました。