Pandora FMS uses a tool to analyze the network in real time: NetFlow® and sFlow®. It uses the principle of “listening” through Ethernet continuously and analyzing traffic to generate statistics.
Pandora FMSは、NetFlow® と sFlow® というツールを使ってネットワークをリアルタイムで分析します。イーサネットを介して継続的に「リスニング」を行い、トラフィックを分析して統計情報を生成するという原理に基づいています。
To intercept network traffic and be able to analyze it, physical access to that network is needed, since the network capture point must be the most appropriate. To capture such data, traffic must be redirected from one switch port to another port using a “port-mirror”. Not all network devices allow this (only mid/high-range ones). A port-mirror can also be done on some commercial firewall devices. It is the easiest way to intercept traffic and requires no additional hardware. By sending all traffic to one port, that port connects directly to the network analyzer (probe).
ネットワークトラフィックを傍受して分析するには、ネットワークキャプチャポイントが最も適切な場所である必要があるため、そのネットワークへの物理的なアクセスが必要です。このようなデータをキャプチャするには、「ポートミラー」を使用して、トラフィックをあるスイッチポートから別のポートにリダイレクトする必要があります。すべてのネットワークデバイスがこれに対応しているわけではありません(中級/高級デバイスのみ)。ポートミラーは、一部の商用ファイアウォールデバイスでも実行できます。これはトラフィックを傍受する最も簡単な方法であり、追加のハードウェアは必要ありません。すべてのトラフィックを1つのポートに送信することで、そのポートはネットワークアナライザ(プローブ)に直接接続されます。
These high-range switches and/or firewalls allow monitoring to be performed more easily. This is because these devices send network flow statistical information directly to the Pandora FMS collector without the need for an independent probe. Hardware specifications should be consulted to see if NetFlow and/or sFlow can be enabled and flows sent to an independent collector (in this case, the Pandora FMS collector).
これらの高性能スイッチやファイアウォールを使用することで、監視をより容易に行うことができます。これは、これらのデバイスが独立したプローブを必要とせずに、ネットワークフローの統計情報を Pandora FMS コレクターに直接送信するためです。NetFlow や sFlow を有効にして、フローを独立したコレクター(この場合は Pandora FMS コレクター)に送信できるかどうかは、ハードウェア仕様書を参照してください。
Pandora FMS is capable of monitoring IP traffic using the NetFlow protocol.
Pandora FMS は、NetFlow プロトコルを使用して IP トラフィックを監視できます。
NetFlow® is a network protocol, developed by Cisco Systems® and is currently supported on several platforms in addition to Cisco IOS® and NXOS®, such as devices from manufacturers like Juniper®, Enterasys Switches®, and operating systems like Linux®, FreeBSD®, NetBSD® and OpenBSD®.
NetFlow® は Cisco Systems® によって開発されたネットワーク プロトコルで、現在 Cisco IOS® および NXOS® に加えて、Juniper®、Enterasys Switches® などのメーカーのデバイスや Linux®、FreeBSD®、NetBSD®、OpenBSD® などのオペレーティングシステムなど、いくつかのプラットフォームでサポートされています。
NetFlow-enabled devices, when this feature is activated, generate “NetFlow records” consisting of small fragments of information that they send to a central device (a NetFlow server or collector), which receives information from the devices (NetFlow probes) to store and process it.
NetFlow 対応デバイスは、この機能が有効になると、小さな情報断片からなる「NetFlow レコード」を生成し、中央デバイス(NetFlow サーバまたはコレクター)に送信します。中央デバイスは、デバイス(NetFlow プローブ)から情報を受け取り、それを保存および処理します。
This information is transmitted using the NetFlow protocol, based on UDP or SCTP. Each NetFlow record is a small packet containing a minimum amount of information, but in no case does it contain raw traffic data. That is, it does not send the payload of the traffic flowing through the collector, only the statistical data.
この情報は、UDP または SCTP に基づく NetFlow プロトコルを使用して送信されます。各 NetFlow レコードは、最小限の情報を含む小さなパケットですが、生のトラフィックデータは一切含まれません。つまり、コレクターを通過するトラフィックのペイロードは送信されず、統計データのみが送信されます。
The traditional Cisco definition is to use a 7-element key:
Cisco の従来の定義では、7要素のキーを使用します。
Over time, other manufacturers have designed equivalent systems for their network devices, with different names but similar purposes:
時が経つにつれ、他のメーカーもネットワーク機器向けに同様のシステムを設計するようになり、名称は異なるものの、目的はほぼ同じです。
This is a device (PC or server) located on the network to collect all the NetFlow information sent from routers and switches.
Netflow コレクタは、ルータやスイッチから送られた全ての Netflow 情報を収集するためにネットワーク上に置かれたデバイス(PCやサーバ)です。
NetFlow generates and collects this information, but software is needed to store and analyze said traffic. With Pandora FMS, a special server is used for this purpose, which Pandora FMS will start and stop when the PFMS Server is started. This server is called nfcapd and it must be installed to use NetFlow monitoring.
Netflow サーバは、データを受け取り保存するために必要です。Pandora FMS は、この目的に nfcapd を利用しています。Pandora FMS が Netflow データを処理できるようにするには、これをインストールする必要があります。Pandora FMS は、必要なときに自動的にこのサーバを起動・停止します。
Probes (such as Raspberry Pi) are generally routers with NetFlow enabled, configured, and sending information to the NetFlow collector (which in this case will be the Pandora FMS server with the nfcapd daemon enabled).
プローブ (Raspberry Pi など) は通常、NetFlow が有効化され、設定され、情報を NetFlow コレクター (この場合は nfcapd デーモンが有効な Pandora FMS サーバです) に送信するルータです。
Pandora FMS uses an OpenSource tool called nfcapd (belonging 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 in a specific location. nfcapd must be installed on the operating system before working with NetFlow in Pandora FMS.
Pandora FMS は、全ての netflow 通信を処理するためにオープンソースのツールである nfcapd (nfdump パッケージに含まれています) を利用します。このデーモンは、Pandora FMS サーバにより自動的に起動されます。このシステムは、データを特定の場所のバイナリファイルに保存します。Netflow を使うには、nfcapd をインストールする必要があります。
The nfcapd daemon defaults to listening on port 9995/UDP, so it must be taken into account if firewalls are enabled to open this port number and when configuring NetFlow probes.
nfcapd デーモンのデフォルトの待ち受けポートは 9995/UDP です。ファイアーウォールがある場合は、このポートを開ける必要があることに注意してください。
The installation of nfcapd must be done manually, as Pandora FMS will not install it. For more information, go to the official nfcapd project page.
nfcapd は、手動でインストールする必要があります。Pandora FMS 自身は nfcapd をインストールしません。インストール方法の詳細は、nfcapd プロジェクトの公式ページを参照してください。
Pandora FMS by default uses the /var/spool/pandora/data_in/netflow directory to process information, so when nfcapd starts, it will use this directory. Avoid modifying this location path, unless strictly necessary and with full knowledge of it.
Pandora FMS はデフォルトで、Netflow データを保存するのに “/var/spool/pandora/data_in/netflow” ディレクトリを利用します。Pandora FMS サーバによって起動されるときに、nfcapd にこのディレクトリが指定されます。何を行っているかがわからない場合は、変更しないでください。
It is necessary to install nfdump version 1.6.8p1 to use it with Pandora FMS.
Pandora FMS では、Netflow データを処理するのに nfdump バージョン 1.6.8p1 が必要です。
If you want to check that nfcapd is correctly installed, run the following command to start the process in the foreground:
nfcapd が正しくインストールできたか確認するには、以下のようにコマンドを実行してプロセスを起動します。
nfcapd -l /var/spool/pandora/data_in/netflow
If everything goes well, you should get an output similar to this:
すべて正しく動作していれば、以下のような出力が見られます。
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
Keep in mind that it is necessary for Pandora FMS, and specifically the WEB server that runs the Web Console, to have access to those data files located by default at:
/var/spool/pandora/data_in/netflow
Pandora FMS コンソール(具体的には、それを実行する Web サーバ)がデータにアクセスできる必要があることに注意してください。 この例では次の場所です。
/var/spool/pandora/data_in/netflow
If a router with NetFlow is not available, but its traffic passes through a Linux system, software can be installed that acts as a probe and sends NetFlow traffic information to the collector.
NetFlow に対応したルーターが利用できない場合でも、そのトラフィックが Linux システムを経由する場合は、プローブとして機能し、NetFlow トラフィック情報をコレクターに送信するソフトウェアをインストールできます。
The fprobe software captures traffic and forwards it to a NetFlow® server. With it, you can generate NetFlow traffic from all the network traffic passing through its interfaces.
fprobe がトラフィックを取得し NetFlow® サーバへ送信します。インターフェイスを通過するすべてのトラフィックから、Netflow トラフィックを生成できます。
In Ubuntu 22 it is installed and configured with:
Ubuntu 22 では、次のようにインストールおよび設定します。
sudo apt install fprobe
The installation offers eth0 as the default interface; it must be configured with a valid network interface; in recent distros, the Ethernet interface is named enp1s0 and the wireless network interface wlp2s0, these names may vary depending on the hardware.
インストールでは、デフォルトのインターフェースとして eth0 が設定されますが、有効なネットワークインターフェースで設定する必要があります。最近のディストリビューションでは、イーサネットインターフェースは enp1s0、ワイヤレスネットワーク インターフェースは wlp2s0 という名前になっていますが、ハードウェアによってはこれらの名前が異なる場合があります。
Next, it will ask for the IP address and the listening port number of the device that will collect the data (in this case the PFMS server), in a format similar to 192.168.70.185:9995.
次に、データを収集するデバイス (この場合は PFMS サーバ) の IP アドレスと待ち受けポート (例: 192.168.70.185:9995) を確認します。
Once the installation is finished, operation can be checked:
インストールが完了したら、操作をテストできます。
sudo systemctl status fprobe
And it will return a response similar to this:
そして、次のような応答が返されます。
To enable it on every system startup:
システムの起動ごとに有効にするには:
sudo systemctl enable fprobe
To read the complete fprobe help:
完全な fprobe ヘルプを読むには:
https://manpages.ubuntu.com/manpages/resolute/man8/fprobe.8.html
Once traffic has been generated, its statistics can be seen in the PFMS Server NetFlow collector with the command:
トラフィックが生成されると、次のコマンドを使用して、PFMS サーバ の NetFlow コレクターでトラフィック統計を表示できます。
nfdump -R /var/spool/pandora/data_in/netflow
Experimental.
実験的
Among many features of the pmacct probe are the ability to work with NetFlow v1/v5/v7/v8/v9 and 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:
ソースコードは以下にあります。
Install dependencies with administrator rights:
依存ファイルの管理者権限でのインストール。
Rocky Linux 8
dnf config-manager --set-enabled powertools dnf groupinstall 'Development Tools' dnf install libpcap libpcap-devel
Rocky Linux 9
dnf config-manager --set-enabled crb dnf groupinstall 'Development Tools' dnf install libpcap libpcap-devel
Download the pmacct source code (you can use curl instead of wget) and compile:
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 プローブとして起動します。
In this particular case, all traffic from the eth0 interface will be sent to the NetFlow collector listening on port number 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
/usr/local/sbin/pmacctd -f ~/pmacctd_probe.conf
Pandora FMS works with NetFlow as an auxiliary system, that is, it does not store NetFlow information in the database. Pandora FMS displays this information as reports requested on demand.
Pandora FMS は、補助システムとしての Netflow と連動します。つまり、データベースに NetFlow データを保存しません。 Pandora FMS は、その情報をオンデマンドでレポートとして表示します。
Pandora FMS operates with NetFlow using sets of rules to visualize specific traffic. These rules can be something as simple as “All traffic from the network 192.168.70.0/24” or something more complex using pcap expressions.
Pandora FMS は、フィルタを使って Netflow データを処理します。フィルタは、通信パターンにマッチするルールのセットです。ルールは、'all the traffic from 192.168.70.0/24 network'(サブネット 192.168.70.0/24 からの通信すべて) といったように簡単です。また、pcap のフィルタ書式も利用できます。
Once filters are defined, reports are defined that determine how to visualize the data (charts, lists, …) and the time interval. By defining filters and reports, that information remains defined, similar to how it works with Pandora FMS reports, to be used on demand when needed. NetFlow reports will also appear as a “report type” in the Pandora FMS Custom Reports section, so they can be incorporated into normal Pandora FMS reports.
フィルタが定義されると、データの視覚化方法(グラフ、リストなど)と時間間隔を決定するレポートが定義されます。フィルタとレポートを定義することで、その情報は Pandora FMS レポートと同様に定義されたままになり、必要に応じてオンデマンドで使用できます。NetFlow レポートは、Pandora FMS カスタムレポートセクションに「レポートタイプ」として表示されるため、通常の Pandora FMS レポートに組み込むことができます。
On the other hand, there is a “real-time” view console to analyze traffic, composing the rules directly. It is useful for investigating problems, seeing specific charts that do not correspond to a certain filter, etc.
一方、トラフィックを分析し、ルールを直接作成できる「リアルタイム」表示コンソールも用意されています。これは、問題の調査や、特定のフィルタに該当しない特定のグラフの確認などに役立ちます。
The access speed of the storage device where the NetFlow data resides is normally the limiting performance factor.
Netflow データが保存されるハードディスクアクセス速度は、通常、パフォーマンスに関わる重要な要素です。
First, NetFlow must be enabled so that it is accessible from the Operation and Administration menus. In the Configuration section, there is an option to enable or disable NetFlow globally:
まず、NetFlow を有効にして、操作メニューと管理メニューからアクセスできるようにする必要があります。設定画面には、NetFlow をグローバルに有効または無効にするオプションがあります。
Once activated, a new NetFlow configuration option will appear in the configuration section:
有効化すると、新たに Netflow 設定オプションが表示されます。
This section must be configured correctly so that the nfcapd daemon can start without problems along with the Pandora FMS Server:
ここでは、nfcapd デーモンが Pandora FMS サーバと同時に起動するように正しく設定する必要があります。
netflow (see General Setup).netflow です(一般設定を参照)Once NetFlow is configured in the console, the PFMS Server will need to be restarted so that it starts the nfcapd server. This must be correctly installed before attempting to start it. Check the server logs in case of any doubt.
コンソールで NetFlow を設定したら、Pandora FMS サーバを再起動して、nfcapd サーバを起動します。 このサーバは、実行する前に適切にインストールする必要があります。 疑わしい場合はサーバのログを確認してください。
If you decide to store NetFlow data on a device other than the PFMS Server (see nfcapd installation procedure and the distributed configuration), the binary file /usr/bin/nfexpire must be copied to that device and the following entry added to the /etc/crontab file:
NetFlow データを PFMS サーバ以外のデバイス ((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
Where x_days is the maximum number of days of antiquity, of the NetFlow data, to be retained on said device (in this particular case the PFMS Web Console configuration, for that field, will not take effect).
ここで、x_dias は、デバイスに残す NetFlow データの最大日数です(Pandora FMS コンソールの設定とは関係ありません)。
The menu for creating and editing filters is found in Management → Resources → Netflow filters. In that view, there is a list of already created filters that can be modified and/or deleted.
リソース(Resources) > NetFlow フィルタ(NetFlow Filters) をクリックすることにより、作成および編集ができます。このセクションには、変更または削除できる作成済みのフィルタのリストが含まれています。
A filter can also be created directly from the Netflow live view, saving the active filter as a new one. NetFlow filters can be basic or advanced: The difference is that the former have fixed filtering fields (source IP address, destination IP address, source port number, destination port number) and the advanced ones are defined using a pcap expression (standard in filtering expressions for network traffic) and use tools of all kinds.
NetFlow ライブビューからすぐにフィルタを作成し、アクティブなフィルタを新しいフィルタとして保存することもできます。 NetFlow フィルタには “基本(basic)” または “高度(advanced)” があります。 違いは、前者には固定のフィルタリングフィールド (ソース IP、ターゲット IP、ソースポート、ターゲットポート) があるのに対し、高度なフィルタリングフィールドは pcap 式 (ネットワークトラフィックのフィルタリング式の標準) によって定義され、あらゆる種類を使用することができます。
When creating the filter, monitoring can be activated by enabling the Enable NetFlow monitoring token.
フィルターを作成するときに、Enable NetFlow monitoring トークン を有効にすることでフィルタ監視を有効にできます。
The parameters are as follows:
パラメータは次の通りです。
NetFlow reports are integrated with Pandora FMS reports.
NetFlow レポートは Pandora FMS レポート と統合されています。
To create a report element, choose one of the available NetFlow report elements.
新たにレポートアイテムを作成するには、netflow レポートアイテムの一つを選択します。
The following configuration options are available:
以下の設定オプションが利用可能です。
There are three types of NetFlow report elements:
netflow レポートのアイテムは、3種類あります。
This view is used to consult the history of captured data based on different search filters. Filters and different ways of displaying information can be used. The way to group the information shown must be defined, as well as the way to obtain said information to start visualizing data.
この表示は、さまざまな検索フィルタに基づいて取得されたデータの履歴を調べるために使用します。フィルタを使用して、さまざまな異なる情報を表示することができます。データの視覚化をするには、表示された情報をグループ化する方法と、この情報を取得する方法があります。
Filters can be viewed in real time from Operation → Monitoring → Network → NetFlow Live View. This tool allows visualizing the changes made to a filter and saving it once the desired result is obtained. It is also possible to load and modify existing filters.
フィルタした情報は、操作(Operation) → モニタリング(Monitoring) → ネットワーク(Network) → Netflow ライブビュー(Netflow Live View) から表示できます。このツールで、フィルタの変更のプレビューおよび、好みの出力結果を保存できます。設定したフィルタをロードし編集することもできます。
Information can be obtained by: source IP address, destination IP address, source port number, or destination port number. If destination IP address information is chosen to be shown, information will be displayed sorted by IP addresses with the most traffic to the destination from highest to lowest. The same would apply to knowing your network consumption by protocol, choosing by destination port number.
情報を取得する方法は、送信元 IP アドレス、宛先 IP アドレス、送信元ポート、または宛先ポートです。 たとえば、宛先 IP アドレス情報を表示することを選択した場合、情報は、宛先へのトラフィックが最も多い IP アドレスによって、最高から最低の順に並べ替えられて表示されます。 宛先ポートを選択して、プロトコルごとのネットワークの消費量を見る場合も同じことが行われます。
The possible visualization ways are as follows:
可能な表示方法は以下の通りです。
Allows creating dynamic network maps based on traffic between nodes. Shows the relationship (connections) between different addresses, showing the N most important connections (by size of data transferred between them).
これにより、ノード間のトラフィックに基づいて動的なネットワーク マップを作成できます。 異なるアドレス間の関係 (接続) が表示され、最も重要な N 個の接続が (接続間で転送されるデータのサイズごとに) 表示されます。
It is possible to locate the Pandora FMS node that collects NetFlow data on a host independent of the Web Console. In environments with a lot of NetFlow data, it is more than recommended to locate it on a server with fast disks and a fast CPU with two or more cores. For the Web Console to extract NetFlow data, it will be necessary to modify the default system configuration:
コンソールから独立したホスト上に Netflow データを収集する pandora ノードを配置することも可能です。大量の Netflow データがある環境では、高速ディスクと 2コア以上の高速 CPU を備えたサーバに配置することをお勧めします。 Pandora コンソールがNetflow データを抽出するためには、以下の手順に従ってシステムのデフォルト設定を変更する必要があります。
To perform this configuration, follow these steps:
その設定には、次の手順を実行する必要があります。
Only for Pandora FMS environments on EL 8
EL 8 上の Pandora FMS 環境のみ
mkdir /usr/share/httpd/.ssh/
chown -R apache. /usr/share/httpd/.ssh/
su apache -s /bin/bash
ssh-keygen
ssh-copy-id < User >@< IP_Address >
ssh < User >@< IP_Address >
From the Pandora FMS configuration, in the NetFlow section, you can fill in the Remote Settings section with the above data to access the remote NetFlow data:
Pandora FMS 設定の NetFlow セクションで、リモート設定(Remote Settings) セクションに前のデータを入力して、NetFlow リモートデータにアクセスできます。
As of version 770 of Pandora FMS, support for sFlow is included, which is a network protocol that is an industrial standard in hardware manufacturing for data network traffic.
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, data will be grouped; in any case, they will always be viewed by accessing the Operation menu in the left sidebar, and then clicking on Views → Network.
Pandora FMS での sFlow の動作は NetFlow で確立しているものと同様 です。 両方のプロトコルが有効な場合、データはグループ化されます。いずれの場合も、左側のサイドバーの 操作(Operation) メニューにアクセスし、ネットワーク(Network) をクリックすると、常に表示されます。
You must enable sFlow so that it is accessible from the Operation and Management menus. In 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 専用の新しいタブが有効になります。
Netflow フィルターの基本的な編集画面:
この機能における設定可能な NetFlow フィルタは次のとおりです。
基本ウェブ通信フィルタの例:
高度なイントラネット通信フィルタの例:
以下に、他のフィルタ例を示します。
host 192.168.0.1
dst host 192.168.0.1
src net 192.168.0.0/24
(port 80) or (port 443)
port not 53
(port 22) and (dst host 192.168.0.1)