====== Raspberry の監視 ====== {{indexmenu_n>15}} [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] * Network connection and device configuration guide. * Pandora FMS agent and satellite installation on a Raspberry device. * Automatic creation Pandora FMS user, securing the ssh protocol. * ネットワーク接続およびデバイス設定ガイド * pandora エージェントのインストールと、Raspberry デバイスでのサテライト * pandora ユーザの自動作成、セキュアな ssh プロトコル ===== ハードウエアコンポーネント ===== ==== Rasberry ==== A Raspberry device is a reduced-plate computer, single-plate computer or low-cost single-plate computer (SBC). Its official operating system is an open source version adapted from Debian, called Raspbian. Raspberry デバイスは、単一基板の低コストコンピュータです(SBC)。公式なオペレーティングシステムはオープンソースの Debian を元にしたもので、Raspbian と呼ばれます。 ===== ソフトウエア ===== ==== Raspberry 用の Pandora FMS イメージ ==== The distributed image is based on the Raspbian operating system. It contains the agent, the satellite, the eHorus client, the packages to install a NetFlow probe and all their dependencies. 配布イメージは、Raspbian オペレーティングシステムを元にしています。エージェント、サテライト、eHorus クライアント、Netflow プローブをインストールするためのパッケージおよび、これらの依存ファイルが含まれています。 ===== インストール ===== ==== SD カード用フラッシュイメージ ==== === Raspberry 用の Pandora FMS 公式イメージのダウンロード === The initial step for installing it is to download the official Pandora FMS image for raspberry from the official download page: インストールの最初のステップは、raspberry 用の公式 Pandora FMS イメージのダウンロードです。 https://sourceforge.net/projects/pandora/files/Raspberry-PandoraFMS/ Once the ''.img'' file is downloaded, flash it onto your SD card of at least 4gb. SD カードへ書き込む ''.img'' ファイルをダウンロードします。SD カードは最低 4GB 必要です。 === Etcher のダウンロード === To flash the image, use the Etcher software that can be downloaded at イメージを書き込むために Etcher を利用します。以下からダウンロードできます。 https://etcher.balena.io/ It works similarly on both Windows® and Linux®. Windows® と Linux® の両方で同様に動作します。 === SD カードへのイメージの書き込み処理 === Insert the SD card into your computer which should have a special port for those kinds of devices. Execute Etcher. SD カードをコンピュータに挿入します。コンピュータには、これらの種類のデバイス用の特別なポートが必要です。 Etcher を実行します。 Click **Select image**. This will open the file explorer to select the previously downloaded Pandora FMS image. **Select image** をクリックします。 これにより、ファイルエクスプローラーが開き、事前にダウンロードした Pandora FMS イメージを選択します。 Select the SD card inserted in the computer. If the SD card is the one that appears by default, leave it as it is and if not, click **Change** and select the desired SD card. コンピュータに挿入されている SD カードを選択します。 SD カードがデフォルトで表示されるものである場合はそのままにし、そうでない場合は **Change** をクリックして目的の SD カードを選択します。 {{ :wiki:etcher2.png }} Click **Flash!** to mount the image on the card. **Flash!** をクリックして、イメージをカードに書き込みます。 Then, remove the card securely according to your OS instructions. 次に、OS の指示に従ってカードを安全に取り外します。 ==== ハードウエア接続 ==== このステップでは、我々のオペレーティングシステムで Raspberry を起動するために、すべてのコンポーネントを接続します。 * SD カードを箱の下にあるスロットに挿入します。 * キーボードを任意の USB ポートへ接続します。 * HDMI ケーブルで Raspberry とモニターを接続します。 * 電源ケーブルを電源に接続します。 ==== ネットワーク設定 ==== 画面にはどのデバイスを起動するかが表示されます。また、どのインタフェースを設定するかがインストーラで表示されます。 === DHCP === Select ''Eth0'' to configure the wired network interface: 有線のネットワークインタフェースの設定を行うために ''Eth0'' を選択します。 It will ask whether you want to change the Eth0 interface settings. Click **Yes** Eth0 インターフェース設定を変更するかどうかを尋ねられます。 **Yes** をクリックします Select **DHCP** if there is a DHCP server in the network ネットワーク内に DHCP サーバがある場合は、**DHCP** を選択します。 Then, a message will appear saying that the wired network has been correctly configured. 次に、有線ネットワークが正しく設定されたことを示すメッセージが表示されます。 === 固定 IP 設定 === Select **IP STATIC** if you wish to configure the wired interface manually. 有線インタフェースを手動で設定したい場合は、**IP STATIC** を選択します。 Enter the Raspberry's static IP. Raspberry の固定 IP を入力します。 Enter the network's **Gateway.** ネットワークの **Gateway** を入力します。 Enter the network mask. ネットワークマスクを入力します。 Enter the public DNS. DNS を入力します。 You will get a message that the configuration has been successfully completed. 設定が完了した旨のメッセージが表示されます。 === 無線 LAN DHCP === Select **Wlan0** to configure the wireless network interface 無線 LAN 設定には、**Wlan0** を選択します。 {{ :wiki:wifi1.png }} It will ask whether you wish to change the **Wlan0** interface configuration. Click **Yes.** **Wlan0** インターフェイスの設定を変更するかどうかを尋ねられます。 **Yes** をクリックします。 Select **DHCP** if there is a DHCP server in the network. ネットワーク上に DHCP サーバがある場合は、**DHCP** を選択します。 Choose the name of the access point from the provided list. Enter the password of the access point. 表示されたリストからアクセス ポイントの名前を選択します。 アクセスポイントのパスワードを入力します。 You will get a message that the configuration was successful. 設定が成功したことを示すメッセージが表示されます。 === 無線 LAN 固定 IP 設定 === * Select **WIFI STATIC** if you wish to configure the wired interface manually. * Choose the name of the access point from the provided list. Enter the password of the access point. * Enter the device static IP address. * Enter the network mask. * Enter the access point **Gateway.** * You will receive a message saying the configuration was successful. * 無線 LAN で固定 IP 設定をしたい場合は、**WIFI STATIC** を選択します。 * アクセスポイント名一覧からアクセスポイントを選択します。アクセスポイントのパスワードを入力します。 * デバイスの固定 IP を入力します。 * ネットワークマスクを入力します。 * アクセスポイントの **Gateway** を入力します。 * 設定が成功したことを示すメッセージが表示されます。 ==== エージェント/サテライトの設定 ==== === エージェント === * To install the agent, select **AGENT** from the menu. * It will ask for the IP address of the Pandora FMS server the agent must point to. * Enter the **existing group** in the Pandora FMS server you wish to add the agent to. * エージェントをインストールするには、メニューから **AGENT** を選択します。 * エージェントが接続する先の Pandora FMS サーバの IP を聞かれます。 * エージェントを追加したい Pandora FMS サーバ上の **既存グループ** を入力します。 === サテライト === * To install the satellite, select **SATELLITE** from the menu. * Enter the IP address of Pandora FMS server the agent must point to. * Enter the network range you wish to monitor along with its mask. * Enter the community or list of SNMP communities of the devices in your network. * Enter the user or list of users to make WMI queries to the computers on your network. * サテライトをインストールするには、メニューから **SATELLITE** を選択します。 * エージェントが接続する先の Pandora FMS サーバの IP を聞かれます。 * 監視したいネットワークの範囲をマスクをつけて入力します。 * ネットワーク内のデバイスの SNMP コミュニティもしくは、その一覧を入力します。 * ネットワーク上のコンピュータへ WMI クエリを実行する場合のユーザもしくは、ユーザ一覧を入力します。 ===== インストール後の調整 ===== ==== eHorus クライアント設定 ==== Edit the file with the **nano** text editor: **nano** エディタで以下のファイルを編集します。 /etc/ehorus/ehorus.conf Replace the''eh_user'' token with your eHorus user. In line ''#password secret'' delete the number that indicates the biginning of the comment (//uncomment the line//) and replace the word “secret” by a password to access your agent from eHorus. ''eh_user'' を自身の eHorus ユーザに置き換えます。''#password secret'' の行のコメントを外し、“secret” を eHorus からエージェントにアクセスするときのパスワードに置き換えます。 [[:wiki:ehorus_conf.png?id=ja%3Adocumentation%3A03_monitoring%3A15_raspberry_monitoring&media=wiki:ehorus_conf.png|{{ :wiki:ehorus_conf.png }}]] /etc/init.d/ehorus_agent_daemon start グラフィカル環境で見るには、x11vnc をインストールします。 apt-get install x11vnc 次の通りサービスを起動します。 /etc/init.d/ehorus_agent_daemon start ==== Netflow プローブ ==== 処理は、次の複数のコンポーネントに基づいて行われます。 * ネットフローとの互換性を持つデバイスで、通常は、情報パケットを生成するスイッチまたはルータのようなネットワークハードウェア、または netflow プローブ。 * 上記のデバイスによって生成されたパケットを受信し、格納して処理する netflow コレクタ。 通常は、これらの機能を備えたツールまたはサーバーです。 Pandora FMS は、すべての netflow トラフィックを処理するために nfcapd というオープンソースツールを用います。このデーモンは、Pandora FMS サーバにより自動的に起動されます。このシステムはデータを指定の場所のバイナリファイルに保存します。Pandora で Netflow が動作するようにするためには、システムに nfcapd をインストールしておく必要があります。デフォルトで nfcapd デーモンは、9995/UDP で待ち受けます。Netflow プローブを設定するとき、ファイアーウォールがある場合はこのポートを開ける必要があることを考慮してください。 === ソフトウエア経由での Netflow プローブ === Netflow ルータがない場合でも、通信が Linux システムを通る場合は、プローブとして動作するソフトウエアをインストールすることができ、Netflow トラフィック情報をコレクタに送信することができます。 Linux では、fprobe と呼ばれるプログラムがあり、トラフィックをキャプチャし NetFlow サーバへ送信します。 これにより、インタフェースを通過する全ネットワークトラフィックから、Netflow トラフィックを生成することができます。 最初に、fprobe をインストールする必要があります。 apt-get install fprobe どのインタフェースをモニタしたいかと、どの ip:port に情報を送信したいかを聞かれます。 聞かれない場合は、次のコマンドで設定することができます。 /usr/sbin/fprobe -i -fip > 次の例では、eth0 インタフェースからのすべてのトラフィックを 192.168.70.185 のポート 9995 で待ち受けている Netflow コレクタに送信します。 /usr/sbin/fprobe -i eth0 -fip 192.168.70.185:9995 トラフィックが生成されたら、次のコマンドで Netflow コレクタ上でトラフィックの統計を見ることができます。 nfdump -R /var/spool/pandora/data_in/netflow Netflow は、操作および管理メニューからアクセスできるように有効化されている必要があります。 [[:ja:documentation:03_monitoring:18_netflow#設定|Netflow設定]] Netflow の設定をしたら、nfcapd を起動するために Pandora FMS サーバを再起動する必要があります。起動のまえに正しくインストールされている必要があります。うまくいかない場合はサーバのログを確認してください。 === ポートミラーリングによる Netflow プローブ === [[:ja:documentation:03_monitoring:18_netflow#設定|Netflow ポートミラーリング]] を参照してください。