Pandora: Documentation ja: Annex ExternalAPI
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 module_groups
- 1.3.2.17 get plugins
- 1.3.2.18 get tags
- 1.3.2.19 get module_from_conf
- 1.3.2.20 get total_modules
- 1.3.2.21 get total_agents
- 1.3.2.22 get agent_name
- 1.3.2.23 get agent_alias
- 1.3.2.24 get module_name
- 1.3.2.25 get alert_action_by_group
- 1.3.2.26 get event_info
- 1.3.2.27 get tactical_view
- 1.3.2.28 get pandora_servers
- 1.3.2.29 get custom_field_id
- 1.3.2.30 get gis_agent
- 1.3.2.31 get special_days
- 1.3.2.32 get module_properties
- 1.3.2.33 get module_properties_by_name
- 1.3.2.34 get module_properties_by_alias
- 1.3.2.35 get module_graph
- 1.3.2.36 get all_planned_downtimes
- 1.3.2.37 get planned_downtimes_items
- 1.3.2.38 get id_group_agent_by_name
- 1.3.2.39 get id_group_agent_by_alias
- 1.3.2.40 get group_agent_by_name
- 1.3.2.41 get group_agent_by_alias
- 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 new_network_component
- 1.3.3.23 set new_plugin_component
- 1.3.3.24 set new_snmp_component
- 1.3.3.25 set new_local_component
- 1.3.3.26 set create_alert_template
- 1.3.3.27 set update_alert_template
- 1.3.3.28 set delete_alert_template
- 1.3.3.29 set delete_module_template
- 1.3.3.30 set delete_module_template_by_names
- 1.3.3.31 set stop_dowtime
- 1.3.3.32 set new_user
- 1.3.3.33 Set update_user
- 1.3.3.34 set delete_user
- 1.3.3.35 set enable_disable_user
- 1.3.3.36 set create_group
- 1.3.3.37 set update_group
- 1.3.3.38 set delete_group
- 1.3.3.39 set add_user_profile
- 1.3.3.40 set delete_user_profile
- 1.3.3.41 set new_incident
- 1.3.3.42 set new_note_incident
- 1.3.3.43 set validate_all_alerts
- 1.3.3.44 set validate_all_policy_alerts
- 1.3.3.45 set event_validate_filter
- 1.3.3.46 set event_validate_filter_pro
- 1.3.3.47 set new_alert_template
- 1.3.3.48 set alert_actions
- 1.3.3.49 set new_module
- 1.3.3.50 set delete_module
- 1.3.3.51 set enable_alert
- 1.3.3.52 set enable_alert_alias
- 1.3.3.53 set disable_alert
- 1.3.3.54 set disable_alert_alias
- 1.3.3.55 set enable_module_alerts
- 1.3.3.56 set disable_module_alerts
- 1.3.3.57 set enable_module
- 1.3.3.58 set disable_module
- 1.3.3.59 set create_network_module_from_component
- 1.3.3.60 set module_data
- 1.3.3.61 set add_module_in_conf
- 1.3.3.62 set delete_module_in_conf
- 1.3.3.63 set update_module_in_conf
- 1.3.3.64 set create_event
- 1.3.3.65 set add_event_comment
- 1.3.3.66 set create_netflow_filter
- 1.3.3.67 set create_custom_field
- 1.3.3.68 set create_tag
- 1.3.3.69 set enable_disable_agent
- 1.3.3.70 set gis_agent_only_position
- 1.3.3.71 set gis_agent
- 1.3.3.72 set create_special_day
- 1.3.3.73 set update_special_day
- 1.3.3.74 set delete_special_day
- 1.3.3.75 set pagerduty_webhook
- 1.3.3.76 set tag_user_profile
- 1.3.3.77 set tag
- 1.3.3.78 set add_tag_module
- 1.3.3.79 set remove_tag_module
- 1.3.3.80 set planned_downtimes_created
- 1.3.3.81 set planned_downtimes_additem
- 1.3.3.82 set planned_downtimes_deleted
- 1.3.3.83 set create_synthetic_module
- 1.3.3.84 set create_service
- 1.3.3.85 set update_service
- 1.3.3.86 set add_element_service
- 1.3.3.87 set metaconsole_synch
- 1.3.3.88 set migrate_agent
- 1.3.3.89 get migrate_agent
- 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%7C0&other_mode=url_encode_separator_%7C 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_%7C
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?api.php?op=get&op2=locate_agent&return_type=csv&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_%7C
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=;%7C%20%7Ctype_row,group_id,agent_alias&other_mode=url_encode_separator_%7C
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=;%7C604800%7C20121201T13:40%7C20171215T13:40&other_mode=url_encode_separator_%7C&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%7C555%7C245%7Cpepito%7C2009-12-07&other_mode=url_encode_separator_%7C
1.3.2.14 get events
書式:
- 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_%7C&return_type=csv&other=;%7C2%7CSERVER%7CCPU%7Ctemplate_alert00%7C%7C1274715715%7C127471781&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 module_groups
書式:
- op=get (必須)
- op2=module_groups (必須)
- other=cvs_separator (オプション)
1.3.2.16.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;
1.3.2.17 get plugins
書式:
- op=get (必須)
- op2=plugins (必須)
- other=cvs_separator (オプション)
1.3.2.17.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;
1.3.2.18 get tags
書式:
- op=get (必須)
- op2=tags (必須)
- return_type=csv (必須)
1.3.2.18.1 例
この例では、システムの全てのタグを返します。
http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv
1.3.2.19 get module_from_conf
>= 5.0 (エンタープライズ版のみ)
書式:
- op=get (必須)
- op2=update_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
1.3.2.19.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.20 get total_modules
グループの全モジュール。
書式:
- op=get (必須)
- op2=total_modules (必須)
- id=<グループID> (必須)
1.3.2.20.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora
1.3.2.21 get total_agents
グループの全エージェント
書式:
- op=get (必須)
- op2=total_agents (必須)
- id=<グループID> (必須)
1.3.2.21.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora
1.3.2.22 get agent_name
指定した ID のエージェント名
書式:
- op=get (必須)
- op2=agent_name (必須)
- id=<エージェントID> (必須)
1.3.2.22.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.23 get agent_alias
>= 7.0NG
指定した ID のエージェントの別名を取得します。
書式:
- op=get (必須)
- op2=agent_alias (必須)
- id=<エージェントID> (必須)
1.3.2.23.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.24 get module_name
指定した ID のモジュール名
書式:
- op=get (必須)
- op2=module_name (必須)
- id=<モジュールID> (必須)
1.3.2.24.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.25 get alert_action_by_group
指定したグループにおよびアクションにおいて、実行された全アラート
書式:
- op=get (必須)
- op2=alert_action_by_group (必須)
- id=<グループID> (必須)
- id2=<アクションID> (必須)
1.3.2.25.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.26 get event_info
書式:
- op=get (必須)
- op2=event_info (必須)
- id=<イベントID> (必須)
1.3.2.26.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.27 get tactical_view
書式:
- op=get (必須)
- op2=tactical_view (必須)
1.3.2.27.1 例
http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora
1.3.2.28 get pandora_servers
バージョン 5.0 かそれ以降
書式:
- op=get (必須)
- op2=pandora_servers (必須)
- other=cvs_separator (オプション)
1.3.2.28.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.29 get custom_field_id
>= 5.0
書式:
- op=get (必須)
- op2=custom_field_id (必須)
- other=<連続パラメータ> (必須) カスタムフィールド名です
- <名前> (必須)
1.3.2.29.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=custom_field_id&other=mycustomfield&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.30 get gis_agent
>= 5.0
エージェントの最新の gis データを返します。
書式:
- op=set (必須)
- op2=gis_agent (必須)
- id=<id> (必衰) エージェントID
1.3.2.30.1 例
1.3.2.31 get special_days
>= 5.1
特別日一覧を返します。
書式:
- op=get (必須)
- op2=gis_agent (必須)
- other=<csvセパレータ> (オプション) CSVのセパレータ
1.3.2.31.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=get&op2=special_days
1.3.2.32 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.32.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=;%7C%20%7Cmodule_id_agent_module,module_id_module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.33 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.33.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=;%7C%20%7Cmodule_id_agent_module,module_id_module_type,module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.2.34 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.34.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.35 get module_graph
>= 6.0
base64 でエンコードされたモジュールグラフを返します。
書式:
- op=get (必須)
- op2=module_graph (必須)
- id=<モジュールID> (必須)
- other=<秒単位の間隔> (オプション) デフォルトは 3600 (1時間)です。 時間間隔はデータリカバリに使われます。
1.3.2.35.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.36 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.36.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test%7C0%7Cquiet%7Cperiodically%7Cweekly&other_mode=url_encode_separator_%7C&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%7C0%7Cquiet%7Cperiodically%7Cweekly&other_mode=url_encode_separator_%7C&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.37 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.37.1 例
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test%7C0%7Cquiet%7Cperiodically%7Cweekly
&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%7C0%7Cquiet%7Cperiodically%7Cweekly
&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.38 get id_group_agent_by_name
>= 5.1
エージェントのグループ ID を返します。
書式:
- op=get
- op2=id_group_agent_by_name
- other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
- <エージェント名>
1.3.2.38.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_%7C&other=192.168.50.40
1.3.2.39 get id_group_agent_by_alias
>= 7.0NG
エージェントのグループ ID を返します。
書式:
- op=get
- op2=id_group_agent_by_alias
- other=<文字列または連続パラメータ> エージェントの別名およびフィルタリングパラメータ (オプション)
- <エージェントの別名>
1.3.2.39.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.40 get group_agent_by_name
>= 5.1
エージェントのグループ名を返します。
書式:
- op=get
- op2=group_agent_by_name
- other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
- <エージェント名>
1.3.2.40.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_%7C&other=192.168.50.40
1.3.2.41 get group_agent_by_alias
>= 7.0NG
エージェントのグループ名を返します。
書式:
- op=get
- op2=group_agent_by_alias
- 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=group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms
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%7C1.1.1.1%7C0%7C4%7C0%7C30%7C8%7Cmiguel-portatil%7C%7C0%7C0%7Cla%20descripcion&other_mode=url_encode_separator_%7C
- 注意: 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?op=set&op2=update_agent&other=agente_nombre%7C1.1.1.1%7C0%7C4%7C0%7C30%7C8%7C10%7C%7C0%7C0%7Cla%20descripcion&other_mode=url_encode_separator_%7C&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%7C10&other_mode=url_encode_separator_%7C&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 以降のみ)
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%7C0%7C7%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C127.0.0.1%7C0%7C%7C0%7C180%7C0%7C0%7C0%7C%7Clatency%20ping&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7C1%7C2%7C0%7C0%7C%7C0%7C0%7C%7C0%7C0%7C127.0.0.1%7C0%7C%7C0%7C300%7C0%7C0%7C0%7C0%7Cplugin%20module%20from%20api%7C2%7Cadmin%7Cpass%7C-p%20max&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7C1%7Cdata%20module%20from%20api%7C1%7C10%7C20%7C10.50%7C180%7C10%7C15%7C%7C16%7C20%7C%7C0&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7C15%7C1%7C10%7C15%7C%7C16%7C18%7C%7C15%7C0%7C127.0.0.1%7C60%7C3%7Cpublic%7C.1.3.6.1.2.1.1.1.0%7C180%7C0%7C0%7C0%7C0%7CSNMP%20module%20from%20API%7CAES%7Cexample_priv_passw%7CauthNoPriv%7CMD5%7Cpepito_user%7Cexample_auth_passw&other_mode=url_encode_separator_%7C
例 2 (SNMP v1)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito1&other=prueba2%7C0%7C15%7C1%7C10%7C15%7C%7C16%7C18%7C%7C15%7C0%7C127.0.0.1%7C60%7C1%7Cpublic%7C.1.3.6.1.2.1.1.1.0%7C180%7C0%7C0%7C0%7C0%7CSNMP 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 以降のみ)
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%7C0%7C2%7C10%7C15%7C%7C16%7C18%7C%7C7%7C0%7C127.0.0.1%7C0%7C%7C0%7C300%7C30.00%7C0%7C0%7C0%7Clatency%20ping%20modified%20by%20the%20Api&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7C2%7C0%7C0%7C%7C0%7C0%7C%7C0%7C0%7C127.0.0.1%7C0%7C%7C0%7C300%7C0%7C0%7C0%7C0%7Cplugin%20module%20from%20api%7C2%7Cadmin%7Cpass%7C-p%20max&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7Cdata%20module%20modified%20from%20API%7C6%7C0%7C0%7C50.00%7C300%7C10%7C15%7C%7C16%7C18%7C%7C0&other_mode=url_encode_separator_%7C
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%7C%20grep%20pandora%20%7C%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 以降のみ)
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%7C0%7C6%7C20%7C25%7C%7C26%7C30%7C%7C15%7C1%7C127.0.0.1%7C60%7C3%7Cpublic%7C.1.3.6.1.2.1.1.1.0%7C180%7C50.00%7C10%7C60%7C0%7CSNMP%20module%20modified%20by%20API%7CAES%7Cexample_priv_passw%7CauthNoPriv%7CMD5%7Cpepito_user%7Cexample_auth_passw&other_mode=url_encode_separator_%7C
1.3.3.15 set apply_policy
id パラメータで指定したポリシーを適用します。
書式:
- op=set (必須)
- op2=apply_policy (必須)
- id=<ポリシーID> (必須) ポリシーIDでなければいけません。
1.3.3.15.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_policy&id=1
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 以降のみ)
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%7C6%7Cnetwork%20module%20created%20by%20Api%7C2%7C0%7C0%7C50.00%7C180%7C10%7C20%7C%7C21%7C35%7C%7C1%7C15%7C0%7C66%7C%7C%7C0&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C0%7C1%7C2%7C0%7C0%7C%7C0%7C0%7C%7C15%7C0%7C66%7C%7C%7C300%7C50.00%7C0%7C0%7C0%7Cplugin%20module%20from%20api%7C2%7Cadmin%7Cpass%7C-p%20max&other_mode=url_encode_separator_%7C
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 以降のみ)
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%7C%20grep%20pandora%20%7C%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 以降のみ)
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%7C0%7C15%7C2%7C0%7C0%7C%7C0%7C0%7C%7C15%7C1%7C66%7C3%7Cpublic%7C.1.3.6.1.2.1.1.1.0%7C180%7C50.00%7C10%7C60%7C0%7CSNMP%20module%20modified%20by%20API%7CAES%7Cexample_priv_passw%7CauthNoPriv%7CMD5%7Cpepito_user%7Cexample_auth_passw&other_mode=url_encode_separator_%7C
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_%7C
1.3.3.22 set new_network_component
新たなネットワークコンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_network_component (必須)
- id=<ネットワークコンポーネント名> (必須) ネットワークコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でエージェントの設定とネットワークコンポーネントのデータを指定します。
- <ネットワークコンポーネントタイプ>
- <説明>
- <モジュールの間隔>
- <最大値>
- <最小値>
- <SNMPコミュニティ>
- <モジュールグループID>
- <最大タイムアウト>
- <データの保存>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データ保存倍率>
- <ネットワークコンポーネントグループ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
1.3.3.22.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_network_component&id=example_network_component_name&other=7%7Cnetwork%20component%20created%20by%20Api%7C300%7C30%7C10%7Cpublic%7C3%7C%7C1%7C10%7C20%7Cstr%7C21%7C30%7Cstr1%7C10%7C50.00%7C12&other_mode=url_encode_separator_%7C
1.3.3.23 set new_plugin_component
新たなプラグインコンポーネントを作成します。
書式:
- op=set (必須)
- op2=new_plugin_component (必須)
- id=<プラグインコンポーネント名> (必須) プラグインコンポーネント名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でエージェントの設定とプラグインコンポーネントのデータを指定します。
- <プラグインコンポーネントタイプ>
- <説明>
- <モジュールの間隔>
- <最大値>
- <最小値>
- <モジュールのポート>
- <モジュールグループID>
- <プラグインID>
- <最大タイムアウト>
- <データの保存>
- <警告の最小値>
- <警告の最大値>
- <警告文字列>
- <障害の最小値>
- <障害の最大値>
- <障害文字列>
- <連続抑制回数>
- <データ保存倍率>
- <プラグインコンポーネントグループ>
- <不明イベントの有効化> (バージョン 5 以降のみ)
- <個別状態変化の利用> (バージョン 5.1 以降のみ)
- <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
- <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
1.3.3.23.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_plugin_component&id=example_plugin_component_name&other=2%7Cplugin%20component%20created%20by%20Api%7C300%7C30%7C10%7C66%7C3%7C2%7Cexample_user%7Cexample_pass%7C-p%20max%7C%7C1%7C10%7C20%7Cstr%7C21%7C30%7Cstr1%7C10%7C50.00%7C12&other_mode=url_encode_separator_%7C
1.3.3.24 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 以降のみ)
1.3.3.24.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_snmp_component&id=example_snmp_component_name&other=16%7CSNMP%20component%20created%20by%20Api%7C300%7C30%7C10%7C3%7C%7C1%7C10%7C20%7Cstr%7C21%7C30%7Cstr1%7C15%7C50.00%7C3%7C.1.3.6.1.2.1.2.2.1.8.2%7Cpublic%7Cexample_auth_user%7Cexample_auth_pass%7C66%7CAES%7Cexample_priv_pass%7CMD5%7CauthNoPriv%7C12&other_mode=url_encode_separator_%7C
1.3.3.25 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 以降のみ)
1.3.3.25.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%7C%20grep%20pid%20%7C%20wc%20-l%0dmodule_interval%202%0dmodule_end&other_mode=url_encode_separator_~
1.3.3.26 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.26.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%7Ctemplate%20based%20in%20regexp%7C1%7C%7C%7C%7Cpp%7C1%7C%7C%7C%7C10%7C0%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C3&other_mode=url_encode_separator_%7C
例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%7Ctemplate%20based%20in%20range%7CNULL%7C%7C%7C%7C%7C%7C10%7C5%7C%7C%7C%7C00:00:00%7C15:00:00%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C4%7C2&other_mode=url_encode_separator_%7C
1.3.3.27 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.27.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%7Conchange%7Cchanging%20from%20min_max%20to%20onchange%7C%7C%7C%7C%7C%7C1%7C%7C%7C%7C5%7C1%7C%7C%7C1%7C1%7C0%7C1%7C1%7C0%7C0%7C1%7Cfield%20recovery%20example%201%7Cfield%20recovery%20example%202%7C1%7C8&other_mode=url_encode_separator_%7C
1.3.3.28 set delete_alert_template
アラートテンプレートと、テンプレートで使われているアラートを削除します。
書式:
- op=set (必須)
- op2=delete_alert_template (必須)
- id=<テンプレートID> (必須) テンプレートIDでなければいけません。
1.3.3.28.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38
1.3.3.29 set delete_module_template
モジュールテンプレートを削除します。
書式:
- op=set (必須)
- op2=delete_module_template (必須)
- id=<alert_template_module ID> (必須) alert_template_module のIDでなければいけません。
1.3.3.29.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38
1.3.3.30 set delete_module_template_by_names
モジュールテンプレートを削除します。
書式:
- op=set (必須)
- op2=delete_module_template_by_names (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other=<連続パラメータ> (必須) 次の順番でデータを指定します。
- <モジュール名> (必須)
1.3.3.30.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.31 set stop_dowtime
計画停止を停止します。
書式:
- op=set (必須)
- op2=stop_downtime (必須)
- id=<計画停止ID> (必須) 計画停止IDでなければいけません。
1.3.3.31.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1
1.3.3.32 set new_user
Pandora に新たなユーザを作成します。
書式:
- op=set (必須)
- op2=new_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で設定とデータを指定します。
- <ユーザ名>
- <フルネーム>
- <名前>
- <名字>
- <ミドルネーム>
- <電子メールアドレス>
- <電話番号>
- <言語>
- <コメント>
1.3.3.32.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel%7Cde%20dios%7Cmatias%7Ckkk%7Cpandora%[email protected]%7C666%7Ces%7Cdescripcion%20y%20esas%20cosas&other_mode=url_encode_separator_%7C
1.3.3.33 Set update_user
指定した ID のユーザを指定したパラメータで更新します。
書式:
- op=set (必須)
- op2=update_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番で設定とデータを指定します。
- <フルネーム>
- <名前>
- <名字>
- <ミドルネーム>
- <パスワード>
- <電子メールアドレス>
- <電話番号>
- <言語>
- <コメント>
- <管理者>
- <一画面の表示数>
- <フラッシュグラフ>
1.3.3.33.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_user&id=example_user_name&other=example_fullname%7C%7Cexample_lastname%7C%7Cexample_new_passwd%7Cexample_email%7C%7Cexample_language%7Cexample%20comment%7C1%7C30%7C&other_mode=url_encode_separator_%7C
1.3.3.34 set delete_user
選択したユーザを削除します。
書式:
- op=set (必須)
- op2=delete_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
1.3.3.34.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md
1.3.3.35 set enable_disable_user
ユーザを無効化・有効化します。
書式:
- op=set (必須)
- op2=enable_disable_user (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。
1.3.3.35.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_%7C
例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_%7C
1.3.3.36 set create_group
グループを作成します。
書式:
- op=set (必須)
- op2=create_group (必須)
- id=<グループ名> (必須) グループ名を指定します。
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <アイコン名>
- <親グループID> (オプション)
- <説明> (オプション)
- <ACLの伝播> (オプション)
- <アラートの無効化> (オプション)
- <カスタムID> (オプション)
- <連絡先> (オプション)
- <その他> (オプション)
1.3.3.36.1 例
例1 (親グループ: Servers)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name&other=applications%7C2&other_mode=url_encode_separator_%7C
例2 (親グループなし)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name2&other=computer%7C&other_mode=url_encode_separator_%7C
1.3.3.37 set update_group
グループの設定を更新します。
書式:
- op=set (必須)
- op2=update_group (必須)
- id=<グループID> (必須) グループIDを指定します。
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <グループ名>
- <アイコン名>
- <親グループID>
- <説明>
- <ACLの伝播>
- <アラートの無効化>
- <カスタムID>
- <連絡先>
- <その他>
1.3.3.37.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_group&id=example_group_id&other=New%20Name%7Capplication%7C2%7Cnew%20description%7C1%7C0%7Ccustom%20id%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.38 set delete_group
>= 6
グループを削除します。
書式:
- op=set (必須)
- op2=update_group (必須)
- id=<グループID> (必須) グループIDを指定します。
1.3.3.38.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.39 set add_user_profile
ユーザにプロファイルを追加します。
書式:
- op=set (必須)
- op2=add_user_profile (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でグループの設定、プロファイルを指定します。
- <グループ>
- <プロファイル>
1.3.3.39.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_user_profile&id=md&other=12%7C4&other_mode=url_encode_separator_%7C
1.3.3.40 set delete_user_profile
ユーザのプロファイルを削します。
書式:
- op=set (必須)
- op2=delete_user_profile (必須)
- id=<ユーザ名> (必須) ユーザ名でなければいけません。
- other=<連続パラメータ> (必須) 次の順番でグループおよびプロファイルを指定します。
- <グループ>
- <プロファイル>
1.3.3.40.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user_profile&id=md&other=12%7C4&other_mode=url_encode_separator_%7C
1.3.3.41 set new_incident
新たなインシデントを作成します。
書式:
- op=set (必須)
- op2=new_incident (必須)
- other=<連続パラメータ> (必須) 次の順番でインシデントの設定とデータを指定します。
- <タイトル>
- <説明>
- <作成者>
- <優先度>
- <状態>
- <グループ>
1.3.3.41.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_incident&other=titulo%7Cdescripcion%20texto%7CLogfiles%7C2%7C10%7C12&other_mode=url_encode_separator_%7C
1.3.3.42 set new_note_incident
インシデントにコメントを追加します。
書式:
- op=set (必須)
- op2=new_note_incident (必須)
- id=<インシデントID> (必須) インシデントのIDです。
- id2=<ユーザ名> (必須) ユーザ名です。
- other=<コメント> (必須) URLエンコードされたコメントです。
1.3.3.42.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.43 set validate_all_alerts
全アラートを承諾します。
書式:
- op=set (必須)
- op2=validate_all_alerts (必須)
1.3.3.43.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts
1.3.3.44 set validate_all_policy_alerts
ポリシーから作成されたアラートを承諾します。
書式:
- op=set (必須)
- op2=validate_all_policy_alerts (必須)
1.3.3.44.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts
1.3.3.45 set event_validate_filter
指定したフィルタにマッチするすべてのイベントを承諾します。
書式:
- op=set (必須)
- op2=event_validate_filter (必須)
- other_mode=url_encode_separator_|(オプション)
- other=<連続パラメータ> (オプション) 次の順番で指定します。
- <セパレータ>
- <重要度> 0 から 4
- <エージェント名>
- <モジュール名>
- <アラートテンプレート名>
- <ユーザ>
- < 最小レベルの数値間隔> UNIXタイムスタンプ
- < 最大レベルの数値間隔> UNIXタイムスタンプ
1.3.3.45.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_%7C&other=;%7C2
1.3.3.46 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.46.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_%7C&other=;%7C2
1.3.3.47 set new_alert_template
テンプレートおよび、エージェントIDおよびモジュール名からモジュールを指定して、新たなアラートを適用します。
書式:
- op=set (必須)
- op2=new_alert_template (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <モジュール名> (必須)
1.3.3.47.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_%7C&other=memfree
1.3.3.48 set alert_actions
アラートにアクションを追加します。
書式:
- op=set (必須)
- op2=alert_actions (必須)
- id=<エージェント名> (必須)
- id2=<アラートテンプレート名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <モジュール名> (必須)
- <アクション名> (必須)
- <開始アラート数> (オプション)
- <終了アラート数> (オプション)
1.3.3.48.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_%7C&other=memfree%7Ctest
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_%7C&other=memfree%7Ctest%7C1%7C3
1.3.3.49 set new_module
新たなモジュールを作成します。
書式:
- op=set (必須)
- op2=new_module (必須)
- id=<エージェント名> (必須)
- id2=<新たなモジュール名> (必須)
- other_mode=url_encode_separator_| (オプション)
- other=<連続パラメータ> (必須) 次の順番で指定します。
- <ネットワークモジュールの種類> (必須)
- <アクション名> (必須)
- <IP または URL> (必須)
- <ポート> (オプション)
- <説明> (オプション)
- <最小値> (オプション)
- <最大値> (オプション)
- <データ保存倍率> (オプション)
- <モジュールの間隔> (オプション)
- <警告の最小値> (オプション)
- <警告の最大値> (オプション)
- <障害の最小値> (オプション)
- <障害の最大値> (オプション)
- <データの保存> (オプション)
- <不明イベントの有効化> (バージョン 5 のみ)
1.3.3.49.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_%7C&other=remote_tcp_string%7Clocalhost%7C33%7Cdescripcion%20larga
1.3.3.50 set delete_module
モジュールを削除します。
書式:
- op=set (必須)
- op2=delete_module (必須)
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other=simulate (オプション)
1.3.3.50.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.51 set enable_alert
エージェントのアラートを有効化します。
書式:
- op=set (必須)
- op2=enable_alert
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: Warning イベント) (必須)
1.3.3.51.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition
1.3.3.52 set enable_alert_alias
エイリアスでエージェントのアラートを有効化します。
書式:
- op=set (必須)
- op2=enable_alert_alias
- id=<エージェントの別名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (p.e: 警告イベント) (必須)
1.3.3.52.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.53 set disable_alert
エージェントのアラートを無効化します。
書式:
- op=set (必須)
- op2=disable_alert
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: Warning イベント) (必須)
1.3.3.53.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition
1.3.3.54 set disable_alert_alias
エージェントのアラートを無効化します。
書式:
- op=set (必須)
- op2=disable_alert_alias
- id=<エージェントエイリアス> (必須)
- id2=<モジュール名> (必須)
- other: アラートテンプレート名 (例: 警告イベント) (必須)
1.3.3.54.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.55 set enable_module_alerts
enable_alert と同じです。
書式:
- op=set (必須)
- op2=enable_module_alerts
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.55.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status
1.3.3.56 set disable_module_alerts
disable_alert と同じです。
書式:
- op=set (必須)
- op2=disable_module_alerts
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.56.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status
1.3.3.57 set enable_module
モジュールを有効化します。
書式:
- op=set (必須)
- op2=enable_module
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.57.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status
1.3.3.58 set disable_module
モジュールを無効化します。
書式:
- op=set (必須)
- op2=disable_module
- id=<エージェント名> (必須)
- id2=<モジュール名> (必須)
1.3.3.58.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status
1.3.3.59 set create_network_module_from_component
コンポーネントから新たなネットワークモジュールを作成します。
書式:
- op=set (必須)
- op2=create_network_module_from_component (必須)
- id=<エージェント名> (必須)
- id2=<コンポーネント名> (必須)
1.3.3.59.1 例
http://localhost/pandora_console/include/api.php?op=set&op2=create_network_module_from_component&id=garfio&id2=OS Total process
1.3.3.60 set module_data
モジュールに値を追加します。
書式:
- op=set (必須)
- op2=module_data (必須)
- id=<エージェントモジュールID> (必須)
- other: モジュールのデータとタイムスタンプ
- dato: Pandora のデータタイプ
- tiempo: タイムスタンプ、"now" を指定できます。
1.3.3.60.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=module_data&id=14&other_mode=url_encode_separator_%7C&other=123%7Cnow&apipass=1234&user=admin&pass=pandora
1.3.3.61 set add_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールに設定を追加します。
書式:
- op=set (必須)
- op2=add_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
- other: conf ファイルに書くモジュール設定を base64 でエンコードしたもの (必須)
1.3.3.61.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&other=bW9kdWxlX2JlZ2luCm1vZHVsZV9uYW1lIGV4YW1wbGVfbmFtZQptb2R1bGVfdHlwZSBnZW5lcmljX2RhdGEKbW9kdWxlX2V4ZWMgZWNobyAxOwptb2R1bGVfZW5k
成功すると '0'、エラー時は '-1'、すでに存在する場合は '-2' を返します。
1.3.3.62 set delete_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールの設定を削除します。
書式:
- op=set (必須)
- op2=add_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
1.3.3.62.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.63 set update_module_in_conf
>= 5.0 (エンタープライズ版のみ)
ローカルモジュールの設定を更新します。
書式:
- op=set (必須)
- op2=update_module_in_conf (必須)
- id=<エージェントID> (必須)
- id2=<モジュール名> (必須)
- other: conf ファイル内のモジュール設定を置き換える内容を、base64 でエンコードしたもの。(必須)
1.3.3.63.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_module_in_conf&user=admin&pass=pandora&id=9043&id2=example_name&other=bW9kdWxlX2JlZ2luCm1vZHVsZV9uYW1lIGV4YW1wbGVfbmFtZQptb2R1bGVfdHlwZSBnZW5lcmljX2RhdGEKbW9kdWxlX2V4ZWMgZWNobyAxOwptb2R1bGVfZW5k
変更が無い場合は '1'、成功すると '0'、エラー時は '-1'、存在しない場合は '-2' を返します。
1.3.3.64 set create_event
Pandora 内に新たなイベントを作成します。
書式:
- op=set (必須)
- op2=create_event (必須)
- other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
- <イベントテキスト> (必須)
- <グループID> (必須)
- <エージェントID> (必須)
- <状態>
- <ユーザID>
- <イベントタイプ>
- <重要度>
- <エージェントモジュールID>
- <アラートID>
- <障害の説明>
- <警告の説明>
- <不明の説明>
- <コメント>
- <ユーザコマンド>
- <発生元>
- <タグ>
- <カスタムデータ> カスタムデータは、base64 でエンコードされた JSON データである必要があります。
1.3.3.64.1 例
http://127.0.0.1/pandora_trunk/include/api.php?op=set&op2=create_event&other=NewEvent%7C0%7C189%7C%7Capiuser%7Csystem%7C1%7C%7C%7C%7C%7C%7C%7C%7CVMware%7C%7CeyJBbnN3ZXIgdG8gdGhlIFVsdGltYXRlIFF1ZXN0aW9uIG9mIExpZmUsIHRoZSBVbml2ZXJzZSwgYW5kIEV2ZXJ5dGhpbmciOiA0Mn0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.65 set add_event_comment
>= 5.1
イベントにコメントを追加します。
書式:
- op=set (必須)
- op2=create_event (必須)
- other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
- <コメント> (必須)
1.3.3.65.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_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.66 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.66.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%7C9%7Chost%20192.168.50.3%20OR%20host%20192.168.50.4%20or%20HOST%20192.168.50.6%7Cdstport%7Ckilobytes&other_mode=url_encode_separator_%7C
1.3.3.67 set create_custom_field
>= 5.0
新たなカスタムフィールドを作成します。
書式:
- op=set (必須)
- op2=create_custom_field (必須)
- other=<連続パラメータ> (必須) カスタムフィールドを設定するパラメータ
- <名前> (必須)
- <フロント表示フラグ> (必須; 0:操作画面でフィールドを表示しない。1:フィールドを表示する。)
1.3.3.67.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_custom_field&other=mycustomfield%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.68 set create_tag
>= 5.0
新たなタグを作成します。
書式:
- op=set (必須)
- op2=create_tag (必須)
- other=<連続パラメータ> (必須) タグの設定パラメータ
- <名前> タグ名 (必須)
- <説明> タグの説明
- <url> タグの URL
- <email> タグのメールアドレス
1.3.3.68.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_tag&other=tag_name%7Ctag_description%7Ctag_url%7Ctag_email&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.69 set enable_disable_agent
エージェントを有効化/無効化します。
書式:
- op=set (必須)
- op2=enable_disable_agent (必須)
- id=<エージェントID> (必須) エージェントIDでなければいけません。
- other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。
1.3.3.69.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_%7C&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_%7C&apipass=1234&user=admin&pass=pandora
1.3.3.70 set gis_agent_only_position
>= 5.0
エージェントに、新たな GIS 位置情報を追加します。
書式:
- op=set (必須)
- op2=gis_agent_only_position (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須) 位置情報パラメータ
- <緯度>
- <経度>
- <高度>
1.3.3.70.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_%7C&other=2%7C1%7C0
1.3.3.71 set gis_agent
>= 5.0
エージェントに gis データを追加します。
書式:
- op=set (必須)
- op2=gis_agent_only_position (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須) gisデータ
- <緯度>
- <経度>
- <高度>
- <新たなgisデータの無視>
- <手動位置決め>
- <開始タイムスタンプ>
- <終了タイムスタンプ>
- <データ数>
- <履歴保存の説明>
- <gis更新の説明>
- <初回挿入の説明>
1.3.3.72 set create_special_day
>= 5.1
新たな特別日を追加します。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<id> (必須) エージェントID
- other=<連続パラメータ> (必須)
- <特別日>
- <同一の日>
- <説明>
- <グループID>
1.3.3.72.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=create_special_day&other_mode=url_encode_separator_%7C&other=2014-05-03%7CSunday%7Cdesc%7C0
1.3.3.73 set update_special_day
>= 5.1
定義済の特別日の設定を更新します。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<特別日ID> (compulsory)
- other=<連続パラメータ> (必須)
- <特別日>
- <同一の日>
- <説明>
- <グループID>
1.3.3.73.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=update_special_day&id=1&other_mode=url_encode_separator_%7C&other=2014-05-03%7CSunday%7Cdesc%7C0
1.3.3.74 set delete_special_day
>= 5.1
特別日を削除。
書式:
- op=set (必須)
- op2=update_special_day (必須)
- id=<特別日ID> (必須)
1.3.3.74.1 例
http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1
1.3.3.75 set pagerduty_webhook
>= 5.1
Pandora FMS アラートと PagerDuty 通知を接続します。PagerDuty サービスの webhooks オプションを、PagerDuty からアラートを承諾した場合の動作に対して、あらかじめ PagerDuty にリンクさせた Pandora FMS のアラートの承諾に設定します。
書式:
- op=set (必須)
- op2=pagerduty_webhook (必須)
- id=alert (必須)
1.3.3.75.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.76 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.76.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_%7C&other=122%7C3
1.3.3.77 set tag
>= 6
pandora にタグを追加します。
書式:
- op = set (必須)
- op2 = tag (必須)
- id = name (必須)
- other_mode = url_encode_separator_| (必須)
- other = <description>|<url>|<email>|<phone>
1.3.3.77.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_%7C&other="a test"|http://www.artica.es%[email protected]%7C01189998819991197253
1.3.3.78 set add_tag_module
>= 6
モジュールにタグを追加します。
書式:
- op = set (必須)
- op2 = add_tag_module (必須)
- id = id_module (必須)
- id2 = id_tag (必須)
1.3.3.78.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.79 set remove_tag_module
>= 6
モジュールのタグを削除します。
書式:
- op = set (必須)
- op2 = add_tag_module (必須)
- id = id_module (必須)
- id2 = id_tag (必須)
1.3.3.79.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.80 set planned_downtimes_created
>= 5.1
計画停止を作成します
書式:
- op=set (必須)
- op2=planned_downtimes_created (必須)
- other=<連続パラメータ> (必須) 計画停止を作成するパラメータ列:
- <説明>
- <開始日時> 一回のみの場合の開始日時
- <終了日時> 一回のみの場合の終了日時
- <グループID>
- <月>
- <火>
- <水>
- <木>
- <金>
- <土>
- <日>
- <定期実行開始時間>
- <定期実行終了時間>
- <定期実行開始日>
- <定期実行終了日>
- <タイプ> quit, disabled_agents, disabled_agents_alerts のいずれか
- <実行> once または periodically
- <定期実行タイプ> weekly または monthly
1.3.3.80.1 例
1.3.3.81 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.81.1 例
1.3.3.82 set planned_downtimes_deleted
>=5.1
計画停止を削除します。
書式:
- op=set
- op2=planned_downtimes_deleted
- id=<計画停止ID>
1.3.3.82.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_deleted &id=10
1.3.3.83 set create_synthetic_module
>=5.1SP4
新たな統合モジュールを作成します。
書式:
- op=set
- op2=create_synthetic_module
- id=モジュールを追加するエージェント名
- other= <モジュール名><統合タイプ><エージェント名;演算タイプ;モジュール名> または <エージェント名;モジュール名> または <演算タイプ;値>
- モジュールのデータ:
演算設定の場合で、エージェントとモジュール名を指定して演算タイプを指定しない場合: <エージェント名;モジュール名>、値を指定する場合: <演算タイプ;値>. それ以外: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値> 平均: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値>
- 演算タイプ:
演算: ADD, SUB, MUL, DIV 平均: AVG のみ
1.3.3.83.1 例
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_synthetic_module&id=test&other=Test%7Carithmetic%7CAgent%20Name;Module%20Name%7CAgent%20Name2;ADD;Module%20Name2&other_mode=url_encode_separator_%7C OR http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_synthetic_module&id=pepito&other=prueba%7Caverage%7CAgent%20Name;AVG;Name%20Module%7CAgent%20Name2;AVG;Name%20Module2&other_mode=url_encode_separator_%7C
1.3.3.84 set create_service
>= 7
新たなサービスを作成します。
書式:
- op=set
- op2=create_service
- id=サービスID
- other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;
<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;
1.3.3.84.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.85 set update_service
>= 7
サービスを更新します。
書式:
- op=set
- op2=update_service
- id=サービスID
- other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;
<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;
1.3.3.85.1 例
http://172.17.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.86 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.86.1 例
http://172.17.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.87 set metaconsole_synch
>= 7
ライセンスキーをメタコンソールへ追加し、ノードへ同期します。
- op=set
- op2=metaconsole_synch
- id=License key
1.3.3.87.1 例
1.3.3.88 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.88.1 例
1.3.3.89 get migrate_agent
>= 7.21 メタコンソールのみ
エージェントマイグレーションキューに、指定のエージェントが存在するかを確認します。
- op=get
- op2=migrate_agent
- id=id_agente a migrar
- return_type = string, json, etc
1.3.3.89.1 例
1.4 例
Pandora API を呼び出すためのいくつかの言語での例です。
1.4.1 例
http://127.0.0.1/pandora5/include/api.php?apipass=caca&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 等でのデータの取得
- セキュアではない環境向けのセキュリティ強化
- 拡張と同じようにカスタマイズできるようにする改善
- 他のツール標準との統合