ja:documentation:pandorafms:monitoring:08_snmp_traps_monitoring

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:monitoring:08_snmp_traps_monitoring [2024/02/21 08:50] – [トラップジェネレータ] junichija:documentation:pandorafms:monitoring:08_snmp_traps_monitoring [2024/05/17 23:11] (現在) – [複雑な SNMP トラップへのアラート関連付け] junichi
行 5: 行 5:
  
 ===== 概要 ===== ===== 概要 =====
 +
 スイッチ、ルータ、サーバ、プリンタ、AP など、SNMP をサポートするネットワークデバイスは、インターフェイスの障害、CPU またはネットワークの負荷が高すぎたり、UPS の状態が変化したり、ディスクの障害が発生したときなどに、アラーム(SNMP トラップ)を送信することができます。各デバイスには、可能なイベントの独自のコレクションがあり、これは MIB と呼ばれます。この場合、デバイスのポーリングに使用する MIB とは異なります。 スイッチ、ルータ、サーバ、プリンタ、AP など、SNMP をサポートするネットワークデバイスは、インターフェイスの障害、CPU またはネットワークの負荷が高すぎたり、UPS の状態が変化したり、ディスクの障害が発生したときなどに、アラーム(SNMP トラップ)を送信することができます。各デバイスには、可能なイベントの独自のコレクションがあり、これは MIB と呼ばれます。この場合、デバイスのポーリングに使用する MIB とは異なります。
  
行 12: 行 13:
 トラップは、デバイスにて何かが発生した場合に非同期で送信されます。Pandora FMS には、モニタリング対象から送られてくるトラップを表示するトラップ受信コンソールがあり、また、トラップに対してアラートを設定することができます。SNMP トラップは、Pandora FMS の起動時に起動される、OS の SNMP サーバデーモンで受け取ります。このサーバは通常ログファイルを以下に保存します。 トラップは、デバイスにて何かが発生した場合に非同期で送信されます。Pandora FMS には、モニタリング対象から送られてくるトラップを表示するトラップ受信コンソールがあり、また、トラップに対してアラートを設定することができます。SNMP トラップは、Pandora FMS の起動時に起動される、OS の SNMP サーバデーモンで受け取ります。このサーバは通常ログファイルを以下に保存します。
  
-  /var/log/pandora /pandora_snmptrap.log+<file>
  
-トラップは、常に生データで受信されます。つまり、数値 OID で受信します。ただし、OS に MIB ファイルがインストールされている場合は、文字に変換することができます。エンタープライズ版の Pandora FMS の SNMP コンソールでは、トラップをより認識しやすいように、OID を数値や文字で表したり、何らかの説明をつけたりする ("インターフェースダウン" など) ためのルールを設定できます。このようなルールを自動的に定義するために、Pandora FMS はトラップのベンダ MIB を読み込むことができます。ビデオチュートリアル [[https://www.youtube.com/watch?v = Oaxf7vi7eME|"Loading MIBs in Pandora FMS"]] もご覧ください。+/var/log/pandora/pandora_snmptrap.log
  
-最初に、SNMP コンソールを有効化するためには /etc/pandora/pandora_server.conf 内の以下のパラメータを編集する必要があります。+</file>
  
-  snmpconsole 1+The Pandora FMS SNMP console allows you to create rules to rename numerical OIDs to alphanumeric OIDs or simple descriptive text strings, so that it is more intuitive to work with SNMP traps. Pandora FMS also allows you to load trap MIBs from any manufacturer to automatically define those rules.
  
-トラップ文字列変換したい場合(変数のバインディングまたは Enterprise 文字列のいずれか)は、ションも有効化しま(Enterpriase 版み)+Pandora FMS SNMP コンソール使用すると、値 OID 名前を英数字 OID または単純な説明テキスト文字列に変更するルールを作成できるため、SNMP トラップをより直感的に操作できるようになります。 Pandora FMS では、任意メーカーのトラップ MIB をロードして、それらのルールを自動的に定義することできます。 
 + 
 +In order to work with SNMP traps, first modify the following parameter in ''/etc/pandora/pandora_server.conf'' to enable the SNMP Console: 
 + 
 +最初に、SNMP コンソールを有効化するためには ''/etc/pandora/pandora_server.conf''以下のパラメータを編集する必要があります
  
 <code> <code>
 +snmpconsole 1
 +
 +</code>
 +
 +So that the traps SNMP appear translated (whether the variable links or the Enterprise SNMP chain) the following parameters must be activated:
 +
 +トラップを文字列変換したい場合(変数のバインディングまたは Enterprise 文字列のいずれか)は、次のオプションも有効化します。
 +
 +<code>
 +
  translate_variable_bindings 1  translate_variable_bindings 1
  translate_enterprise_strings 1  translate_enterprise_strings 1
 +
 </code> </code>
  
-また、/etc/snmp/snmptrapd.conf ファイルを必要なパラメータで設定する必要があります。 +The ''/etc/snmp/snmptrapd.conf'' file must also be configured with the necessary parameters, for example: 
-例:+ 
 +また、''/etc/snmp/snmptrapd.conf'' ファイルを必要なパラメータで設定する必要があります。例:
  
 <code> <code>
  authCommunity log public  authCommunity log public
  disableAuthorization yes  disableAuthorization yes
 +
 </code> </code>
  
-この設定では、コミュニティ "public"、認証無しでトラップを受け付けます。+With this configuration, traps will be created for the **public** community and will not require authorization. 
 + 
 +この設定では、コミュニティ **public**、認証無しでトラップを受け付けます。
  
 ==== SNMPv3 ==== ==== SNMPv3 ====
行 342: 行 362:
 アップロードが完了すると、システムはそれをトラップライブラリに取り込みます。 アップロードが完了すると、システムはそれをトラップライブラリに取り込みます。
  
-===== 複雑な SNMP トラップのアラート関連付け =====+===== SNMP トラップの Pandora FMS アラートへの関連付け =====
  
-This is an Enterprise feature and is configured in **Management** → **Setup** → **Setup** → **Enterprise** → **Forward SNMP traps to an agent (if it exists)**.+Menu <wrap :en>**Management → Setup → Setup → Enterprise → Forward SNMP traps to an agent (if it exists)**</wrap>.
  
-これは Enterprise 版の機能であり、**管理(Management)** → **セットアップ(Setup)** → **セットアップ(Setup)** → **Enterprise** → **SNMP トラップをエージェント (存在する場合) に転送(Forward SNMP traps to an agent (if it exists)** で設定します+**管理(Management)** → **セットアップ(Setup)** → **セットアップ(Setup)** → **Enterprise** → **SNMP トラップをエージェント (存在する場合) に転送(Forward SNMP traps to an agent (if it exists)**。
  
 <WRAP center round info 60%> <WRAP center round info 60%>
行 406: 行 426:
 With Pandora FMS it is possible to enable forwarding of SNMP traps to an external host by enabling the [[:en:documentation:pandorafms:installation:04_configuration#snmp_forward_trap|snmp_forward_trap]] in the token in the Pandora configuration file. With Pandora FMS it is possible to enable forwarding of SNMP traps to an external host by enabling the [[:en:documentation:pandorafms:installation:04_configuration#snmp_forward_trap|snmp_forward_trap]] in the token in the Pandora configuration file.
  
-Pandora FMS では、Pandora 設定ファイルのトークン [[:ja:documentation:pandorafms:installation:04_configuration#snmp_forward_trap|snmp_forward_trap]] を有効にすること、外部ホストへの SNMP トラップの転送を有効にすることができます。+Pandora FMS では、Pandora サーバの設定ファイル[[:ja:documentation:pandorafms:installation:04_configuration#snmp_forward_trap|snmp_forward_trap]]トークンを有効にすることによりSNMP trap を外部ホストへ転送することができます。
  
  
-===== 外部 SNMP トラップハンドラ =====+ 
 + 
 + 
 +==== SNMP v1 を使った trap 転送設定例 ==== 
 + 
 +<code> 
 + snmp_forward_trap 1 
 + snmp_forward_ip 192.168.1.145 
 + snmp_forward_version 1 
 + snmp_forward_community public 
 + snmp_forward_secName 
 + snmp_forward_engineid 
 + snmp_forward_authProtocol 
 + snmp_forward_authPassword 
 + snmp_forward_privProtocol 
 + snmp_forward_privPassword 
 + snmp_forward_secLevel 
 +</code> 
 + 
 +==== SNMP v2c を使った trap 転送設定例 ==== 
 + 
 +<code> 
 + snmp_forward_trap 1 
 + snmp_forward_ip 192.168.1.145 
 + snmp_forward_version 2c 
 + snmp_forward_community public 
 + snmp_forward_secName 
 + snmp_forward_engineid 
 + snmp_forward_authProtocol 
 + snmp_forward_authPassword 
 + snmp_forward_privProtocol 
 + snmp_forward_privPassword 
 + snmp_forward_secLevel 
 +</code> 
 + 
 +==== SNMP v3 を使った trap 転送設定例 ==== 
 + 
 +この例は、SNMP v3 trap の知識が必要になるため特に難しいです。リモートの SNMP エージェントが[[:ja:documentation:02_installation:04_configuration#snmp_forward_ip|snmp_forward_ip]]で定義されており、次の設定が /etc/snmp/snmptrapd.conf ファイルに書かれていることを想定します。 
 +<code> 
 + 
 +createUser -e 0x0102030405 myuser MD5 mypassword DES myotherpassword 
 + 
 +</code> 
 + 
 +Pandora サーバの設定ファイルは次のようになります。 
 + 
 +<code> 
 + snmp_forward_trap 1 
 + snmp_forward_ip 192.168.1.145 
 + snmp_forward_version 3 
 + snmp_forward_secName myuser 
 + snmp_forward_engineid 0x0102030405 
 + snmp_forward_authProtocol MD5 
 + snmp_forward_authPassword mypassword 
 + snmp_forward_privProtocol DES 
 + snmp_forward_privPassword myotherpassword 
 + snmp_forward_secLevel authNoPriv 
 + 
 +</code> 
 + 
 +より詳細は、 [[http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap_SNMPv3#SNMPv3_TRAPs|NET-SNMP's v3 Traps]]を参照してください。 
 + 
 + 
 +===== snmptrapd デーモンの個別管理 ===== 
 + 
 +何らかの理由により、snmptrapd デーモンを Pandora FMS から独立して管理したい場合(Pandora FMS デーモンとは独立して停止・起動をしたい場合)は、いくつか考慮すべきことがあります。 
 + 
 +1. You must also activate [[:en:documentation:pandorafms:installation:04_configuration#snmpconsole|the]] ''snmpconsole'' parameter on the Pandora FMS server. 
 + 
 +1. Pandora FMS サーバにおいて ''snmpconsole'' [[:ja:documentation:pandorafms:installation:04_configuration#snmpconsole|パラメータを有効化する必要があります]]。 
 + 
 +2. The logs configured on the Pandora FMS server must be the same as those generated in the independent call to **snmptrapd** 
 + 
 +2. Pandora FMS サーバで設定されるログは、**snmptrapd** を独立して管理する場合でも同じでなければいけません。 
 + 
 +3. The call to **snmptrapd** must have a specific format **since the call to the standard system daemon is invalid**. The call should be like this (the ''-A'' parameter is especially important): 
 + 
 +3. **snmptrapd** の呼び出しは特定のフォーマットである必要があり、**標準的なシステムからの呼び出しは利用できません** 。呼び出しは次のようにする必要があります(パラメータ ''-A'' はとても重要です)。 
 + 
 +<code> 
 + 
 +/usr/sbin/snmptrapd -A -t -On -n -a -Lf /var/log/pandora/pandora_snmptrap.log -p /var/run/pandora_snmptrapd.pid --format1=SNMPv1[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\n --format2=SNMPv2[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%b[**]%v\n 
 + 
 +</code> 
 + 
 +4. You must configure the token in the server configuration file: 
 + 
 +4. snmptrapd トークンが、Pandora FMS 設定ファイル内に設定されている必要があります。 
 + 
 +<code> 
 +snmp_trapd manual 
 + 
 +</code> 
 + 
 +5. この機能を有効化したら、次の手順を実施する必要があります。 
 + 
 +   * Change the configuration in ''/etc/pandora/pandora_server.conf''
 +   * Stop the Pandora FMS server. 
 +   * End the **snmptrapd** process. 
 +   * Start up**snmptrapd** manually (with the format indicated above). 
 +   * Start the Pandora FMS server. 
 + 
 +  * ''/etc/pandora/pandora_server.conf'' の設定を変更 
 +  * Pandora FMS サーバを停止 
 +  * **snmptrapd** プロセスが動作していないことを確認 (もし動いていたら、停止するまで待つか kill します) 
 +  * **snmptrapd** を手動で起動 (上記のフォーマットにて) 
 +  * Pandora FMS サーバを起動 
 + 
 +==== トラップログファイルの管理 ==== 
 + 
 +The snmptrapd process can be stopped and started without the need to stop and start the Pandora FMS server process, as long as the files ''pandora_snmptrap.log.index'' and ''pandora_snmptrap.log'' are not modified. If these files are modified, it is necessary to restart the Pandora FMS server. If you need to externally rotate the trap log, you must restart the Pandora FMS server after deleting the aforementioned files. 
 + 
 +''pandora_snmptrap.log.index'' および ''pandora_snmptrap.log'' が変更されていなければ、snmptrapd プロセスは、pandora サーバプロセスの停止および起動に依存せず、停止および起動することができます。これらのファイルに変更が加わっている場合は、pandora サーバの再起動が必要です。トラップのログファイルを外部でローテートする必要がある場合は、前述の 2つのファイルを削除したあとに pandora サーバを再起動する必要があります。 
 + 
 +===== SNMP トラップバッファリング ===== 
 + 
 +<WRAP center round important 60%> 
 + 
 +It is more efficient for the SNMP console to directly process traps from the **snmptrapd** log file. This configuration is recommended only if reliability or direct connectivity is a concern. 
 + 
 +</WRAP> 
 + 
 +<WRAP center round important 60%> 
 + 
 +SNMP コンソールが **snmptrapd** ログファイルからトラップを直接処理する方が効率的です。 この設定は、信頼性または直接接続に何らかの懸念がある場合にのみ推奨されます。 
 + 
 +</WRAP> 
 + 
 +If SNMP traps are sent to an external manager over an unreliable connection, some information will be lost. Pandora FMS allows you to instead forward traps from a local **snmptrapd** to your Pandora FMS server in a reliable way. 
 + 
 +SNMP トラップが信頼性の低い接続を介して外部マネージャに送信されると、一部の情報が失われます。 Pandora FMS では、ローカル **snmptrapd** からトラップを信頼できる方法で Pandora FMS サーバに転送できます。 
 + 
 +**Prerequisites**: 
 + 
 +**前提条件**: 
 + 
 +   * A local **snmptrapd** that is receiving traps. 
 +   * A local Pandora FMS agent. 
 +   * An installation of Pandora FMS. 
 + 
 +   * ローカルの **snmptrapd** がトラップを受信すること。 
 +   * ローカルの Pandora FMS エージェントがあること。 
 +   * Pandora FMS がインストールされていること。 
 + 
 + 
 + 
 + 
 +==== アーキテクチャ ==== 
 + 
 +{{ wiki: Remote snmp trap schema.jpg }} 
 + 
 + 
 +  * SNMP エージェントは、ローカルの //snmptrapd// にトラップを送信します。 
 +  * ローカルの Pandora FMS エージェントが //snmptrapd// のログファイルからトラップを読み取り、XML データファイルを用いて指定の Pandora FMS サーバへ送信します。それは XML バッファに保存され必要に応じてリトライされます。 
 +  * データサーバは、XML データファイルからトラップを読み込み、プレーンテキストファイルに展開します。 
 +  * SNMP コンソールは、プレーンテキストファイルからトラップを処理します。 
 + 
 + 
 + 
 + 
 +==== 設定 ==== 
 + 
 +=== snmptrapd === 
 + 
 +///etc/snmp/snmptrapd.conf// を編集し、Pandora FMS と互換性があるフォーマットでログをファイルに記録する設定になっているか確認します。(必要に応じてログファイル名を変更することができます) 
 + 
 +<code> 
 +[snmp] logOption f /var/log/snmptrapd.log 
 +format1 SNMPv1[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\n 
 +format2 SNMPv2[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%b[**]%v\n 
 +</code> 
 + 
 +== Pandora FMS エージェント == 
 +//snmptrapd// のログファイルからデータを読む Pandora FMS エージェントに付属の //grep_snmptrapd// プラグインを利用します。 
 + 
 +ローカルのエージェント設定ファイル ///etc/pandora/pandora_agent.conf// を編集し、必要に応じて //snmptrapd// のログファイルのパスを指定する次の行を追加します。 
 + 
 +  module_plugin grep_snmptrapd /var/log/snmptrapd.log 
 + 
 +=== Pandora FMS サーバ === 
 + 
 +SNMP コンソールが、データサーバにて書かれた外部ログファイルからトラップを処理するよに設定する必要があります。 
 + 
 +サーバ設定ファイル ///etc/pandora/pandora_server.conf// 編集し、次の設定をします。 
 + 
 +  * SNMP コンソールが有効であるか確認します。 
 + 
 +  snmpconsole 1 
 + 
 +  * データサーバが有効であるか確認します。 
 + 
 +  dataserver 1 
 + 
 +  * 外部 SNMP ログファイルを設定します。存在しない場合は、SNMP コンソールが作成します。 
 + 
 +  snmp_extlog /var/log/pandora/pandora_snmptrap.ext.log 
 + 
 +<WRAP center round important 60%> 
 + 
 +**snmp_extlog** には、Pandora FMS サーバが書き込むことができる任意のファイルを指定できますが、**snmp_logfile** (''/etc/pandora/pandora_agent.conf'' でも定義されています) とは異なるものである必要があります。 
 + 
 +</WRAP> 
 + 
 +===== トラップジェネレータ ===== 
 + 
 +This tool allows you to generate custom SNMP traps that you can later view in the SNMP console. It is accessed through the menu **Operation** → **SNMP** → **SNMP trap generator**. 
 + 
 +このツールを使用すると、後で SNMP コンソールで表示できるカスタム SNMP トラップを生成できます。 これには、メニュー **操作(Operation)** → **SNMP** → **SNMP トラップジェネレータ(SNMP trap generator)** からアクセスできます。 
 + 
 +In **SNMP Type** choose an SNMP type from the following options: 
 + 
 +**SNMP タイプ(SNMP Type)** で、次のオプションから SNMP タイプを選択します。 
 + 
 +   * **Cold Start**: Indicates that the agent has been started or restarted. 
 +   * **Warm Start**: Indicates that the agent configuration has been modified. 
 +   * **Link down**: Indicates that the communication interface is out of service (inactive). 
 +   * **Link up**: Indicates that a communication interface has been activated. 
 +   * **Authentication failure**: Indicates that the agent received a request from an unauthorized (community controlled) NMS. 
 +   * **EGP neighbor loss**: Indicates that on systems where routers use the EGP protocol, a nearby host is out of service. 
 +   * **Enterprise**: This category contains all new SNMP traps, including those from vendors. 
 + 
 +   * **Cold Start**: エージェントが開始または再開されたことを意味します。 
 +   * **Warm Start**: エージェント設定が変更されたことを意味します。 
 +   * **Link down**: 通信インタフェースが利用できない状態になった(無効化)ことを意味します。 
 +   * **Linu up**: 通信インタフェースが利用できる状態になったことを意味します。 
 +   * **Authentication failure**: エージェントが(コミュニティによって)認証できない NMS を受信したことを意味します。 
 +   * **EGP neighbor loss**: ルータが EGP プロトコルを使用しているシステムで、近くのホストが利用できない状態になったことを示します。 
 +   * **Enterprise**: ベンダトラップを含む、すべての新規トラップです。 
 + 
 +[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
 + 
 + 
 +===== (OBSOLETE) Pandora アラートとトラップの関係 / SNMP エージェントのトラップ転送 ===== 
 + 
 +トラップに定義されたアラートは、Pandora のアラートエンジンとは完全に独立しています。そのために、"温度が 29度に達したらアラート上げるといったことや、冗長化電源ダウンのトラップを受信したときにアラートを上げる" といったことがアラート管理からは設定できません。この種のアラートは、Pandora FMS のモジュールとは独立しており、トラップコンソールも、これらの要素に関連していません。 
 + 
 + 
 +//SNMP コンソールからフォワードされたトラップを含む、特殊な SNMP トラップモジュール//: 
 + 
 +{{ wiki:Snmptrap_agent.png }} 
 + 
 +これを解決するために、"エージェントへの SNMP トラップ転送(Agent SNMP Trap Forwarding)" という手法が存在します。このオプションは、トラップの発信元 IP アドレスが特定のエージェントのアドレスであった場合、トラップをそのエージェントの "SNMPTrap" という名前のモジュールへ文字列として転送します。この場合は常に、トラップはエージェントのモジュールにてテキストで受信します。モジュールは、最初のトラップを受信したときに定義されます。 
 + 
 +テキストのアラートは、通常のモジュールにおける標準的な方法で定義できます。これにより、別の発信元からのトラップを、それぞれ別のモジュールで扱うための SNMP モニタリングのカスタマイズが可能です。それにより、アラートの設定もそれぞれ可能になります。 
 + 
 + 
 +//SNMPトラップデータサンプル//: 
 + 
 +{{wiki:Snmptrapforward2.png}} 
 + 
 + 
 +これは、//エンタープライズ版//の機能です。次のように、メインの設定画面で有効にできます。 
 + 
 + 
 +//エージェントへのトラップフォワーディングを有効にするオプション設定//: 
 +{{ wiki:Snmptrap_agent_forwardsetup.png }} 
 + 
 +設定を変更したら、有効にするためには Pandora FMS サーバを再起動する必要があります。 
 + 
 +ほかには、エージェントのモジュールに、トラップを関連付ける手段もあります。例えば、トラップ受信で何らかのログファイルに "1" を書くようにし、それを読むモジュールを定義します。この方法により、想定したトラップを受信したときにモジュールの状態が変化するようになり、トラップの受信と関連付けることができます。 
 + 
 +===== (OBSOLETE) 外部 SNMP トラップハンドラ =====
  
 SNMP コンソールは、トラップを取得する目的のためだけに作られています。トラップは個々のアイテムとしてのみ処理されます。 1つのトラップは多くの情報を含むことができます。 SNMP コンソールは、トラップを取得する目的のためだけに作られています。トラップは個々のアイテムとしてのみ処理されます。 1つのトラップは多くの情報を含むことができます。
行 606: 行 887:
  
 {{  :wiki:snmp7.jpg?650  |snmp7.jpg}} {{  :wiki:snmp7.jpg?650  |snmp7.jpg}}
- 
- 
- 
-===== SNMP trap 転送 ===== 
- 
-Pandora FMS では、Pandora サーバの設定ファイルで[[:ja:documentation:02_installation:04_configuration#snmp_forward_trap|snmp_forward_trap]]トークンを有効にすることにより、SNMP trap を外部のホストへ転送することができます。 
- 
- 
-==== SNMP v1 を使った trap 転送設定例 ==== 
- 
-<code> 
- snmp_forward_trap 1 
- snmp_forward_ip 192.168.1.145 
- snmp_forward_version 1 
- snmp_forward_community public 
- snmp_forward_secName 
- snmp_forward_engineid 
- snmp_forward_authProtocol 
- snmp_forward_authPassword 
- snmp_forward_privProtocol 
- snmp_forward_privPassword 
- snmp_forward_secLevel 
-</code> 
- 
-==== SNMP v2c を使った trap 転送設定例 ==== 
- 
-<code> 
- snmp_forward_trap 1 
- snmp_forward_ip 192.168.1.145 
- snmp_forward_version 2c 
- snmp_forward_community public 
- snmp_forward_secName 
- snmp_forward_engineid 
- snmp_forward_authProtocol 
- snmp_forward_authPassword 
- snmp_forward_privProtocol 
- snmp_forward_privPassword 
- snmp_forward_secLevel 
-</code> 
- 
-==== SNMP v3 を使った trap 転送設定例 ==== 
- 
-この例は、SNMP v3 trap の知識が必要になるため特に難しいです。リモートの SNMP エージェントが[[:ja:documentation:02_installation:04_configuration#snmp_forward_ip|snmp_forward_ip]]で定義されており、次の設定が /etc/snmp/snmptrapd.conf ファイルに書かれていることを想定します。 
-<code> 
- 
-createUser -e 0x0102030405 myuser MD5 mypassword DES myotherpassword 
- 
-</code> 
- 
-Pandora サーバの設定ファイルは次のようになります。 
- 
-<code> 
- snmp_forward_trap 1 
- snmp_forward_ip 192.168.1.145 
- snmp_forward_version 3 
- snmp_forward_secName myuser 
- snmp_forward_engineid 0x0102030405 
- snmp_forward_authProtocol MD5 
- snmp_forward_authPassword mypassword 
- snmp_forward_privProtocol DES 
- snmp_forward_privPassword myotherpassword 
- snmp_forward_secLevel authNoPriv 
- 
-</code> 
- 
-より詳細は、 [[http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap_SNMPv3#SNMPv3_TRAPs|NET-SNMP's v3 Traps]]を参照してください。 
- 
- 
-===== snmptrapd デーモンの個別管理 ===== 
- 
-何らかの理由により、snmptrapd デーモンを Pandora FMS から独立して管理したい場合(Pandora FMS デーモンとは独立して停止・起動をしたい場合)は、いくつか考慮すべきことがあります。 
- 
-1. The ''snmpconsole'' [[:en:documentation:02_installation:04_configuration#snmpconsole|parameter must be active]] for Pandora FMS server. 
- 
-1. Pandora FMS サーバにおいて ''snmpconsole'' [[:ja:documentation:02_installation:04_configuration#snmpconsole|パラメータを有効化する必要があります]]。 
- 
-2. Pandora FMS サーバで設定されるログは、snmptrapd を独立して管理する場合でも同じでなければいけません。 
- 
-3. snmptrap の呼び出しは特定のフォーマットである必要があり、**標準的なシステムからの呼び出しは利用できません** 。呼び出しは次のようにする必要があります(パラメータ -A はとても重要です)。 
-<code> 
- 
-/usr/sbin/snmptrapd -A -t -On -n -a -Lf /var/log/pandora/pandora_snmptrap.log -p /var/run/pandora_snmptrapd.pid --format1=SNMPv1[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\n --format2=SNMPv2[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%b[**]%v\n 
- 
-</code> 
- 
-4. snmptrapd トークンが、Pandora FMS 設定ファイル内に設定されている必要があります。 
- 
-<code> 
-snmp_trapd manual 
- 
-</code> 
- 
-5. この機能を有効化したら、次の手順を実施する必要があります。 
- 
-  * /etc/pandora/pandora_server.conf の設定を変更 
-  * Pandora FMS サーバを停止 
-  * snmptrapd プロセスが動作していないことを確認 (もし動いていたら、停止するまで待つか kill します) 
-  * snmptrapd を手動で起動 (上記のフォーマットにて) 
-  * Pandora FMS サーバを起動 
- 
- 
-==== トラップログファイルの管理 ==== 
-//pandora_snmptrap.log.index// および //pandora_snmptrap.log// が変更されていなければ、snmptrapd プロセスは、pandora サーバプロセスの停止および起動に依存せず、停止および起動することができます。これらのファイルに変更が加わっている場合は、pandora サーバの再起動が必要です。トラップのログファイルを外部でローテートする必要がある場合は、前述の 2つのファイルを削除したあとに pandora サーバを再起動する必要があります。 
- 
-===== SNMP トラップバッファリング ===== 
- 
-SNMPトラップが信頼できない接続を介して外部マネージャに送信されると、情報が失われます。Pandora FMS では、トラップをローカルの //snmptrapd// からの転送ではなく、信頼できる方法で Pandora FMS サーバに転送することができます。 
- 
-==== アーキテクチャ ==== 
- 
-{{ wiki: Remote snmp trap schema.jpg }} 
- 
- 
-  * SNMP エージェントは、ローカルの //snmptrapd// にトラップを送信します。 
-  * ローカルの Pandora FMS エージェントが //snmptrapd// のログファイルからトラップを読み取り、XML データファイルを用いて指定の Pandora FMS サーバへ送信します。それは XML バッファに保存され必要に応じてリトライされます。 
-  * データサーバは、XML データファイルからトラップを読み込み、プレーンテキストファイルに展開します。 
-  * SNMP コンソールは、プレーンテキストファイルからトラップを処理します。 
- 
-<WRAP center round important 60%> 
-SNMPコンソールが //snmptrapd// のログファイルから直接トラップを処理する方が効率的です。この設定は、直接の接続や信頼性に不安がある場合にのみ利用します。 
-</WRAP> 
- 
-==== 前提条件 ==== 
- 
-  * ローカルの //snmptrapd// がトラップを受信すること。 
-  * ローカルの Pandora FMS エージェントがあること。 
-  * Pandora FMS がインストールされていること。 
- 
-==== 設定 ==== 
- 
-=== snmptrapd === 
- 
-///etc/snmp/snmptrapd.conf// を編集し、Pandora FMS と互換性があるフォーマットでログをファイルに記録する設定になっているか確認します。(必要に応じてログファイル名を変更することができます) 
- 
-<code> 
-[snmp] logOption f /var/log/snmptrapd.log 
-format1 SNMPv1[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\n 
-format2 SNMPv2[**]%4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%b[**]%v\n 
-</code> 
- 
-== Pandora FMS エージェント == 
-//snmptrapd// のログファイルからデータを読む Pandora FMS エージェントに付属の //grep_snmptrapd// プラグインを利用します。 
- 
-ローカルのエージェント設定ファイル ///etc/pandora/pandora_agent.conf// を編集し、必要に応じて //snmptrapd// のログファイルのパスを指定する次の行を追加します。 
- 
-  module_plugin grep_snmptrapd /var/log/snmptrapd.log 
- 
-=== Pandora FMS サーバ === 
- 
-SNMP コンソールが、データサーバにて書かれた外部ログファイルからトラップを処理するよに設定する必要があります。 
- 
-サーバ設定ファイル ///etc/pandora/pandora_server.conf// 編集し、次の設定をします。 
- 
-  * SNMP コンソールが有効であるか確認します。 
- 
-  snmpconsole 1 
- 
-  * データサーバが有効であるか確認します。 
- 
-  dataserver 1 
- 
-  * 外部 SNMP ログファイルを設定します。存在しない場合は、SNMP コンソールが作成します。 
- 
-  snmp_extlog /var/log/pandora/pandora_snmptrap.ext.log 
- 
-<WRAP center round important 60%> 
-//snmp_extlog// は、Pandora FMS サーバで書き込み可能な任意のファイルです。(同様に ///etc/pandora/pandora_agent.conf// で定義されている)//snmp_logfile// とは異なります。 
-</WRAP> 
- 
-===== トラップジェネレータ ===== 
- 
-このツールは、SNMP コンソールから参照できるトラップを生成します。 
- 
-{{  :wiki:generador_de_traps.png  }} 
- 
- 
-トラップジェネレータを正しく設定するには、次のフィールドを入力する必要があります。 
- 
-**ホストアドレス(Host Address)** 
- 
-トラップ送信先 IP アドレス。 
- 
-**コミュニティ(Community)** 
- 
-トラップジェネレータでアクセスするときの SNMP コミュニティ。 
- 
-**エンタープライズ文字列(Enterprise String)** 
- 
-トラップの OID です。例: 1.3.6.1.2.1.2.2.1.8 
- 
-**値(Value)** 
- 
-トラップで送信するデータであり、値です。 
- 
-**SNMP エージェント(SNMP Agent)** 
- 
-トラップをシミュレートするエージェントです。 
- 
-**SNMP タイプ (SNMP Type)** 
- 
-以下から SNMP タイプを選択します。 
- 
-    * **Cold Start**: エージェントが開始または再開されたことを意味します。 
-    * **Warm Start**: エージェント設定が変更されたことを意味します。 
-    * **Link down**: 通信インタフェースが利用できない状態になった(無効化)ことを意味します。 
-    * **Linu up**: 通信インタフェースが利用できる状態になったことを意味します。 
-    * **Authentication failure**: エージェントが(コミュニティによって)認証できない NMS を受信したことを意味します。 
-    * **EGP neighbor loss**: ルータが EGP プロトコルを使用しているシステムで、近くのホストが利用できない状態になったことを示します。 
-    * **Enterprise**: ベンダトラップを含む、すべての新規トラップです。 
- 
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
- 
- 
-===== (OBSOLETE) Pandora アラートとトラップの関係 / SNMP エージェントのトラップ転送 ===== 
- 
-トラップに定義されたアラートは、Pandora のアラートエンジンとは完全に独立しています。そのために、"温度が 29度に達したらアラート上げるといったことや、冗長化電源ダウンのトラップを受信したときにアラートを上げる" といったことがアラート管理からは設定できません。この種のアラートは、Pandora FMS のモジュールとは独立しており、トラップコンソールも、これらの要素に関連していません。 
- 
- 
-//SNMP コンソールからフォワードされたトラップを含む、特殊な SNMP トラップモジュール//: 
- 
-{{ wiki:Snmptrap_agent.png }} 
- 
-これを解決するために、"エージェントへの SNMP トラップ転送(Agent SNMP Trap Forwarding)" という手法が存在します。このオプションは、トラップの発信元 IP アドレスが特定のエージェントのアドレスであった場合、トラップをそのエージェントの "SNMPTrap" という名前のモジュールへ文字列として転送します。この場合は常に、トラップはエージェントのモジュールにてテキストで受信します。モジュールは、最初のトラップを受信したときに定義されます。 
- 
-テキストのアラートは、通常のモジュールにおける標準的な方法で定義できます。これにより、別の発信元からのトラップを、それぞれ別のモジュールで扱うための SNMP モニタリングのカスタマイズが可能です。それにより、アラートの設定もそれぞれ可能になります。 
- 
- 
-//SNMPトラップデータサンプル//: 
- 
-{{wiki:Snmptrapforward2.png}} 
- 
- 
-これは、//エンタープライズ版//の機能です。次のように、メインの設定画面で有効にできます。 
- 
- 
-//エージェントへのトラップフォワーディングを有効にするオプション設定//: 
-{{ wiki:Snmptrap_agent_forwardsetup.png }} 
- 
-設定を変更したら、有効にするためには Pandora FMS サーバを再起動する必要があります。 
- 
-ほかには、エージェントのモジュールに、トラップを関連付ける手段もあります。例えば、トラップ受信で何らかのログファイルに "1" を書くようにし、それを読むモジュールを定義します。この方法により、想定したトラップを受信したときにモジュールの状態が変化するようになり、トラップの受信と関連付けることができます。 
  
  • ja/documentation/pandorafms/monitoring/08_snmp_traps_monitoring.1708505439.txt.gz
  • 最終更新: 2024/02/21 08:50
  • by junichi