文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== ネットワーク設定管理 (NCM) ====== {{indexmenu_n>16}} [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] ===== 概要 ===== Pandora FMS NCM Server (**Network Config Management**) allows interacting with any network device, through Telnet and SSH protocols, to manage its configuration, perform backups, restore the configuration of the devices from the backups made and even perform custom executions with them. Pandora FMS NCM サーバ(**ネットワーク設定管理**)を使用すると、Telnet および SSH プロトコルを介して任意のネットワークデバイスと対話し、設定の管理、バックアップの実行、作成したバックアップからのデバイス設定の復元、さらにはカスタム実行が可能です。 To carry out all of these tasks, it is based on a system of templates by ''Manufacturer''-''Model'' that will allow to customize all the executions the network devices will carry out, having the control and knowledge of all the executions that will be carried out in each and every one of the above mentioned network devices. これらのタスクの実行は、''メーカ'' - ''モデル'' によるテンプレートのシステムに基づいています。ネットワークデバイスで実行できる処理のデータを持っており、すべての処理をカスタマイズすることができます。上記のそれぞれの処理やすべてを実行することができます。 <wrap #ks2 /> ===== NCM サーバの有効化 ===== To enable this feature in Pandora FMS, [[:en:documentation:pandorafms:installation:04_configuration#heavyserver|Heavy Server]] must be running (it is enabled by default). Pandora FMS でこの機能を有効にするには、[[:ja:documentation:pandorafms:installation:04_configuration#heavyserver|ヘビーサーバ]] が実行されている必要があります (デフォルトでは有効になっています)。 In addition, the following [[:en:documentation:pandorafms:installation:04_configuration#ncm_ssh_utility|parameter]] must be correctly configured in the ''pandora_server.conf'' file: さらに、次の [[:ja:documentation:pandorafms:installation:04_configuration#ncm_ssh_utility|パラメータ]] を ''pandora_server.conf'' ファイルで正しく設定する必要があります。 <code> # NCM utility to execute SSH and Telnet connections. ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension </code> <WRAP center round info 90%> For the menus related to everything concerning the NCM server to appear //[[#acl|each user must have the corresponding ACL rights]]//. </WRAP> <WRAP center round info 90%> NCM サーバに関連するすべてのメニューを表示するには、//[[#acl|各ユーザが対応する ACL 権限を持っている必要があります]]//。 </WRAP> <wrap #ks3 /> ===== ベンダとモデルの定義 ===== Before starting work, you must make sure that the system has the manufacturer and model(s) of the devices to be used defined. To that end use the //Vendor// and //Model// editors. 利用開始する前に、利用するデバイスのベンダとモデルが定義されていることを確認する必要があります。それには、//ベンダ// および //モデル// エディタを利用します。 You will find these editors in the **Configuration** → **Network Config Manager** section. **設定(Configuration)** → **ネットワーク設定管理(Network Config Manager)** セクションに、これらのエディタがあります。 <WRAP center round info 60%> This is only a descriptive definition. The logic is applied in the network equipment Templates. </WRAP> <WRAP center round info 60%> これは説明的な定義にすぎません。 ロジックは、ネットワーク機器のテンプレートに適用されます。\\ </WRAP> <wrap #ks4 /> ===== ネットワーク機器テンプレート ===== Templates are applied on a Manufacturer and on one or more models. **Templates define how to interact with a network computer**. The NCM and the equipment can be connected through Telnet or SSH. In both cases it will be necessary to provide one or more sets of credentials (in the case of the Cisco manufacturer the access username/password and the ''enable'' mode password). In other devices there may be two pairs of credentials. テンプレートは、メーカーと1つ以上のモデルに適用されます。 **テンプレートは、ネットワーク機器との対話方法を定義します。** NCM と機器は、Telnet または SSH を介して接続できます。 どちらの場合も、1つ以上の資格情報のセットを提供する必要があります(Cisco の場合は、アクセスユーザ名/パスワードと ''enable'' モードのパスワード)。他のデバイスでは、2組の資格情報が存在する場合があります。 For the credentials, use [[:en:documentation:04_using:11_managing_and_administration#credential_store|Pandora FMS internal credentials system]] that allows to reuse them without knowing the details. That way the administrator may specify different user/password "pairs" with an identifier, **and an operator may use them without seeing the content**. In NCM, these users and passwords are passed to the dialog with the device through macros. 認証情報には、[[:ja:documentation:04_using:11_managing_and_administration#認証情報ストア|Pandora FMS 内部認証情報システム]] を使用して、詳細を知らなくても再利用できるようにします。 このようにして、管理者は識別子を使用して異なるユーザ/パスワードの ''ペア'' を指定でき、**オペレーターは内容を見ずにそれらを使用できます**。 NCM では、これらのユーザとパスワードは、マクロを介してデバイスとのダイアログに渡されます。 **Macros in the dialog with the network device** **ネットワークデバイスに対するダイアログにおけるマクロ** * ''_enablepass_'' : It will be replaced by the ''password'' field of the advanced key associated to the agent. * ''_username_'' : It will be replaced by the ''username'' field of the agent's access key. * ''_password_'' : It will be replaced by the ''password'' field of the agent's access key. * ''_advusername_'' : It will be replaced by the ''username'' field of the ''enable'' advanced key. * ''_advpassword_'' : It will be replaced by the ''password'' field of the ''enable'' advanced key. It is an alias of ''_enablepass_'' and both can be used in the templates since they are equivalent to the same value. * ''_applyconfigbackup_'' : Expands by as many commands as there are configuration lines in the current backup, applied line by line, as they are applied in Cisco® devices. * ''_SOURCE_FILE_NAME_'': It will be replaced by the path to the last firmware uploaded for a specific manufacturer and model in Pandora FMS server, to be downloaded using the IP address of the FTP server (**FTP server IP** field). * ''_TFTP_SERVER_IP_'': It will be replaced by the IP address configured for the FTP server from which the //firmware// to be used by NCM devices can be downloaded. The IP address can be specified in [[:en:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1_1|Pandora FMS general configuration]]. * ''_enablepass_'' : エージェントに関連付けられた拡張キーの ''パスワード'' フィールドに置き換えらえます。 * ''_username_'' : エージェントのアクセスキーの ''ユーザ名'' フィールドに置き換えられます。 * ''_password_'' : エージェントのアクセスキーの ''パスワード'' に置き換えられます。 * ''_advusername_'' : ''enable'' 拡張キーの ''ユーザ名'' フィールドに置き換えられます。 * ''_advpassword_'' : ''enable'' 拡張キーの ''パスワード'' フィールドに置き換えれれます。''_enablepass_'' の別名です。同じ値を参照しており、どちらもテンプレートで利用可能です。 * ''_applyconfigbackup_'' : 現在のバックアップにある設定行と同じ数のコマンドが展開されます。 Cisco® デバイスに適用する場合、1行ずつ適用されます。 * ''_SOURCE_FILE_NAME_'': これは、FTP サーバの IP アドレス (**FTP サーバ IP** フィールド) を使用してダウンロードされる、Pandora FMS サーバ内の特定の製造元およびモデルに対してアップロードされた最新のファームウェアへのパスに置き換えられます。 * ''_TFTP_SERVER_IP_'': これは、NCM デバイスが使用する//ファームウェア//をダウンロードできる FTP サーバに設定された IP アドレスに置き換えられます。IPアドレスは[[:ja:documentation:pandorafms:management_and_operation:12_console_setup#ks1_1_1|Pandora FMS の一般設定]]で指定できます。 <wrap #ks4_1 /> ==== NCM テンプレートの作成 ==== Click the **Define a NCM template button** (menu **Management → Configuration → Network Config Manager**) and click the **Create** button. **NCM テンプレート定義(Define a NCM template)** ボタン (メニュー **管理(Management) → 設定(Configuration) → ネットワーク設定マネージャー(Network Config Manager)**) をクリックし、**作成(Create)** ボタンをクリックします。 Fill the fields: フィールドに入力します。 * **Name**: NCM template name. * **Vendors**: Comma separated, a vendors list compatible with scripts defined within template. * **Models**: Comma separated, a model list compatible with scripts defined within template. * **Script: Test**: This script will be used to test devices availability. * **Script: Get configuration**: This script will be used to retrieve configuration from devices * **Script: set configuration**: This script will be used to apply configuration, previously backed up, to devices. * **Script: get firmware**: This script will be used to retrieve firmware version from devices. * **Script: set firmware**: This script will be used to upgrade firmware version of the devices. * **Script: custom task**:This script will be executed on the devices when selecting **CUSTOM** task. * **名前(Name)**: NCM テンプレート名。 * **ベンダ(Vendors)**: カンマ区切りの、テンプレート内で定義されたスクリプトと互換性のあるベンダー一覧。 * **モデル(Models)**: カンマ区切りの、テンプレート内で定義されたスクリプトと互換性のあるモデル一覧。 * **スクリプト: テスト(Script: Test)**: デバイスの可用性をテストするために使用されるスクリプト。 * **スクリプト: 設定取得(Script: Get configuration)**: デバイスから設定を取得するために使用されるスクリプト。 * **スクリプト: 設定(Script: set configuration)**: デバイスの設定、以前のバックアップをするために使用されるスクリプト。 * ** スクリプト: ファームウエア取得(Script: get firmware)**: デバイスからファームウエアのバージョンを取得するために使用されるスクリプト。 * **スクリプト: ファームウエア設定(Script: set firmware)**: デバイスのファームウエアをアップグレードするために使用されるスクリプト。 * **スクリプト: カスタムタスク(Script: custom task)**: **カスタム(CUSTOM)** タスクを選択したときにデバイスで実行されるスクリプト。 <wrap #ks4_2 /> ==== Cisco 7200 デバイスでの利用例 ==== These scripts only work if the user you log in with (via Telnet or SSH) works with user and password and does not have ''enable'' field enabled by default. これらのスクリプトは、(Telnet または SSH 経由で)ログインするユーザがユーザとパスワードを利用し、デフォルトで ''enable'' フィールドが有効になっていない場合にのみ機能します。 === テスト === A test connection is made to the device and ended without performing any operation. デバイスへのテスト接続が行われ、操作を実行せずに終了します。 <code> enable expect:Password:\s* _enablepass_ exit </code> The test connection is used to verify that you can actually connect to the device. It can be modified (''expect:xxxx'') to expect a certain response, such as ''Ready''. This is only a basic example. テスト接続は、実際にデバイスに接続できることを確認するために使用されます。 ''Ready'' などの特定の応答を期待するように変更 (''expect:xxxx'') することができます。 これは基本的な例にすぎません。 <wrap #ks4_2_2 /> === 現在の設定の取得 === This block is used to define the way to obtain the configuration of the active device. In this example (Cisco®), the running configuration of the device is obtained by executing the ''show running-config'' command inside the device: このブロックは、現在のデバイスの設定を取得する方法を定義するために使用されます。 この例(Cisco®)では、デバイスの running configuration は、デバイス内で ''show running-config'' コマンドを実行することによって取得されます。 <code> enable expect:Password:\s* _enablepass_ term length 0 capture:show running-config exit </code> ''capture:<comando>'' : It is used to capture as active configuration what is returned by the screen. ''capture:<comando>'' : 画面に返す現在の設定を取得するために使われています。 <wrap #ks4_2_3 /> === ファームウエアバージョンの取得 === Similar to the previous case, run the ''show version | i IOS Software'' command to retrieve the firmware version of the device, and as in the previous case, the ''capture'' command is used to capture the output of the command. 前の例と似ていますが、''show version | i IOS Software'' コマンドを使用してデバイスのファームウェアバージョンを取得します。前の例と同様に、''capture'' コマンドを使用してコマンドの出力を取得します。 <code> enable expect:Password:\s* _enablepass_ term length 0 capture:show version | i IOS Software exit </code> <wrap #ks4_2_4 /> === 設定バックアップのリストア === In this execution, the macro ''_applyconfigbackup_'' is used to apply all the configuration stored in the Backup previously stored in the Console. これは、マクロ ''_applyconfigbackup_'' を使用して前もってコンソール上にバックアップ保存されているすべての設定を適用します。 <code> enable expect:Password:\s* _enablepass_ term length 0 config terminal _applyconfigbackup_ exit </code> <wrap #ks4_2_5 /> === カスタムスクリプトの例 === Example of a custom script in which the values of some SHH parameters of the device are changed. Any necessary modification or command execution can be applied. デバイスの SSH パラメータの一部の値を変更するカスタムスクリプトの例です。必要な変更やコマンドの実行を適用できます。 <code> enable expect:Password:\s* _enablepass_ conf term ip ssh authentication-retries 4 ip tcp synwait-time 10 end exit </code> All changes recorded in the device will be recorded **when performing a firmware backup** and you will have control of the changes made, both [[en:documentation:pandorafms:technical_annexes/22_pfms_report_types#ks15|by reports]] and by screen (Web Console PFMS). デバイスに記録されたすべての変更は**ファームウェアバックアップの実行時に**記録され、[[:ja:documentation:pandorafms:technical_annexes/22_pfms_report_types#ks15|レポート]]と画面(Webコンソール)の両方で行われた変更を制御できます。 <wrap #ks5 /> ===== エージェントデータテンプレート ===== These templates allow obtaining data from an NCM device and updating the information of the agent for which they are executed with such data. The operation and configuration is identical to that of the network equipment templates, but in this case indicating the agent field that will update the result of each script. The fields that can be updated in an agent are: これらのテンプレートは、NCM デバイスからデータを取得し、そのデータを使用して実行対象のエージェントの情報を更新します。操作と設定はネットワーク機器テンプレートと同じですが、このテンプレートでは、各スクリプトの結果を更新するエージェントフィールドを指定します。エージェントで更新できるフィールドは以下のとおりです。 * **OS version**. <wrap #ks5_1 /> ==== エージェントデータテンプレートの作成 ==== Click **Create** (menu **Management → Configuration → Network Config Manager → NCM Agents data templates** and fill in the requested fields: **作成(Create)** (メニュー **管理(Management) → 設定(Configuration) → ネットワーク設定管理(Network Config Manager) → NCM エージェントデータテンプレート(NCM Agents data tempates)**) をクリックし、要求されたフィールドに入力します。 * **Vendors**: Comma-separated, script-compatible list of vendors. * **Models**: A comma-separated list of models supported by scripts. * **Script OS version**: This script will be used to update the agent version OS field. * **ベンダー(Vendors)**: スクリプト互換のベンダーのカンマ区切りリスト。 * **モデル(Models)**: スクリプトでサポートされるモデルのカンマ区切りリスト。 * **スクリプト OS バージョン(Script OS version)**: このスクリプトは、エージェントの OS バージョンフィールドを更新するために使用されます。 <wrap #ks6 /> ===== エージェントでの設定 ===== Within each of the agents that need to manage their remote configuration, associate a model to it. リモート設定管理をする必要がある各エージェント内で、モデルを関連付けます。 This association will have to be done in the NCM section of the agent, where the following parameters must be selected: この関連付けは、エージェントの NCM セクションで行う必要があります。ここで、次のパラメータを選択する必要があります。 * **Device manufacturer**. * **Device model**. * **Connection method**: Type of connection to be made (Telnet or SSH). If you use SSH with key pairs, it is important that you keep it updated by deleting or adding each IP address and its respective key in the file ''/etc/.ssh/known_hosts'' . * **Port**: Port to use in the Telnet or SSH connection. * **Credentials to access device**: Credentials stored in [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#credential_store|Credential Store of Pandora FMS]], which will be used to make the initial Telnet or SSH connection. It is necessary for the user to need both parameters when connecting. * **Credentials to admin device**: Credentials stored in [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#credential_store|Credential Store of Pandora FMS]], which will be identified within the template selected in **NCM template to be used**, with the macros ''_advusername_'' for the user and ''_enablepass_'' or ''_advpassword_'' for the password. * **NCM template to be used**: If there is a template defined, choose one that is compatible with the chosen model. * **デバイスのベンダ(Device manufacturer)**. * **デバイスモデル(Device model)**. * **接続手法(Connection method)**: 接続タイプ(Telnet または SSH) * **ポート(Port)**: Telnet または SSH 接続で利用するポート番号 * **デバイスへアクセスする認証情報(Credentials to access device)**: [[:ja:documentation:pandorafms:management_and_operation:11_managing_and_administration#認証情報ストア|Pandora FMS の認証情報ストア]] 内の認証情報で、Telnet または SSH 接続に利用されます。ユーザが接続するときは、両方のパラメーターが必要です。 * **admin の認証情報(Credentials to admin device)**: [[:ja:documentation:pandorafms:management_and_operation:11_managing_and_administration#認証情報ストア|Pandora FMS の認証情報ストア]] 内の認証情報で、**使用する NCM テンプレート**で選択されたテンプレート内で利用されます。マクロはユーザの場合は ''_advusername_''、パスワードの場合は ''_enablepass_'' または ''_advpassword_'' です。 * **使用する NCM テンプレート(NCM template to be used)**: テンプレートが定義されている場合は、選択したモデルと互換性のあるテンプレートを選択します。 If the chosen template has **Script: Get configuration** can be backed up periodically using the **Backup schedule (if defined)** option. To create an [[:en:documentation:pandorafms:management_and_operation:01_alerts#ks12|event]] if there are changes between configuration backups, check the option just to the right of the period selection list (daily, weekly, monthly or unscheduled). 選択したテンプレートに **スクリプト: 設定の取得** が含まれている場合、**バックアップスケジュール(定義されている場合)** オプションを使用して定期的にバックアップできます。設定バックアップ間で変更があった場合に [[:ja:documentation:pandorafms:management_and_operation:01_alerts#ks12|イベント]] を作成するには、期間選択リスト(毎日、毎週、毎月、またはスケジュールなし)のすぐ右にあるオプションにチェックを入れます。 <WRAP center round info 75%> To upload the firmware files and create backups of them with FTP, you must do it in an encrypted way to have the highest possible security. See section “[[:en:documentation:pandorafms:technical_annexes:01_ssh_and_ftp_setup#ftp_configuration_to_receive_data_in_pandora_fms|FTP configuration to receive data in Pandora FMS]]” and the use of vsFTPd. You must use SFTP with exclusive [[https://en.wikipedia.org/wiki/Chroot|chroot]] in: ''/var/spool/pandora/firmware/'' See Pandora FMS "[[:en:documentation:pandorafms:cybersecurity:15_security_architecture|Security Architecture]]" for a comprehensive overview of this issue. </WRAP> <WRAP center round info 75%> ファームウェアファイルをアップロードし、FTP でそれらのバックアップを作成するには、暗号化された方法でそれを実行して、可能な限り最高のセキュリティを確保する必要があります。 “[[:ja:documentation:pandorafms:technical_annexes:01_ssh_and_ftp_setup#ftp_にてサーバがデータを受け取る設定|Pandora FMS にデータを取り込むための FTP 設定]]” および vsFTPd の使用を参照してください。 次の場所で排他的な [[https://en.wikipedia.org/wiki/Chroot|chroot]] を使用して SFTP を使用する必要があります。 ''/var/spool/pandora/firmware/'' これに関する統合的な内容は、Pandora FMS の "[[:ja:documentation:pandorafms:cybersecurity:15_security_architecture|セキュリティアーキテクチャ]]" を参照してください。 </WRAP> * **NCM Agents data templates to be used**: If there is any template that updates agent data defined, choose one that is compatible with the chosen model. It will be possible to schedule the execution of such template with the **Agents data templates schedule (if defined)** option. To create an [[:en:documentation:pandorafms:management_and_operation:01_alerts#ks12|event]] if there are changes between the data obtained and the current data, check the option just to the right of the period selection list (daily, weekly, monthly or unscheduled). * **使用するNCMエージェントデータテンプレート(NCM Agents data templates to be used)**: エージェントデータを更新するテンプレートが定義されている場合は、選択したモデルと互換性のあるものを選択してください。**エージェントデータテンプレートスケジュール(定義されている場合)** オプションを使用して、このテンプレートの実行をスケジュール設定できます。取得データと現在のデータに変化があった場合に[[:ja:documentation:pandorafms:management_and_operation:01_alerts#ks12|イベント]]を作成するには、期間選択リスト(日次、週次、月次、またはスケジュールなし)のすぐ右にあるオプションにチェックを入れます。 <WRAP center round tip 90%> This configuration can be performed in bulk for several agents meeting the same characteristics from the menu **Management → Configuration → Network Config Manager → Manage NCM devices**. </WRAP> <WRAP center round tip 90%> この設定は、**管理(Management) → 設定(Configuration) → ネットワーク設定管理(Network Config Manager) → NCM デバイスの管理(Manage NCM devices)** メニューから、同じ特性を満たす複数のエージェントに対して一括で実行できます。 </WRAP> <wrap #ks7 /> ===== デバイスの設定管理 ===== After the NCM devices have been configured, you may access the agent view or go to **Management → Configuration → Network Config Manager → NCM Devices** to perform all possible management on each device. NCM デバイスの設定が完了したら、エージェント表示にアクセスするか、**管理(Management) → 設定(Configuration) → ネットワーク設定管理(Network Config Manager) → NCM デバイス(NCM Devices)** に移動して、各デバイスに対して可能なすべての管理操作を実行できます。 {{ :wiki:pfms-management-configuration-network_config_manager-ncm_devices-01.png }} {{ :wiki:pfms-management-configuration-network_config_manager-ncm_devices-02.png }} From both views you may queue all the tasks defined in the template, download the current configuration, see the backups generated for the device and compare them with the last backup obtained. どちらの画面からも、テンプレートで定義されているすべてのタスクをキューに追加したり、現在の設定をダウンロードしたり、デバイス用に生成されたバックアップを表示したり、最後に取得したバックアップと比較したりできます。 {{ :wiki:pfms-management-configuration-network_config_manager-ncm_devices-03.png }} <wrap #ks7_1 /> ==== スニペットの実行 ==== It will also be possible to execute snippets on any NCM device, i.e. scripts that would not be defined in the templates and that allow code blocks to be executed on demand. These are one-time scripts that are not stored. また、NCM デバイス上でスニペット(テンプレートには定義されていないスクリプトで、必要に応じてコードブロックを実行できるもの)を実行することも可能になります。これらは一度限りの実行で、保存されることはありません。 {{ :wiki:pfms-management-configuration-network_config_manager-ncm_devices-snippet_script.png }} <wrap #ks8 /> ===== ACL ===== For the NCM feature there are three different [[:en:documentation:04_using:11_managing_and_administration#profiles_in_pandora_fms|ACL]] bits in which you may define the different users from the following defined bits: NCM 機能には、次の定義済みビットからさまざまなユーザを定義できる 3つの異なる [[:ja:documentation:04_using:11_managing_and_administration#pandora_fms_でのプロファイル|ACL]] ビットがあります。 **View NCM data** → You will only be able to see the agent view and see the information reflected on it without being able to apply any changes on it. **NCM データ参照(View NCM data)** → エージェント表示を参照でき、それに反映されている情報を見ることはできますが、変更を適用することはできません。 **Operate NCM** → You will be able to not only see the view, but also to perform the executions you wish on the agents and on the NCM view. **NCM 操作(Operate NCM)** → 参照できるだけでなく、エージェントおよび NCM 表示で必要な処理を実行することもできます。 **Manage NCM** → With this permission you will be able to generate templates, models and new manufacturers in addition to the executions already performed by Operate NCM. **NCM 管理(Manage NCM)** → この権限があれば、NCM 操作(Operate NCM) によってできる実行に加えて、テンプレート、モデル、および新しいメーカーを設定できます。 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/monitoring/16_ncm.txt 最終更新: 2026/04/18 22:38by junichi