ja:documentation:pandorafms:monitoring:18_netflow

Netflow および sFlow によるネットワークトラフィック監視

Pandora FMS はリアルタイムでネットワークを分析するために、Pandora NTA と Netflow の 2つの異なるシステムを使用します。どちらのシステムもイーサネットを連続的に リスニング し、トラフィックを分析して統計を生成するという同じ手法を用います。どちらの場合も、何らかの方法でネットワークトラフィックを “傍受” してそれを分析するプローブに送信し、その結果を Pandora FMS に送信することが必要です。

ネットワークトラフィックを傍受して分析できるようにするには、ネットワークのキャプチャポイントを適切に判断する必要があるため、そのネットワークに物理的に確認するか、少なくともそのトポロジを理解する必要があります。たとえば、ルータまたはローカルAPのネットワークトラフィックをキャプチャすることは、ルータに到達する前のサーバのすべてのネットワークトラフィックをキャプチャするのとは同じではありません。

To capture such data, traffic must be redirected from one port of the switch to another port using a “port-mirror”. Not all network devices allow this (only mid/high range). A port-mirror can also be made on some commercial firewalls. This is the easiest way to intercept traffic and requires no additional hardware. By sending all traffic to a port, that port is connected directly to the network analyzer (netflow probe).

トラフィックをキャプチャするには、ポートミラーリングを使用して、スイッチのあるポートから別のポートにトラフィックを再送信します。すべてのネットワークデバイスが対応しているわけではありません(中価格帯以上のみ)。いくつかの商用ファイアーウォールでもポートミラーはできます。これはトラフィックを傍受する最も簡単な方法であり、追加のハードウェアを必要としません。すべてのトラフィックを特定のポートに送信するので、そのポートはネットワークアナライザ(netflow probe)を直接接続します。

These high-end switches and/or firewalls make monitoring easier. This is due to the fact that these devices send the network flow statistical information directly to Pandora FMS's Netflow collector without the need of using a separate probe. You should consult the characteristics of the hardware to know if you can enable Netflow and send the flows to an independent Netflow collector (in this case, the Pandora FMS Netflow collector).

ハイエンドスイッチやファイアウォールでは監視が容易になります。

それは、これらのデバイスが、個別のプローブを使用せずに、ネットワークフロー統計情報を Pandora FMS の Netflow コレクターに直接送信するためです。

ハードウェアの機能を調べて、Netflow を有効にし、フローを独立したNetflow コレクター(この場合は Pandora FMS Netflow コレクター)に送信できるかどうかを確認する必要があります。

バージョン 5.0 の Pandora FMS から、NetFlow プロトコルを使って IP 通信をモニターできます。通信のパターンおよび全体のデータを見ることができ、とても便利です。

Netflow は、Cisco Systems により開発された IP 通信の情報を収集するためのネットワークプロトコルです。Netflow はネットワークトラフィックモニタリングの業界標準になっており、現在では Cisco IOS および NXOS、Juniper デバイス、Enterasys Switches、そして Linux, FreeBSD, NetBSD, OpenBSD といった OS など複数のプラットフォームでサポートされています。

Netflow に関する詳細は、我々の blog https://blog.pandorafms.org/what-is-netflow/ を参照してください。

NetFlow

Netflow に対応したデバイス(netflowプローブ)は、情報の小さなかたまりで構成される netflow レコードを生成します。それは中央デバイスまたは netflow サーバ(netflowコレクタ)へ送信され、情報が保存、処理されます。

データは、UDP または SCTP にて Netflow プロトコルにより送信されます。netflow レコードは小さなパケットで、流れている全通信内容ではなく、接続に関する統計情報のみを含んでいます。

オリジナルの仕様から異なり追加情報を含んだいくつかの Netflow 実装がありますが、ほとんどの場合少なくとも次の情報を含んでいます。 Netflow はさまざまな方法で説明されていますが、Cisco の従来の定義では 7要素キーを使用しています。フローは、次の 7つの値を共有する一方向のパケットシーケンスとして定義されています。

  • 発信元 IP アドレス
  • 宛先 IP アドレス
  • 発信元 UDP または TCP ポート
  • 宛先 UDP または TCP ポート
  • IP プロトコル
  • インタフェース (SNMP ifIndex)
  • サービスのタイプ

いくつかのベンダでは、異なる名前で似たようなプロトコルを定義していますが、目的は同じです。

  • Juniper Networks の Jflow または cflowd
  • 3Com/H3C|HP の NetStream
  • Huawei の NetStream
  • Alcatel Lucent の Cflowd
  • Ericsson の Rflow
  • AppFlow
  • sFlow

Netflow コレクタ

Netflow コレクタは、ルータやスイッチから送られた全ての Netflow 情報を収集するためにネットワーク上に置かれたデバイス(PCやサーバ)です。

Netflow サーバは、データを受け取り保存するために必要です。Pandora FMS は、この目的に nfcapd を利用しています。Pandora FMS が Netflow データを処理できるようにするには、これをインストールする必要があります。Pandora FMS は、必要なときに自動的にこのサーバを起動・停止します。

Netflow プローブ

プローブは、通常 Netflow に対応したルータで、Netflow データを Netflow コレクタ (我々の場合、nfcapd が動いている Pandora FMS サーバです) に送信するように設定されたものです。

我々の blog に、RaspBerry Pi を使った Netflow プローブの作り方を載せています。 https://pandorafms.com/blog/netflow-probe-using-raspberry/ を参照ください。

Pandora FMS uses an open-source tool called nfcapd (that belongs to the nfdump package) to process all NetFlow traffic. This daemon is automatically started by the Pandora FMS Server. This system stores data in binary files at a specific location. You must install nfcapd on your system before working with NetFlow in Pandora FMS.

Pandora FMS は、全ての netflow 通信を処理するためにオープンソースのツールである nfcapd (nfdump パッケージに含まれています) を利用します。このデーモンは、Pandora FMS サーバにより自動的に起動されます。このシステムは、データを特定の場所のバイナリファイルに保存します。Netflow を使うには、nfcapd をインストールする必要があります。

Daemon nfcapd listens on port 9995/UDP by default, so keep it in mind if you have firewalls to open this port and when configuring NetFlow probes.

デーモン nfcapd のデフォルトの待ち受けポートは 9995/UDP です。ファイアーウォールがある場合は、このポートを開ける必要があることに注意してください。

nfcapd のインストール

nfcapd は、手動でインストールする必要があります。Pandora FMS 自身は nfcapd をインストールしません。インストール方法の詳細は、nfcapd プロジェクトの公式ページを参照してください。

Pandora FMS はデフォルトで、Netflow データを保存するのに /var/spool/pandora/data_in/netflow ディレクトリを利用します。Pandora FMS サーバによって起動されるときに、nfcapd にこのディレクトリが指定されます。何を行っているかがわからない場合は、変更しないでください。

Pandora FMS では、Netflow データを処理するのに nfdump バージョン 1.6.8p1 が必要です。

'nfcapd' が正しくインストールできたか確認するには、以下のようにコマンドを実行してプロセスを起動します。

nfcapd -l /var/spool/pandora/data_in/netflow -D

すべて正しく動作していれば、以下のような出力が見られます。

Add extension: 2 byte input/output interface index
Add extension: 4 byte input/output interface index
Add extension: 2 byte src/dst AS number
Add extension: 4 byte src/dst AS number
Add extension: 4 byte output bytes
Add extension: 8 byte output bytes
Add extension: NSEL Common block
Add extension: NSEL xlate ports
Add extension: NSEL xlate IPv4 addr
Add extension: NSEL xlate IPv6 addr
Add extension: NSEL ACL ingress/egress acl ID
Add extension: NSEL username
Add extension: NSEL max username
Add extension: NEL Common block
Bound to IPv4 host/IP: any, Port: 9995
Startup.
Init IPFIX: Max number of IPFIX tags: 62

Pandora FMS コンソール(具体的には、それを実行する Web サーバ)がデータにアクセスできる必要があることに注意してください。 この例では、'/var/spool/pandora/data_in/netflow' です。

Netflow プローブのインストール

Netflow に対応したルータが無く、Linux サーバをルータとして利用している場合は、netflow 情報を Netflow サーバへ送信するソフトウエアの Netflow プローブをインストールできます。

fprobe のインストール

fprobe captures traffic and sends it to a NetFlow Server. You may generate NetFlow traffic with it, among all the traffic that goes through its interfaces.

fprobe がトラフィックを取得し Netflow サーバへ送信します。インターフェイスを通過するすべてのトラフィックから、Netflow トラフィックを生成できます。

CentOS 7:

rpm パッケージをダウンロードおよびインストールするには、以下のコマンドを用います。

wget http://repo.iotti.biz/CentOS/7/x86_64/fprobe-1.1-2.el7.lux.x86_64.rpm
yum install fprobe-1.1-2.el7.lux.x86_64.rpm

For instance, executing this command, 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 コレクターに送信されます。

/usr/sbin/fprobe -i eth0 -fip 192.168.70.185:9995

Once the traffic has been generated, you may see its statistics in the NetFlow collector by entering this command:

トラフィックが生成されたら、次のコマンドでトラフィックの状態を見る事ができます。

nfdump -R /home/netflow_data/

次のような情報が表示されます。

Aggregated flows 1286
Top 10 flows ordered by packets:
Date flow start          Duration Proto      Src IP Addr:Port          Dst IP Addr:Port   Packets    Bytes Flows
2011-12-22 20:41:35.697   901.035 TCP     192.168.60.181:50935 ->     192.168.50.2:22        2105   167388     4
2011-12-22 20:41:35.702   900.874 TCP       192.168.50.2:22    ->   192.168.60.181:50935     1275   202984     4
2011-12-22 20:48:15.057     1.347 TCP       157.88.36.34:80    ->    192.168.50.15:40044      496   737160     1
2011-12-22 20:48:14.742     1.790 TCP     91.121.124.139:80    ->    192.168.50.15:60101      409   607356     1
2011-12-22 20:46:02.791    76.616 TCP      192.168.50.15:80    ->   192.168.60.181:40500      370   477945     1
2011-12-22 20:48:15.015     1.389 TCP      192.168.50.15:40044 ->     157.88.36.34:80         363    22496     1
2011-12-22 20:46:02.791    76.616 TCP     192.168.60.181:40500 ->    192.168.50.15:80         303    24309     1
2011-12-22 20:48:14.689     1.843 TCP      192.168.50.15:60101 ->   91.121.124.139:80         255    13083     1
2011-12-22 20:48:14.665     1.249 TCP     178.32.239.141:80    ->    192.168.50.15:38476      227   335812     1
2011-12-22 20:48:21.350     0.713 TCP     137.205.124.72:80    ->    192.168.50.15:47551      224   330191     1

Top 10 flows ordered by bytes:
Date flow start          Duration Proto      Src IP Addr:Port          Dst IP Addr:Port   Packets    Bytes Flows
2011-12-22 20:48:15.057     1.347 TCP       157.88.36.34:80    ->    192.168.50.15:40044      496   737160     1
2011-12-22 20:48:14.742     1.790 TCP     91.121.124.139:80    ->    192.168.50.15:60101      409   607356     1
2011-12-22 20:46:02.791    76.616 TCP      192.168.50.15:80    ->   192.168.60.181:40500      370   477945     1
2011-12-22 20:48:14.665     1.249 TCP     178.32.239.141:80    ->    192.168.50.15:38476      227   335812     1
2011-12-22 20:48:21.350     0.713 TCP     137.205.124.72:80    ->    192.168.50.15:47551      224   330191     1
2011-12-22 20:48:15.313     1.603 TCP       89.102.0.150:80    ->    192.168.50.15:52019      212   313432     1
2011-12-22 20:48:14.996     1.433 TCP     212.219.56.138:80    ->    192.168.50.15:36940      191   281104     1
2011-12-22 20:51:12.325    46.928 TCP      192.168.50.15:80    ->   192.168.60.181:40512      201   245118     1
2011-12-22 20:52:05.935    34.781 TCP      192.168.50.15:80    ->   192.168.60.181:40524      167   211608     1
2011-12-22 20:41:35.702   900.874 TCP       192.168.50.2:22    ->   192.168.60.181:50935     1275   202984     4

Summary: total flows: 1458, total bytes: 5.9 M, total packets: 15421, avg bps: 49574, avg pps: 15, avg bpp: 399
Time window: 2011-12-22 20:40:46 - 2011-12-22 20:57:21
Total flows processed: 1458, Records skipped: 0, Bytes read: 75864
Sys: 0.006s flows/second: 208345.2   Wall: 0.006s flows/second: 221177.2

ここまでの動作確認ができたら、次はそれを利用できるようにするための Pandora FMS の設定です。

pmacct のインストール

Experimental.

実験的

Among many features of the pmacct probe are the ability to work with NetFlow v1/v5/v7/v8/v9, sFlow v2/v4/v5 over IPv4 and IPv6.

pmacct プローブは、IPv4 および IPv6 を介して NetFlow v1/v5/v7/v8/v9、sFlow v2/v4/v5 で動作する機能があります。

The source code is hosted at:

ソースコードは以下にあります。

Rocky Linux 8

Install dependencies with administrator rights:

依存ファイルの管理者権限でのインストール。

dnf config-manager --set-enabled powertools
dnf groupinstall 'Development Tools'
dnf install libpcap libpcap-devel

Download pmacct source code (you may use curl instead of wget) and build it:

pmacct のソースをダウンロード(wget の代わりに curl も使えます)してビルドします。

cd /tmp
wget -O pmacct-1.7.7.tar.gz "https://github.com/pmacct/pmacct/releases/download/v1.7.7/pmacct-1.7.7.tar.gz"
tar xvzf pmacct-1.7.7.tar.gz
cd pmacct-1.7.7
./autogen.sh
./configure
make && make install

Start pmacct as a NetFlow probe in daemon mode:

デーモンモードで、pmacct を NetFlow プローブとして起動します。

  • Create pmacct config:
  • 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 コレクタに送信されます。

cat> pmacctd_probe.conf <<EOF
daemonize: true
pcap_interface: eth0
aggregate: src_host, dst_host, src_port, dst_port, proto, tos
plugins: nfprobe
nfprobe_receiver: 192.168.70.185:9995
nfprobe_version: 9
EOF
  • Start pmacctd:
  • pmacctd の起動:
# pmacctd -f pmacctd_probe.conf

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 カスタムレポートに現れます。Pandora FMS の “通常” のレポートへ追加することができます。

また、通信の分析や素ぽーっとでルールを作成したり修正するためのライブ Netflow ビューワがあります。これは、問題を調査したり、保存しない一時的なグラフを表示するのにするのにとても便利です。

設定

Hard drive access speed where Netflow data are stored is usually the key factor for performance limits.

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 およびそれ以前:

Version 769 and earlier

For version 770 and later:

バージョン 770 およびそれ以降:

Version 770 and later

Once activated, a new NetFlow configuration option will appear in the setup section.

有効化すると、新たに Netflow 設定オプションが表示されます。

For version 769 and earlier:

バージョン 769 およびそれ以前:

Version 769 and earlier

For version 770 and later:

バージョン 770 およびそれ以降:

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.
    • For version 769 and earlier enter the full path.
    • For version 770 and later only the directory name, by default netflow (see General Setup).
  • Daemon binary path: The path to the nfcapd 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.
  • 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.
  • 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 データが保存されるディレクトリです。
    • バージョン 769 およびそれ以前では、フルパスを入力します。
    • バージョン 770 およびそれ以降では、ディレクトリ名のみを入力します。デフォルトは netflow です。(一般設定を参照)
  • デーモンバイナリパス(Daemon binary path): nfcapd バイナリのパスです。
  • Nfdump バイナリパス(Nfdump binary path): nfdump バイナリのパスです。
  • Nfexpire バイナリパス(Nfexpire binary path): nfexpire バイナリのパスです。
  • 最大グラフ解像度(Maximum chart resolution): Netflow グラフを表示するエリアの最大サイズです。解像度を高くするとパフォーマンスが下がります。50 と 100 の間の値をお勧めします。
  • ライブビューカスタムフィルタの無効化(Disable custom live view filters): 有効にすると、管理者によってあらかじめ作成された Netflow フィルタのみが Netflow ライブビューで利用できます。
  • Netflow 最大保存期間(Netflow max lifespan): 指定した日数よりも古い Netflow データが削除されます。
  • IP アドレス名前解決の有効化(Enable IP address name resolution): Netflow デバイスから IP アドレスの名前解決をするようにします。
  • デーモン間隔(Daemon interval): (バージョン NG 769 およびそれ以前) データファイルをローテートする時間間隔(秒)です。3600を推奨します。間隔を大きくすると大きなファイルとなり、I/O のオーバーヘッドは小さくなりますが、特定の時間間隔におけるデータの検索は遅くなります。

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 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';
  • 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.

バージョン 770 以降

デーモン間隔(Daemon interval) のデフォルト値を変更する必要がある場合は、次の手順を実行する必要があります。

  • コマンドラインまたは DB インターフェイス を使用して、netflow_interval トークンの値を秒単位で変更します。たとえば、300 秒に変更するには、UPDATE tconfig SET value = '300' where token = 'netflow_interval'; です。
  • ターミナル画面を開き、上記の間隔で生成されたデータを rm -i /var/spool/pandora/data_in/netflow で削除します。
  • Pandora FMS サーバを起動します。

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 サーバを再起動する必要があります。このサーバは、システムからアクセスできるパスにインストールされている必要があります。動作に関して疑問点があればサーバログを確認してください。

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.

バージョン 769 およびそれ以前: このサーバは、Pandora FMS サーバではないため、サーバ表示には現れません。バージョン 770 以降では、一覧に表示されます

If you decide to store the NetFlow data on a device other than the PFMS server (see nfcapd installation procedure and the distributed configuration) you must copy the binary file /usr/bin/nfexpire to that device and add the following entry in /etc/crontab:

0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_days d

Where x_dias is the maximum number of days old, of NetFlow data, to retain on that device (in this particular case the PFMS Console configuration, for that field, will have no effect).

Pandora FMS サーバ以外のデバイスに NetFlow データを保存する場合(nfcapd インストール手順 および 分散設定)は、/usr/bin/nfexpire バイナリを該当デバイスへコピーし、次のエントリを /etc/crontab に追加する必要があります。

0 * * * * root yes 2>/dev/null | /usr/bin/nfexpire -e "/var/spool/pandora/data_in/netflow" -t X_days d

ここで、x_dias は、デバイスに残す NetFlow データの最大日数です(Pandora FMS コンソールの設定とは関係ありません)。

You may access the creation and edition of filters by clicking on RessourcesNetFlow Filters.

リソース(Resources) > NetFlow フィルタ(NetFlow Filters) をクリックすることにより、作成および編集ができます。

This section contains a list of already created filters which can be modified or deleted.

ここには、変更または削除できる作成済みのフィルタの一覧が表示されます。

“Netflow ライブビュー” からも直接フィルタを作成でき、アクティブフィルタを新規保存することもできます。 Netflow フィルタには “基本” または “高度” があります。違いは、前者はフィルタリングフィールド(送信元IP、送信先IP、送信元ポート、送信先ポート)を固定し、高度な方は pcap (ネットワークトラフィックのフィルタリングを標準入力にて)および関連ツールを用います。

フィルタ作成

Netflow フィルターの基本的な編集画面:

この機能における設定可能な NetFlow フィルタは次のとおりです。

  • Name: It is recommended for the filter's name to be quite descriptive.
  • Group: A user can only create a filter or edit the filter of a group it has access to.
  • Filter: There are two types of filters: Basic and advanced. Advanced filters allow using advanced expressions in the same format as 'nfdump'. Basic filters can filter traffic by source and target IP and source or target port. Lists of comma-separated IPs or ports are also accepted here.
  • Aggregate by: All traffic data can be grouped by one of the following criteria:
    • DST IP address: Group traffic of each IP from a different source.
    • DST port: Group traffic of each IP with a different target.
    • SRC IP address: Group traffic of each port from a different source.
    • SRC Port: Group traffic of each port with a different target.
  • 名前(Name): フィルタの名前です。解りやすいものを定義してください。
  • グループ(Group): 1ユーザは、アクセス可能なグループの一つのフィルタのみ作成または編集できます。
  • フィルタ(Filter): フィルタには、基本と拡張の 2つのタイプがあります。拡張フィルタは、nfdump と同じフォーマットの拡張表現が利用できます。基本フィルタは、発信元IP、宛先IP、発信元ポート、宛先ポートで通信をフィルタできます。カンマで区切った IP またはポートリストが利用できます。
  • 集約(Aggregate by): 通信が次の基準で集約されます:
    • 宛先 IP(DST IP address): 異なる宛先 IP ごとに通信を表示します。
    • 宛先ポート(DST port): 異なる宛先ポートごとに通信を表示します。
    • 発信元 IP(SRC IP address): 異なる発信元 IP ごとに通信を表示します。
    • 発信元ポート(SRC Port): 異なる発信元ポートごとに通信を表示します。

基本ウェブ通信フィルタの例:

高度なイントラネット通信フィルタの例:

以下に、他のフィルタ例を示します。

  • 192.168.0.1 発または宛のトラフィックをキャプチャ:
host 192.168.0.1
  • 192.168.0.1 宛のトラフィックをキャプチャ:
dst host 192.168.0.1
  • 192.168.0.0./24 発のトラフィックをキャプチャ:
src net 192.168.0.0/24
  • HTTP および HTTPS のトラフィックをキャプチャ:
(port 80) or (port 443)
  • DNS 以外の全トラフィックをキャプチャ:
port not 53
  • 192.168.0.1 宛の SSH トラフィックをキャプチャ:
(port 22) and (dst host 192.168.0.1)

Netflow レポートは、Pandora FMS のレポート機能に統合されています。

新たにレポートアイテムを作成するには、netflow レポートアイテムの一つを選択します。

そして、設定します。次のオプションがあります。

  • タイプ(Type): 以下に説明するアイテムのタイプです。
  • フィルター(Filter): 利用する Netflow フィルタです。
  • 説明(Description): アイテムの説明です。
  • 間隔(Period): データを表示する期間です。
  • 解像度(Resolution): データは、解像度に指定したサイズで取得されます。もし、間隔/解像度を最大グラフ解像度より大きく設定すると、動的に再調整されます。例えば、間隔が 1日で、解像度が 1時間の場合、24ポイントがグラフに表示されます。
  • 最大値(Max. values): 集約する要素の最大値です。例えば、HTTP トラフィックのグラフを書く場合、ソースIPアドレスで集約し、最大値が 5 であれば、5つの IP アドレスのみが表示されます。

netflow レポートのアイテムは、3種類あります。

  • 塗りつぶしグラフ(Area chart): 集約または未集約の塗りつぶしグラフです。

  • データ一覧(Data table): 塗りつぶしグラフをテキストで表したものです。

  • Netflow サマリグラフ(Netflow summary chart): 指定した間隔のトラフィックサマリです。グローバル情報を含む表、最も関連性のある IP またはポートを含む円グラフ、分割された円グラフと同じ情報を含む表の 3つの要素があります。

This view is used to check captured data history based on different search filters. You may use filters and different ways of information display. It is necessary to define the way to group the displayed information, as well as the way to obtain this information in order to start seeing data.

この表示は、さまざまな検索フィルタに基づいて取得されたデータの履歴を調べるために使用します。フィルタを使用して、さまざまな異なる情報を表示することができます。データの視覚化をするには、表示された情報をグループ化する方法と、この情報を取得する方法があります。

Filters can be seen in real time from MonitoringNetworkNetflow Live View. This tool allows you to see the changes that are made to a filter and save it once the desired result is obtained. It is also possible to load and modify existing filters.

フィルタした情報は、モニタリング(Monitoring)ネットワーク(Network)Netflow ライブビュー(Netflow Live View) から表示できます。このツールで、フィルタの変更のプレビューおよび、好みの出力結果を保存できます。設定したフィルタをロードし編集することもできます。

See Reports and Filters to learn how to configure live view options.

ライブビューオプションの設定方法については、レポートフィルタ を参照してください。

情報を取得する方法の場合、発信元IP、宛先IP、送信元ポート、宛先ポートから行います。たとえば、受信先 IP 情報を表示するように選択した場合、受信先へのトラフィックが最も多い IP から最も低い IP の順に表示されます。 宛先ポートを選択して、プロトコルごとにネットワークの利用量を見る場合も同じことが言えます。

可能な表示方法は以下の通りです。

  • 塗りつぶしグラフ(Area Graph) (積み重ね): 時間の経過とともに(開始日から終了日まで)、データの変化を表示します。 “解像度(Resolution)” で、グラフの精度を選択する必要があります。

  • 概要(Summary): サマリ表、円グラフ、および期間全体のデータを含む表を表示します。

  • 詳細(Detailed): IP トラフィックを表すマップを表示します。

  • データ表(Data table): 選択に応じて、各 IP と行数を含むデータテーブルを表示します。

  • 円グラフ(Circle graph): IP とトラフィック量の間の関係を表すインタラクティブな円グラフを表示します。

これは、OUM 733 から追加された機能で、この先も改善の予定です。ノード間のトラフィックに基づいて動的なネットワークマップを作成します。異なるアドレス間の関係(接続)および、(データ転送量による)トップ N を表示します。

network_usage_map.jpg

コンソールから独立したホスト上に Netflow データを収集する pandora ノードを配置することも可能です。大量の Netflow データがある環境では、高速ディスクと 2コア以上の高速 CPU を備えたサーバに配置することをお勧めします。 Pandora コンソールがNetflow データを抽出するためには、以下の手順に従ってシステムのデフォルト設定を変更する必要があります。

  • Web デーモンを実行するユーザと、コレクターノードで nfdump を実行するユーザとの間の自動 SSH 認証を構成します。

その設定には、次の手順を実行する必要があります。

apache ユーザを有効化します。それには、/etc/passwd ファイル内の apache ユーザを次のように編集します。

apache:x:48:48:Apache:/var/www:/bin/bash

/var/www ディレクトリ内に .ssh ディレクトリを作成し、正しいパーミッションを設定します。

#mkdir /var/www/.ssh
#chown apache:apache /var/www/.ssh

ssh 鍵を作成し、それを Netflow トラフィックを収集するホストにコピーします。

#su apache
bash-4.2$ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/var/www/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /var/www/.ssh/id_rsa.
Your public key has been saved in /var/www/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:vYvl5V00E4faa14zN08ARzGUQ9IfAQJnMzkaqLAGRHI apache@<server>
The key's randomart image is:
+---[RSA 2048]----+
|+oE     ...*o=B+.|
|.o .   . .oo+o++ |
|  . o .   o o o+o|
|   o .   o   =  +|
|  .     S . . oo.|
|           .   +o|
|          o . o+=|
|         + + + +*|
|        . o . o .|
+----[SHA256]-----+
bash-4.2$ ssh-copy-id root@<netflow_server>

コピーしたら、パスワード無しで apache ユーザがサーバにアクセスできるかどうかを確認します。

bash-4.2$ ssh usuario@<netflow_server>
  • 以下のように Pandora FMS コンソールで /usr/bin/nfdump を置き換えるスクリプトを作成します。
#!/bin/bash
NFDUMP_PARAMS=$(sed 's/(\(.*\))/\"\(\1\)\"/' <<< "$@");

ssh usuario@<netflow_server> "/usr/bin/nfdump $NFDUMP_PARAMS"

スクリプトに実行パーミッションを与えます。

chmod 755 /usr/bin/nfdump

以下のようにスクリプトを実行してみます。

/usr/bin/nfdump -V

つぎのような応答があります。

nfdump: Version: 1.6.13

NG 770 version or later.

バージョン NG 770 以降

From Pandora FMS version 770 onwards, support for sFlow, a network protocol which is an industry standard in hardware manufacturing for data network traffic, is included.

Pandora FMS バージョン 770 以降では、sFlow のサポートが含まれています。sFlow は、データネットワークトラフィック用のハードウェアにおける業界標準のネットワークプロトコルです。

The operation of sFlow in PFMS is 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 の動作は NetFlow で確立しているものと同様 です。 両方のプロトコルが有効な場合、データはグループ化されます。いずれの場合も、左側のサイドバーの 操作(Operation) メニューにアクセスし、ネットワーク(Network) をクリックすると、常に表示されます。

NG 775 version or later.

バージョン NG 775 以降

Enable sFlow to be accessible from the Operation and Management menus. Under the NetFlow configuration section, there is an option to enable or disable sFlow globally.

操作管理 メニューからアクセスできるように、sFlow を有効化する必要があります。 NetFlow 設定セクションに、sFlow をグローバルに有効または無効にするオプションがあります。

A new tab will be enabled specifically for sFlow:

sFlow 専用の新しいタブが有効になります。

  • Data storage path: Directory where the sFlow data files are to be stored (see 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 データファイルが保存されるディレクトリ。(一般設定を参照)
  • デーモンバイナリパス(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 アドレス名前解決を有効にします。

Pandora FMS ドキュメント一覧に戻る

  • ja/documentation/pandorafms/monitoring/18_netflow.txt
  • 最終更新: 2024/01/15 02:38
  • by 127.0.0.1