ja:documentation:05_big_environments:04_netflow

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
ja:documentation:05_big_environments:04_netflow [2022/10/28 22:23] – [fprobe のインストール] junichija:documentation:05_big_environments:04_netflow [2023/05/12 06:25] – [設定] junichi
行 1: 行 1:
-====== Netflow によるネットワークトラフィック監視 ====== +====== Netflow および sFlow によるネットワークトラフィック監視 ====== 
 {{indexmenu_n>4}} {{indexmenu_n>4}}
  
行 232: 行 232:
 **Rocky Linux 8** **Rocky Linux 8**
  
-Install dependencies:+Install dependencies with administrator rights:
  
-依存ファイルのインストール。+依存ファイルの管理者権限でのインストール。
  
 <code> <code>
  
-dnf groupinstall 'Development Tools' +dnf config-manager --set-enabled powertools 
-dnf install libpcap libpcap-devel+dnf groupinstall 'Development Tools' 
 +dnf install libpcap libpcap-devel
  
 </code> </code>
  
-Download **pmacct** source code (you may use wget instead curl) and build it:+Download **pmacct** source code (you may use **curl** instead of **wget**) and build it:
  
-**pmacct** のソースをダウンロード(curl の代わりに wget も使えます)してビルドします。+**pmacct** のソースをダウンロード(**wget** の代わりに **curl** も使えます)してビルドします。
  
 <code> <code>
-# curl -O https://github.com/pmacct/pmacct/releases/download/v1.7.7/pmacct-1.7.7.tar.gz # (or get newest one) +cd /tmp 
-tar xvzf pmacct-1.7.7.tar.gz +wget -O pmacct-1.7.7.tar.gz "https://github.com/pmacct/pmacct/releases/download/v1.7.7/pmacct-1.7.7.tar.gz" 
-cd pmacct-1.7.7 +tar xvzf pmacct-1.7.7.tar.gz 
-./autogen.sh +cd pmacct-1.7.7 
-./configure +./autogen.sh 
-make && make install+./configure 
 +make && make install
  
 </code> </code>
行 264: 行 266:
  
    * **pmacct** 設定の作成:    * **pmacct** 設定の作成:
 +
 +For instance, all ''eth0''  interface traffic will be sent to the NetFlow collector listening on port ''9995''  of the IP address ''192.168.70.185'':
 +
 +例では、すべての ''eth0'' インターフェイストラフィックが、IP アドレス ''192.168.70.185'' のポート ''9995'' で待ち受けている NetFlow コレクタに送信されます。
  
 <code> <code>
-cat> pmacctd_probe.conf <<EOF+cat> pmacctd_probe.conf <<EOF
 daemonize: true daemonize: true
-pcap_interface: ens192 (← set correct interface name)+pcap_interface: eth0
 aggregate: src_host, dst_host, src_port, dst_port, proto, tos aggregate: src_host, dst_host, src_port, dst_port, proto, tos
 plugins: nfprobe plugins: nfprobe
-nfprobe_receiver: 127.0.0.1:9995 (← set appropriate ndcapd server)+nfprobe_receiver: 192.168.70.185:9995
 nfprobe_version: 9 nfprobe_version: 9
 EOF EOF
行 288: 行 294:
  
 ==== Pandora FMS における Netflow の動作 ==== ==== Pandora FMS における Netflow の動作 ====
-Pandora FMS は、補助システムとしての Netflow と連動します。つまり、データベースに NetFlow データを保存しません。 Pandora FMS は、その情報をオンデマンドでレポートとして表示します。 
  
-Pandora FMS は、//フィルタ// を使って Netflow データを処理します。フィルタは、通信パターンにマッチするルールのセットです。ルールは、'サブネット 192.168.70.0/24 からの通信すべてといったように簡単です。また、pcap の書式も利用できます。+Pandora FMS works along with Netflow as an auxiliary system, that means** it does not store NetFlow data in its database**. Pandora FMS shows that information as reports on demand. 
 + 
 +Pandora FMS は、補助システムとしての Netflow と連動します。つまり、**データベースに NetFlow データを保存しません**。 Pandora FMS は、その情報をオンデマンドでレポートとして表示します。 
 + 
 +Pandora FMS works with NetFlow data by using filters, which are sets of rules that match certain traffic patterns. A rule can be as simple as 'all the traffic from 192.168.70.0/24 network' or a complex **pcap **filter expression. 
 + 
 +Pandora FMS は、フィルタを使って Netflow データを処理します。フィルタは、通信パターンにマッチするルールのセットです。ルールは、'all the traffic from 192.168.70.0/24 network'(サブネット 192.168.70.0/24 からの通信すべてといったように簡単です。また、**pcap** フィルタ書式も利用できます。
  
 フィルタを作成したら、フィルタにマッチした情報をどのように表示するか(グラフや表)および時間範囲をレポートで定義する必要があります。Netflow レポートは、他の Pandora FMS レポートと同様にオンデマンドでのアクセスです。 フィルタを作成したら、フィルタにマッチした情報をどのように表示するか(グラフや表)および時間範囲をレポートで定義する必要があります。Netflow レポートは、他の Pandora FMS レポートと同様にオンデマンドでのアクセスです。
行 304: 行 315:
 <WRAP center round important 60%> Netflow データが保存されるハードディスクアクセス速度は、通常、パフォーマンスに関わる重要な要素です。</WRAP> <WRAP center round important 60%> Netflow データが保存されるハードディスクアクセス速度は、通常、パフォーマンスに関わる重要な要素です。</WRAP>
  
-まず最初に、Netflow を操作(Operation)およびシステム管理(Administration)メニューからアクセスできるようにする必要があります。設定画面(管理メニュー)に、Netflow を有効化・無効化するオプションがあります。+First of all, enable NetFlow in order for it to become accessible from the **Operation** and **Administration **menus. In the **Configuration** section (**Management** menu) there is an option for enabling or disabling Netflow globally. 
 + 
 +まず最初に、Netflow を **操作(Operation)** および **システム管理(Administration)** メニューからアクセスできるようにする必要があります。設定画面(**管理**メニュー)に、Netflow を有効化・無効化するオプションがあります。 
 + 
 +**For version 769 and earlier:** 
 + 
 +**バージョン 769 およびそれ以前:** 
 + 
 +{{  :wiki:netflow1.png  |Version 769 and earlier}} 
 + 
 +**For version 770 and later:** 
 + 
 +**バージョン 770 およびそれ以降:** 
 + 
 +{{  :wiki:pfms-general_setup-netflow_config-general_network_path.png  |Version 770 and later}}
  
-{{  :wiki:netflow1.png  }}+Once activated, a new NetFlow configuration option will appear in the setup section.
  
 有効化すると、新たに Netflow 設定オプションが表示されます。 有効化すると、新たに Netflow 設定オプションが表示されます。
  
-{{  :wiki:netflow2.png  }}+**For version 769 and earlier:**
  
-ここでは、nfcapd デーモンが Pandora FMS サーバと同時に起動するように正しく設定する必要があります。+**バージョン 769 およびそれ以前:** 
 + 
 +{{  :wiki:netflow2.png  |Version 769 and earlier}} 
 + 
 +**For version 770 and later:** 
 + 
 +**バージョン 770 およびそれ以降:** 
 + 
 +{{  :wiki:pfms-netflow_config.png  |Version 770 and later}} 
 + 
 +This section must be correctly configured so that the **nfcapd **daemon may be started together with the Pandora FMS server: 
 + 
 +ここでは、**nfcapd** デーモンが Pandora FMS サーバと同時に起動するように正しく設定する必要があります。
  
    * **Data storage path:**  The directory where NetFlow data files are stored.    * **Data storage path:**  The directory where NetFlow data files are stored.
-  * **Daemon interval:**  Time interval in seconds for data rotation. The recommended value is '3600'. A wider interval means potentially bigger files, which means less I/O overhead, but it also renders accessing data for a specific time interval slower+      //For version 769 and earlier// enter the full path. 
-  * **Daemon binary path:**  The path to the //nfcapd//  binary. +      //For version 770 and later//  only the directory name, by default ''netflow''  (see [[:en:documentation:04_using:12_console_setup#general_setup|General Setup]])
-  * **Nfdump binary path:**  The path to the //nfdump//  binary. +  * **Daemon binary path:**  The path to the **nfcapd **binary. 
-  * **Nfexpire binary path:**  The path to the //nfexpire//  binary.+  * **Nfdump binary path:**  The path to the **nfdump**  binary. 
 +  * **Nfexpire binary path:**  The path to the **nfexpire **binary.
   * **Maximum chart resolution:**  The maximum number of points displayed by a NetFlow area chart. The higher the resolution, the lower the performance. Values between '50' and '100' are recommended here.   * **Maximum chart resolution:**  The maximum number of points displayed by a NetFlow area chart. The higher the resolution, the lower the performance. Values between '50' and '100' are recommended here.
-  * **Disable custom live view filters:**  Disables defining custom filters from Netflow view (only for previously created filters). +  * **Disable custom live view filters:**  It disables defining custom filters from the NetFlow view (only for previously created filters). 
-  * **Netflow max. lifespan:**  Maximum number of days Netflow data will be stored before being deleted. +  * **NetFlow max. lifespan:**  Maximum number of days NetFlow data will be stored before being deleted. 
-  * **Enable IP address name resolution:**  Il allows IP resolution to try to retrieve the hostnames form Netflow devices. +  * **Enable IP address name resolution:**  Il allows IP resolution to try to retrieve the hostnames from NetFlow devices. 
 +  * **Daemon interval:**  (//NG 769 version or earlier//) Time interval in seconds for data rotation. The recommended value is '3600'. A wider interval means potentially bigger files, which means less I/O overhead, but it also renders accessing data for a specific time interval slower.
  
   * **データ保存パス(Data storage path):** Netflow データが保存されるディレクトリです。   * **データ保存パス(Data storage path):** Netflow データが保存されるディレクトリです。
-  **デ間隔(Daemon interval):** データァイルをローテートする時間間隔(秒)です。3600を推奨します。間隔を大きくすると大きなファイルとなり、I/O のオーバーヘッド小さくなりますが特定の時間間隔におけるータ検索は遅くなります。 +      //バジョン 769 およびそれ以前//では、フルパス入力します。 
-  * **デーモンバイナリパス(Daemon binary path):**  //nfcapd// バイナリのパスです。 +      * //バージョン 770 およびそれ以降//は、ディレクトリ名みを入力します。デフォルトは ''netflow'' です。([[:ja:documentation:04_using:12_console_setup#一般設定|一般設定]]を参照) 
-  * **Nfdump バイナリパス(Nfdump binary path):** //nfdump// バイナリのパスです。 +  * **デーモンバイナリパス(Daemon binary path):**  **nfcapd** バイナリのパスです。 
-  * **Nfexpire バイナリパス(Nfexpire binary path):** //nfexpire// バイナリのパスです。+  * **Nfdump バイナリパス(Nfdump binary path):** **nfdump** バイナリのパスです。 
 +  * **Nfexpire バイナリパス(Nfexpire binary path):** **nfexpire** バイナリのパスです。
   * **最大グラフ解像度(Maximum chart resolution):** Netflow グラフを表示するエリアの最大サイズです。解像度を高くするとパフォーマンスが下がります。50 と 100 の間の値をお勧めします。   * **最大グラフ解像度(Maximum chart resolution):** Netflow グラフを表示するエリアの最大サイズです。解像度を高くするとパフォーマンスが下がります。50 と 100 の間の値をお勧めします。
   * **ライブビューカスタムフィルタの無効化(Disable custom live view filters):** 有効にすると、管理者によってあらかじめ作成された Netflow フィルタのみが Netflow ライブビューで利用できます。   * **ライブビューカスタムフィルタの無効化(Disable custom live view filters):** 有効にすると、管理者によってあらかじめ作成された Netflow フィルタのみが Netflow ライブビューで利用できます。
   * **Netflow 最大保存期間(Netflow max lifespan):** 指定した日数よりも古い Netflow データが削除されます。   * **Netflow 最大保存期間(Netflow max lifespan):** 指定した日数よりも古い Netflow データが削除されます。
   * **IP アドレス名前解決の有効化(Enable IP address name resolution):** Netflow デバイスから IP アドレスの名前解決をするようにします。   * **IP アドレス名前解決の有効化(Enable IP address name resolution):** Netflow デバイスから IP アドレスの名前解決をするようにします。
 +  * **デーモン間隔(Daemon interval):** (//バージョン NG 769 およびそれ以前//) データファイルをローテートする時間間隔(秒)です。3600を推奨します。間隔を大きくすると大きなファイルとなり、I/O のオーバーヘッドは小さくなりますが、特定の時間間隔におけるデータの検索は遅くなります。
  
-netflow 設定を有効にした場合、//nfcapd// サーバを起動するために Pandora FMS サーバを再起動する必要があります。このサーバは、システムからアクセスできるパスにインストールされている必要があります。動作に関して疑問点があればサーバログを確認してください。+<WRAP center round tip 90%>
  
-<WRAP center round tip 60%> このサーバは、Pandora FMS サーバではないため、サーバ表示には現れません。 </WRAP>+//Version 770 or later:// 
 + 
 +In case you need to change the default value of the **Daemon interval**  you should perform the following: 
 + 
 +  * Through a command line session or through the [[:en:documentation:04_using:11_managing_and_administration|DB Interface]] modify the value, in seconds, of the ''netflow_interval''  token, for example to change it to 300 seconds: ''UPDATE tconfig SET value = '300' where token = 'netflow_interval'''; 
 +  * [[:en:documentation:05_big_environments:07_server_management#manual_startupshutdown_for_pandora_fms_servers|Stop the PFMS server]]. 
 +  * Open a terminal window and delete the data generated with the above interval with ''rm -i /var/spool/pandora/data_in/netflow'' 
 +  * Start the PFMS server. 
 + 
 +</WRAP> 
 + 
 +<WRAP center round tip 90%> 
 + 
 +//バージョン 770 以降// 
 + 
 +**デーモン間隔(Daemon interval)** のデフォルト値を変更する必要がある場合は、次の手順を実行する必要があります。 
 + 
 +  * コマンドラインまたは [[:ja:documentation:04_using:11_managing_and_administration|DB インターフェイス]] を使用して、''netflow_interval'' トークンの値を秒単位で変更します。たとえば、300 秒に変更するには、''UPDATE tconfig SET value = '300' where token = 'netflow_interval';'' です。 
 +  * [[:ja:documentation:05_big_environments:07_server_management#pandora_fms_サーバの手動起動停止|Pandora FMS サーバを停止]]します。 
 +  * ターミナル画面を開き、上記の間隔で生成されたデータを ''rm -i /var/spool/pandora/data_in/netflow'' で削除します。 
 +  * Pandora FMS サーバを起動します。 
 + 
 +</WRAP> 
 + 
 +Once NetFlow is configured in the console, restart Pandora FMS Server so that it starts the **nfcapd **server. This server must be properly installed before trying to run it. Check server logs in case of doubt. 
 + 
 +netflow 設定を有効にした場合、**nfcapd** サーバを起動するために Pandora FMS サーバを再起動する必要があります。このサーバは、システムからアクセスできるパスにインストールされている必要があります。動作に関して疑問点があればサーバログを確認してください。 
 + 
 +<WRAP center round tip 75%> 
 + 
 +**Version 769 and earlier:**  The NetFlow server will not appear as a server in the Pandora FMS servers view, since it is not a Pandora FMS server. From version 770 onwards **it does appear in the list**. 
 + 
 +</WRAP> 
 + 
 +<WRAP center round tip 75%> 
 + 
 +**バージョン 769 およびそれ以前:** このサーバは、**Pandora FMS サーバではないため**、サーバ表示には現れません。バージョン 770 以降では、**一覧に表示されます**。 
 + 
 +</WRAP>
  
 <WRAP center round info 95%>If you decide to store the NetFlow data **on a device other than the PFMS server**  ([[:en:documentation:05_big_environments:04_netflow#nfcapd_installation|see nfcapd installation procedure]] and the [[:en:documentation:05_big_environments:04_netflow#distributed_configuration|distributed configuration]]) you must copy the binary file ''/usr/bin/nfexpire''  to that device and add the following entry in ''/etc/crontab'': <WRAP center round info 95%>If you decide to store the NetFlow data **on a device other than the PFMS server**  ([[:en:documentation:05_big_environments:04_netflow#nfcapd_installation|see nfcapd installation procedure]] and the [[:en:documentation:05_big_environments:04_netflow#distributed_configuration|distributed configuration]]) you must copy the binary file ''/usr/bin/nfexpire''  to that device and add the following entry in ''/etc/crontab'':
 <file> <file>
  
-0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_dias d+0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_days d
  
 </file> </file>
行 351: 行 429:
 <file> <file>
  
-0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_dias d+0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_days d
  
 </file> </file>
行 357: 行 435:
 ここで、''x_dias'' は、デバイスに残す NetFlow データの最大日数です(//Pandora FMS コンソールの設定とは関係ありません//)。</WRAP> ここで、''x_dias'' は、デバイスに残す NetFlow データの最大日数です(//Pandora FMS コンソールの設定とは関係ありません//)。</WRAP>
 ==== フィルタ ==== ==== フィルタ ====
-リソース(Resources) > NetFlow フィルタ(NetFlow Filters) をクリックすることにより、作成および編集ができます。ここでは作成済のフィルタ一覧が表示され、変更したり削除したりできます。 
  
 +You may access the creation and edition of filters by clicking on **Ressources** -> **NetFlow Filters**.
  
-{{ wiki:Netflow3.png }}+**リソース(Resources)** > **NetFlow フィルタ(NetFlow Filters)** をクリックすることにより、作成および編集ができます。
  
 +{{  :wiki:pfms-resources-netflow_filters-menu.png  }}
  
 +This section contains a list of already created filters which can be modified or deleted.
  
 +ここには、変更または削除できる作成済みのフィルタの一覧が表示されます。
 +
 +{{ wiki:Netflow3.png }}
  
 "Netflow ライブビュー" からも直接フィルタを作成でき、アクティブフィルタを新規保存することもできます。 Netflow フィルタには "基本" または "高度" があります。違いは、前者はフィルタリングフィールド(送信元IP、送信先IP、送信元ポート、送信先ポート)を固定し、高度な方は //pcap// (ネットワークトラフィックのフィルタリングを標準入力にて)および関連ツールを用います。 "Netflow ライブビュー" からも直接フィルタを作成でき、アクティブフィルタを新規保存することもできます。 Netflow フィルタには "基本" または "高度" があります。違いは、前者はフィルタリングフィールド(送信元IP、送信先IP、送信元ポート、送信先ポート)を固定し、高度な方は //pcap// (ネットワークトラフィックのフィルタリングを標準入力にて)および関連ツールを用います。
行 597: 行 680:
  
   nfdump: Version: 1.6.13   nfdump: Version: 1.6.13
 +
 +===== sFlow でのネットワーク監視 =====
 +
 +<WRAP center round info 60%>
 +
 +NG 770 version or later.
 +
 +</WRAP>
 +
 +<WRAP center round info 60%>
 +
 +バージョン NG 770 以降
 +
 +</WRAP>
 +
 +From Pandora FMS version 770 onwards, support for [[http://sflow.org/about/index.php|sFlow]], a network protocol which is an industry standard in hardware manufacturing for data network traffic, is included.
 +
 +Pandora FMS バージョン 770 以降では、[[http://sflow.org/about/index.php|sFlow]] のサポートが含まれています。[[http://sflow.org/about/index.php|sFlow]] は、データネットワークトラフィック用のハードウェアにおける業界標準のネットワークプロトコルです。
 +
 +The operation of sFlow in PFMS is [[:en:documentation:05_big_environments:04_netflow#netflow_network_monitoring|similar to the one established with NetFlow]]. In case both protocols are active, **the data will be grouped together**; in any case they will always be displayed by accessing the **Operation**  menu in the left sidebar, and then clicking on **Network**.
 +
 +Pandora FMS での sFlow の動作は [[:ja:documentation:05_big_environments:04_netflow#netflow_ネットワーク監視|NetFlow で確立しているものと同様]] です。 両方のプロトコルが有効な場合、**データはグループ化されます**。いずれの場合も、左側のサイドバーの **操作(Operation)** メニューにアクセスし、**ネットワーク(Network)** をクリックすると、常に表示されます。
 +
 +==== sFlow 設定 ====
 +
 +<WRAP center round info 60%>
 +
 +NG 770 version or later.
 +
 +</WRAP>
 +
 +<WRAP center round info 60%>
 +
 +バージョン NG 770 以降
 +
 +</WRAP>
 +
 +You must enable sFlow to be accessible from the Operation and Management menus. Under **Setup**  → **Setup**  → **General**  (**Management**  menu) there is an option to enable or disable sFlow globally.
 +
 +操作メニューと管理メニューからアクセスできるように、sFlow を有効化する必要があります。 **セットアップ(Setup)** → **セットアップ(Setup)** → **基本設定(General)** (**管理(Management)** メニュー) の下に、sFlow をグローバルに有効または無効にするオプションがあります。
 +
 +{{  :wiki:pfms-general_setup-sflow_config.png  }}
 +
 +Once you have activated sFlow, configure **General network path**  (General path for the network shared with NetFlow), by default:
 +
 +sFlow を有効化したら、**一般的なネットワークパス** (NetFlow と共有されるネットワークの一般的なパス) を設定します。デフォルトは次の通りです。
 +
 +<file>
 +
 +/var/spool/pandora/data_in/
 +
 +</file>
 +
 +{{  :wiki:pfms-general_setup-sflow_config-general_network_path.png  }}
 +
 +A new tab will be enabled specifically for sFlow:
 +
 +sFlow 専用の新しいタブが有効になります。
 +
 +{{  :wiki:pfms-sflow_config.png  }}
 +
 +  * **Data storage path**: Directory where the sFlow data files are to be stored (see [[:en:documentation:04_using:12_console_setup#general_setup|General Setup]]).
 +  * **Daemon binary path**:  Path to the binary of **nfcapd**.
 +  * **Nfdump binary path**:  Path to the binary of **nfdump**.
 +  * **Nfexpire binary path**:  Path to the binary of **nfexpire**.
 +  * **Maximum chart resolution**: Maximum number of points an sFlow area plot will display. The higher the resolution, the worse the performance. Values between 50 and 100 are recommended.
 +  * **Disable custom live view filters**: Disables the definition of custom filters from the sFlow view (filters that are already created can still be used).
 +  * **sFlow max lifetime**: Indicates the maximum time in days of sFlow data to be stored.
 +  * **Enable IP address name resolution**: Enables IP address resolution to try to obtain the hostnames of sFlow devices.
 +
 +  * **データ保存パス(Data storage path)**: sFlow データファイルが保存されるディレクトリ。([[:ja:documentation:04_using:12_console_setup#一般設定|一般設定]]を参照)
 +  * **デーモンバイナリパス(Daemon binary path)**: **nfcapd** のバイナリのパス。
 +  * **nfdump バイナリパス(Nfdump binary path)**: **nfdump** のバイナリのパス。
 +  * **nfexpire バイナリパス(Nfexpire binary path)**: **nfexpire** のバイナリのパス。
 +  * **最大グラフ解像度(Maximum chart resolution)**: sFlow グラフが表示するポイントの最大数。解像度が高くなるほどパフォーマンスが低下します。 50 から 100 の間の値をお勧めします。
 +  * **カスタムライブビューフィルタ無効化(Disable custom live view filters)**: sFlow 表示のカスタムフィルターの定義を無効にします (既に作成されているフィルターは引き続き使用できます)。
 +  * **sFlow 最大保存期間(sFlow max lifetime)**: sFlow データを保存する最大日数を示します。
 +  * **IP アドレス名前解決の有効化(Enable IP address name resolution)**: sFlow デバイスのホスト名を取得するための IP アドレス名前解決を有効にします。
  
 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]