両方とも前のリビジョン 前のリビジョン 次のリビジョン 前のリビジョン ja:documentation:pandorafms:technical_reference:03_anexo_cli [2025/05/17 02:14] – [--get_policy_modules] junichi ja:documentation:pandorafms:technical_reference:03_anexo_cli [2025/05/17 02:35] (現在) – [--start_snmptrapd] junichi
==== --get_policies ==== ==== --get_policies ====
(バージョン 5.0 以上)
**オプションパラメーター: ** [<エージェント名> <エージェントの別名の利用>] **Required parameters **: None.
**説明:** 全てのポリシー( パラメータ無しの場合)または、指定したエージェントのポリシーを取得します(パラメータにエージェントを指定 します)。 **必須 パラメータ**: な し
**実行例: ** **Optional parameters **:
perl pandora_manage .pl /etc/pandora/pandora_server.conf --get_policies 'Agent name' **オプションパラメータ**:
* < agent_name >
* ''use_alias'' to search by agent alias .
* < エージェント名 >
* ''use_alias'' エージェントの別名で検索する場合
**Description**:
**説明**:
* Without parameters: Obtains all policies (numeric identifier and name).
* Agent name: Gets the policies of an agent (list agent name, numeric policy identifier and policy name).
* パラメータなし: すべてのポリシー (数値識別子と名前) を取得します。
* エージェント名: エージェントのポリシー (エージェント名、数値ポリシー識別子、ポリシー名の一覧) を取得します。
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
**例([[#ks1|呼び出し]]と[[#ks1_1|書式]]を参照)**:
<code bash>
pandora_manage /etc/pandora/pandora_server.conf --get_policies "pandorafms agent" use_alias
</code>
<wrap #ks8 />
===== Netflow ===== ===== Netflow =====
==== --create_netflow_filter ==== ==== --create_netflow_filter ====
(>= 5.0)
**オプションパラメーター: ** <ファイル名> <グループ名> <フィルター> <集約方法> <出力フォーマット> **Required parameters **:
**説明: ** Netflow フィルタを作成します。 **必須パラメータ **:
集約方法に指定可能なパラメータ : dstip,dstport,none, proto,srcip,srcport * < new_filter_name >
出力フォーマットに指定可能なパラメータ: kilobytes,kilobytespersecond,megabytes,megabytespersecond * < agent_group_name >
* < filter_as_such >
* < aggregated_by > One of the following values : ''none'', '' dstip'' , '' dstport'' , '' proto'' , '' srcip'' , '' srcport''.
* < formato_de_salida > '' kilobytes'' , '' kilobytespersecond'' , '' megabytes'' , '' megabytespersecond''.
**実行例: ** * < 新規フィルタ名 >
* < エージェントグループ名 >
* < フィルタ >
* < 集約 > 次のいずれか: ''none'', ''dstip'', ''dstport'', ''proto'', ''srcip'', ''srcport''
* < 出力フォーマット > ''kilobytes'', ''kilobytespersecond'', ''megabytes'', ''megabytespersecond''
Netflow フィルタを作成するには、次のコマンドを実行します。 **Optional parameters**: None.
perl pandora_manage .pl /etc/pandora/pandora_server.conf --create_netflow_filter "Filter name " Network "host 192.168.50.3 OR host 192.168.50.4 or HOST 192.168.50.6" dstport kilobytes **オプションパラメータ**: なし
**Description**: Create a new filter to monitor via NetFlow® .
**説明**: NetFlow® 経由で監視する新しいフィルターを作成します。
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
**例([[#ks1|呼び出し]]と[[#ks1_1|書式]]を参照)**:
<code bash>
pandora_manage /etc/pandora/pandora_server.conf --create_netflow_filter "New filter" "Network" "host 192.168.50.3 OR host 192.168.50.4 or HOST 192.168.50.6" dstport kilobytes
</code>
<wrap #ks9 />
===== ツール ===== ===== ツール =====
==== --exec_from_file ==== ==== --exec_from_file ====
(バージョン 5.0 以上)
**オプションパラメーター: ** <ファイルパス> <実行オプション> <オプションパラメータ> **Required parameters ** (see case study):
**説明: ** このオプションで、CSV ファイルから読み込んだマクロで CLI を実行 します。マクロの数は、CSV ファイルのカラム数になります。それぞれのマクロは、__FIELD1__ , __FIELD2__ , __FIELD3__ と いった形式になります。 **必須パラメータ ** (ケーススタディ を参照 してくださ い):
**実行例:** * < command_to_execute >
CSV ファイルから、ユーザを作成します。 * < parameters_of_the_command_to_execute >
次のような CSV ファイルが必要で す。 * < 実行 するコマンド >
* < 実行するコマンドのパラメータ >
<code > **Description**: With this option it is possible to execute any CLI PFMS command with macros from a CSV file. The number of macros will correspond to the number of columns in the CSV file. Each macro will be called '' <nowiki >__FIELD1__</nowiki>'' , ''<nowiki>__FIELD2__</nowiki>'' , ''<nowiki>__FIELD3__</nowiki>'' , … , ''<nowiki>__FIELDn__ </nowiki >''.
User 1 ,Password 1 ,0
User 2 ,Password 2 ,0
User 3,Password 3,0
User Admin,Password Admin,1
</code >
ファイル名 は、'/tmp /users_csv ' で す。 **説明**: このオプションを使用すると、CSV ファイルからマクロを使用して任意の PFMS CLI コマンドを実行できます。マクロの数 は CSV ファイルの列数に対応します。各マクロは ''<nowiki>__FIELD1__</nowiki>'' 、''<nowiki>__FIELD2__< /nowiki>''、''<nowiki>__FIELD3__< /nowiki> ''、…、''<nowiki>__FIELDn__</nowiki>'' という名前になりま す。
--create_user を次のオプションをつけて実行します。 <ユーザ名> <ユーザパスワード> <管理者フラグ> <コメント ><WRAP center round info 90% >
次のように実行します。 Commas in CSV columns are not yet supported.
perl pandora_manage.pl /etc/pandora/pandora_server.conf --exec_from_file /tmp/users_csv create_user __FIELD1__ __FIELD2__ __FIELD3__ 'User created with exec_from_file option from CLI' < /WRAP>
注意: CSV カラム 内に カンマを含める操作に は対応し ていません。<WRAP center round info 90%>
CSV 列 内の カンマはまだサポートされ ていません。
</WRAP>
**Case study**:
**ケーススタディ**:
Register users with the command [[#create_user|create_user]] from CSV file ''/tmp/users_csv'':
CSV ファイル ''/tmp/users_csv'' からコマンド [[#create_user|create_user]] を使用してユーザを登録します。
<file>
User 1,Password 1,0
User 2,Password 2,0
User 3,Password 3,0
User Admin,Password Admin,1
</file>
Sentence to be executed (line connectors are included for didactic purposes):
実行される内容 (わかりやすいように複数行で書いています):
<code bash>
pandora_manage /etc/pandora/pandora_server.conf --exec_from_file \
/tmp/users_csv \
create_user \
__FIELD1__ \
__FIELD2__ \
__FIELD3__ \
'Created by exec_from_file CLI PFMS command'
</code>
==== --create_snmp_trap ==== ==== --create_snmp_trap ====
**オプションパラメーター: ** <ファイルパス> <名前> <OID> <説明> <重要度> **Required parameters **:
**名前 **: snmp トラップコンソールで表示されます。 **必須パラメータ **:
**OID**: SNMP トラップのメイン OID。 * < snmp_trap_name > As will be seen in the [[[:en:documentation:pandorafms:monitoring:08_snmp_traps_monitoring|SNMP traps console]].
* < OID >
* < description >
* < severity > Numeric value, one of the following values : ''0'' (<wrap :en>**Maintenance**</wrap>), ''1'' (<wrap :en>**Info**</wrap>) , ''2'' (<wrap :en>**Normal**</wrap>), ''3'' (<wrap :en>**Warning**</wrap>), ''4'' (<wrap :en>**Critical**</wrap>), ''5'' (<wrap :en>**Minor**</wrap>), ''6'' (<wrap :en>**Major**</wrap>).
**重要度**: 次の数 値: 0(メンテナンス)、1(情報)、2(正常)、3(警告)、4(障害)、5(マイナー)、6(メジャー) * < SNMPトラップ名 > [[:ja:documentation:pandorafms:monitoring:08_snmp_traps_monitoring|SNMP トラップコンソール]] で確認できます。
* < OID >
* < 説明 >
* < 重要度 > 数値。 次のいずれかの 値になります : '' 0'' (<wrap :ja>** メンテナンス**</wrap> )、'' 1'' (<wrap :ja>** 情報**</wrap> )、'' 2'' (<wrap :ja>** 正常**</wrap> )、'' 3'' (<wrap :ja>** 警告**</wrap> )、'' 4'' (<wrap :ja>** 障害**</wrap> )、'' 5'' (<wrap :ja>** マイナー**</wrap> )、'' 6'' (<wrap :ja>** メジャー**</wrap> )。
**実行例 :** **Description** : Creates a new SNMP trap definition. **A name must be entered, if an OID is repeated, the trap will not be created **.
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_snmp_trap Cisco_FAN_Crash 1.3.3.3.2.12.3.3.4.1 "Something happen with the FAN inside the CISCO device, probably a failure" 3 **説明**: 新しいSNMPトラップ定義を作成します。**名前を入力する必要があります。OIDが重複している場合、トラップは作成されません。**
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
**例([[#ks1|呼び出し]]と[[#ks1_1|書式]]を参照)**:
<code bash>
pandora_manage /etc/pandora/pandora_server.conf --create_snmp_trap " Cisco_FAN_Crash" " 1.3.3.3.2.12.3.3.4.1" "Something happen with the FAN inside the CISCO device, probably a failure" "3"
</code>
==== --start_snmptrapd ==== ==== --start_snmptrapd ====
**Parameters:** Nothing . **Parameters** : None.
**パラメータ**: なし
Starts the ''snmptrapd'' process in the [[:en:documentation:pandorafms:monitoring:08_snmp_traps_monitoring|SNMP traps server]]] . In case it is already started, it terminates this service (**kill** command) and executes it again, deleting all the traps located in the exchange log located by default in:
**オプションパ ラメ ータ ー: ** な し[[:ja:documentation:pandorafms:monitoring:08_snmp_traps_monitoring|SNMPト ラップサ ーバ]]] 内の ''snmptrapd'' プロセスを起動します。既に起動している場合は、このサ ービスを終了( **kill** コマンド) し、再度実行します。これにより、デフォルトで以下の場所にあるログ内のすべてのトラップが削除されます。
Starts the ''snmptrapd'' process on the traps server. In case it is already started, it terminates the service (**kill** command) and runs it again, deleting all the traps located in the exchange log (by default '' /var/log/pandora/pandora_snmptrapd.log''). <file>
/var/log/pandora/pandora_snmptrapd.log
トラップサーバで ''snmptrapd'' プロセスを開始します。すでに起動している場合は、サービス停止(**kill** コマンド)後に再実行し、ログ(デフォルトは '' /var/log/pandora/pandora_snmptrapd.log'')にあるすべてのトラップを削除します。 < /file>
**Example: ** **Example (see [[#ks1|call]] and [[#ks1_1|syntax]]) **:
**実行 例: ** **例([[#ks1|呼び出し]]と[[#ks1_1|書式]]を参照) **:
<code> <code bash >
pandora_manage /etc/pandora/pandora_server.conf --start_snmptrapd pandora_manage /etc/pandora/pandora_server.conf --start_snmptrapd