Difference between revisions of "Pandora: Documentation ja: Annex ExternalAPI"
(→例) |
(→例) |
||
Line 3,931: | Line 3,931: | ||
=====例===== | =====例===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_agent&other=2%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_agent&other=2%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_cluster_item==== | ====set delete_cluster_item==== |
Revision as of 16:04, 18 July 2019
Contents
- 1 Pandora FMS 外部 API
- 1.1 セキュリティ
- 1.2 API における新規呼び出し拡張
- 1.3 API 呼び出し
- 1.3.1 情報取得
- 1.3.2 読み出し
- 1.3.2.1 get test
- 1.3.2.2 get all_agents
- 1.3.2.3 get module_last_value
- 1.3.2.4 get agent_module_name_last_value
- 1.3.2.5 get agent_module_name_last_value_alias
- 1.3.2.6 get module_value_all_agents
- 1.3.2.7 get agent_modules
- 1.3.2.8 get module_id
- 1.3.2.9 get locate_agent
- 1.3.2.10 get policies
- 1.3.2.11 get tree_agents
- 1.3.2.12 get module_data
- 1.3.2.13 get graph_module_data
- 1.3.2.14 get events
- 1.3.2.15 get all_alert_templates
- 1.3.2.16 get all_alert_commands
- 1.3.2.17 get module_groups
- 1.3.2.18 get plugins
- 1.3.2.19 get tags
- 1.3.2.20 get module_from_conf
- 1.3.2.21 get total_modules
- 1.3.2.22 get total_agents
- 1.3.2.23 get agent_name
- 1.3.2.24 get agent_alias
- 1.3.2.25 get module_name
- 1.3.2.26 get alert_action_by_group
- 1.3.2.27 get alert_actions
- 1.3.2.28 get alert_actions_meta
- 1.3.2.29 get event_info
- 1.3.2.30 get tactical_view
- 1.3.2.31 get pandora_servers
- 1.3.2.32 get custom_field_id
- 1.3.2.33 get gis_agent
- 1.3.2.34 get special_days
- 1.3.2.35 get module_properties
- 1.3.2.36 get module_properties_by_name
- 1.3.2.37 get module_properties_by_alias
- 1.3.2.38 get module_graph
- 1.3.2.39 get all_planned_downtimes
- 1.3.2.40 get planned_downtimes_items
- 1.3.2.41 get id_group_agent_by_name
- 1.3.2.42 get id_group_agent_by_alias
- 1.3.2.43 get group_agent_by_name
- 1.3.2.44 get group_agent_by_alias
- 1.3.2.45 get group_id_by_name
- 1.3.2.46 get get_timezone
- 1.3.2.47 get cluster_status
- 1.3.2.48 get cluster_id_by_name
- 1.3.2.49 get agents_id_name_by_cluster_id
- 1.3.2.50 get agents_id_name_by_cluster_name
- 1.3.2.51 get modules_id_name_by_cluster_id
- 1.3.2.52 get modules_id_name_by_cluster_name
- 1.3.2.53 get cluster_items
- 1.3.2.54 get policy
- 1.3.2.55 get collections_policy
- 1.3.2.56 get plugins_policy
- 1.3.2.57 get inventory_policy
- 1.3.2.58 get unlinking_policy
- 1.3.2.59 get alerts_policy
- 1.3.2.60 get alerts_actions_policy
- 1.3.2.61 get agents_policy
- 1.3.2.62 get groups_policy
- 1.3.2.63 get queue_policy
- 1.3.2.64 get traps
- 1.3.2.65 get event_responses
- 1.3.2.66 get users
- 1.3.2.67 get user_profiles_info
- 1.3.2.68 get migrate_agent
- 1.3.2.69 get language
- 1.3.2.70 get session_timeout
- 1.3.2.71 get groups
- 1.3.2.72 get inventory_modules
- 1.3.2.73 get list_collections
- 1.3.2.74 get list_collection_files
- 1.3.2.75 get all_event_filters
- 1.3.3 設定
- 1.3.3.1 set new_agent
- 1.3.3.2 set update_agent
- 1.3.3.3 set delete_agent
- 1.3.3.4 set create_module_template
- 1.3.3.5 set apply_module_template
- 1.3.3.6 set create_network_module
- 1.3.3.7 set create_plugin_module
- 1.3.3.8 set create_data_module
- 1.3.3.9 set create_SNMP_module
- 1.3.3.10 set update_network_module
- 1.3.3.11 set update_plugin_module
- 1.3.3.12 set update_data_module
- 1.3.3.13 set update_data_module_policy
- 1.3.3.14 set update_SNMP_module
- 1.3.3.15 set apply_policy
- 1.3.3.16 set apply_all_policies
- 1.3.3.17 set add_network_module_policy
- 1.3.3.18 set add_plugin_module_policy
- 1.3.3.19 set add_data_module_policy
- 1.3.3.20 set add_SNMP_module_policy
- 1.3.3.21 set add_agent_policy
- 1.3.3.22 set remove_agent_from_policy
- 1.3.3.23 set new_network_component
- 1.3.3.24 set new_plugin_component
- 1.3.3.25 set new_snmp_component
- 1.3.3.26 set new_local_component
- 1.3.3.27 set create_alert_template
- 1.3.3.28 set update_alert_template
- 1.3.3.29 set delete_alert_template
- 1.3.3.30 set delete_module_template
- 1.3.3.31 set delete_module_template_by_names
- 1.3.3.32 set stop_dowtime
- 1.3.3.33 set new_user
- 1.3.3.34 Set update_user
- 1.3.3.35 set delete_user
- 1.3.3.36 set enable_disable_user
- 1.3.3.37 set meta_synch_user
- 1.3.3.38 set create_group
- 1.3.3.39 set update_group
- 1.3.3.40 set delete_group
- 1.3.3.41 set add_user_profile
- 1.3.3.42 set delete_user_profile
- 1.3.3.43 set new_incident
- 1.3.3.44 set new_note_incident
- 1.3.3.45 set validate_all_alerts
- 1.3.3.46 set validate_all_policy_alerts
- 1.3.3.47 set event_validate_filter
- 1.3.3.48 set event_validate_filter_pro
- 1.3.3.49 set new_alert_template
- 1.3.3.50 set alert_actions
- 1.3.3.51 set alert_commands
- 1.3.3.52 set new_module
- 1.3.3.53 set delete_module
- 1.3.3.54 set enable_alert
- 1.3.3.55 set enable_alert_alias
- 1.3.3.56 set disable_alert
- 1.3.3.57 set disable_alert_alias
- 1.3.3.58 set enable_module_alerts
- 1.3.3.59 set disable_module_alerts
- 1.3.3.60 set enable_module
- 1.3.3.61 set disable_module
- 1.3.3.62 set create_network_module_from_component
- 1.3.3.63 set module_data
- 1.3.3.64 set new_module_group
- 1.3.3.65 set module_group_synch
- 1.3.3.66 set add_module_in_conf
- 1.3.3.67 set delete_module_in_conf
- 1.3.3.68 set update_module_in_conf
- 1.3.3.69 set create_event
- 1.3.3.70 set add_event_comment
- 1.3.3.71 set create_netflow_filter
- 1.3.3.72 set create_custom_field
- 1.3.3.73 set create_tag
- 1.3.3.74 set enable_disable_agent
- 1.3.3.75 set gis_agent_only_position
- 1.3.3.76 set gis_agent
- 1.3.3.77 set reset_agent_counts
- 1.3.3.78 set create_special_day
- 1.3.3.79 set update_special_day
- 1.3.3.80 set delete_special_day
- 1.3.3.81 set pagerduty_webhook
- 1.3.3.82 set tag_user_profile
- 1.3.3.83 set tag
- 1.3.3.84 set add_tag_module
- 1.3.3.85 set remove_tag_module
- 1.3.3.86 set planned_downtimes_created
- 1.3.3.87 set planned_downtimes_additem
- 1.3.3.88 set planned_downtimes_deleted
- 1.3.3.89 set create_synthetic_module
- 1.3.3.90 set create_service
- 1.3.3.91 set update_service
- 1.3.3.92 set add_element_service
- 1.3.3.93 set metaconsole_synch
- 1.3.3.94 set migrate_agent
- 1.3.3.95 set new_cluster
- 1.3.3.96 set add_cluster_agent
- 1.3.3.97 set add_cluster_item (アクティブ/アクティブ)
- 1.3.3.98 set add_cluster_item (アクティブ/スタンバイ)
- 1.3.3.99 set delete_cluster
- 1.3.3.100 set delete_cluster_agent
- 1.3.3.101 set delete_cluster_item
- 1.3.3.102 set create_policy
- 1.3.3.103 set update_policy
- 1.3.3.104 set delete_policy
- 1.3.3.105 set add_collections_policy
- 1.3.3.106 set remove_collections_policy
- 1.3.3.107 set create_plugins_policy
- 1.3.3.108 set delete_plugins_policy
- 1.3.3.109 set linking_policy
- 1.3.3.110 set create_alerts_policy
- 1.3.3.111 set update_alerts_policy
- 1.3.3.112 set delete_alerts_policy
- 1.3.3.113 set create_alerts_actions_policy
- 1.3.3.114 set delete_alerts_actions_policy
- 1.3.3.115 set remove_agents_policy
- 1.3.3.116 set add_groups_policy
- 1.3.3.117 set remove_groups_policy
- 1.3.3.118 set create_os
- 1.3.3.119 set update_os
- 1.3.3.120 set disabled_and_standby
- 1.3.3.121 set validate_traps
- 1.3.3.122 set delete_traps
- 1.3.3.123 set access_process
- 1.3.3.124 set create_event_response
- 1.3.3.125 set update_event_response
- 1.3.3.126 set delete_event_response
- 1.3.3.127 set create_user_profile_info
- 1.3.3.128 set update_user_profile_info
- 1.3.3.129 set delete_user_profile_info
- 1.3.3.130 set create_event_filter
- 1.3.3.131 set update_event_filter
- 1.3.3.132 set delete_event_filter
- 1.3.3.133 set create_inventory_module
- 1.3.3.134 set update_inventory_module
- 1.3.3.135 set delete_inventory_module
- 1.3.3.136 set create_collection
- 1.3.3.137 set delete_collection
- 1.4 例
- 1.5 API.php の今後
1 Pandora FMS 外部 API
Pandora FMS 外部 API は、(/include/api.php に対して HTTP アクセスすることにより) リモート操作に利用します。 これは、Pandora FMS 外から操作するアプリケーションを作成できるように、Pandora FMS に用意されている手法です。基本的に、アプリケーションからの操作で、指定したフォーマットのパラメータで値を受け渡します。
API.php の呼び出しは、次のように単純です。
http://<pandoraコンソールのインストールパス>/include/api.php<パラメータ>
API は次のパラメータのみ受け取ることができます。
- op (必須): 最初のパラメータで、操作の種類を指定します。"get"、"set"、"help" のいずれかを指定できます。
- get: 値を取得します。
- set: 値を設定します。
- help: 小さなヘルプを返します。
- op2 (必須): 処理の名前を指定します。
- id (オプション): 1番目のパラメータです。
- id2 (オプション): 2番目のパラメータです。
- other (オプション): 3番目のパラメータです。連続したデータリストの場合もあります。
- other_mode (オプション): 連続データのフォーマットです。指定可能な値は次の通りです。
- url_encode: 文字列フォーマットです。UrlEncode
- url_encode_separator_<セパレータ>:複数の値を分割する文字を指定します。例えば、次の通りです。
...other=peras|melones|sandias&other_mode=url_encode_separator_|
- returnType (オプション): 値の取得フォーマットです。設定可能な値は次の通りです。
- string: 英数字として値を返します。
- csv:デフォルトで ";" および改行で区切られた CSV で値を返します。
- csv_head: "csv" と同様ですが、最初にフィールド名を返します。
1.1 セキュリティ
現時点では、セキュリティはツールにアクセスする IP アドレスリストに基づいています。以下に示す画面のように Pandora コンソールの設定オプションで設定できます。
* 文字を設定すると、IP による ACL チェックは省略され、プロトコルおよび環境によるセキュリティのみに下がります。同様に、*' 文字はワイルドカードとして利用できます。例えば、183.234.33.* などです。
API の操作にパスワードを設定することもできます。
パスワードを設定するには、次の手順を行う必要があります。
- APIパスワード: コンソールでAPIパスワードを設定します。これは次の設定画面 (システム管理(Administration) > 設定(Setup))で設定できます。
注意: 4.0.2 より前のバージョンでは、このパラメータは、パスワード(pass) です。
APIにアクセスするには、Pandora FMS の正しいユーザとパスワードも必要です。
- user: Pandora FMS の正しいユーザ
- pass: 指定したユーザのパスワード
注意: API呼び出しではパスワードは暗号化されていません。キャプチャされないように SSL 通信を使うなど注意してください。API では SSL/HTTPS を使って POST できます。
1.1.1 戻り値
API へのアクセスができなかった場合は、単純に "auth error" という文字が出力されます。
1.1.2 例
ここでは、API パスワードが 1234 で、アクセスユーザが admin、そのパスワードが pandora とします。
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
アクセスできるための条件は次の通りです。
- ACL の IP 一覧にアクセスもとの IP が設定されている。
- API パスワードが設定されていないか、1234 である。
- ユーザ admin が存在し、そのパスワードが pandora である。
1.1.3 セキュリティ処理の流れ
バージョン 4.0.2 から、API ではいくつかのセキュリティの改善が行われています。これは、次の 3つの要素で実装されています。
- IPフィルタリング。リストに設定された IP から API への接続ができます。
- グローバル API パスワード。定義されている場合は、API を利用する場合に必要です。
- コンソールのユーザとパスワード。要求した操作を実行する正しい権限が必要です。
以下に処理の流れを示します。
1.2 API における新規呼び出し拡張
API の新たな呼び出しを開発するには、以下を考慮してください。
- 呼び出しは <Pandoraコンソールインストール場所>/include/functions_api.php ファイル内の関数として実装されます。
- 呼び出しは、"get"、"set"、または、"help" と新たな呼び出し名の組み合わせで、操作とつじつまが合うようにします。例えば、function get<呼び出し名>(パラメータ) です。
- 全てを利用しない場合でも、任意の名前で良いですが、呼び出しパラメータは次に示す全てを受け渡す必要があります。
- id: 1番目の操作またはパラメータで、文字列を含みます。
- id2: 2番目の操作またはパラメータで、文字列を含みます。
- other: 残りの操作またはパラメータで、以下の2種類の配列を含みます。
- $other['type']: 文字列または配列です。
- $other['data']: パラメータを持った文字列または、パラメータの数値インデックスの配列です。
- returnType: 呼び出しの戻値の種類を指定する文字列です。通常は透過的ですが必要であれば編集できます。
1.2.1 Pandora FMS 拡張からの新たな API 呼び出し
/include/functions_api.php を利用せずに新たな API 呼び出しを作成することができます。それには、Pandora FMS の extension ディレクトリに <extension_name>.api.php という名前でファイルを追加し、標準の API と同じように欲しい関数を作成します。ただし、プリフィックスは、"api" ではなく、"apiextension" です。
例えば、<Pandora installation>/extensions/module_groups に "module_groups" という名前の拡張を作る場合は、module_groups.php というファイルをそのディレクトリに作成します。
このファイルに、例えば、グループのモジュール数を取得する関数などの欲しい関数を入れます。この関数の名前は、"apiextension_get_groupmodules" といった名前である必要があります。
1.2.1.1 関数例
以下に示すのは、関数の例です。
function apiextension_get_groupmodules($group_name) {
$group_id = group_id_from_name($group_name);
if($group_id == false) {
echo 'Group doesnt exist';
return;
}
$number_of_modules = group_modules($group_id);
echo $number_of_modules;
}
1.2.1.2 呼び出し例
この呼び出し例では、"Servers" グループのモジュール数を取得します。
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=extension&ext_name=module_groups&ext_function=groupmodules&id=Servers&apipass=1234&user=admin&pass=pandora
1.2.2 API 関数
API 関数内では、以下の関数を利用できます。
- returnError(typeError, returnType): 全ての呼び出しに対して標準化したエラーを返します。
- typeError: 現在のところ、'id_not_found' または null です。
- returnType: 現在のところ、'string' またはエラーメッセージです。
- returnData(returnType, data, separator): API の呼び出しデータを返す関数です。
- returnType: 'string', 'csv', 'csv_head' のいずれかです。
- data: データおよびその形式を含んだ配列です。次のフィールドがあります。
- 'type' (必須): 'string' および 'array' です。
- 'list_index' (オプション): 終了時に引き渡す英数字インデックスを含む数値インデックスの配列です。
- 'data' (必須): データの内容または、英数字インデックスの配列、または、データと数値インデックスです。
1.2.3 例
function get_module_last_value($idAgentModule, $trash1, $other = ';', $returnType)
{
$sql = sprintf('SELECT datos FROM tagente_estado WHERE id_agente_modulo = %d', $idAgentModule);
$value = get_db_value_sql($sql);
if ($value === false) {
switch ($other['type']) {
case 'string':
switch ($other['data']) {
case 'error_message':
default:
returnError('id_not_found', $returnType);
break;
}
break;
case 'array':
switch ($other['data'][0]) {
case 'error_value':
returnData($returnType, array('type' => 'string', 'data' => $other['data'][1]));
break;
}
break;
}
}
else {
$data = array('type' => 'string', 'data' => $value);
returnData($returnType, $data);
}
}
1.3 API 呼び出し
Pandora FMS に対して読み出しか書き込みかによって、2つの種類に分けられます。
1.3.1 情報取得
Pandora コンソールのバージョンを返します。get test と似ていますが、API 接続のチェックをしません。
これは、Pandora FMS のインストールパスの確認と、認証前にバージョンを確認するのに便利です。
返される情報はログイン画面から確認することができるものであるため、セキュリティ上の脆弱性にはなりません。
http://127.0.0.1/pandora_console/include/api.php?info=version
返される値は、Pandora FMS v5.0 - PC131015 といったものです。
1.3.2 読み出し
データを読み出します。
1.3.2.1 get test
書式: パラメータ無し
1.3.2.1.1 例
以下の例では、OK を返します。
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test
1.3.2.2 get all_agents
書式:
- op=get (必須)
- op2=all_agents (必須)
- return_type=csv または json (必須)
- other=<連続パラメータ> (オプション) 検索するエージェントをフィルタするためのパラメータ列:
- <filter_so>
- <filter_group>
- <filter_module_states>
- <filter_alias>
- <filter_policy>
- <csv_separator>
1.3.2.2.1 例
この例では、OS ID が 1、グループ ID が 2、状態が警告、エージェント名に 'j' を含み、関連付けられたポリシーが 2 の全エージェントを返します。
CSV の例: http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=csv&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora JSON の例: http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=json&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.3 get module_last_value
書式:
- op=get (必須)
- op2=module_last_value (必須)
- id=<インデックス> (必須) エージェントモジュールのインデックスである必要があります。
- other=<返すエラー> (オプション) (通常データベースに記録されない)エラーが発生したときに、返したいもの。
- エラーコードは次の通りです:
- 'error_message' テキストでエラーメッセージを返します。
- 'error_value'<セパレータ><コードまたは値> エラーの値を返します。ただし、other_mode=url_encode_separator_<セパレータ> のように、分割するためのセパレータを 'other_mode' で設定する必要があります。
1.3.2.3.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=63&other=error_value|0&other_mode=url_encode_separator_| http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62
1.3.2.4 get agent_module_name_last_value
書式:
- op=get (必須)
- op2=agent_module_name_last_value (必須)
- id=<英数字>(必須) エージェント名。
- id2=<英数字> (必須) モジュール名。
- other=<返すエラー> (オプション) (通常DBには記録されない)エラー時に返したいもの。
- エラーコードは次の通りです:
- 'error_message' テキストのエラーメッセージ。
- 'error_value'<セパレータ><コードまたは値> このコードまたはエラーの値が返ります。ただし、other_mode=url_encode_separator_<セパレータ> のように、 'other_mode' でセパレータを指定する必要があります。
1.3.2.4.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user
1.3.2.5 get agent_module_name_last_value_alias
>= 7.0NG
モジュールの最新の値を返します。このモジュールは、パラメータ id で渡されるエージェントの別名と、パラメータ id2 で渡されるモジュール名でフィルタされます。other パラメータで、アプリケーションが利用するエラーコードおよび、範囲を超えたモジュールの値を追加することができます。
書式:
- op=get (必須)
- op2=agent_module_name_last_value_alias (必須)
- id=<英数字>(必須) エージェント名。
- id2=<英数字> (必須) モジュール名。
- other=<返すエラー> (オプション) (通常DBには記録されない)エラー時に返したいもの。
- エラーコードは次の通りです:
- 'error_message' テキストのエラーメッセージ。
- 'error_value'<セパレータ><コードまたは値> このコードまたはエラーの値が返ります。ただし、other_mode=url_encode_separator_<セパレータ> のように、 'other_mode' でセパレータを指定する必要があります。
1.3.2.5.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value_alias&id=miguel-portatil&id2=cpu_user
1.3.2.6 get module_value_all_agents
書式:
- op=get (必須)
- op2=module_value_all_agents (必須)
- id=<エージェント名> (必須) エージェント名です。
1.3.2.6.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_value_all_agents&id=example_module_name
1.3.2.7 get agent_modules
書式:
- op=get (必須)
- op2=agent_modules (必須)
- return_type=<csv> (必須) 出力書式
- other=<複数の数値> (必須) エージェントでフィルタするための複数の数値:
- <エージェントID>
次のように、セパレータを設定するために 'other_mode' パラメータを設定する必要があります。 other_mode=url_encode_separator_<セパレータ>
1.3.2.7.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|
1.3.2.8 get module_id
エージェントのモジュール ID を返します。
書式:
- op=get (必須)
- op2=module_id (必須)
- id=id agent (必須)
- other=module name (必須)
1.3.2.8.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_id&id=5&other=Host%20Alive&apipass=1234&user=admin&pass=pandora
1.3.2.9 get locate_agent
エージェントが存在するサーバ ID を取得し、すべての結果を csv で出力します。
書式:
- op=get (必須)
- op2=locate_agent (必須)
- return_type=<csv> (必須) 出力フォーマット
- id=id_agent (必須)
- other_mode= other_mode=url_encode_separator_<separator> (必須)
1.3.2.9.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=locate_agent&return_type=csv&apipass=1234&user=admin&pass=pandora&id=Pepito&other_mode=url_encode_separator_%7C
1.3.2.10 get policies
書式:
- op=get (必須)
- op2=policies (必須)
- return_type=<csv> (必須)
- other=<複数の値> (オプション) ポリシーエージェントによってポリシーをフィルタするための複数の値:
- <エージェントID>
1.3.2.10.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|
1.3.2.11 get tree_agents
書式:
- op=get (必須)
- op2=tree_agents (必須)
- return_type=<戻りタイプ> (必須) 'csv' または 'csv_head' を指定できます。
- other=<文字列またはパラメータの並び> (オプション) セパレータ文字によって分割されたパラメータリストです。以下に2つのケースを示します。:
- <セパレータ> CSV のセパレータ
- <CSVセパレータ>|<CR と置き換える文字>|<フィールド1>,<フィールド2>,<フィールドN>これは、次のパラメータを構成します。(セパレータ文字として '|' を "other_mode" で指定できます。):
- <CSVセパレータ>: CSV のフィールドセパレータ
- <CR と置き換える文字> CSVファイル内に改行コードを見つけた場合に、通常の改行の意味で利用している場合と曖昧になるのを避けるために、それを置き換える文字です。文字列を渡すと、スペースに置換されます。
- <フィールド1>,<フィールド2>,<フィールドN> :CSV に指定できるフィールドは次の通りです:
- type_row
- group_id
- group_name
- group_parent
- disabled
- custom_id
- group_description
- group_contact
- group_other
- agent_id
- alias
- agent_direction
- agent_comentary
- agent_id_group
- agent_last_contant
- agent_mode
- agent_interval
- agent_id_os
- agent_os_version
- agent_version
- agent_last_remote_contact
- agent_disabled
- agent_id_parent
- agent_custom_id
- agent_server_name
- agent_cascade_protection
- agent_name
- module_id_agent_modulo
- module_id_agent
- module_id_module_type
- module_description
- module_name
- module_max
- module_min
- module_interval
- module_tcp_port
- module_tcp_send
- module_tcp_rcv
- module_snmp_community
- module_snmp_oid
- module_ip_target
- module_id_module_group
- module_flag
- module_id_module
- module_disabled
- module_id_export
- module_plugin_user
- module_plugin_pass
- module_plugin_parameter
- module_id_plugin
- module_post_process
- module_prediction_module
- module_max_timeout
- module_custom_id
- module_history_data
- module_min_warning
- module_max_warning
- module_min_critical
- module_max_critical
- module_min_ff_event
- module_delete_pending
- module_id_agent_state
- module_data
- module_timestamp
- module_state
- module_last_try
- module_utimestamp
- module_current_interval
- module_running_by
- module_last_execution_try
- module_status_changes
- module_last_status
- module_plugin_macros
- module_macros
- module_critical_inverse (only in version 6.0SP1 or later)
- module_warning_inverse (only in version 6.0SP1 or later)
- alert_id_agent_module
- alert_id_alert_template
- alert_internal_counter
- alert_last_fired
- alert_last_reference
- alert_times_fired
- alert_disabled
- alert_force_execution
- alert_id_alert_action
- alert_type
- alert_value
- alert_matches_value
- alert_max_value
- alert_min_value
- alert_time_threshold
- alert_max_alerts
- alert_min_alerts
- alert_time_from
- alert_time_to
- alert_monday
- alert_tuesday
- alert_wednesday
- alert_thursday
- alert_friday
- alert_saturday
- alert_sunday
- alert_recovery_notify
- alert_field2_recovery
- alert_field3_recovery
- alert_id_alert_template_module
- alert_fires_min
- alert_fires_max
- alert_id_alert_command
- alert_command
- alert_internal
- alert_template_modules_id
- alert_templates_id
- alert_template_module_actions_id
- alert_actions_id
- alert_commands_id
- alert_templates_name
- alert_actions_name
- alert_commands_name
- alert_templates_description
- alert_commands_description
- alert_template_modules_priority
- alert_templates_priority
- alert_templates_field1
- alert_actions_field1
- alert_templates_field2
- alert_actions_field2
- alert_templates_field3
- alert_actions_field3
- alert_templates_id_group
- alert_actions_id_group'
1.3.2.11.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=; http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;|%20|type_row,group_id,agent_alias&other_mode=url_encode_separator_|
1.3.2.12 get module_data
書式:
- op=set (必須)
- op2=module_data (必須)
- id=<モジュールID> (必須)
- other_mode=url_encode_separator_<セパレータ> (必須)
- other=<連続パラメータ> (オプション)
- CSV の区切り文字
- 間隔 (秒)
- 開始日時 (<年><月><日>T<時間>:<分>)
- 終了日時 (<年><月><日>T<時間>:<分>)
1.3.2.12.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_data&id=17&other=;|604800|20121201T13:40|20171215T13:40&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.13 get graph_module_data
モジュールのグラフを画像ファイルで返します。このグラフは、Pandora の静的グラフと同じ手法で生成されます。グラフの幅、高さ、期間、ラベル、開始日(データの終わりがグラフに表示される最後になります)をパラメータに指定する必要があります。
書式:
- op=set (必須)
- op2=module_data (必須)
- id=<モジュールID> (必須)
- other=<連続パラメータ> (必須), 順番に次のデータを指定します:
- <期間>
- <幅>
- <高さ>
- <ラベル>
- <開始日>
1.3.2.13.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=graph_module_data&id=17&other=604800|555|245|pepito|2009-12-07&other_mode=url_encode_separator_|
1.3.2.14 get events
other パラメータでフィルタしたイベントの一覧を返します。
これはメタコンソール用です。
書式:
- op=get (必須)
- op2=events (必須)
- return_type=csv (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続したパラメータ> (オプション) 次の順番でパラメータを指定します:
- <セパレータ>
- <重要度> 0 から 4
- <エージェント名>
- <モジュール名>
- <アラートテンプレート名>
- <ユーザ>
- <開始時間> UNIXタイムにて
- <終了時間> UNIXタイムにて
- <状態>
- <イベントに含まれる文字列>
- <表示上限数>
- <表示オフセット>
- <形式オプション [total|more_criticity]> (total - 該当レコード数を返す, more_criticity - 該当レコード中の重要度の最も大きい値を返す)
- <イベントタイプ> unknown, alert_fired, alert_recovered など(部分文字列も可) または、not_normal
1.3.2.14.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora
1.3.2.14.2 取得情報の例
例えば、次のような情報が得られます。
951140;3998;0;14;0;2012-06-23 22:51:28;Module CheckPandora (0.00) is going to CRITICAL;1340484688;going_up_critical;8176;0;4;;;RemoteAgent;Aerin;transmit;Going down to critical state;http://firefly.artica.es/pandora_demo//images/b_red.png;Critical;http://firefly.artica.es/pandora_demo// images/status_sets/default/severity_critical.png
取得したデータの多くは、データベースの対応テーブルに保存されている値そのものです。 試しに、SQL マネージャーから次のクエリを実行してみてください。
select * from tevento order by id_evento DESC limit 100;
取得したデータの各フィールドは次の通り;
- フィールド1 - イベントID (自動インクリメント)
- フィールド2 - エージェントID
- フィールド3 - イベントを承諾したユーザーのユーザーID
- フィールド4 - グループID
- フィールド5 - 状態 (0 - 新規, 1 - 承諾済み, など.. 詳細は、状態コードの記述を参照)
- フィールド6 - タイムスタンプ (可読文字列)
- フィールド7 - イベント文字列
- フィールド8 - unixタイムスタンプ (1970年1月1日からの経過秒数)
- フィールド9 - イベントタイプ (イベントタイプを表す固定文字列)
- フィールド10 - モジュールID (イベントが発生したモジュールに割り当てられた数値。例えば new_agent の場合など、イベントタイプによっては 0 が返る。この後記載している通り、取得データにはモジュール名も含まれるので、追加で API を呼んでモジュールID をモジュール名に変換する必要はない)
- フィールド11- アラートID。モジュールID と同様にイベントタイプによっては 0 が返る
- フィールド12 - 重要度 (数値、詳細は、重要度の記述を参照)
- フィールド13 - ユーザーコメント (ユーザー指定があった場合)
- フィールド14 - タグ
これ以降は、同テーブル外からの追加情報;
- フィールド15 - エージェント名
- フィールド16 - グループ名
- フィールド17 - グループに対するイメージファイル名
- フィールド18 - イベントタイプに対する説明
- フィールド19 - 障害状態を示す赤いボールイメージの URL
- フィールド20 - (フィールド12の)重要度に対する説明
- フィールド21 - 重要度を表すイメージの URL
1.3.2.15 get all_alert_templates
書式:
- op=get (必須)
- op2=all_alert_templates (必須)
- other=cvs_separator (オプション)
1.3.2.15.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;
1.3.2.16 get all_alert_commands
全アラートコマンドを返します。
書式:
- op=get (必須)
- op2=all_alert_commands (必須)
1.3.2.16.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=all_alert_commands&return_type=csv&other=$&apipass=1234&user=admin&pass=pandora
1.3.2.17 get module_groups
書式:
- op=get (必須)
- op2=module_groups (必須)
- other=cvs_separator (オプション)
1.3.2.17.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;
1.3.2.18 get plugins
書式:
- op=get (必須)
- op2=plugins (必須)
- other=cvs_separator (オプション)
1.3.2.18.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;
1.3.2.19 get tags
書式:
- op=get (必須)
- op2=tags (必須)
- return_type=csv (必須)
1.3.2.19.1 例
この例では、システムの全てのタグを返します。
http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv
1.3.2.20 get module_from_conf
>= 5.0 (エンタープライズ版のみ)
書式:
- op=get (必須)
- op2=update_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
1.3.2.20.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_from_conf&apipass=1234&user=admin&pass=pandora&id=9043&id2=example_name
モジュールが見つからない場合は、空の文字列を返します。
1.3.2.21 get total_modules
グループの全モジュール。
書式:
- op=get (必須)
- op2=total_modules (必須)
- id=<グループID> (必須)
1.3.2.21.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora
1.3.2.22 get total_agents
グループの全エージェント
書式:
- op=get (必須)
- op2=total_agents (必須)
- id=<グループID> (必須)
1.3.2.22.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora
1.3.2.23 get agent_name
指定した ID のエージェント名
書式:
- op=get (必須)
- op2=agent_name (必須)
- id=<エージェントID> (必須)
1.3.2.23.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.24 get agent_alias
>= 7.0NG
指定した ID のエージェントの別名を取得します。
書式:
- op=get (必須)
- op2=agent_alias (必須)
- id=<エージェントID> (必須)
- id2=<ノードID> (メタコンソールでは必須、ノードでは不要)
1.3.2.24.1 例
ノード:
http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora
メタコンソール:
http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora
1.3.2.25 get module_name
指定した ID のモジュール名
書式:
- op=get (必須)
- op2=module_name (必須)
- id=<モジュールID> (必須)
1.3.2.25.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.26 get alert_action_by_group
指定したグループにおよびアクションにおいて、実行された全アラート
書式:
- op=get (必須)
- op2=alert_action_by_group (必須)
- id=<グループID> (必須)
- id2=<アクションID> (必須)
1.3.2.26.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=alert_action_by_group&id=0&id2=3&apipass=1234&user=admin&pass=pandora
1.3.2.27 get alert_actions
アラートアクションの一覧を取得します。
書式:
- op=get (必須)
- op2=alert_actions (必須)
- return_type=<return type> (必須) 'csv' または 'json' を指定できます。
- other=<連続パラメータ> (オプション):
- <action_name> (オプション)
- <separator> (オプション)
1.3.2.27.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions&apipass=1234&user=admin&pass=pandora&other=Create|&other_mode=url_encode_separator_|&return_type=json
1.3.2.28 get alert_actions_meta
これはメタコンソール用です。
メタコンソールから、ノードのアラートアクションの一覧を取得します。
書式:
- op=get (必須)
- op2=alert_actions_meta (必須)
- return_type=<return type> (必須) 'csv' または 'json' を指定できます。
- other=<連続パラメータ> (オプション):
- <server_name> (オプション)
- <action_name> (オプション)
- <separator> (オプション)
1.3.2.28.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions_meta&apipass=1234&user=admin&pass=pandora&other=nodo|Create|&other_mode=url_encode_separator_|&return_type=json
1.3.2.29 get event_info
書式:
- op=get (必須)
- op2=event_info (必須)
- id=<イベントID> (必須)
1.3.2.29.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora
1.3.2.30 get tactical_view
書式:
- op=get (必須)
- op2=tactical_view (必須)
1.3.2.30.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora
1.3.2.31 get pandora_servers
バージョン 5.0 かそれ以降
書式:
- op=get (必須)
- op2=pandora_servers (必須)
- other=cvs_separator (オプション)
1.3.2.31.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora
次の順番で値が返ります。
- サーバ名
- 状態 (1 - 稼働, 0 - 停止)
- サーバタイプ (文字列)
- マスターサーバかどうか (1 - マスターサーバ, 0 - マスターサーバではない)
- 稼働中のモジュール数
- 該当する全モジュール数
- 最大遅延(秒)
- 遅延モジュール数
- スレッド数
- 現在キューに溜まっているモジュール数
- 最終更新日時 (文字列)
1.3.2.32 get custom_field_id
>= 5.0
書式:
- op=get (必須)
- op2=custom_field_id (必須)
- other=<連続パラメータ> (必須) カスタムフィールド名です
- <名前> (必須)
1.3.2.32.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=custom_field_id&other=mycustomfield&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.33 get gis_agent
>= 5.0
エージェントの最新の gis データを返します。
書式:
- op=set (必須)
- op2=gis_agent (必須)
- id=<id> (必衰) エージェントID
1.3.2.33.1 例
http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1
1.3.2.34 get special_days
>= 5.1
特別日一覧を返します。
書式:
- op=get (必須)
- op2=gis_agent (必須)
- other=<csvセパレータ> (オプション) CSVのセパレータ
1.3.2.34.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days
1.3.2.35 get module_properties
>= 5.1SP2
モジュールのプロパティ一覧を返します。出力する項目は other で指定できます。
書式:
- op=get (必須)
- op2=module_properties (必須)
- id=モジュールID。 (必須)
- return_type=<戻りタイプ> (必須) 'csv' または 'csv_head' を指定できます。
- other=<文字列またはパラメータの並び> (オプション) セパレータ文字によって分割されたパラメータリストです。以下に2つのケースを示します。:
- <セパレータ> CSV のセパレータ
- <CSVセパレータ>|<CR と置き換える文字>|<フィールド1>,<フィールド2>,<フィールドN>これは、次のパラメータを構成します。(セパレータ文字として '|' を "other_mode" で指定できます。):
- <CSVセパレータ>: CSV のフィールドセパレータ
- <CR と置き換える文字> CSVファイル内に改行コードを見つけた場合に、通常の改行の意味で利用している場合と曖昧になるのを避けるために、それを置き換える文字です。文字列を渡すと、スペースに置換されます。
- <フィールド1>,<フィールド2>,<フィールドN> :CSV に指定できるフィールドは次の通りです:
- module_id_agent_modulo
- module_id_agent
- module_id_module_type
- module_description
- module_name
- module_max
- module_min
- module_interval
- module_tcp_port
- module_tcp_send
- module_tcp_rcv
- module_snmp_community
- module_snmp_oid
- module_ip_target
- module_id_module_group
- module_flag
- module_id_module
- module_disabled
- module_id_export
- module_plugin_user
- module_plugin_pass
- module_plugin_parameter
- module_id_plugin
- module_post_process
- module_prediction_module
- module_max_timeout
- module_custom_id
- module_history_data
- module_min_warning
- module_max_warning
- module_min_critical
- module_max_critical
- module_min_ff_event
- module_delete_pending
- module_id_agent_state
- module_data
- module_timestamp
- module_state
- module_last_try
- module_utimestamp
- module_current_interval
- module_running_by
- module_last_execution_try
- module_status_changes
- module_last_status
- module_plugin_macros
- module_macros
- module_critical_inverse (only in version 6.0SP1 or later)
- module_warning_inverse (only in version 6.0SP1 or later)
1.3.2.35.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=6233&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=1103&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.36 get module_properties_by_name
>= 5.1SP2
モジュールのプロパティ一覧を返します。出力する項目は other で指定できます。
書式:
- op=get (必須)
- op2=module_properties_by_name (必須)
- id=エージェント名。 (必須)
- id2=モジュール名。 (必須)
- return_type=<戻りタイプ> (必須) 'csv' または 'csv_head' を指定できます。
- other=<文字列またはパラメータの並び> (オプション) セパレータ文字によって分割されたパラメータリストです。(get_module_properties と同じです。詳しくは、get_module_properties を参照してください)
1.3.2.36.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.37 get module_properties_by_alias
>= 7.0NG
モジュールプロパティの一覧を返します。一覧はパラメータでフィルタできます。
書式:
- op=get (必須)
- op2=module_properties_by_alias (必須)
- id=agent_alias (必須)
- id2=agentmodule_name (必須)
- return_type=<戻りタイプ> (必須) 'csv' または 'csv_head' を指定できます。
- other=<文字列またはパラメータの並び> (オプション) セパレータ文字によって分割されたパラメータリストです。(get_module_properties と同じです。詳しくは、get_module_properties を参照してください)
1.3.2.37.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_alias&id=pandorafms&id2=Memory_Used&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
1.3.2.38 get module_graph
>= 6.0
base64 でエンコードされたモジュールグラフを返します。
書式:
- op=get (必須)
- op2=module_graph (必須)
- id=<モジュールID> (必須)
- other=<秒単位の間隔> (オプション) デフォルトは 3600 (1時間)です。 時間間隔はデータリカバリに使われます。
1.3.2.38.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=module_graph&id=5&other=3600%7C1&other_mode=url_encode_separator_%7C&apipass=1234&api=1&user=admin&pass=pandora
1.3.2.39 get all_planned_downtimes
>= 5.1
フィルタにマッチした計画停止の一覧を返します。
op=get (必須) op2=all_planned_downtimes (必須) return_type=csv または json (必須) other=<連続パラメータ> (オプション) 計画停止をフィルタするためのパラメータ列:
- <名前>
- <グループID>
- <タイプ> quit, disabled_agents, disabled_agents_alerts のいずれか
- <実行> once または periodically
- <定期実行タイプ> weekly または monthly
1.3.2.39.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.40 get planned_downtimes_items
>= 5.1
フィルタにマッチした計画停止のアイテム一覧を返します。
- op=get (必須)
- op2=planned_downtimes_items (必須)
- return_type=csv または json (必須)
- other=<連続パラメータ> (オプション) 計画停止をフィルタするためのパラメータ列:
- <名前>
- <グループID>
- <タイプ> quit, disabled_agents, disabled_agents_alerts のいずれか
- <実行> once または periodically
- <定期実行タイプ> weekly または monthly
1.3.2.40.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.41 get id_group_agent_by_name
>= 5.1
エージェントのグループ ID を返します。
書式:
- op=get
- op2=id_group_agent_by_name
- other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
- <エージェント名>
1.3.2.41.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40
1.3.2.42 get id_group_agent_by_alias
>= 7.0NG
エージェントのグループ ID を返します。
書式:
- op=get
- op2=id_group_agent_by_alias
- other=<文字列または連続パラメータ> エージェントの別名およびフィルタリングパラメータ (オプション)
- <エージェントの別名>
1.3.2.42.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms
1.3.2.43 get group_agent_by_name
>= 5.1
エージェントのグループ名を返します。
書式:
- op=get
- op2=group_agent_by_name
- other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
- <エージェント名>
1.3.2.43.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40
1.3.2.44 get group_agent_by_alias
>= 7.0NG
エージェントのグループ名を返します。
書式:
- op=get
- op2=group_agent_by_alias
- other=<文字列または連続パラメータ> エージェントの別名およびフィルタリングパラメータ (オプション)
- <エージェントの別名>
1.3.2.44.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms
1.3.2.45 get group_id_by_name
>= 7.0NG
名前からグループ ID を返します。
書式:
- op=get
- op2=group_id_by_name
- other=<単一パラメータ> (必須):
- <グループ名>
1.3.2.45.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_id_by_name&other=Servers
1.3.2.46 get get_timezone
>= 7.0NG
Pandora に設定されているタイムゾーンを返します。
書式:
- op=get
- op2=timezone
1.3.2.46.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone
1.3.2.47 get cluster_status
>= 7.0
ID ごとのクラスタ状態を返します。
- op=get
- op2=cluster_status
- id=<クラスタID>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_status&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.48 get cluster_id_by_name
>= 7.0
名前からクラスタの ID を返します。
- op=get
- op2=cluster_id_by_name
- id=<クラスタ名>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_id_by_name&id=paco&apipass=1234&user=admin&pass=pandora
1.3.2.49 get agents_id_name_by_cluster_id
>= 7.0
クラスタ ID から、ID => クラスタエージェント名を返します。
- op=get
- op2=agents_id_name_by_cluster_id
- id=<クラスタID>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agents_id_name_by_cluster_id&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.50 get agents_id_name_by_cluster_name
>= 7.0
クラスタ名から、ID => クラスタエージェント名を返します。
- op=get
- op2=agents_id_name_by_cluster_name
- id=<クラスタ名>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agents_id_name_by_cluster_name&id=paco&apipass=1234&user=admin&pass=pandora
1.3.2.51 get modules_id_name_by_cluster_id
>= 7.0
クラスタ ID から、ID => クラスタエージェントの全モジュール名を返します。
- op=get
- op2=modules_id_name_by_cluster_id
- id=<クラスタID>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=modules_id_name_by_cluster_id&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.52 get modules_id_name_by_cluster_name
>= 7.0
クラスタ名から、ID => クラスタエージェントの全モジュール名を返します。
- op=get
- op2=modules_id_name_by_cluster_name
- id=<クラスタ名>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=modules_id_name_by_cluster_name&id=paco&apipass=1234&user=admin&pass=pandora
1.3.2.53 get cluster_items
>= 7.0
クラスタ ID から、アイテムID => (name,id,module_agent,type,pcrit,pwarn) のフォーマットで json オブジェクトの要素を返します。
pcrit: % for the critic state if its AA or 1 o 0 if its AP
pwarn: % for the warning state if its AA or null if its AP
- op=get
- op2=cluster_items
- id=<クラスタID>
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_items&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.54 get policy
>= 7.0NG. 725
ポリシーから全データを返します。ポリシー ID が指定されていない場合は、全ポリシーから全データを返します。
書式:
- op=get
- op2=policy
- id=<ポリシーID> (オプション)
- return_type=(json, csv, string).
1.3.2.54.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.55 get collections_policy
>= 7.0NG. 725
ポリシーの全コレクションを返します。ポリシー ID が指定されていない場合は、全ポリシーの全コレクションを返します。
書式:
- op=get
- op2=collections_policy
- id=<ポリシーID> (オプション)
- return_type=(json, csv, string).
1.3.2.55.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.56 get plugins_policy
>= 7.0NG. 725
ポリシーの全プラグインを返します。ポリシー ID が指定されていない場合は、全ポリシーの全プラグインを返します。
書式:
- op=get
- op2=plugins_policy
- id=<ポリシーID> (オプション)
- return_type=(json, csv, string).
1.3.2.56.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.57 get inventory_policy
>= 7.0NG. 725
ポリシーのインベントリモジュールを返します。ポリシー ID が指定されていない場合は、全ポリシーの全インベントリモジュールを返します。
書式:
- op=get
- op2=inventory_policy
- id=<ポリシーID> (オプション)
- return_type=(json, csv, string).
1.3.2.57.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2
1.3.2.58 get unlinking_policy
>= 7.0NG. 725
ポリシーの全未リンクモジュールを返します。ポリシー ID が指定されていない場合は、全ポリシーの全未リンクモジュールを返します。
書式:
- op=get
- op2=unlinking_policy
- id=<ポリシーID> (オプション)
- return_type=(json, csv, string).
1.3.2.58.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.59 get alerts_policy
>= 7.0NG. 725
次の点を考慮して、ポリシーのアラートを返します。
- ポリシー ID が指定されていれば、ポリシーのアラートを返します。そうでなければ、全ポリシーの全アラートを返します。
- アラートのタイプを指定されている場合: (オプションは 3つあります)
- 0: すべてを表示します(デフォルト)
- 1: 通常アラートのみ表示します
- 2: 外部アラートのみ表示します
書式:
- op=get
- op2=alerts_policy
- id=<ポリシーID> (オプション)
- id2= 0:すべて(デフォルト), 1:通常, 2:外部
- return_type=(json, csv, string).
1.3.2.59.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2.
1.3.2.60 get alerts_actions_policy
>= 7.0NG. 725
以下を考慮して、ポリシーのアラートの全アクションを返します。
- ポリシー ID が指定されている場合は、そのポリシーのアラートのアクションを返します。指定されていない場合は、全ポリシーの全アラートの全アクションを返します。
- アラート ID が指定されている場合は、そのアラートのアクションを返します。
書式:
- op = get
- op2 = alerts_actions_policy
- id = <ポリシーID> (オプション)
- id2 = <ポリシーアラートID> (オプション)
- return_type=(json, csv, string).
1.3.2.60.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=1&id2=3
1.3.2.61 get agents_policy
>= 7.0NG. 725
ポリシーの全エージェントを返します。ポリシー ID が指定されていない場合は、全ポリシーの全エージェントを返します。
書式:
- op = get
- op2 = agents_policy
- id = <ポリシーID> (オプション)
- return_type = (json, csv, string).
1.3.2.61.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.62 get groups_policy
>= 7.0NG. 725
ポリシーの全グループを返します。ポリシー ID が指定されていない場合は、全ポリシーの全グループを返します。
書式:
- op = get
- op2 = groups_policy
- id = <ポリシーID> (オプション)
- return_type = (json, csv, string).
1.3.2.62.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2
1.3.2.63 get queue_policy
>= 7.0NG. 725
ポリシーのキューを返します。ポリシー ID が指定されていない場合は、全ポリシーの全キューを返します。
書式:
- op = get
- op2 = queue_policy
- id = <ポリシーID> (オプション)
- return_type = (json, csv, string).
1.3.2.63.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json
1.3.2.64 get traps
>= 7.0NG. 728
指定されたソーストラップを返します。また、タイムスタンプやその他のデータをフィルタリングすることもできます。
書式:
- op = get
- op2 = traps
- other=<オプションパラメータ>:
- <timestamp>
- <limit>
- <offset>
- <status>
- <oid_custom>
1.3.2.64.1 例
https://localhost/pandora_console/include/api.php?op=get&op2=traps&other=1537128000%7C9000%7C0%7C1%7C.1.2.3.6.4&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.65 get event_responses
Pandora FMS でユーザがアクセスするイベント応答の一覧を返します。
書式:
- op=get (必須)
- op2=event_reponses (必須)
- return_type=csv|json (必須)
1.3.2.65.1 例
この例では、csv フォーマットで全システムイベント応答を返します。
http://localhost/pandora_console/include/api.php?op=get&op2=event_responses&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.66 get users
Pandora FMS のユーザ一覧を返します。
書式:
- op=get (必須)
- op2=users (必須)
- return_type=csv|json (必須)
1.3.2.66.1 例
この例では、全ユーザを CSV フォーマットで返します。
http://localhost/pandora_console/include/api.php?op=get&op2=users&return_type=csv&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_&
1.3.2.67 get user_profiles_info
Pandora FMS のユーザプロファイル一覧を返します。
書式:
- op=get (必須)
- op2=user_profiles_info (必須)
- return_type=csv|json (必須)
1.3.2.67.1 例
この例では、全システムユーザプロファイルを json フォーマットで返します。
http://localhost/pandora_console/include/api.php?op=get&op2=user_profiles_info&return_type=json&apipass=1234&user=admin&pass=pandora
1.3.2.68 get migrate_agent
>= 7.21 メタコンソールのみ
エージェントマイグレーションキューに、指定のエージェントが存在するかを確認します。
- op=get
- op2=migrate_agent
- id=id_agente a migrar
- return_type = string, json, etc
1.3.2.68.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=migrate_agent&apipass=1234&user=admin&pass=pandora&id=2&return_type=json
1.3.2.69 get language
>= 7.0NG 730
Pandora FMS に設定されている言語を返します。
書式:
- op=get
- op2=language
1.3.2.69.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=language
1.3.2.70 get session_timeout
>= 7.0NG 730
Pandora FMS に設定されたセッションタイムアウトを返します。
書式:
- op=get
- op2=session_timeout
1.3.2.70.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=session_timeout
1.3.2.71 get groups
>= 7.0NG 732
存在するグループを返します。
書式:
- op=get
- op2=groups
- other=<オプションパラメータ>:
- <csv_separator>: デフォルトは ';'。
- <return_all_group>: 'すべて' グループを返します。
- <return_all_columns>: 全カラムを返します。
1.3.2.71.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=groups&other=;%7C1%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.72 get inventory_modules
Pandora インベントリモジュールの一覧を返します。
書式:
- op=get (必須)
- op2=inventory_modules (必須)
- return_type=csv|json (必須)
1.3.2.72.1 例
この例では、全インベントリの情報を json フォーマットで返します。
http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora
1.3.2.73 get list_collections
Pandora の全コレクションの一覧を返します。
書式:
- op=get (必須)
- op2=list_collections (必須)
1.3.2.73.1 例
この例では、全コレクションの情報を json フォーマットで返します。
http://localhost/pandora_console/include/api.php?op=get&op2=list_collections&apipass=1234&user=admin&pass=pandora
1.3.2.74 get list_collection_files
コレクション内の全ファイル一覧を返します。コレクション ID を指定しなかった場合、全コレクションの全ファイルを返します。
書式:
- op=get (必須)
- op2=list_collections_files (必須)
- id=id_collection
1.3.2.74.1 例
この例では、コレクション内の全ファイル名を json フォーマットで返します。
http://localhost/pandora_console/include/api.php?op=get&op2=list_collection_files&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.75 get all_event_filters
存在するイベントフィルタの一覧を返します。
書式:
- op=get (必須)
- op2=all_event_filters (必須)
- other=cvs_separator (オプション)
1.3.2.75.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_event_filters&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
1.3.3 設定
データを送信します。
1.3.3.1 set new_agent
パラメータで指定した内容で新たなエージェントを作成します。
書式:
- op=set (必須)
- op2=new_agent (必須)
- other=<連続したパラメータ> (必須) エージェントの設定とデータを次の順番に指定します。
- <エージェント名>
- <IP>
- <親エージェントのID>
- <グループID>
- <関連障害検知抑制>
- <関連障害検知抑制モジュール>
- <間隔(秒)>
- <OSのID>
- <サーバ名>
- <カスタムID>
- <学習モード>
- <無効化>
- <説明>
1.3.3.1.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_agent&other=agente_nombre|1.1.1.1|0|4|0|30|8|miguel-portatil||0|0|la%20descripcion&other_mode=url_encode_separator_|
- 注意: alias_as_name が 1 の場合はエージェント名は別名と同じです。0 の場合はエージェント名は自動的に生成されます。
1.3.3.2 set update_agent
パラメータで渡したデータで、新たなエージェントを更新します。
書式:
- op=set (必須)
- op2=update_agent (必須)
- id=<エージェントID> (必須)
- other=<連続パラメータ> (必須) エージェントの設定データで次の順番で設定します。
- <エージェント名>
- <ip>
- <親ID>
- <グループID>
- <関連障害検知抑制>
- <間隔(秒)>
- <OSのID>
- <サーバ名>
- <カスタムID>
- <学習モード>
- <無効化>
- <説明>
1.3.3.2.1 例
http://127.0.0.1/pandora_console/include/api.php?id=5&op=set&op2=update_agent&other=agente_nombre|1.1.1.1|0|4|0|30|8|10||0|0|la%20descripcion&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.3 set delete_agent
指定した名前のエージェントを削除します。
書式:
- op=set (必須)
- op2=delete_agent (必須)
- id=<エージェント名> (必須) エージェント名でなければいけません。
1.3.3.3.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_agent&id=agente_erroneo
1.3.3.4 set create_module_template
id に指定したテンプレート、other に指定したエージェント、モジュール ID から、アラートを作成します。
書式:
- op=set (必須)
- op2=create_module_template (必須)
- id=<テンプレートID> (必須) テンプレートIDでなければいけません。
- other=<id_module>|<id_agent>
1.3.3.4.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_module_template&id=1&other=1|10&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.5 set apply_module_template
モジュールテンプレートをエージェントへ適用します。
モジュールテンプレートは、ネットワークモジュールを集めたものです。このテンプレートは、直接エージェントに適用することができ、モジュールを一つ一つ追加する必要はありません。
書式:
- op=set (必須)
- op2=apply_module_template (必須)
- id<id_template> (必須) 適用されるテンプレートの ID
- id2<id_agente> (必須) モジュールが作成されるエージェントの ID
1.3.3.5.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_module_template&id=2&id2=2&apipass=1234&user=admin&pass=pandora
1.3.3.6 set create_network_module
指定のパラメータでネットワークモジュールを作成します。
書式:
- op=set (必須)
- op2=create_network_module (必須)
- id=<エージェント名> (必須) エージェント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で指定するモジュール設定パラメータです。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告の文字列>
- <障害の最小値>
- <障害の最大値>
- <障害の文字列>
- <連続抑制回数>
- <ヒストリーデータ>
- <対象IP>
- <TCPポート>
- <snmpコミュニティ>
- <snmp OID>
- <モジュール間隔>
- <データ保存倍率>
- <最小>
- <最大>
- <カスタムID>
- <説明>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.6.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|0|0|0|0|0|1|127.0.0.1|0||0|180|0|0|0||latency%20ping&other_mode=url_encode_separator_|
1.3.3.7 set create_plugin_module
指定のパラメータでプラグインモジュールを作成します。
書式:
- op=set (必須)
- op2=create_plugin_module (必須)
- id=<エージェント名> (必須) エージェント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定を指定します。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <ヒストリーデータ>
- <対象IP>
- <TCPポート>
- <snmp コミュニティ>
- <snmp OID>
- <モジュール間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <プラグインID>
- <プラグインユーザ>
- <プラグインパスワード>
- <プラグインパラメータ>
- <不明イベントの有効化> (バージョン 5 のみ)
- <マクロ> (バージョン 5 以降のみ) base 64 でエンコードされた JSON 文字列である必要があります。内容は、次のプロパティでまとめたオブジェクトでなければいけません。
- '"macro": マクロ名。_field1_, _field2_, ..., _fieldN_ でなければいけません。
- "desc": マクロを表す名前。
- "help": マクロの説明。
- "value": マクロの値。
- "hide": マクロの値を隠す場合は "1" に設定します。(パスワードの記載に便利です)
- 例
{ "1": { "macro": "_field1_", "desc": "Target IP", "help": "", "value": "192.168.0.1", "hide": "" }, "2": { "macro": "_field2_", "desc": "Port", "help": "", "value": "80", "hide": "" } }
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロを一つのプロパティで表した base 64 でエンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" です。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.7.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_plugin_module&id=pepito&other=prueba|0|1|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|
1.3.3.8 set create_data_module
指定したパラメータでモジュールを作成します。
書式:
- op=set (必須)
- op2=create_data_module (必須)
- id=<エージェント名> (必須) エージェント名でなければいけません。
- other=<連続パラメータ> (必須) モジュールの設定とデータを次の順番で指定します。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <説明>
- <モジュールグループID>
- <最小値>
- <最大値>
- <データ保存倍率>
- <モジュールの間隔>
- <警告の最小値>
- <警告の最大値>
- <警告の文字列>
- <障害の最小値>
- <障害の最大値>
- <障害の文字列>
- <データの保存>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <連続抑制回数> (バージョン 5.1 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <連続抑制タイムアウト> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.8.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_data_module&id=pepito&other=prueba|0|1|data%20module%20from%20api|1|10|20|10.50|180|10|15||16|20||0&other_mode=url_encode_separator_|
1.3.3.9 set create_SNMP_module
SNMP モジュールを作成します。
書式:
- op=set (必須)
- op2=create_snmp_module (必須)
- id=<エージェント名> (必須) エージェント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で指定するモジュールの設定とデータです。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告の文字列>
- <障害の最小値>
- <障害の最大値>
- <障害の文字列>
- <連続抑制回数>
- <データの保存>
- <対象IP>
- <モジュールのポート>
- <SNMPバージョン>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <SNMPv3 暗号化手法 [AES|DES]>
- <SNMPv3 暗号化パスワード>
- <SNMPv3 セキュリティレベル [authNoPriv|authPriv|noAuthNoPriv]>
- <SNMPv3 認証手法 [MD5|SHA]>
- <SNMPv3 認証ユーザ>
- <SNMPv3 認証パスワード>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.9.1 例
例 1 (SNMP v3, 暗号化手法: AES, 暗号化パスワード: example_priv_passw, セキュリティレベル: authNoPriv, 認証手法:MD5, 認証ユーザ: pepito_user, 認証パスワード: example_priv_passw)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito&other=prueba|0|15|1|10|15||16|18||15|0|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP%20module%20from%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|
例 2 (SNMP v1)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito1&other=prueba2|0|15|1|10|15||16|18||15|0|127.0.0.1|60|1|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP module from API&other_mode=url_encode_separator_|
1.3.3.10 set update_network_module
ネットワークモジュールを更新します。
書式:
- op=set (必須)
- op2=update_network_module (必須)
- id=<モジュールID> (必須) モジュールIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <エージェントID>
- <無効化>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <対象のIPO>
- <モジュールのポート>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <イベントタイプの無効化> (バージョン 5 以降のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.10.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_network_module&id=3431&other=44|0|2|10|15||16|18||7|0|127.0.0.1|0||0|300|30.00|0|0|0|latency%20ping%20modified%20by%20the%20Api&other_mode=url_encode_separator_|
1.3.3.11 set update_plugin_module
プラグインモジュールを更新します。
書式:
- op=set (必須)
- op2=update_plugin_module (必須)
- id=<モジュールID> (必須) モジュールIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <エージェントID>
- <無効化>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <対象IP>
- <モジュールのポート>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <プラグインID>
- <プラグインユーザ>
- <プラグインパスワード>
- <プラグインパラメータ>
- <イベントタイプの無効化> (バージョン 5 以降のみ)
- <マクロ> (バージョン 5 以降のみ) base 64 でエンコードされた文字列でなければいけません。内容は、次のプロパティで表すオブジェクトを一つにまとめたものでなければいけません。
- "macro": マクロ名。_field1_, _field2_, ..., _fieldN_ でなければいけません。
- "desc": マクロを表す名前。
- "help": マクロの説明。
- "value":マクロの値。
- 例
{ "1": { "macro": "_field1_", "desc": "Target IP", "help": "", "value": "192.168.0.1" }, "2": { "macro": "_field2_", "desc": "Port", "help": "", "value": "80" } }
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめ base 64 でエンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.11.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_plugin_module&id=2343&other=44|0|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|
1.3.3.12 set update_data_module
ローカルモジュールを更新します。
書式:
- op=set (必須)
- op2=update_data_module (必須)
- id=<モジュールID> (必須) モジュールIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <エージェントID>
- <無効化>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <対象のIP>
- <モジュールのポート>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <イベントタイプの無効化> (バージョン 5 以降のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <連続抑制回数> (バージョン 5.1 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <連続抑制タイムアウト> (バージョン 5.1 以降のみ)
- <障害条件の反転> (バージョン 6.0SP1 以降のみ)
- <警告条件の反転> (バージョン 6.0SP1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.12.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module&id=23234&other=44|0|data%20module%20modified%20from%20API|6|0|0|50.00|300|10|15||16|18||0&other_mode=url_encode_separator_|
1.3.3.13 set update_data_module_policy
ポリシーのデータモジュールを更新し、新たなモジュールの ID を返します。
書式:
- op=set (必須)
- op2=update_data_module (必須)
- id=<id_agent_module> (必須) 対象のポリシーモジュールID。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。:
- <ポリシーモジュールID>
- <説明>
- <モジュールグループID>
- <最小>
- <最大>
- <事前処理>
- <モジュールの間隔>
- <警告の最小値>
- <警告の最大値>
- <障害の最小値>
- <障害の最大値>
- <障害の文字列>
- <データの保存>
- <設定データ>
- <disabled_types_event> (バージョン 5以降)
- <モジュールマクロ> (バージョン 5以降) 各マクロに対して 1つのプロパティを持つオブジェクトによって形成された、base64 でエンコードされた JSON ドキュメントである必要があります。JSON フォーマットは、"<マクロ名>": "<マクロの値>" となっている必要があります。
1.3.3.13.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module_policy&id=1&other=10~data%20module%20updated%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_
1.3.3.14 set update_SNMP_module
SNMP モジュールを更新します。
書式:
- op=set (必須)
- op2=update_snmp_module (必須)
- id=<モジュールID> (必須) モジュールIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <エージェントID>
- <無効化>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <対象のIP>
- <モジュールのポート>
- <SNMPバージョン>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <snmp3 暗号化方式 [AES|DES]>
- <snmp3 暗号化パスワード>
- <snmp3 セキュリティレベル [authNoPriv|authPriv|noAuthNoPriv]>
- <snmp3 認証方式 [MD5|SHA]>
- <snmp3 認証ユーザ>
- <snmp3 認証パスワード>
- <イベントタイプの無効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.14.1 例
例 (SNMPバージョン: 3、snmp3暗号化方式: AES、snmp3暗号化パスワード: example_priv_passw、snmp3セキュリティレベル: authNoPriv、snmp3認証方式:MD5、snmp3認証ユーザ: pepito_user、snmp3認証パスワード: example_priv_passw)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_snmp_module&id=33432&other=44|0|6|20|25||26|30||15|1|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|
1.3.3.15 set apply_policy
ひとつもしくは複数のエージェントに、ID を指定してポリシーを適用します。
書式:
- op=set (必須)
- op2=apply_policy (必須)
- id=<id_policy> (必須)
- id2=<id_agent> (オプション) 他のパラメータに示されているエージェントのIDまたは名前。 空の場合、ポリシーはすべてのエージェントに適用されます。
- other=<連続パラメータ> (オプション):
- <name_agent (Boolean)> エージェントを ID(0) で指定するか、名前(1) で指定するかを示します。
- <return>
1.3.3.15.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=apply_policy&id=10&id2=0&other=1&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|
1.3.3.16 set apply_all_policies
Pandora 内にある全ポリシーを適用します。
書式:
- op=set (必須)
- op2=apply_all_policies (必須)
1.3.3.16.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_all_policies
1.3.3.17 set add_network_module_policy
指定したパラメータで、ポリシーにネットワークモジュールを追加します。
書式:
- op=set (必須)
- op2=add_network_module_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <モジュールタイプID>
- <説明>
- <モジュールグループID>
- <最小値>
- <最大値>
- <データ保存倍率>
- <モジュールの間隔>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <データの保存>
- <連続抑制回数>
- <無効化>
- <モジュールのポート>
- <SNMPコミュニティ>
- <SNMP OID>
- <カスタムID>
- <不明イベントの有効化> (バージョン 5 のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.17.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_network_module_policy&id=1&other=network_module_policy_example_name|6|network%20module%20created%20by%20Api|2|0|0|50.00|180|10|20||21|35||1|15|0|66|||0&other_mode=url_encode_separator_|
1.3.3.18 set add_plugin_module_policy
指定したパラメータで、ポリシーにプラグインモジュールを追加します。
書式:
- op=set (必須)
- op2=add_plugin_module_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <モジュールのポート>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <プラグインID>
- <プラグインユーザ>
- <プラグインパスワード>
- <プラグインパラメータ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <マクロ> (バージョン 5 以降のみ) base 64 でエンコードした JSON 文字列でなければいけません。内容は、次のプロパティのオブジェクトを一つのオブジェクトにまとめた形式でなければいけません。
- "macro": マクロ名。_field1_, _field2_, ..., _fieldN_ でなければいけません。
- "desc": マクロを表す名前。
- "help": マクロの説明。
- "value":マクロの値。
- 例
{ "1": { "macro": "_field1_", "desc": "Target IP", "help": "", "value": "192.168.0.1" }, "2": { "macro": "_field2_", "desc": "Port", "help": "", "value": "80" } }
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.18.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_plugin_module_policy&id=1&other=example%20plugin%20module%20name|0|1|2|0|0||0|0||15|0|66|||300|50.00|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|
1.3.3.19 set add_data_module_policy
指定したパラメータで、ポリシーにローカルモジュールを追加します。
書式:
- op=set (必須)
- op2=add_data_module_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <モジュール名>
- <モジュールタイプID>
- <説明>
- <モジュールグループID>
- <最小値>
- <最大値>
- <データ保存倍率>
- <モジュールの間隔>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <データの保存>
- <設定データ> ポリシーエージェントの設定ファイルに挿入されるエージェントの定義ブロックです。
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロのプロパティを一つのオブジェクトにまとめて base 64 エンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、"<macro name>": "<macro value>" でなければいけません。
- <連続抑制回数> (バージョン 5.1 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <連続抑制タイムアウト> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.19.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_data_module_policy&id=1&other=data_module_policy_example_name~2~data%20module%20created%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_~
1.3.3.20 set add_SNMP_module_policy
指定したパラメータで、ポリシーに SNMP モジュールを追加します。
書式:
- op=set (必須)
- op2=add_snmp_module_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
- <モジュール名>
- <無効化>
- <モジュールタイプID>
- <モジュールグループID>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データの保存>
- <モジュールのポート>
- <SNMPバージョン>
- <SNMPコミュニティ>
- <SNMP OID>
- <モジュールの間隔>
- <データ保存倍率>
- <最小値>
- <最大値>
- <カスタムID>
- <説明>
- <snmp3 暗号化方式 [AES|DES]>
- <snmp3 暗号化パスワード>
- <snmp3 セキュリティレベル [authNoPriv|authPriv|noAuthNoPriv]>
- <snmp3 認証方式 [MD5|SHA]>
- <snmp3 認証ユーザ>
- <snmp3 認証パスワード>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.20.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_snmp_module_policy&id=1&other=example%20SNMP%20module%20name|0|15|2|0|0||0|0||15|1|66|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|
1.3.3.21 set add_agent_policy
ポリシーにエージェントを追加します。
書式:
- op=set (必須)
- op2=add_agent_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でエージェントの設定とデータを指定します。
- <エージェントID>
1.3.3.21.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy&id=1&other=167&other_mode=url_encode_separator_|
1.3.3.22 set remove_agent_from_policy
ポリシーからエージェントを削除します。
書式:
- op=set (必須)
- op2=remove_agent_from_policy (必須)
- id=<id_política> (必須) ポリシー ID である必要があります。
- id2=<id_agente>> (必須) ポリシーに適用されたエージェント ID である必要があります。
1.3.3.22.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy&apipass=1234&user=admin&pass=pandora&id=11&id2=2
1.3.3.23 set new_network_component
新たなネットワークコンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_network_component (必須)
- id=<ネットワークコンポーネント名> (必須) ネットワークコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でエージェントの設定とネットワークコンポーネントのデータを指定します。
- <ネットワークコンポーネントタイプ>
- <説明>
- <モジュールの間隔>
- <最大値>
- <最小値>
- <SNMPコミュニティ>
- <モジュールグループID>
- <最大タイムアウト>
- <データの保存>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データ保存倍率>
- <ネットワークコンポーネントグループ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.23.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_network_component&id=example_network_component_name&other=7|network%20component%20created%20by%20Api|300|30|10|public|3||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|
1.3.3.24 set new_plugin_component
新たなプラグインコンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_plugin_component (必須)
- id=<プラグインコンポーネント名> (必須) プラグインコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でエージェントの設定とプラグインコンポーネントのデータを指定します。
- <プラグインコンポーネントタイプ>
- <説明>
- <モジュールの間隔>
- <最大値>
- <最小値>
- <モジュールのポート>
- <モジュールグループID>
- <プラグインID>
- <最大タイムアウト>
- <データの保存>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データ保存倍率>
- <プラグインコンポーネントグループ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.24.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_plugin_component&id=example_plugin_component_name&other=2|plugin%20component%20created%20by%20Api|300|30|10|66|3|2|example_user|example_pass|-p%20max||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|
1.3.3.25 set new_snmp_component
新たな SNMP コンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_snmp_component (必須)
- id=<SNMPコンポーネント名> (必須) SNMPコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で SNMP コンポーネントの設定とデータを指定します。
- <SNMPコンポーネントタイプ>
- <説明>
- <モジュールの間隔>
- <最大値>
- <最小値>
- <モジュールグループID>
- <最大タイムアウト>
- <データの保存>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データ保存倍率>
- <SNMPバージョン>
- <SNMP OID>
- <SNMPコミュニティ>
- <snmp3 認証ユーザ>
- <snmp3 認証パスワード>
- <モジュールのポート>
- <snmp3 暗号化手法>
- <snmp3 暗号化パスワード>
- <snmp3 認証手法>
- <snmp3 セキュリティレベル>
- <SNMPコンポーネントグループ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.25.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_snmp_component&id=example_snmp_component_name&other=16|SNMP%20component%20created%20by%20Api|300|30|10|3||1|10|20|str|21|30|str1|15|50.00|3|.1.3.6.1.2.1.2.2.1.8.2|public|example_auth_user|example_auth_pass|66|AES|example_priv_pass|MD5|authNoPriv|12&other_mode=url_encode_separator_|
1.3.3.26 set new_local_component
新たなローカルコンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_local_component (必須)
- id=<ローカルコンポーネント名> (必須) ローカルコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でローカルコンポーネントの設定とデータを指定します。
- <説明>
- <OSのID>
- <ローカルコンポーネントグループ>
- <設定データ> モジュールの設定ブロックです。
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <連続抑制回数> (バージョン 5.1 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <連続抑制タイムアウト> (バージョン 5.1 以降のみ)
- <ff_type> (バージョン 733 以降のみ)
1.3.3.26.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_local_component&id=example_local_component_name&other=local%20component%20created%20by%20Api~5~12~module_begin%0dmodule_name%20example_local_component_name%0dmodule_type%20generic_data%0dmodule_exec%20ps%20|%20grep%20pid%20|%20wc%20-l%0dmodule_interval%202%0dmodule_end&other_mode=url_encode_separator_~
1.3.3.27 set create_alert_template
アラートテンプレートを作成します。
書式:
- op=set (必須)
- op2=create_alert_template (必須)
- id=<テンプレート名> (必須) テンプレート名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でテンプレートの設定とデータを指定します。
- <タイプ [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]>
- <説明>
- <アラートアクションID>
- <フィールド1>
- <フィールド2>
- <フィールド3>
- <値>
- <マッチする値>
- <最大値>
- <最小値>
- <再通知間隔>
- <最大アラート数>
- <最小アラート数>
- <開始時間>
- <終了時間>
- <月曜>
- <火曜>
- <水曜>
- <木曜>
- <金曜>
- <土曜>
- <日曜>
- <復旧アラート>
- <復旧時のフィールド2>
- <復旧時のフィールド3>
- <優先度>
- <グループID>
1.3.3.27.1 例
例1 (状態: regexp =~ /pp/、アクション: Mail to XXX、最大アラート数: 10、最小アラート数: 0、優先度: 警告、グループ: database):
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_alert_template&id=pepito&other=regex|template%20based%20in%20regexp|1||||pp|1||||10|0|||||||||||||3&other_mode=url_encode_separator_|
例2 (状態: 値が5と10の間以外、最大値: 10.00、最小値: 5.00、開始時間: 00:00:00、終了時間: 15:00:00、優先度: 障害、グループ: Servers):
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_alert_template&id=template_min_max&other=max_min|template%20based%20in%20range|NULL||||||10|5||||00:00:00|15:00:00|||||||||||4|2&other_mode=url_encode_separator_|
1.3.3.28 set update_alert_template
アラートテンプレートを更新します。
書式:
- op=set (必須)
- op2=update_alert_template (必須)
- id=<テンプレートID> (必須) テンプレートIDでなければいけません。
- other=<連続パラメータ> (必須) 次の順番でテンプレートの設定とデータを指定します。
- <テンプレート名>
- <タイプ [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]>
- <説明>
- <アラートアクションID>
- <フィールド1>
- <フィールド2>
- <フィールド3>
- <値>
- <マッチする値>
- <最大値>
- <最小値>
- <再実行間隔>
- <最大アラート数>
- <最小アラート数>
- <開始時間>
- <終了時間>
- <月曜>
- <火曜>
- <水曜>
- <木曜>
- <金曜>
- <土曜>
- <日曜>
- <復旧アラート>
- <復旧時のフィールド2>
- <復旧時のフィールド3>
- <優先度>
- <グループID>
1.3.3.28.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_alert_template&id=38&other=example_template_with_changed_name|onchange|changing%20from%20min_max%20to%20onchange||||||1||||5|1|||1|1|0|1|1|0|0|1|field%20recovery%20example%201|field%20recovery%20example%202|1|8&other_mode=url_encode_separator_|
1.3.3.29 set delete_alert_template
アラートテンプレートと、テンプレートで使われているアラートを削除します。
書式:
- op=set (必須)
- op2=delete_alert_template (必須)
- id=<テンプレートID> (必須) テンプレートIDでなければいけません。
1.3.3.29.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38
1.3.3.30 set delete_module_template
モジュールテンプレートを削除します。
書式:
- op=set (必須)
- op2=delete_module_template (必須)
- id=<alert_template_module ID> (必須) alert_template_module のIDでなければいけません。
1.3.3.30.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38
1.3.3.31 set delete_module_template_by_names
モジュールテンプレートを削除します。
書式:
- op=set (必須)
- op2=delete_module_template_by_names (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other=<連続パラメータ> (必須) 次の順番でデータを指定します。
- <モジュール名> (必須)
1.3.3.31.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template_by_names&id=sample-agent&id2=test&other=memfree&apipass=1234&user=admin&pass=pandora
1.3.3.32 set stop_dowtime
計画停止を停止します。
書式:
- op=set (必須)
- op2=stop_downtime (必須)
- id=<計画停止ID> (必須) 計画停止IDでなければいけません。
1.3.3.32.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1
1.3.3.33 set new_user
Pandora に新たなユーザを作成します。
書式:
- op=set (必須)
- op2=new_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で設定とデータを指定します。
- <ユーザ名>
- <フルネーム>
- <名前>
- <名字>
- <ミドルネーム>
- <電子メールアドレス>
- <電話番号>
- <言語>
- <コメント>
1.3.3.33.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel|de%20dios|matias|kkk|pandora|[email protected]|666|es|descripcion%20y%20esas%20cosas&other_mode=url_encode_separator_|
1.3.3.34 Set update_user
指定した ID のユーザを指定したパラメータで更新します。
書式:
- op=set (必須)
- op2=update_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で設定とデータを指定します。
- <フルネーム>
- <名前>
- <名字>
- <ミドルネーム>
- <パスワード>
- <電子メールアドレス>
- <電話番号>
- <言語>
- <コメント>
- <管理者>
- <一画面の表示数>
- <フラッシュグラフ>
1.3.3.34.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_user&id=example_user_name&other=example_fullname||example_lastname||example_new_passwd|example_email||example_language|example%20comment|1|30|&other_mode=url_encode_separator_|
1.3.3.35 set delete_user
選択したユーザを削除します。
書式:
- op=set (必須)
- op2=delete_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
1.3.3.35.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md
1.3.3.36 set enable_disable_user
ユーザを無効化・有効化します。
書式:
- op=set (必須)
- op2=enable_disable_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。
1.3.3.36.1 例
例1 (ユーザ 'example_name' を無効化)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=0&other_mode=url_encode_separator_|
例2 (ユーザ 'example_name' を有効化)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=1&other_mode=url_encode_separator_|
1.3.3.37 set meta_synch_user
これはメタコンソール用です。
ノードへメタコンソールユーザを同期します。
書式:
- op=set (必須)
- op2=meta_synch_user (必須)
- other=<連続パラメータ> (オプション):
- <user_name_1,user_name_2,user_name_3..> (先頭および末尾にスペースを入れずにカンマで区切ったユーザ名, 必須)
- <server_name> (必須)
- <profile_mode(1-0)> (オプション)
- <group_name> (オプション)
- <profile_1,profile_2,profile_3> (最初と最後にスペースを入れずにカンマで区切ったプロファイル, オプション)
- <create_groups(1-0)> (オプション)
1.3.3.37.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=meta_synch_user&apipass=1234&user=admin&pass=pandora&other=name1,name2|nodo1|0|||&other_mode=url_encode_separator_|
1.3.3.38 set create_group
グループを作成します。
書式:
- op=set (必須)
- op2=create_group (必須)
- id=<グループ名> (必須) グループ名を指定します。
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <アイコン名>
- <親グループID> (オプション)
- <説明> (オプション)
- <ACLの伝播> (オプション)
- <アラートの無効化> (オプション)
- <カスタムID> (オプション)
- <連絡先> (オプション)
- <その他> (オプション)
1.3.3.38.1 例
例1 (親グループ: Servers)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name&other=applications|2&other_mode=url_encode_separator_|
例2 (親グループなし)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name2&other=computer|&other_mode=url_encode_separator_|
1.3.3.39 set update_group
グループの設定を更新します。
書式:
- op=set (必須)
- op2=update_group (必須)
- id=<グループID> (必須) グループIDを指定します。
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <グループ名>
- <アイコン名>
- <親グループID>
- <説明>
- <ACLの伝播>
- <アラートの無効化>
- <カスタムID>
- <連絡先>
- <その他>
1.3.3.39.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_group&id=example_group_id&other=New%20Name|application|2|new%20description|1|0|custom%20id||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.40 set delete_group
グループを削除します。
書式:
- op=set (必須)
- op2=update_group (必須)
- id=<グループID> (必須) グループIDを指定します。
1.3.3.40.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora
1.3.3.41 set add_user_profile
ユーザにプロファイルを追加します。
書式:
- op=set (必須)
- op2=add_user_profile (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でグループの設定、プロファイルを指定します。
- <グループ>
- <プロファイル>
1.3.3.41.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|
1.3.3.42 set delete_user_profile
ユーザのプロファイルを削します。
書式:
- op=set (必須)
- op2=delete_user_profile (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でグループおよびプロファイルを指定します。
- <グループ>
- <プロファイル>
1.3.3.42.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|
1.3.3.43 set new_incident
新たなインシデントを作成します。
書式:
- op=set (必須)
- op2=new_incident (必須)
- other=<連続パラメータ> (必須) 次の順番でインシデントの設定とデータを指定します。
- <タイトル>
- <説明>
- <作成者>
- <優先度>
- <状態>
- <グループ>
1.3.3.43.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_incident&other=titulo|descripcion%20texto|Logfiles|2|10|12&other_mode=url_encode_separator_|
1.3.3.44 set new_note_incident
インシデントにコメントを追加します。
書式:
- op=set (必須)
- op2=new_note_incident (必須)
- id=<インシデントID> (必須) インシデントのIDです。
- id2=<ユーザ名> (必須) ユーザ名です。
- other=<コメント> (必須) URLエンコードされたコメントです。
1.3.3.44.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_note_incident&id=5&id2=miguel&other=una%20nota%20para%20la%20incidencia
1.3.3.45 set validate_all_alerts
全アラートを承諾します。
書式:
- op=set (必須)
- op2=validate_all_alerts (必須)
1.3.3.45.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts
1.3.3.46 set validate_all_policy_alerts
ポリシーから作成されたアラートを承諾します。
書式:
- op=set (必須)
- op2=validate_all_policy_alerts (必須)
1.3.3.46.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts
1.3.3.47 set event_validate_filter
指定したフィルタにマッチするすべてのイベントを承諾します。
書式:
- op=set (必須)
- op2=event_validate_filter (必須)
- other_mode=url_encode_separator_|(オプション)
- other=<連続パラメータ> (オプション) 次の順番で指定します。
- <セパレータ>
- <重要度> 0 から 4
- <エージェント名>
- <モジュール名>
- <アラートテンプレート名>
- <ユーザ>
- < 最小レベルの数値間隔> UNIXタイムスタンプ
- < 最大レベルの数値間隔> UNIXタイムスタンプ
1.3.3.47.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2
1.3.3.48 set event_validate_filter_pro
前述の API と似たものです。
書式:
- op=set (必須)
- op2=event_validate_filter_pro (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (オプション) 次の順番で指定します。
- <セパレータ>
- <重要度> 0 から 4
- <エージェントID>
- <モジュールID>
- <エージェントモジュールアラートID>
- <ユーザ>
- <最小レベルの数値間隔> UNIXタイムスタンプ
- <最大レベルの数値間隔> UNIXタイムスタンプ
1.3.3.48.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_|&other=;|2
1.3.3.49 set new_alert_template
テンプレートおよび、エージェントIDおよびモジュール名からモジュールを指定して、新たなアラートを適用します。
書式:
- op=set (必須)
- op2=new_alert_template (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <モジュール名> (必須)
1.3.3.49.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_alert_template&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree
1.3.3.50 set alert_actions
アラートにアクションを追加します。
書式:
- op=set (必須)
- op2=alert_actions (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <モジュール名> (必須)
- <アクション名> (必須)
- <開始アラート数> (オプション)
- <終了アラート数> (オプション)
1.3.3.50.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test|1|3
1.3.3.51 set alert_commands
アラートにコマンドを追加します。
書式:
- op=set (必須)
- op2=alert_commands (必須)
- id=<コマンド名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須), 次の順番:
- <command> (必須)
- <id_group> (必須)
- <description > (必須)
- <internal > (オプション)
- <field_description_1><field_value_1><field_description_2><field_value_2>...<field_description_n><field_value_n>
1.3.3.51.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=alert_commands&id=PRUEBA1&other=command|0|Desc|1|des1|val1|des2|val2|des3|val3||val4|des5&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.52 set new_module
新たなモジュールを作成します。
書式:
- op=set (必須)
- op2=new_module (必須)
- id=<エージェント名> (必須)
- id2=<新たなモジュール名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <ネットワークモジュールの種類> (必須)
- <アクション名> (必須)
- <IP または URL> (必須)
- <ポート> (オプション)
- <説明> (オプション)
- <最小値> (オプション)
- <最大値> (オプション)
- <データ保存倍率> (オプション)
- <モジュールの間隔> (オプション)
- <警告の最小値> (オプション)
- <警告の最大値> (オプション)
- <障害の最小値> (オプション)
- <障害の最大値> (オプション)
- <データの保存> (オプション)
- <不明イベントの有効化> (バージョン 5 のみ)
1.3.3.52.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_module&id=miguel-portatil&id2=juanito&other_mode=url_encode_separator_|&other=remote_tcp_string|localhost|33|descripcion%20larga
1.3.3.53 set delete_module
モジュールを削除します。
書式:
- op=set (必須)
- op2=delete_module (必須)
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other=simulate (オプション)
1.3.3.53.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&other=simulate
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito
1.3.3.54 set enable_alert
エージェントのアラートを有効化します。
書式:
- op=set (必須)
- op2=enable_alert
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: Warning イベント) (必須)
1.3.3.54.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition
1.3.3.55 set enable_alert_alias
エイリアスでエージェントのアラートを有効化します。
書式:
- op=set (必須)
- op2=enable_alert_alias
- id=<エージェントの別名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (p.e: 警告イベント) (必須)
1.3.3.55.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert_alias&id=nova&id2=CPU%20Load&other=critical%20condition&apipass=1234&user=admin&pass=pandora
1.3.3.56 set disable_alert
エージェントのアラートを無効化します。
書式:
- op=set (必須)
- op2=disable_alert
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: Warning イベント) (必須)
1.3.3.56.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition
1.3.3.57 set disable_alert_alias
エージェントのアラートを無効化します。
書式:
- op=set (必須)
- op2=disable_alert_alias
- id=<エージェントエイリアス> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: 警告イベント) (必須)
1.3.3.57.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert_alias&id=nova&id2=CPU%20Load&other=critical%20condition&apipass=1234&user=admin&pass=pandora
1.3.3.58 set enable_module_alerts
enable_alert と同じです。
書式:
- op=set (必須)
- op2=enable_module_alerts
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.58.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status
1.3.3.59 set disable_module_alerts
disable_alert と同じです。
書式:
- op=set (必須)
- op2=disable_module_alerts
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.59.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status
1.3.3.60 set enable_module
モジュールを有効化します。
書式:
- op=set (必須)
- op2=enable_module
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.60.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status
1.3.3.61 set disable_module
モジュールを無効化します。
書式:
- op=set (必須)
- op2=disable_module
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.61.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status
1.3.3.62 set create_network_module_from_component
コンポーネントから新たなネットワークモジュールを作成します。
書式:
- op=set (必須)
- op2=create_network_module_from_component (必須)
- id=<エージェント名> (必須)
- id2=<コンポーネント名> (必須)
1.3.3.62.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_network_module_from_component&id=garfio&id2=OS%20Total%20process&apipass=1234&user=admin&pass=pandora
1.3.3.63 set module_data
モジュールに値を追加します。
書式:
- op=set (必須)
- op2=module_data (必須)
- id=<エージェントモジュールID> (必須)
- other: モジュールのデータとタイムスタンプ
- dato: Pandora のデータタイプ
- tiempo: タイムスタンプ、"now" を指定できます。
1.3.3.63.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=module_data&id=14&other_mode=url_encode_separator_|&other=123|now&apipass=1234&user=admin&pass=pandora
1.3.3.64 set new_module_group
新たなモジュールグループを作成します。
書式:
- op=set (必須)
- op2=new_module_group (必須)
- id=<モジュールグループ名> (必須)
1.3.3.64.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=new_module_group&id=Module_group_name&apipass=1234&user=admin&pass=pandora
1.3.3.65 set module_group_synch
これはメタコンソール用です。
メタコンソールからモジュールグループを同期します。
書式:
- op=set (必須)
- op2=module_group_synch (必須)
- other=<連続パラメータ> (必須) メタコンソールと同期するサーバの名前が必須です。
- <server_name_1><server_name_2>...<server_name_n> (必須)
1.3.3.65.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=module_group_synch&other=server_name1|server_name2|server_name3&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.66 set add_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールに設定を追加します。
書式:
- op=set (必須)
- op2=add_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
- other: conf ファイルに書くモジュール設定を base64 でエンコードしたもの (必須)
1.3.3.66.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_module_in_conf&apipass=1234&user=admin&pass=pandora&id=9043&id2=example_name&other=bW9kdWxlX2JlZ2luCm1vZHVsZV9uYW1lIGV4YW1wbGVfbmFtZQptb2R1bGVfdHlwZSBnZW5lcmljX2RhdGEKbW9kdWxlX2V4ZWMgZWNobyAxOwptb2R1bGVfZW5k
成功すると '0'、エラー時は '-1'、すでに存在する場合は '-2' を返します。
1.3.3.67 set delete_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールの設定を削除します。
書式:
- op=set (必須)
- op2=add_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
1.3.3.67.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_module_in_conf&user=admin&pass=pandora&id=9043&id2=example_name
成功すると '0'、エラー時は '-1' を返します。
1.3.3.68 set update_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールの設定を更新します。
書式:
- op=set (必須)
- op2=update_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
- other: conf ファイル内のモジュール設定を置き換える内容を、base64 でエンコードしたもの。(必須)
1.3.3.68.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_module_in_conf&apipass=1234&user=admin&pass=pandora&id=9043&id2=example_name&other=bW9kdWxlX2JlZ2luCm1vZHVsZV9uYW1lIGV4YW1wbGVfbmFtZQptb2R1bGVfdHlwZSBnZW5lcmljX2RhdGEKbW9kdWxlX2V4ZWMgZWNobyAxOwptb2R1bGVfZW5k
変更が無い場合は '1'、成功すると '0'、エラー時は '-1'、存在しない場合は '-2' を返します。
1.3.3.69 set create_event
Pandora 内に新たなイベントを作成します。
書式:
- op=set (必須)
- op2=create_event (必須)
- other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
- <イベントテキスト> (必須)
- <グループID> (必須)
- <エージェントID> (必須)
- <状態>
- <ユーザID>
- <イベントタイプ>
- <重要度>
- <エージェントモジュールID>
- <アラートID>
- <障害の説明>
- <警告の説明>
- <不明の説明>
- <コメント>
- <ユーザコマンド>
- <オーナーユーザ>(文字列)
- <発生元>
- <タグ>
- <カスタムデータ> カスタムデータは、base64 でエンコードされた JSON データである必要があります。
1.3.3.69.1 例
http://127.0.0.1/pandora_trunk/include/api.php?op=set&op2=create_event&other=NewEvent|0|189||apiuser|system|1||||||||VMware||eyJBbnN3ZXIgdG8gdGhlIFVsdGltYXRlIFF1ZXN0aW9uIG9mIExpZmUsIHRoZSBVbml2ZXJzZSwgYW5kIEV2ZXJ5dGhpbmciOiA0Mn0=&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.70 set add_event_comment
イベントにコメントを追加します。
書式:
- op=set (必須)
- op2=create_event (必須)
- other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
- <コメント> (必須)
1.3.3.70.1 例
- ノード
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_event_comment&id=event_id&other=string&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
- メタコンソール
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_event_comment&id=event_id&other=string|true&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.71 set create_netflow_filter
(>=5.0)
新たな netflow フィルタを作成します。
書式:
- op=set (必須)
- op2=create_netflow_filter (必須)
- other=<連続パラメータ> (必須) 次の順番でフィルタデータを指定します:
- <フィルター名> (必須)
- <グループID> (必須)
- <フィルタ> (必須)
- <集約方法> (設定可能な値: dstip,dstport,none,proto,srcip,srcport) (必須)
- <出力フォーマット> (設定可能な値: kilobytes,kilobytespersecond,megabytes,megabytespersecond) (必須)
1.3.3.71.1 例
http://127.0.0.1/pandora/include/api.php?op=set&op2=create_netflow_filter&apipass=1234&user=admin&pass=pandora&other=Filter%20name|9|host%20192.168.50.3%20OR%20host%20192.168.50.4%20or%20HOST%20192.168.50.6|dstport|kilobytes&other_mode=url_encode_separator_|
1.3.3.72 set create_custom_field
>= 5.0
新たなカスタムフィールドを作成します。
書式:
- op=set (必須)
- op2=create_custom_field (必須)
- other=<連続パラメータ> (必須) カスタムフィールドを設定するパラメータ
- <名前> (必須)
- <フロント表示フラグ> (必須; 0:操作画面でフィールドを表示しない。1:フィールドを表示する。)
1.3.3.72.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_custom_field&other=mycustomfield|0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.73 set create_tag
>= 5.0
新たなタグを作成します。
書式:
- op=set (必須)
- op2=create_tag (必須)
- other=<連続パラメータ> (必須) タグの設定パラメータ
- <名前> タグ名 (必須)
- <説明> タグの説明
- <url> タグの URL
- <email> タグのメールアドレス
1.3.3.73.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_tag&other=tag_name|tag_description|tag_url|tag_email&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.74 set enable_disable_agent
エージェントを有効化/無効化します。
書式:
- op=set (必須)
- op2=enable_disable_agent (必須)
- id=<エージェントID> (必須) エージェントIDでなければいけません。
- other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。
1.3.3.74.1 例
例1 (エージェント 'example_id' を無効化)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_agent&id=example_id&other=0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
例2 (エージェント 'example_id' を有効化)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_agent&id=example_id&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.3.75 set gis_agent_only_position
>= 5.0
エージェントに、新たな GIS 位置情報を追加します。
書式:
- op=set (必須)
- op2=gis_agent_only_position (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須) 位置情報パラメータ
- <緯度>
- <経度>
- <高度>
1.3.3.75.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=gis_agent_only_position&id=582&other_mode=url_encode_separator_|&other=2%7C1%7C0
1.3.3.76 set gis_agent
>= 5.0
エージェントに gis データを追加します。
書式:
- op=set (必須)
- op2=gis_agent_only_position (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須) gisデータ
- <緯度>
- <経度>
- <高度>
- <新たなgisデータの無視>
- <手動位置決め>
- <開始タイムスタンプ>
- <終了タイムスタンプ>
- <データ数>
- <履歴保存の説明>
- <gis更新の説明>
- <初回挿入の説明>
1.3.3.77 set reset_agent_counts
エージェントのモジュールおよびアラートカウントを更新します。
書式:
- op=set (必須)
- op2=reset_agent_counts (必須)
- id=<id_agent> (必須) エージェント ID もしくは "All" である必要があります。
1.3.3.77.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=reset_agent_counts&apipass=1234&user=admin&pass=pandora&id=All
1.3.3.78 set create_special_day
>= 5.1
新たな特別日を追加します。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須)
- <特別日>
- <同一の日>
- <説明>
- <グループID>
1.3.3.78.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=create_special_day&other_mode=url_encode_separator_|&other=2014-05-03|Sunday|desc|0
1.3.3.79 set update_special_day
>= 5.1
定義済の特別日の設定を更新します。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<特別日ID> (compulsory)
- other=<連続パラメータ> (必須)
- <特別日>
- <同一の日>
- <説明>
- <グループID>
1.3.3.79.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=update_special_day&id=1&other_mode=url_encode_separator_|&other=2014-05-03|Sunday|desc|0
1.3.3.80 set delete_special_day
>= 5.1
特別日を削除。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<特別日ID> (必須)
1.3.3.80.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1
1.3.3.81 set pagerduty_webhook
>= 5.1
Pandora FMS アラートと PagerDuty 通知を接続します。PagerDuty サービスの webhooks オプションを、PagerDuty からアラートを承諾した場合の動作に対して、あらかじめ PagerDuty にリンクさせた Pandora FMS のアラートの承諾に設定します。
書式:
- op=set (必須)
- op2=pagerduty_webhook (必須)
- id=alert (必須)
1.3.3.81.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=pagerduty_webhook&apipass=1234&user=admin&pass=pandora&id=alert
1.3.3.82 set tag_user_profile
>= 6
ユーザのプロファイルにタグを追加します。
書式:
- op = set (必須)
- op2 = tag_user_profile (必須)
- id = id_user (必須)
- id2 = id_tag (必須)
- other_mode = url_encode_separator_| (必須)
- other = <id_group>|<id_profile> (必須)
1.3.3.82.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=tag_user_profile&apipass=1234&user=admin&pass=pandora&id=1&id2=2&other_mode=url_encode_separator_|&other=122|3
1.3.3.83 set tag
>= 6
pandora にタグを追加します。
書式:
- op = set (必須)
- op2 = tag (必須)
- id = name (必須)
- other_mode = url_encode_separator_| (必須)
- other = <description>|<url>|<email>|<phone>
1.3.3.83.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=tag&apipass=1234&user=admin&pass=pandora&id=test&other_mode=url_encode_separator_|&other="a test"|http://www.artica.es|[email protected]|01189998819991197253
1.3.3.84 set add_tag_module
>= 6
モジュールにタグを追加します。
書式:
- op = set (必須)
- op2 = add_tag_module (必須)
- id = id_module (必須)
- id2 = id_tag (必須)
1.3.3.84.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_tag_module&apipass=1234&user=admin&pass=pandora&id=1&id2=2
1.3.3.85 set remove_tag_module
>= 6
モジュールのタグを削除します。
書式:
- op = set (必須)
- op2 = add_tag_module (必須)
- id = id_module (必須)
- id2 = id_tag (必須)
1.3.3.85.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_tag_module&apipass=1234&user=admin&pass=pandora&id=1&id2=2
1.3.3.86 set planned_downtimes_created
>= 5.1
計画停止を作成します
書式:
- op=set (必須)
- op2=planned_downtimes_created (必須)
- other=<連続パラメータ> (必須) 計画停止を作成するパラメータ列:
- <説明>
- <開始日時> 一回のみの場合の開始日時
- <終了日時> 一回のみの場合の終了日時
- <グループID>
- <月>
- <火>
- <水>
- <木>
- <金>
- <土>
- <日>
- <定期実行開始時間>
- <定期実行終了時間>
- <定期実行開始日>
- <定期実行終了日>
- <タイプ> quit, disabled_agents, disabled_agents_alerts のいずれか
- <実行> once または periodically
- <定期実行タイプ> weekly または monthly
- <id_user>
1.3.3.86.1 例
一回:
http://localhost/pandora_console/include/api.php?op=set&op2=planned_downtimes_created&apipass=1234&user=admin&pass=pandora&id=testing&other=testing|11/05/2018|11/16/2018|0|1|1|1|1|1|1|1|12:06:00|19:06:00|1|31|quiet|once|weekly|admin&other_mode=url_encode_separator_|
繰り返し:
http://localhost/pandora_console/include/api.php?op=set&op2=planned_downtimes_created&apipass=1234&user=admin&pass=pandora&id=testing&other=testing|11/05/2018|11/16/2018|0|1|1|1|1|1|1|1|12:06:00|19:06:00|1|31|quiet|periodically|weekly|admin&other_mode=url_encode_separator_|
1.3.3.87 set planned_downtimes_additem
>= 5.1
計画停止に対象エージェント(および対象モジュール)を追加します
書式:
- op=set
- op2=planned_downtimes_additem
- id=<計画停止ID>
- other=<連続パラメータ> (必須) 追加対象
- <エージェントID1;エージェントID2;エージェントID3;...エージェントIDn>
- <モジュール名1;モジュール名2;モジュール名3;...モジュール名n>
1.3.3.87.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_additem&apipass=1234&user=admin&pass=pandora&id=123&other=1;2;3;4%7CStatus;Unkown_modules%20&other_mode=url_encode_separator_|
1.3.3.88 set planned_downtimes_deleted
>=5.1
計画停止を削除します。
書式:
- op=set
- op2=planned_downtimes_deleted
- id=<計画停止ID>
1.3.3.88.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_deleted&apipass=1234&user=admin&pass=pandora&id=10
1.3.3.89 set create_synthetic_module
>=5.1SP4
新たな統合モジュールを作成します。
書式:
- op=set
- op2=create_synthetic_module
- id=モジュールを追加するエージェント名
- other= <モジュール名><統合タイプ><エージェント名;演算タイプ;モジュール名> または <エージェント名;モジュール名> または <演算タイプ;値>
- モジュールのデータ:
演算設定の場合で、エージェントとモジュール名を指定して演算タイプを指定しない場合: <エージェント名;モジュール名>、値を指定する場合: <演算タイプ;値>. それ以外: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値> 平均: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値>
- 演算タイプ:
演算: ADD, SUB, MUL, DIV 平均: AVG のみ
1.3.3.89.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_synthetic_module&apipass=1234&user=admin&pass=pandora&id=test&other=Test|arithmetic|Agent%20Name;Module%20Name|Agent%20Name2;ADD;Module%20Name2&other_mode=url_encode_separator_|
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_synthetic_module&apipass=1234&user=admin&pass=pandora&id=pepito&other=prueba|average|Agent%20Name;AVG;Name%20Module|Agent%20Name2;AVG;Name%20Module2&other_mode=url_encode_separator_|
1.3.3.90 set create_service
>= 7
新たなサービスを作成します。
書式:
- op=set
- op2=create_service
- id=サービスID
- other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;
<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;
1.3.3.90.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_service&return_type=json&other=test1%7CDescripcion%7C12%7C1%7C0.5%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.91 set update_service
>= 7
サービスを更新します。
書式:
- op=set
- op2=update_service
- id=サービスID
- other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;
<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;
1.3.3.91.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_service&return_type=json&id=1&other=test2%7CDescripcion2%7C%7C%7C0.6%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.92 set add_element_service
>= 7
サービスに要素を追加します。
書式:
- op=set
- op2=add_element_service
- id=サービスID
- other=base64エンコードした要素のJson
json の構造は次の通りです。
[{"type":"agent","id":2,"description":"Test1","weight_critical":0,"weight_warning":0,"weight_unknown":0,"weight_ok":0},{"type":"module","id":1,"description":"Test2","weight_critical":0,"weight_warning":0,"weight_unknown":0,"weight_ok":0},{"type":"service","id":3,"description":"Test3","weight_critical":0,"weight_warning":0,"weight_unknown":0,"weight_ok":0}]
それぞれのタイプで、ID フィールドは異なるものを参照します。
- タイプが agent の場合は、エージェント ID です。
- タイプが module の場合は、エージェントモジュール ID です。
- タイプが service の場合は、追加したいサービス ID です。
1.3.3.92.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_element_service&return_type=json&id=6&other=W3sidHlwZSI6ImFnZW50IiwiaWQiOjIsImRlc2NyaXB0aW9uIjoiamlqaWppIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH0seyJ0eXBlIjoibW9kdWxlIiwiaWQiOjEsImRlc2NyaXB0aW9uIjoiSG9sYSBxdWUgdGFsIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH0seyJ0eXBlIjoic2VydmljZSIsImlkIjozLCJkZXNjcmlwdGlvbiI6ImplamVqZWplIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH1d&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.93 set metaconsole_synch
>= 7
ライセンスキーをメタコンソールへ追加し、ノードへ同期します。
- op=set
- op2=metaconsole_synch
- id=License key
1.3.3.93.1 例
http://127.0.0.1/pandora_console/enterprise/meta/include/api.php?op=set&op2=metaconsole_synch&id=LICENSEKEY&apipass=1234&user=admin&pass=pandora
1.3.3.94 set migrate_agent
>= 7.21 メタコンソールのみ
選択したエージェントをエージェントマイグレーションキューへ追加します。
- op=set
- op2=migrate_agent
- id=id_agent to migrate
- other=origin node name| destination node name | (true|false) not to migrate historical database
- other_mode=url_encode_separator_|
- return_type = string, json, etc
1.3.3.94.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=migrate_agent&apipass=1234&user=admin&pass=pandora&id=2&other=nova|fringe|0&other_mode=url_encode_separator_|&return_type=string
1.3.3.95 set new_cluster
>= 7.0
エージェントのクラスタを作成します。
異なるノードを監視するためのエージェントとアイテムを持つ監視クラスタを作成します。
書式:
- op=set
- op2=new_cluster
- other=クラスタ名| クラスタタイプ| 説明| グループID
- other_mode=url_encode_separator_
1.3.3.95.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_cluster&other=nombre_cluster%7CAA%7Cdescripcion%7C12&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.96 set add_cluster_agent
>= 7.0
エージェントをクラスタに追加します。
書式:
- op=set
- op2=add_cluster_agent
- other=要素を含む json を base64 エンコードしたもの
- other_mode=url_encode_separator_
json の構造は次の通りです。
[{"id":5,"id_agent":2}, {"id":5,"id_agent":3}]
1.3.3.96.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_agent&other=W3siaWQiOjUsImlkX2FnZW50IjoyfSwKeyJpZCI6NSwiaWRfYWdlbnQiOjN9XQ==&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.97 set add_cluster_item (アクティブ/アクティブ)
>= 7.0
クラスタに、アクティブ/アクティブ アイテムを追加します。
書式:
- op=set
- op2=add_cluster_item
- other=要素を含む json を base64 エンコードしたもの
- other_mode=url_encode_separator_
json の構造は次の通りです。
[{"name":"Swap_Used","id_cluster":5,"type":"AA","critical_limit":80,"warning_limit":60}, {"name":"TCP_Connections","id_cluster":5,"type":"AA","critical_limit":80,"warning_limit":60}]
1.3.3.97.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=W3sibmFtZSI6IlN3YXBfVXNlZCIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBQSIsImNyaXRpY2FsX2xpbWl0Ijo4MCwid2FybmluZ19saW1pdCI6NjB9LAp7Im5hbWUiOiJUQ1BfQ29ubmVjdGlvbnMiLCJpZF9jbHVzdGVyIjo1LCJ0eXBlIjoiQUEiLCJjcml0aWNhbF9saW1pdCI6ODAsIndhcm5pbmdfbGltaXQiOjYwfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.98 set add_cluster_item (アクティブ/スタンバイ)
>= 7.0
クラスタに、アクティブ/スタンバイのアイテムを追加します。
書式:
- op=set
- op2=add_cluster_item
- other=要素を含む json を base64 エンコードしたもの
- other_mode=url_encode_separator_
json の構造は次の通りです。
[{"name":"DiskUsed_/proc/kcore","id_cluster":5,"type":"AP","is_critical":1}, {"name":"DiskUsed_/proc/sched_debug","id_cluster":5,"type":"AP","is_critical":1}]
1.3.3.98.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=W3sibmFtZSI6IkRpc2tVc2VkXy9wcm9jL2tjb3JlIiwiaWRfY2x1c3RlciI6NSwidHlwZSI6IkFQIiwiaXNfY3JpdGljYWwiOjF9LAp7Im5hbWUiOiJEaXNrVXNlZF8vcHJvYy9zY2hlZF9kZWJ1ZyIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBUCIsImlzX2NyaXRpY2FsIjoxfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.99 set delete_cluster
>= 7.0
クラスタを削除します。
書式:
- op=set
- op2=delete_cluster
- id=<削除するクラスタID>
1.3.3.99.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster&id=7&apipass=1234&user=admin&pass=pandora
1.3.3.100 set delete_cluster_agent
>= 7.0
クラスタからエージェントを削除します。
書式:
- op=set
- op2=delete_cluster_agent
- other=エージェントID| クラスタID|
- other_mode=url_encode_separator_
1.3.3.100.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_agent&other=2%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.101 set delete_cluster_item
>= 7.0
クラスタからアイテムを削除します。
書式:
- op=set
- op2=delete_cluster_item
- id=<削除するアイテムID>
1.3.3.101.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_item&id=9&apipass=1234&user=admin&pass=pandora
1.3.3.102 set create_policy
>= 7.0. 725
ポリシーを作成します。 ポリシー名を指定する必要があります。複数設定はできません。また、グループ ID がデータベースに存在する必要があります。
書式:
- op = set
- op2 = create_policy
- other = ポリシー名(必須) | グループID(必須) | 説明;
- other_mode = url_encode_separator_|
- return_type = (string, csv, json).
1.3.3.102.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_policy&apipass=1234&user=admin&pass=pandora&other=name%20Policy%7C11%7Cthis%20description&other_mode=url_encode_separator_%7C&return_type=json
1.3.3.103 set update_policy
>= 7.0. 725
ポリシーを更新します。 ポリシー名は複数指定できません。また、グループ ID がデータベースに存在する必要があります。0(失敗した場合)または、更新したポリシーID(成功した場合)を返します。
書式:
- op = set
- op2 = update_policy
- id = ポリシーID
- other = ポリシー名 | グループID | 説明;
- other_mode = url_encode_separator_|
- return_type = (string, csv, json).
1.3.3.103.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=update_policy&apipass=1234&user=admin&pass=pandora&id=17&other=policy2%7C11%7Cthis%20description&other_mode=url_encode_separator_%7C&return_type=json
1.3.3.104 set delete_policy
>= 7.0. 725
ポリシーを削除します。存在するポリシー ID を指定する必要があります。0(失敗した場合) または、1(成功した場合) を返します。
書式:
- op = set
- op2 = delete_policy
- id = ポリシーID
- return_type = (string, csv, json).
1.3.3.104.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_policy&apipass=1234&user=admin&pass=pandora&id=10&return_type=json
1.3.3.105 set add_collections_policy
>= 7.0. 725
ポリシーにコレクションを追加します。存在するポリシー ID と、コレクションの名前または短い名前を指定する必要があります。いずれも必須です。 0(失敗した場合) または、ポリシーへ追加したコレクション ID (成功した場合) を返します。
書式:
- op = set
- op2 = add_collections_policy
- id = ポリシー ID
- id2 = 名前または短い名前
- return_type = (string, csv, json).
1.3.3.105.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=add_collections_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=4&id2=apache_plugin
1.3.3.106 set remove_collections_policy
>= 7.0. 725
ポリシーのコレクションに削除予約を設定します。
- 存在するポリシー ID を指定する必要があります。
- 存在するコレクションの名前もしくは短い名前を指定する必要があります。
- other に 0 か 1 を指定します。1 を指定すると削除予約を設定します。0 を指定すると削除予約を解除します。このフィールドを指定しない場合、デフォルトでは削除予約を設定します。
0(失敗) または 1(成功) を返します。
書式:
- op = set
- op2 = remove_collections_policy
- id = ポリシーID
- id2 = 名前もしくは短い名前
- other = (bool) 0 または 1
- return_type = (string, csv, json).
1.3.3.106.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=remove_collections_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=4&id2=2&other=1.
1.3.3.107 set create_plugins_policy
>= 7.0. 725
ポリシーにプラグインを追加します。
- 存在するポリシーIDを指定する必要があります。
- 実行するプラグイン文字列を指定する必要があります。
0(失敗) または、ポリシーへ追加したプラグイン ID (成功)を返します。
書式:
- op = set
- op2 = create_plugins_policy
- id = ポリシーID
- id2 = テキスト文字列
- return_type = (string, csv, json).
1.3.3.107.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2&id2=echo%201
1.3.3.108 set delete_plugins_policy
>= 7.0. 725
ポリシーからプラグインを削除します。
- 存在するポリシー ID を指定する必要があります。
- 削除したいプラグイン ID を指定する必要があります。
- other に 0 か 1 を指定します。1を指定するとプラグインの削除予約を設定します。0を指定すると削除予約を解除します。このフィールドを指定しない場合、デフォルトでは予約が設定されます。
0(失敗) または 1(成功) を返します。
書式:
- op = set
- op2 = delete_plugins_policy
- id = ポリシーID
- id2 = プラグインID
- other = 0 または 1
- return_type = (string, csv, json).
1.3.3.108.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&id2=1&other=1
1.3.3.109 set linking_policy
>= 7.0. 725
ポリシーに未リンクのモジュールをリンクします。
- 未リンクのエージェントモジュール ID を指定する必要があります。
0(失敗) または 1(成功) を返します。
書式:
- op = set
- op2 = linking_policy
- id = エージェントモジュールID
- return_type = (string, csv, json).
1.3.3.109.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=linking_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=28
1.3.3.110 set create_alerts_policy
>= 7.0. 725
ポリシーアラートを作成します。
- 存在するポリシー ID を指定する必要があります。
- 通常のタイプの場合、ポリシーモジュールIDを指定する必要があります。
- 存在するテンプレートIDを指定する必要があります。
- 外部かどうかを 0(通常)、1(外部) で設定します。デフォルトは、通常の 0 です。
- 外部タイプ(1) の場合は、名前を指定する必要があります。
0(失敗) または、ポリシーに追加したアラートID(成功) を返します。
書式:
- op = set
- op2 = create_alerts_policy
- id = ポリシーID
- id2 = ポリシーモジュールID
- other = ポリシーモジュールID|テンプレートID|0 または 1|モジュール名
- other_mode = url_encode_separator_|
- return_type = (string, csv, json).
1.3.3.110.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&other=0%7C2%7C1%7Ccpu%20load&other_mode=url_encode_separator_%7C
1.3.3.111 set update_alerts_policy
>= 7.0. 725
ポリシーアラートを更新します。
- 存在するポリシーIDを指定する必要があります。
- アクティブ 0 または、待ち 1 を指定します。
- 有効化 0 または、無効化 1 を指定します。
0(失敗) もしくは、ポリシーで更新したアラートID(成功)を返します。
書式:
- op = set
- op2 = update_alerts_policy
- id = ポリシーID
- other = 0 または 1 (activate/deactivate ) | 0 または 1 (enable/disable).
- other_mode = url_encode_separator_|
- return_type = (string, csv, json).
1.3.3.111.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=update_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&other=1%7C1&other_mode=url_encode_separator_%7C
1.3.3.112 set delete_alerts_policy
>= 7.0. 725
ポリシーからアラートを削除します。
- 存在するポリシーアラートIDを指定する必要があります。
- 0 | 1 で削除予約の設定・解除設定をします。このフィールドを指定しない場合、デフォルトは 1 です。
- アクティブ 0 | スタンバイ 1 を設定します。
0(失敗) または 1(成功) を返します。
書式:
- op = set
- op2 = delete_alerts_policy
- id = ポリシーID
- id2 = 0 または 1
- return_type = (string, csv, json).
1.3.3.112.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=1
1.3.3.113 set create_alerts_actions_policy
>= 7.0. 725
ポリシーアラートにアクションを追加します。
- 存在するポリシーアラートIDを指定する必要があります。
- 存在するポリシーアクションIDを指定する必要があります。
- 最低および最大アラート数を設定することができます。デフォルトは 0 です。
0(失敗) または、ポリシーアラートに追加したアクションID(成功) を返します。
書式:
- op = set
- op2 = create_alerts_action_policy
- id = ポリシーID
- id2 = アクションID
- other = 最小アラート数 | 最大アラート数
- other_mode=url_encode_separator_|
- return_type = (string, csv, json).
1.3.3.113.1 例
http://172.16.0.2/pandora_console/include/api.php?op=set&op2=create_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4&other=5%7C2&other_mode=url_encode_separator_%7C
1.3.3.114 set delete_alerts_actions_policy
>= 7.0. 725
ポリシーアラートからアクションを削除します。
- 存在するポリシーアラートIDを指定する必要があります。
- 存在するポリシーアクションIDを指定する必要があります。
書式:
- op = set
- op2 = delete_alerts_action_policy
- id = ポリシーID
- id2 = アクションID
- return_type = (string, csv, json).
1.3.3.114.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4
1.3.3.115 set remove_agents_policy
>= 7.0. 725
ポリシーからエージェントを削除します。
- 存在するポリシーIDを指定する必要があります。
- 存在するエージェントIDを指定する必要があります。
書式:
- op = set
- op2 = remove_agents_policy
- id = ポリシーID
- id2 = エージェントID
- return_type = (string, csv, json).
1.3.3.115.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=remove_agents_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2
1.3.3.116 set add_groups_policy
>= 7.0. 725
ポリシーのグループを追加します。
- 存在するポリシーIDを指定する必要があります。
- 存在するグループIDを指定する必要があります。
書式:
- op = set
- op2 = add_groups_policy
- id = ポリシーID
- id2 = グループID
- return_type = (string, csv, json).
1.3.3.116.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=add_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=12
1.3.3.117 set remove_groups_policy
>= 7.0. 725
ポリシーからグループを削除します。
- 存在するポリシーIDを指定する必要があります。
- 存在するグループIDを指定する必要があります。
書式:
- op = set
- op2 = add_groups_policy
- id = ポリシーID
- id2 = グループID
- return_type = (string, csv, json).
1.3.3.117.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=remove_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2
1.3.3.118 set create_os
>= 7.0. 727
パラメータで渡したデータで OS を作成します。
書式:
- op=set (必須)
- op2=create_os (必須)
- other=<連続パラメータ> (必須) 次の順番で指定するデータです。
- <名前>
- <説明>
- <アイコン>
1.3.3.118.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_os&other=os_name%7Cos_description%7Cos_icon.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.119 set update_os
>= 7.0. 727
パラメータで渡したデータで OS を更新します。
書式:
- op=set (必須)
- op2=create_os (必須)
- other=<連続パラメータ> (必須) 次の順番で指定するデータです。
- <名前>
- <説明>
- <アイコン>
1.3.3.119.1 例
http://127.0.0.1/pandora_console/include/api.php?id=107&op=set&op2=update_os&other=os_name_to_update%7Cos_description_to_update%7Cos_icon_to_update.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.120 set disabled_and_standby
>= 7.0. 728
エージェントを無効化し、またリモート設定がある場合はスタンバイモードにします。
書式:
- op=set (必須)
- op2=disabled_and_standby (必須)
- id=<エージェント ID> (必須) メタコンソールでは tagente の ID で、つまりノード ID です。
- id2=<ノード ID> (メタコンソールでは必須、ノードでは不要)
- other=<値> (オプション) 新たな状態(0 で有効化、1 で無効化)です。値を指定しない場合は、エージェントは無効化されます。
1.3.3.120.1 例
http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
http://127.0.0.1/pandora_console/include/api.php?id=2&id2=1&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.121 set validate_traps
>= 7.0. 728
トラップの承諾をします。
- op = set
- op2 = validate_traps
- id = トラップID
1.3.3.121.1 例
https://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.122 set delete_traps
>= 7.0. 728
トラップを削除します。
- op = set
- op2 = delete_traps
- id = トラップID
1.3.3.122.1 例
http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=delete_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.123 set access_process
>= 7.0NG. 728
この機能により、Pandora FMS のシステム監査ログにおける、3つ目のレコードのアプリケーションへのアクセスを管理できます。 アプリケーションに登録されたアクションの一つの処理を実行するために異なるパラメータを用い、管理者ユーザによる同時アクセスを回避します。オプションで、管理者以外のユーザーへのアクセスを禁止することもできます。
書式:
- op = set
- op2 = access_process
- other=<必要なパラメータ>:
- <ユーザID>
アプリケーションにアクセスしようとしているユーザーの ID です。このデータは監査で記録およびチェックされ、アプリケーションを介したユーザのアクセス、終了、閲覧、またはナビゲーションをフィルタリングします。
- <アクション> - (login,logout,exclude,browse)
login: アプリケーションへのアクセスを要求するために使用されます。 テキスト文字列 "free" を削除して Pandora FMS 監査ログにアクセスを登録するか、または以前にシステムにアクセスしたがまだログアウトしていない別のユーザーが監査レコードに含まれている場合は、テキスト文字列 "denied" を返します。 管理者のみのアクセスパラメータが有効になっていて、ユーザが無効になっている場合も、denied を返します。
logout: 他のユーザが再びアクセスを許可されるように、アプリケーションからのユーザのログアウトしたことをログに記録します。
browse: このユーザがまだアクセスしているのか、アプリケーションからログアウトさせられたのかをチェックするため、外部アプリケーションのすべてのページで使用する必要があります。
exclude: 現在登録されているユーザをログアウトさせ、別のユーザーのアクセスを user_id パラメータに登録します。
- <アプリケーション IP アドレス>
アクセス元のアプリケーションの IP アドレス。 これは Pandora FMS 監査で登録およびチェックされ、アプリケーション内のユーザのアクセス状況をチェックします。
- <アプリケーション名>
アクセスするアプリケーションの名前。これは Pandora FMS 監査で登録およびチェックされ、アプリケーション内のユーザのアクセス状況をチェックします。
- <管理者アクセスのみ>
非管理者ユーザのアクセスを禁止します。
1.3.3.123.1 例 (適応環境が必要)
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=access_process&other=1%7Clogin%7C192.168.50.25%7Cexternal_app%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.124 set create_event_response
新たなイベント応答を作成します。
書式:
- op=set (必須)
- op2=create_event_response (必須)
- return_type=csv|json (必須)
- other=<連続パラメータ> (以下の順番ですべて必須)
- <名前>
- <説明>
- <対象> 4つ目のパラメータ (<タイプ>) が command の場合、ここでは、イベントへの応答を実行するために必要なコマンドを指定する必要があります。一方、url の場合は、イベントへの応答としてアクセスしたい URL を指定する必要があります。
- <タイプ> command または url.
- <グループID> 指定したグループに対してユーザがアクセス権を持っている必要があります。
- <モーダルウインドウの幅> ピクセル単位。
- <モーダルウインドウの高さ> ピクセル単位。
- <新規ウインドウ> 1 または 0。 URL を新規ウインドウで表示する(1)か、モーダルウインドウで表示する(0)かを指定します。
- <パラメータ> コマンドの実行を補完するパラメータ。
- <サーバ> コマンドを実行するサーバの ID。ローカルコンソールの場合、値は 0 です。
1.3.3.124.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_event_response&other=response%7Cdescription%20response%7Ctouch%7Ccommand%7C0%7C650%7C400%7C0%7Cresponse%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.125 set update_event_response
既存のイベント応答を編集します。イベント応答の編集にはそれが所属するグループにユーザがアクセスできる権限を持っている必要があります。
書式:
- op=set (必須)
- op2=update_event_response (必須)
- return_type=csv|json (必須)
- id=<id of event response> (必須)
- other=<serialized parameters> (以下の順番でオプション)
- <名前>
- <説明>
- <対象> 4つ目のパラメータ (<タイプ>) が command の場合、ここでは、イベントへの応答を実行するために必要なコマンドを指定する必要があります。一方、url の場合は、イベントへの応答としてアクセスしたい URL を指定する必要があります。
- <タイプ> command または url.
- <グループID> 指定したグループに対してユーザがアクセス権を持っている必要があります。
- <モーダルウインドウの幅> ピクセル単位。
- <モーダルウインドウの高さ> ピクセル単位。
- <新規ウインドウ> 1 または 0。 URL を新規ウインドウで表示する(1)か、モーダルウインドウで表示する(0)かを指定します。
- <パラメータ> コマンドの実行を補完するパラメータ。
- <サーバ> コマンドを実行するサーバの ID。ローカルコンソールの場合、値は 0 です。
1.3.3.125.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=update_event_response&id=7&other=response%7Cdescription%20response%7Ctouch%7Ccommand%7C0%7C650%7C400%7C0%7Cresponse%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.126 set delete_event_response
イベント応答を削除します。イベント応答の削除にはそれが所属するグループにユーザがアクセスできる権限を持っている必要があります。
書式:
- op=set (必須)
- op2=delete_event_reponse (必須)
- return_type=csv|json
- id=<イベント応答ID> (必須)
1.3.3.126.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_event_response&id=7&apipass=1234&user=admin&pass=pandora
1.3.3.127 set create_user_profile_info
新たなユーザプロファイルを作成します。
書式:
- op=set (必須)
- op2=create_user_profile_info (必須)
- return_type=csv|json (必須)
- other=<連続パラメータ> 以下の順番にて
- <名前> (必須)
- <アクセスピット>: 設定する場合は 1、しない場合は 0。必須ではありませんが設定しない場合は 0 と同じです。順番は次の通りです。
IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM.
どの権限を有効化すべきかは、 こちらを参照してください。 |
|
1.3.3.127.1 例
この例では、Pandora にリードオンリーのプロファイルを作成します。初期設定済の Operator (read) のプロファイルと同じです。
http://localhost/pandora_console/include/api.php?op=set&op2=create_user_profile_info&return_type=json&other=API_profile%7C1%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.128 set update_user_profile_info
既存のユーザプロファイルを更新します。
書式:
- op=set (必須)
- op2=update_user_profile_info (必須)
- other=<serialized parameters> (オプション) 以下の順番にて
- <名前>
- <アクセスビット>: 設定する場合は 1、しない場合は 0。値を指定しなかった場合は変更されません。順番は次の通りです。
IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM.
どの権限を有効化すべきかは、 こちらを参照してください。 |
|
1.3.3.128.1 例
以下の例では、API_profile_updated という名前の ID 6 のプロファイルに対して、エージェントに関してすべての権限(参照、書き込み、管理)を与えています。また、イベントの参照権限を削除しています。
http://localhost/pandora_console/include/api.php?op=set&op2=update_user_profile_info&return_type=json&id=6&other=API_profile_updated%7C%7C%7C%7C1%7C1%7C1%7C%7C%7C%7C%7C0%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.129 set delete_user_profile_info
ユーザプロファイルを削除します。また該当のプロファイルのユーザへの割り当ても削除します。
書式:
- op=set (必須)
- op2=delete_user_profile_info (必須)
- return_type=csv|json
- id=<削除するプロファイルID> (必須)
1.3.3.129.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_user_profile_info&return_type=json&id=8&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.130 set create_event_filter
イベントフィルタを作成します。
書式:
- op=set (必須)
- op2=create_event_filter (必須)
- other=<連続パラメータ> 以下の順番:
- <id_group_filter>
- <id_group>
- <event_type [new_agent|alert_recovered|alert_ceased|alert_fired|configuration_change|error|alert_manual_valdation|critical|normal|warning|not_normal|recon_host_detected|system|unknown|going_unknown]>
- <severity [0|1|2|3|4|5|6|20|21|34]> (0: Maintenance, 1: Informative, 2: Normal, 3: Warning, 4: Critical, 5: Minor, 6: Principal, 20: Not normal, 21: Critical/Normal, 34: Warning/Critical)
- <event_status [2|3|0|1]> (0: Only new, 1: only validated, 2: only in process, 3: only not validated)
- <free_search>
- <agent_id>
- <pagination_size [25|50|100|200|500]>
- <max_hours_old>
- <id_user_ack>
- <duplicate [0|1]> (0: All the events, 1: grouped events)
- <date_from> (format: AAAA/MM/DD)
- <date_to> (format: AAAA/MM/DD)
- <events_with_tags> (format: ["tag_id_1", "tag_id_2", "tag_id_3", "..."])
- <events_without_tags> (format: ["tag_id_1", "tag_id_2", "tag_id_3", "..."])
- <alert_events [0|1]> (0: filter by event aletrs, 1: Alert events only)
- <module_id>
- <source>
- <id_extra>
- <user_comment>
1.3.3.130.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event_filter&id=test&other=%7C%7Cerror%7C4%7C%7C%7C1%7C%7C12%7C%7C%7C2018-12-09%7C2018-12-13%7C[%226%22]%7C[%2210%22,%226%22,%223%22]%7C1%7C10%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.131 set update_event_filter
イベントフィルタを更新します。
書式:
- op=set (必須)
- op2=update_event_filter (必須)
- id=<event_filter_id> (必須) 存在するイベントフィルタ ID でなければいけません。
- other=<連続パラメータ> (オプション) 以下の順番:
- <id_group_filter>
- <id_group>
- <event_type [new_agent|alert_recovered|alert_ceased|alert_fired|configuration_change|error|alert_manual_valdation|critical|normal|warning|not_normal|recon_host_detected|system|unknown|going_unknown]>
- <severity [0|1|2|3|4|5|6|20|21|34]> (0: Maintenance, 1: Informative, 2: Normal, 3: Warning, 4: Critical, 5: Minor, 6: Principal, 20: Not normal, 21: Critical/Normal, 34: Warning/Critical)
- <event_status [2|3|0|1]> (0: new only, 1: validated only, 2: in process only, 3: not validated only)
- <free_search>
- <agent_id>
- <pagination_size [25|50|100|200|500]>
- <max_hours_old>
- <id_user_ack>
- <duplicate [0|1]> (0: all events, 1: grouped events)
- <date_from> (format: AAAA/MM/DD)
- <date_to> (format: AAAA/MM/DD)
- <events_with_tags> (format: ["tag_id_1", "tag_id_2", "tag_id_3", "..."])
- <events_without_tags> (format: ["tag_id_1", "tag_id_2", "tag_id_3", "..."])
- <alert_events [0|1]> (0: filter by alert events, 1: alert events only)
- <module_id>
- <source>
- <id_extra>
- <user_comment>
1.3.3.131.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_event_filter&id=195&other=new_name%7C%7C%7Calert_recovered%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.132 set delete_event_filter
イベントフィルタを削除します。
書式:
- op=set (必須)
- op2=delete_event_filter (必須)
- id=<event_filter_id> (必須) 存在するイベントフィルタ ID でなければいけません。
1.3.3.132.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_event_filter&id=38&apipass=1234&user=admin&pass=pandora
1.3.3.133 set create_inventory_module
新たなインベントリモジュールを作成します。
書式:
- op=set (必須)
- op2=create_inventory_module (必須)
- return_type=csv|json
- other=<連続パラメータ> 以下の順番
- <name> (必須)
- <description>: (必須ですが空でも可)
- <operation system id>: (必須) tconfig_os テーブルの数値 ID です。
- <interpreter>: (必須ですが空でも可) 空の場合、ローカルインベントリモジュールとして解釈されます。
- < code >: (必須ですが空でも可) インベントリデータを取得するために実行される スクリプトです。base64 エンコードされている必要があります。
- < data format >: (必須) 展開されるデータのヘッダーです。(; で区切られます)
- <block mode>: (必須) 1 または 0
1.3.3.133.1 例
この例では、Linux システムから kernel-name および nodename というデータを収集する OS というインベントリモジュールを作成します。
http://localhost/pandora_console/include/api.php?op=set&op2=create_inventory_module&return_type=json&other=OS%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.134 set update_inventory_module
インベントリモジュールを更新します。
書式:
- op=set (必須)
- op2=update_inventory_module (必須)
- id= inventory module ID (必須)
- return_type=csv|json
- other=<連続パラメータ> 以下の順番
- <name> (必須)
- <description>: (必須ですが空でも可)
- <operation system id>: (必須) tconfig_os テーブルの数値 ID です。
- <interpreter>: (必須ですが空でも可) 空の場合、ローカルインベントリモジュールとして解釈されます。
- < code >: (必須ですが空でも可) インベントリデータを取得するために実行される スクリプトです。base64 エンコードされている必要があります。
- < data format >: (必須) 展開されるデータのヘッダーです。(; で区切られます)
- <block mode>: (必須) 1 または 0
1.3.3.134.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=update_inventory_module&return_type=json&id=42&other=OS_easy%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.135 set delete_inventory_module
インベントリモジュールを削除します。
書式:
- op=set (必須)
- op2=delete_inventory_module (必須)
- return_type=csv|json
- id=<inventory module ID> (必須)
1.3.3.135.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_inventory_module&return_type=json&id=42&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.136 set create_collection
コレクションを作成します。
書式:
- op=set (必須)
- op2=create_collection (必須)
- other=<連続パラメータ> (必須) コレクションを作成するための連続パラメータ
- <name>
- <short_name>
- <id_group>
- <description>
連続パラメータのセパレータを渡すために、次のように 'other_mode' が必要です: other_mode=url_encode_separator_<separator>
1.3.3.136.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_collection&other=test_plugin%7Ctest_p%7C0%7Ctest&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.137 set delete_collection
コレクションを削除します。
書式:
- op=set (必須)
- op2=delete_collection (必須)
- id= id_collection (必須)
1.3.3.137.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=delete_collection&id=15&apipass=1234&user=admin&pass=pandora
1.4 例
Pandora API を呼び出すためのいくつかの言語での例です。
1.4.1 例
http://127.0.0.1/pandora5/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=gis_agent&id=582&other_mode=url_encode_separator_%7C&other=2%7C2%7C0%7C0%7C0%7C2000-01-01+01%3A01%3A01%7C0%7C666%7Caaa%7Cbbb%7Cccc
1.4.2 PHP
<?php $ip = '192.168.70.110'; $pandora_url = '/pandora5'; $apipass = '1234'; $user = 'admin'; $password = 'pandora'; $op = 'get'; $op2 = 'all_agents'; $return_type = 'csv'; $other = ''; $other_mode = ''; $url = "http://" . $ip . $pandora_url . "/include/api.php"; $url .= "?"; $url .= "apipass=" . $apipass; $url .= "&user=" . $user; $url .= "&pass=" . $password; $url .= "&op=" . $op; $url .= "&op2=" . $op2; if ($id !== '') { $url .= "&id=" . $id; } if ($id2 !== '') { $url .= "&id2=" . $id2; } if ($return_type !== '') { $url .= "&return_type=" . $return_type; } if ($other !== '') { $url .= "&other_mode=" . $other_mode; $url .= "&other=" . $other; } $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, $url); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($curlObj); curl_close($curlObj); $agents = array(); if (!empty($result)) { $lines = explode("\n", $result); foreach ($lines as $line) { $fields = explode(";", $line); $agent = array(); $agent['id_agent'] = $fields[0]; $agent['name'] = $fields[1]; $agent['ip'] = $fields[2]; $agent['description'] = $fields[3]; $agent['os_name'] = $fields[4]; $agent['url_address'] = $fields[5]; $agents[] = $agent; } } print_list_agents($agents); function print_list_agents($agents) { echo "<table border='1' style='empty-cells: show;'>"; echo "<thead>"; echo "<tr>"; echo "<th>" . "ID" . "</th>"; echo "<th>" . "Name" . "</th>"; echo "<th>" . "IP" . "</th>"; echo "<th>" . "Description" . "</th>"; echo "<th>" . "OS" . "</th>"; echo "<th>" . "URL" . "</th>"; echo "</tr>"; echo "</thead>"; foreach ($agents as $agent) { echo "<tr>"; echo "<td>" . $agent['id_agent'] . "</td>"; echo "<td>" . $agent['name'] . "</td>"; echo "<td>" . $agent['ip'] . "</td>"; echo "<td>" . $agent['description'] . "</td>"; echo "<td>" . $agent['os_name'] . "</td>"; echo "<td>" . $agent['url_address'] . "</td>"; echo "</tr>"; } echo "</table>"; } ?>
1.4.3 Python
import pycurl import cStringIO import pprint def main(): ip = '192.168.70.110' pandora_url = '/pandora5' apipass = '1234' user = 'admin' password = 'pandora' op = 'get' op2 = 'all_agents' return_type = 'csv' other = '' other_mode = '' url = "http://" + ip + pandora_url + "/include/api.php" url += "?" url += "apipass=" + apipass url += "&user=" + user url += "&pass=" + password url += "&op=" + op url += "&op2=" + op2 buf = cStringIO.StringIO() c = pycurl.Curl() c.setopt(c.URL, url) c.setopt(c.WRITEFUNCTION, buf.write) c.perform() output = buf.getvalue() buf.close() lines = output.split("\n") agents = [] for line in lines: if not line: continue fields = line.split(";") agent = {} agent['id_agent'] = fields[0] agent['name'] = fields[1] agent['ip'] = fields[2] agent['description'] = fields[3] agent['os_name'] = fields[4] agent['url_address'] = fields[5] agents.append(agent) for agent in agents: print("---- Agent #" + agent['id_agent'] + " ----") print("Name: " + agent['name']) print("IP: " + agent['ip']) print("Description: " + agent['description']) print("OS: " + agent['os_name']) print("URL: " + agent['url_address']) print("") if __name__ == "__main__": main()
1.4.4 Perl
use strict; use warnings; use WWW::Curl::Easy; sub write_callback { my ($chunk,$variable) = @_; push @{$variable}, $chunk; return length($chunk); } my $ip = '192.168.70.110'; my $pandora_url = '/pandora5'; my $apipass = '1234'; my $user = 'admin'; my $password = 'pandora'; my $op = 'get'; my $op2 = 'all_agents'; my $return_type = 'csv'; my $other = ''; my $other_mode = ''; my $url = "http://" . $ip . $pandora_url . "/include/api.php"; $url .= "?"; $url .= "apipass=" . $apipass; $url .= "&user=" . $user; $url .= "&pass=" . $password; $url .= "&op=" . $op; $url .= "&op2=" . $op2; my @body; my $curl = WWW::Curl::Easy->new; $curl->setopt(CURLOPT_URL, $url); $curl->setopt(CURLOPT_WRITEFUNCTION, \&write_callback); $curl->setopt(CURLOPT_FILE, \@body); $curl->perform(); my $body=join("",@body); my @lines = split("\n", $body); foreach my $line (@lines) { my @fields = split(';', $line); print("\n---- Agent #" . $fields[0] . " ----"); print("\nName: " . $fields[1]); print("\nIP: " . $fields[2]); print("\nDescription: " . $fields[3]); print("\nOS: " . $fields[4]); print("\n"); }
1.4.5 Ruby
require 'open-uri' ip = '192.168.70.110' pandora_url = '/pandora5' apipass = '1234' user = 'admin' password = 'pandora' op = 'get' op2 = 'all_agents' return_type = 'csv' other = '' other_mode = '' url = "http://" + ip + pandora_url + "/include/api.php" url += "?" url += "apipass=" + apipass url += "&user=" + user url += "&pass=" + password url += "&op=" + op url += "&op2=" + op2 agents = [] open(url) do |content| content.each do |line| agent = {} tokens = line.split(";") agent[:id_agent] = tokens[0] agent[:name] = tokens[1] agent[:ip] = tokens[2] agent[:description] = tokens[3] agent[:os_name] = tokens[4] agent[:url_address] = tokens[5] agents.push agent end end agents.each do |agent| print("---- Agent #" + (agent[:id_agent] || "") + " ----\n") print("Name: " + (agent[:name] || "") + "\n") print("IP: " + (agent[:ip] || "") + "\n") print("Description: " + (agent[:description] || "") + "\n") print("OS: " + (agent[:os_name] || "") + "\n") print("URL: " + (agent[:url_address] || "") + "\n") print("\n") end
1.4.6 Lua
require("curl") local content = "" function WriteMemoryCallback(s) content = content .. s return string.len(s) end ip = '192.168.70.110' pandora_url = '/pandora5' apipass = '1234' user = 'admin' password = 'pandora' op = 'get' op2 = 'all_agents' return_type = 'csv' other = '' other_mode = '' url = "http://" .. ip .. pandora_url .. "/include/api.php" url = url .. "?" url = url .. "apipass=" .. apipass url = url .. "&user=" .. user url = url .. "&pass=" .. password url = url .. "&op=" .. op url = url .. "&op2=" .. op2 if curl.new then c = curl.new() else c = curl.easy_init() end c:setopt(curl.OPT_URL, url) c:setopt(curl.OPT_WRITEFUNCTION, WriteMemoryCallback) c:perform() for line in string.gmatch(content, "[^\n]+") do line = string.gsub(line, "\n", "") count = 0 for field in string.gmatch(line, "[^\;]+") do if count == 0 then print("---- Agent #" .. field .. " ----") end if count == 1 then print("Name: " .. field) end if count == 2 then print("IP: " .. field) end if count == 3 then print("Description: " .. field) end if count == 4 then print("OS: " .. field) end if count == 5 then print("URL: " .. field) end count = count + 1 end print("") end
1.4.7 Brainfuck
[-]>[-]< >+++++++++[<+++++++++>-]<-. >+++++[<+++++>-]<----. >++++[<++++>-]<---. >++++[<---->-]<++. >+++[<+++>-]<++. -. >++++++++[<-------->-]<--. >+++[<--->-]<---. >++++++++[<++++++++>-]<++++. +. >++++++++[<-------->-]<-----. >+++++++++[<+++++++++>-]<----. ++. --. >+++[<--->-]<+. >+++[<+++>-]<. >++[<++>-]<++. >++[<-->-]<-. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<---. +. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<+++. >++++[<---->-]<+. >+++[<+++>-]<. >+++[<--->-]<++. >+++[<+++>-]<-. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<+++. >+++[<--->-]<--. ----. >+++[<+++>-]<-. +++. -. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<-. >++++[<---->-]<+. >++++[<++++>-]<+. >++++[<---->-]<-. >++++++++[<-------->-]<-. >++++++++[<++++++++>-]<++++++++. >+++[<--->-]<++. ++. ++. >++++[<++++>-]<---. >++[<-->-]<--. +++. >++++++++[<-------->-]<---. >+++[<--->-]<---. >+++++++++[<+++++++++>-]<-. >+++[<--->-]<--. >++++[<++++>-]<---. ---. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<+++++. >+++++[<----->-]<++++. >+++[<+++>-]<++. >+++[<--->-]<++. >++++++++[<-------->-]<-----. >+++++++++[<+++++++++>-]<----. >+++[<+++>-]<-. >++++[<---->-]<--. >++[<++>-]<+. >+++[<+++>-]<--. ++++. >+++++++++[<--------->-]<--. >++++++++[<++++++++>-]<++++++. >+++[<+++>-]<+++. >+++[<--->-]<. ++. --. >+++[<+++>-]<--. >++[<++>-]<+. >+++[<--->-]<++. >++[<++>-]<++. >++[<-->-]<-. ++++. >++++++++[<-------->-]<-----.
1.4.8 Java (Android)
SourceForge の SVN リポジトリ内の Pandroid イベントビューワーソースコード より、我々のプロジェクト(Pandora Event Viwer)を参照すると、API を通してイベントデータを取得する部分のコードがあります。
/** * Performs an http get petition. * * @param context * Application context. * @param additionalParameters * Petition additional parameters * @return Petition result. * @throws IOException * If there is any problem with the connection. */ public static String httpGet(Context context, List<NameValuePair> additionalParameters) throws IOException { SharedPreferences preferences = context.getSharedPreferences( context.getString(R.string.const_string_preferences), Activity.MODE_PRIVATE); String url = preferences.getString("url", "") + "/include/api.php"; String user = preferences.getString("user", ""); String password = preferences.getString("password", ""); String apiPassword = preferences.getString("api_password", ""); if (url.length() == 0 || user.length() == 0) { return ""; } ArrayList<NameValuePair> parameters = new ArrayList<NameValuePair>(); parameters.add(new BasicNameValuePair("user", user)); parameters.add(new BasicNameValuePair("pass", password)); if (apiPassword.length() > 0) { parameters.add(new BasicNameValuePair("apipass", apiPassword)); } parameters.addAll(additionalParameters); Log.i(TAG, "sent: " + url); if (url.toLowerCase().contains("https")) { // Secure connection return Core.httpsGet(url, parameters); } else { HttpParams params = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIMEOUT); HttpConnectionParams.setSoTimeout(params, CONNECTION_TIMEOUT); DefaultHttpClient httpClient = new DefaultHttpClient(params); UrlEncodedFormEntity entity; HttpPost httpPost; HttpResponse response; HttpEntity entityResponse; String return_api; httpPost = new HttpPost(url); entity = new UrlEncodedFormEntity(parameters); httpPost.setEntity(entity); response = httpClient.execute(httpPost); entityResponse = response.getEntity(); return_api = Core .convertStreamToString(entityResponse.getContent()); Log.i(TAG, "received: " + return_api); return return_api; } }
1.5 API.php の今後
今後の api.php では次のようなことを考えています。
- APIの追加
- xml や jason 等でのデータの取得
- セキュアではない環境向けのセキュリティ強化
- 拡張と同じようにカスタマイズできるようにする改善
- 他のツール標準との統合