ja:documentation:pandorafms:technical_reference:02_annex_externalapi

外部 API

Pandora FMS 外部 API は、(/include/api.php に対して HTTP アクセスすることにより) リモート操作に利用します。 これは、Pandora FMS 外から操作するアプリケーションを作成できるように、Pandora FMS に用意されている手法です。基本的に、アプリケーションからの操作で、指定したフォーマットのパラメータで値を受け渡します。

API.php の呼び出しは、次のように単純です。

http://<Pandora FMS Console install >/include/api.php<parameters >
http://<Pandora FMS コンソールのインストールパス>/include/api.php<パラメータ>

API は次のパラメータのみ受け取ることができます。

  • op (required): It is the first parameter that specifies the nature of the operation, which could be get or set or help:
    • get: It returns a value or values.
    • set: It sends a value or values.
    • help: It returns a little help from the calls
  • op2 (required): The call with an explanatory name of the one that it works on.
  • id (depends on the command): The first call parameter.
  • id2 (depends on the command): The second call parameter.
  • other (depends on the command): The third call parameter, sometimes it could be a list of serial values.
  • other_mode (depends on the command): Serial format, list of posible values:
    • url_encode: the othervalue is an alphanumeric formatted as UrlEncode.
    • url_encode_separator_<separator>:The value will be a serial value list with the divider character, for example:
  • op (必須): 最初のパラメータで、操作の種類を指定します。“get”、“set”、“help” のいずれかを指定できます。
    • get: 値を取得します。
    • set: 値を設定します。
    • help: 小さなヘルプを返します。
  • op2 (必須): 処理の名前を指定します。
  • id (コマンドによる): 1番目のパラメータです。
  • id2 (コマンドによる): 2番目のパラメータです。
  • other (コマンドによる): 3番目のパラメータです。連続したデータリストの場合もあります。
  • other_mode (オプション): 連続データのフォーマットです。指定可能な値は次の通りです。
    • url_encode: 文字列フォーマットです。UrlEncode
    • url_encode_separator_<セパレータ»複数の値を分割する文字を指定します。例えば、次の通りです。
...other=pears|melons|watermelon&other_mode=url_encode_separator_|

You can use any separator, in this documentation the | character (%7C percent-encoded) is used preferentially. See also how works the API checker.

任意の区切り文字を使用できます。このドキュメントでは、| 文字(%7C パーセントエンコード)を優先的に使用しています。API チェッカー がどのように動くかも確認してください。

  • returnType (depends on the command): return format of the value or values. Any of current available values:
    • string: It returns the value as it is as an alphanumeric one.
    • csv: It returns the values as a CSV separated with the ; character (fields) and with CR (files) by default.
    • csv_head: It returns the same as with csv, except that it adds a first file with the field names to return.
  • Security credentials: see “Security” section.
  • returnType (コマンドによる): 値の取得フォーマットです。設定可能な値は次の通りです。
    • string: 英数字として値を返します。
    • csv: デフォルトで ; および改行で区切られた CSV で値を返します。
    • csv_head: csv と同様ですが、最初にフィールド名を返します。
  • Security credentials: セキュリティ の章を参照してください。

The API authenticates access via API source and/or password and/or user credentials.

API は、アクセス元、パスワードおよび、ユーザ資格情報を介してアクセスを認証します。

アクセス元による

At the moment, security is based on an IP addresses list that will have access to the tool.

現時点では、セキュリティはアクセスする IP アドレスリストに基づいています。

If you enter the character * in the box text, the ACL check will be omitted relegating the security to the protocol and to the environment.

テキストボックスに * を入力すると、IP アドレスによる ACL チェックは省略され、セキュリティはプロトコルと環境に委ねられます。

API パスワードによる

You can also set a password for API actions (·API password).

API アクセスのパスワードも設定することができます。(API パスワード(API password))

  • apipass: By default, and used in this documentation, 1234.
  • apipass: デフォルトかつこのドキュメントでは、1234 が使われています。

ユーザ資格情報による

Access is by user name and password; additionally from version 768 or later it is possible to authenticate by bearer token.

ユーザ名とパスワードによるものです。さらに、バージョン 768 以降からは、Bearer トークンによる認証が可能です。

ユーザ名とパスワードによる

To access API actions, it is necessary to give a Pandora FMS valid user name and password.

API へアクセスするには、Pandora FMS の正しいユーザ名とパスワードを与える必要があります。

  • user: Valid Pandora FMS user; admin is used in this documentation.
  • pass: The user password; pandora is used in this documentation.
  • user: 正しい Pandora FMS のユーザで、このドキュメントでは admin を使っています。
  • pass: ユーザのパスワードで、このドキュメントでは pandora を使っています。

In API calls, passwords are uncoded. Be careful and use SSL connections to avoid sniffers from third party. The API allows POST petitions to encrypt them when using SSL/HTTPS.

API 呼び出しではパスワードは暗号化されていません。SSL 接続を使用することにより、第三者から盗み見られることを防いでください。API アクセスでは、SSL/HTTPS を使用することで POST リクエストを暗号化できます。

戻り値

API へのアクセスができなかった場合は、単純に “auth error” という文字が出力されます。

In this documentaion the API password 1234 is used, the user name is admin and the user password is pandora.

このドキュメントでは、API パスワードが 1234 で、アクセスユーザが admin、そのパスワードが pandora とします。

See call syntax:

呼び出し書式:

.../include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora

Access conditions:

アクセス条件:

  • The source IP address is in the ACLs IP addresses list (or is used *).
  • The API password is not set or is 1234.
  • The user admin exists and its password is pandora .
  • ソース IP アドレスが ACL の IP アドレス一覧に存在する(または * が設定されている)
  • API パスワードが 設定されていない または 1234
  • ユーザ admin が存在し、そのパスワードが pandora

Access from the Administration menu: Admin toolsAPI checker.

管理メニューの 管理ツール(Admin tools)API チェッカー(API checker) からアクセスします。

Version 768 or later: You can authenticate with API Token by sending in the HTTP headers a bearer token generated by each user and for their own private and particular use. See “Edit my user” for more details.


バージョン 768 以降: HTTP ヘッダー で各ユーザによって個別に生成され bearer トークン を送信することにより、API トークン で認証することができます。

It is implemented thanks to three elements:

次の 3つの要素で実装されています。

以下に処理の流れを示します。

関数例

以下に示すのは、関数の例です。

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;
}
呼び出し例

この呼び出し例では、“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

They are divided into two groups, depending on whether they return or write data in Pandora FMS.

Pandora FMS に対して読み出し書き込みかによって、2つの種類に分けられます。

There is an exception: The info retrieving call.

例外があります: 情報取得 呼出

Version 768 or later: You can authenticate with API Token by sending in the HTTP headers a bearer token generated by each user and for their own private and particular use. See “Edit my user” for more details.

バージョン 758 以降: 各ユーザによって個別に生成された HTTP headers a bearer トークンHTTP ヘッダ で送信することにより API トークン で認証することができます。詳細は、ユーザ編集 を参照してください。

Authentication based on bearer token allows each of the users registered in Pandora FMS to generate their own identifier in one-to-one correspondence. This bearer token must be inserted in the HTTP headers, that is, it is not part of the complete URL of the API. The sending mechanism corresponds to the application that makes the connection with the PFMS API.

bearer トークンに基づく認証により、Pandora FMS に登録された各ユーザは、1 対 1 の対応で独自の識別子を生成できます。この bearer トークンは、HTTP ヘッダーに挿入する必要があります。つまり、API の URL の一部ではありません。 送信メカニズムは、Pandora FMS API にアクセスするアプリケーションにて対応します。

Version 768 or later: If a warning icon appears next to the API Token, configure the php.conf file.

バージョン 768 以降: API トークンの隣に警告アイコンが表示された場合は、php.conf ファイルを設定してください。

The following examples use the command line program cURL, version 7.68 .

以下の例では、コマンドラインプログラムである cURL バージョン 7.68 を使っています。

  • Check the curl version with curl -V.
  • curl のバージョンは、curl -V で確認します。

  • If you need more help using curl, invoke curl -h.
  • The -k and -H parameters are used to accept connections with self-signed certificates for HTTPS and send header information, respectively.
  • Consult the bearer token corresponding to the user who will perform the API query.
  • Now you can perform an API query, the following example uses get test (replace with your previously queried bearer token):
  • curl のヘルプが必要な場合は、curl -h を実行します。
  • -k および -H パラメータは、それぞれ HTTPS アクセスで自己証明書でのアクセスの受け入れ、ヘッダ情報を送信するために利用します。
  • API クエリを実行するユーザに対応する bearer トークンを調べます。
  • API クエリを実行できるようになりました。次の例では、get test を使用しています (あらかじめ用意した自身の bearer トークンに置き換えます)。
BEARER="Authorization: Bearer 811a0c1889f3aa62ef481ccd173ea5ec"
URL="http://192.168.7.117/pandora_console/include/api.php"
API_QUERY="?op=get&op2=test"
curl -k -H "$BEARER" $URL$API_QUERY && echo ""

  • If you need to debug the connection use the -v parameter (not to be confused with -V used to display the version).
  • 接続をデバッグする場合は、-v パラメータを利用します。(バージョンを表示する -V と混同しないでください。)

Pandora コンソールのバージョンを返します。get test と似ていますが、API 接続のチェックをしません。

これは、Pandora FMS のインストールパスの確認と、認証前にバージョンを確認するのに便利です。

返される情報はログイン画面から確認することができるものであるため、セキュリティ上の脆弱性にはなりません。

http://127.0.0.1/pandora_console/include/api.php?info=version

A return sample could be: Pandora FMS v7.0NG.768 - PC230120 MR60

例えば、Pandora FMS v7.0NG.768 - PC230120 MR60 といった内容が返ります。

データを読み出します。

get test

書式: パラメータ無し

以下の例では、OK を返します。

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test

応答サンプル: OK,v7.0NG.751,PC201215

get license

ユーザ権限のアクセスレベルに応じて、Pandora FMS のライセンス状態を返します。

Call syntax:

書式:

  • op=get (必須)
  • op2=license (必須)
  • return_type=json (必須)

Example (see call syntax):

例 ( 呼び出し書式を参照):

/include/api.php?op=get&op2=license&return_type=json&apipass=1234&user=admin&pass=pandora

コミュニティ 版では、次のような応答を返します。

 {
  "type":"array",
  "data":{
   "license_mode":"PANDORA-FREE",
  }
 }

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>

この例では、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

get license_remaining

= 7.0NG 752

To check the number of Agents or Modules available according to the Pandora FMS use licence and according to the access level of the user credentials used.

Pandora FMS ライセンスおよびユーザのアクセス権限に応じた、残りのエージェントまたはモジュール数を確認します。

Call syntax:

書式:

  • op = get (required)
  • op2= license_remaining (required)
  • return_type = json (required)
  • op = get (必須)
  • op2= license_remaining (必須)
  • return_type = json (必須)

Examples

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=license_remaining&return_type=json&apipass=1234&user=admin&pass=pandora

get module_last_value

書式:

  • op=get (必須)
  • op2=module_last_value (必須)
  • id=<インデックス> (必須) エージェントモジュールのインデックスである必要があります。
  • other=<返すエラー> (オプション) (通常データベースに記録されない)エラーが発生したときに、返したいもの。
    • エラーコードは次の通りです:
      • 'error_message' テキストでエラーメッセージを返します。
      • 'error_value'<セパレータ><コードまたは値> エラーの値を返します。ただし、 other_mode=url_encode_separator_<セパレータ> のように、分割するためのセパレータを 'other_mode' で設定する必要があります。

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

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' でセパレータを指定する必要があります。

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user

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' でセパレータを指定する必要があります。

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

get module_value_all_agents

Given a module name, returns a list of agents containing that module name. The result returns the agent identifier, agent alias, requested module value and agent name, separated by semicolon (;). For example:

モジュール名を指定すると、そのモジュール名を含むエージェントのリストを返します。 結果は、セミコロン (;) で区切られた、エージェントID、エージェントの別名、要求されたモジュールの値、およびエージェント名を返します。例:

653;agente network;0.00000;a8c83b348451040dc91c1327303adf8945aefce6ac59ab9bf856c9f4e0cf6c6f

Call syntax:

書式:

  • op=get (required).
  • op2=module_value_all_agents (required).
  • id=< module_name > (required).
  • op=get (必須)
  • op2=module_value_all_agents (必須)
  • id=<エージェント名> (必須)

Example (see call syntax):

(書式を参照):

A list of all the agents that have the module with Host Alive name:

Host Alive というモジュールがある全エージェントの一覧:

.../include/api.php?op=get&op2=module_value_all_agents&id=Host%20Alive&apipass=1234&user=admin&pass=pandora

get agent_modules

Returns the list of modules of an agent requested by its numerical identifier.

数値 ID で指定したエージェントのモジュール一覧を返します。

Syntax:

書式:

  • op=get (required).
  • op2=agent_modules (required).
  • return_type=csv (required) Output format.
  • other=< serialized values > (required) Serialized values in order to filter by agent:
  • < id_agent >
  • op=get (必須)
  • op2=agent_modules (必須)
  • return_type=<csv> (必須) 出力書式
  • other=<連続パラメータ> (必須) エージェントでフィルタするためのパラメータ:
    • <エージェントID>

It is absolutely essential to use

other_mode=url_encode_separator_< separator >

with this parameter!

次のように、セパレータを設定することが必要です。

other_mode=url_encode_separator_< セパレータ >

Example (see call syntax):

例 ( 書式を参照):

.../include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

get module_id

エージェントのモジュール ID を返します。

書式:

  • op=get (必須)
  • op2=module_id (必須)
  • id=id agent (必須)
  • other=module name (必須)

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

get module_custom_id

モジュール ID をパラメータをとして渡し、特定のエージェントモジュールの カスタムID の値を返します。

書式:

  • op=get (必須)
  • op2=module_custom_id (必須)
  • id=id_agent_module (必須)

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_custom_id&id=5&apipass=1234&user=admin&pass=pandora

get locate_agent

エージェントが存在するサーバ ID を取得し、すべての結果を csv で出力します。

書式:

  • op=get (必須)
  • op2=locate_agent (必須)
  • return_type=<csv> (必須) 出力フォーマット
  • id=id_agent (必須)
  • other_mode=other_mode=url_encode_separator_<separator> (必須)

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

get policies

書式:

  • op=get (必須)
  • op2=policies (必須)
  • return_type=<csv> (必須)
  • other=<複数の値> (オプション) ポリシーエージェントによってポリシーをフィルタするための複数の値:
    • <エージェントID>

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|

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'

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_|

get module_data

書式:

  • op=get (required)
  • op2=module_data (required)
  • id=<id_modulo> (required)
  • other_mode=url_encode_separator_<separator> (required)
  • other=<serialized parameters> (optional)
  • The CSV divider character (point by default)
  • The period (in seconds)
  • Start time (<year><month><day>T<hour>:<minute>)
  • End time (<year><month><day>T<hour>:<minute>)
  • op=get (必須)
  • op2=module_data (必須)
  • id=<モジュールID> (必須)
  • other_mode=url_encode_separator_<セパレータ> (必須)
  • other=<連続パラメータ> (オプション)
    • CSV の区切り文字
    • 間隔 (秒)
    • 開始日時 (<年><月><日>T<時間»<分>)
    • 終了日時 (<年><月><日>T<時間»<分>)

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

get graph_module_data

モジュールのグラフを画像ファイルで返します。このグラフは、Pandora の静的グラフと同じ手法で生成されます。グラフの幅、高さ、期間、ラベル、開始日(データの終わりがグラフに表示される最後になります)をパラメータに指定する必要があります。

書式:

  • op=set (必須)
  • op2=module_data (必須)
  • id=<モジュールID> (必須)
  • other=<連続パラメータ> (必須), 順番に次のデータを指定します:
    • <期間>
    • <幅>
    • <高さ>
    • <ラベル>
    • <開始日>

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_|

get events

other パラメータでフィルタしたイベントの一覧を返します。

Call syntax:

書式:

  • op=get (required).
  • op2=events (required).
  • id=< id_node > (optional in metaconsole, unnecessary in node).
  • return_type=csv or return_type=json (required).
  • other_mode=url_encode_separator_| (required).
  • other=< serialized parameters > (optional), are the following in this order:
    1. < separator > (required).
    2. < criticality > any of the following values from 0 to number 6:
      1. 0:Maintenance
      2. 1:Informational
      3. 2:Normal
      4. 3:Warning
      5. 4:Critical
      6. 5:Minor
      7. 6:Major
    3. < agent alias >
    4. < module name >
    5. < filter by alert > use 1 to filter events generated by alerts.
    6. < event owner user >
    7. < minimum date and time (since) > in Unix® time format, without milliseconds (EPOCH).
    8. < maximum date and time (until) > in Unix® time format, without milliseconds (EPOCH).
    9. < state > 0 to filter non-validated events, 1 for validated events.
    10. < text > keyword to search for in the events.
    11. < page size > sets the number of records to return for pagination (offset). If the offset number is omitted, it will only return the first offset (the first offset is the number zero 0).
    12. < page number > according to the page size of the previous point, returns earlier or later record blocks (offset).
    13. < style > only accepts two key values:
      1. total: it simply returns the total number of events, for example in JSON format delivers: {“type”:“json”,“data”:{“count”:990}}.
      2. more_criticity: returns the number of most critical events, for example if requested in JSON format: {“type”:“json”,“data”:[{“criticity”:“4”,“user_can_manage”:“1”,“user_can_write”:“1”,“server_id”:5,“server_name”:“stod”}]}.
    14. < group_id > returns non-validated events belonging to a group of agents, use numeric values only.
    15. < tag > any of the tags registered in PFMS (see get tags ). JSON format required, for example: [“2”,“5”] (see call syntax).
    16. < event type > any of the following values:
      • going_unknown
      • unknown
      • recon_host_detected
      • system
      • error
      • new_agent
      • going_up_warning
      • going_up_critical
      • going_down_warning
      • going_down_normal
      • going_down_critical
      • going_up_normal
      • configuration_change
      • ncm
      • not_normal
  • op=get (必須)
  • op2=events (必須)
  • id=<ノードID> (メタコンソールではオプション、ノードでは不要)
  • return_type=csv (必須)
  • other_mode=url_encode_separator_| (オプション)
  • other=<連続したパラメータ> (オプション) 次の順番でパラメータを指定します:
    1. < セパレータ > (必須).
    2. < 重要度 > 0 から 6 で次の通り:
      1. 0:メンテナンス
      2. 1:情報
      3. 2:正常
      4. 3:警告
      5. 4:障害
      6. 5:マイナー
      7. 6:メジャー
    3. < エージェントの別名 >
    4. < モジュール名 >
    5. < アラートによるフィルタ > アラートにより生成されたイベントをフィルタするには 1 にします。
    6. < イベントの所有者ユーザ >
    7. < 最小の日時 (開始日時) > ミリ秒は含まない Unix® 時刻フォーマット(EPOCH)。
    8. < 最大の日時 (終了日時) > ミリ秒は含まない Unix® 時刻フォーマット(EPOCH)。
    9. < 状態 > 未承諾イベントをフィルタするには 0、承諾済みは 1
    10. < テキスト > イベント内を検索するキーワード。
    11. < ページサイズ > ページネーション (オフセット) のために返すレコードの数を設定します。 オフセット番号が省略された場合、最初のオフセットのみが返されます (最初のオフセットは数字のゼロ 0 です)。
    12. < ページ番号 > 上記のページ サイズに応じて、前後のレコードブロック (オフセット) を返します。
    13. < スタイル > 以下の二種類の値のみ指定可能です:
      1. total: 単純にイベントの総数を返します。たとえば、JSON 形式では、{“type”:“json”,“data”:{“count”:990}} が配信されます。
      2. more_criticity: 最も重大なイベントの数を返します。JSON 形式でリクエストされた場合の例: {“type”:“json”,“data”:[{“criticity”:“4”,“user_can_manage”:“1”,“user_can_write”:“1”,“server_id”:5,“server_name”:“stod”}]}.
    14. < グループ ID > エージェントのグループに属する 未承諾 イベントを返します。数値のみ指定できます。
    15. < タグ > Pandora FMS に登録されている任意のタグです。(get tags を参照)。JSON フォーマットである必要があります。例: [“2”,“5”] (書式 を参照)。
    16. < イベントタイプ > 以下の値を指定できます:
      • going_unknown
      • unknown
      • recon_host_detected
      • system
      • error
      • new_agent
      • going_up_warning
      • going_up_critical
      • going_down_warning
      • going_down_normal
      • going_down_critical
      • going_up_normal
      • configuration_change
      • ncm
      • not_normal

Example (see call syntax):

(書式を参照):

To obtain the ncm (Network configuration manager) events by querying a Metaconsole whose node is 5:

メタコンソールで、ノード ID が 5ncm (ネットワーク設定管理) イベントの取得:

…include/api.php?op=get&op2=events&user=admin&pass=pandora&return_type=json&apipass=1234&other_mode=url_encode_separator_|&other=|||||||||||||||ncm&id=5

get all_alert_templates

書式:

  • op=get (必須)
  • op2=all_alert_templates (必須)
  • other=cvs_separator (オプション)

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;

get module_groups

書式:

  • op=get (必須)
  • op2=module_groups (必須)
  • other=cvs_separator (オプション)

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;

get plugins

書式:

  • op=get (必須)
  • op2=plugins (必須)
  • other=cvs_separator (オプション)

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;

get tags

Call syntax:

書式:

  • op=get (required)
  • op2=tags (required)
  • return_type=csv or return_type=json (required)
  • other=< field separator > if you request in CSV format you must specify separator, otherwise it will return the fields together.
  • op=get (必須)
  • op2=tags (必須)
  • return_type=csv または、return_type=json (必須)
  • other=< フィールドセパレータ > CSV フォーマットを指定した場合はフィールドセパレータは必須です。指定しないと各フィールドが一緒に返されます。

Example (see call syntax):

(書式を参照):

This example will return all tags in the system in CSV format with semicolon separator.

この例では、システムの全てのタグをセミコロンで区切った CSV フォーマットで返します。

/include/api.php?op=get&op2=tags&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora

get module_from_conf

= 5.0 (エンタープライズ版のみ)

書式:

  • op=get (必須)
  • op2=update_module_in_conf (必須)
  • id=<エージェントID> (必須)
  • id2=<モジュール名> (必須)

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

モジュールが見つからない場合は、空の文字列を返します。

get total_modules

Total modules by group.

グループの全モジュール。

Call syntax:

書式:

  • op=get (required).
  • op2=total_modules (required).
  • id=< id group > (required up to version 768; optional from version 769 onwards).
  • op=get (必須)
  • op2=total_modules (必須)
  • id=<グループID> (バージョン 768 までは必須、バージョン 769 以降はオプション)

Examples (see call syntax)

例 (書式を参照)

To obtain the total number of modules in the Networking module group:

Networking モジュールグループの全モジュール数の取得:

.../include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora

The following groups of modules come by default when installing Pandora FMS:

Pandora FMS インストール時のデフォルトでは、以下の モジュールグループ があります。

  1. General.
  2. Networking.
  3. Application.
  4. System.
  5. Miscellaneous.
  6. Performance.
  7. Database.
  8. Enviromental.
  9. Users.

If you set 0 as group id, or simply omit it, it will return the total number of modules:

グループ ID が 0 または、省力した場合は、全モジュール数が返ります。

.../include/api.php?op=get&op2=total_modules&apipass=1234&user=admin&pass=pandora

get total_agents

グループの全エージェント

書式:

  • op=get (必須)
  • op2=total_agents (必須)
  • id=<グループID> (必須)

http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora

get agent_name

指定した ID のエージェント名

書式:

  • op=get (必須)
  • op2=agent_name (必須)
  • id=<エージェントID> (必須)

http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora

get agent_alias

= 7.0NG

指定した ID のエージェントの別名を取得します。

書式:

  • op=get (必須)
  • op2=agent_alias (必須)
  • id=<エージェントID> (必須)
  • id2=<ノードID> (メタコンソールでは必須、ノードでは不要)

ノード:

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

get module_name

指定した ID のモジュール名

書式:

  • op=get (必須)
  • op2=module_name (必須)
  • id=<モジュールID> (必須)

http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora

get alert_action_by_group

指定したグループにおよびアクションにおいて、実行された全アラート

書式:

  • op=get (必須)
  • op2=alert_action_by_group (必須)
  • id=<グループID> (必須)
  • id2=<アクションID> (必須)

http://localhost/pandora_console/include/api.php?op=get&op2=alert_action_by_group&id=0&id2=3&apipass=1234&user=admin&pass=pandora

get alert_actions

アラートアクションの一覧を取得します。

Call syntax:

書式:

  • op=get (required).
  • op2=alert_actions (required).
  • return_type=< list_format > choice csv or json (required).
  • other=< serialized parameter > (optionals):
    • < action_name >
    • < separator >
  • op=get (必須)
  • op2=alert_actions (必須)
  • return_type=<一覧フォーマット> (必須) 'csv' または 'json' を指定できます。
  • other=<連続パラメータ> (オプション):
    • <action_name>
    • <separator>

To get the list of all alert actions in JSON format (see call syntax):

JSON フォーマットでアラートアクションの一覧を取得する (書式を参照):

.../include/api.php?op=get&op2=alert_actions&return_type=json&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

To get the list of all alert actions in CSV format (see call syntax):

CSV フォーマットでアラートアクションの一覧を取得する (書式を参照):

.../include/api.php?op=get&op2=alert_actions&return_type=csv&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

get alert_actions_meta

This feature is in Metaconsole.

この機能はメタコンソールのみです。

List of node alert actions from Metaconsole.

メタコンソールからノードのアラートアクション一覧を取得します。

Call syntax:

書式:

  • op=get (required)
  • op2=alert_actions_meta (required)
  • return_type=<return type> (required). It can be 'csv' o 'json'.
  • other=<serialized parameters> (optional):
  • <server_name> (optional)
  • <action_name> (optional)
  • <separator> (optional)
  • op=get (必須)
  • op2=alert_actions_meta (必須)
  • return_type=<return type> (必須) 'csv' または 'json' を指定できます。
  • other=<連続パラメータ> (オプション):
    • <server_name> (オプション)
    • <action_name> (オプション)
    • <separator> (オプション)

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

get all_alert_commands

全アラートコマンドを返します。

書式:

  • op=get (必須)
  • op2=all_alert_commands (必須)
  • other=cvs_separator (オプション)

http://localhost/pandora_console/include/api.php?op=get&op2=all_alert_commands&return_type=csv&other=$&apipass=1234&user=admin&pass=pandora

get event_info

書式:

  • op=get (必須)
  • op2=event_info (必須)
  • id=<イベントID> (必須)

http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora

get tactical_view

書式:

  • op=get (必須)
  • op2=tactical_view (必須)

http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora

get pandora_servers

バージョン 5.0 かそれ以降

書式:

  • op=get (必須)
  • op2=pandora_servers (必須)
  • other=cvs_separator (オプション)

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 - マスターサーバではない)
  • 稼働中のモジュール数
  • 該当する全モジュール数
  • 最大遅延(秒)
  • 遅延モジュール数
  • スレッド数
  • 現在キューに溜まっているモジュール数
  • 最終更新日時 (文字列)

get custom_field_id

= 5.0

書式:

  • op=get (必須)
  • op2=custom_field_id (必須)
  • other=<連続パラメータ> (必須) カスタムフィールド名です
    • <名前> (必須)

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

get gis_agent

= 5.0

エージェントの最新の gis データを返します。

書式:

  • op=set (必須)
  • op2=gis_agent (必須)
  • id=<id> (必衰) エージェントID

http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1

get special_days

= 5.1

特別日一覧を返します。

書式:

  • op=get (必須)
  • op2=special_days (必須)
  • other=<csvセパレータ> (オプション) CSVのセパレータ

http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days

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)

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

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 を参照してください)

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

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 を参照してください)

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

get module_graph

base64 でエンコードされたモジュールグラフを返します。

書式:

  • op=get (必須)
  • op2=module_graph (必須)
  • id=<モジュールID> (必須)
  • other=<秒単位の間隔> (オプション) デフォルトは 3600 (1時間)です。 時間間隔はデータリカバリに使われます。

バージョン NG 752 以降では、追加のパラメータがあります。必須項目っとそのセパレータ | または、その エスケープ文字 %7C に注意してください。

  • op=get (必須)
  • op2=module_graph (必須)
  • id=<module id> (必須)
  • other =====
    • リクエストの日付からさかのぼってデータが収集される秒単位の時間範囲(デフォルトは 3600)(必須)。
    • セパレータ
    • 0 であれば base64 グラフィック、1 であれば画像(必須)
    • セパレータ
    • 0 であればしきい値無し。 1 であればしきい値あり。- モジュールに有効なしきい値がある場合 - (必須)
    • セパレータ
    • ピクセル単位のグラフの高さ(必須)。マップキーを表示するには 49ピクセルが必要です。

バージョン NG 752 未満:

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

バージョン NG 752 以上:

http://localhost/pandora_console/include/api.php?op=get&op2=module_graph&id=2&other=3600%7C1%7C1%7C500%7C&other_mode=url_encode_separator_%7C|&apipass=1234&api=1&user=admin&pass=pandora

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

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

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

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

get id_group_agent_by_name

= 5.1

エージェントのグループ ID を返します。

書式:

  • op=get
  • op2=id_group_agent_by_name
  • other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
    • <エージェント名>

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

get id_group_agent_by_alias

= 7.0NG

エージェントのグループ ID を返します。

書式:

  • op=get
  • op2=id_group_agent_by_alias
  • other=<文字列または連続パラメータ> エージェントの別名およびフィルタリングパラメータ (オプション)
    • <エージェントの別名>

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

get group_agent_by_name

= 5.1

エージェントのグループ名を返します。

書式:

  • op=get
  • op2=group_agent_by_name
  • other=<文字列または連続パラメータ> エージェント名およびフィルタリングパラメータ (オプション)
    • <エージェント名>

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

get group_agent_by_alias

= 7.0NG

エージェントのグループ名を返します。

書式:

  • op=get
  • op2=group_agent_by_alias
  • other=<文字列または連続パラメータ> エージェントの別名およびフィルタリングパラメータ (オプション)
    • <エージェントの別名>

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

get group_id_by_name

= 7.0NG

名前からグループ ID を返します。

書式:

  • op=get
  • op2=group_id_by_name
  • other=<単一パラメータ> (必須):
    • <グループ名>

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

get get_timezone

= 7.0NG

Pandora に設定されているタイムゾーンを返します。

書式:

  • op=get
  • op2=timezone

http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone

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

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

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

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

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

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

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

pcrit: アクティブ・アクティブの場合は障害状態のパーセンテージ、アクティブ・スタンバイの場合は 1 または 0

pwarn: % for the warning state if its AA or null if its AP

pwarn: アクティブ・アクティブの場合は警告状態のパーセンテージ、アクティブ・スタンバイの場合は null

  • 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

get policy

= 7.0NG. 725

ポリシーから全データを返します。ポリシー ID が指定されていない場合は、全ポリシーから全データを返します。

書式:

  • op=get
  • op2=policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json.

get collections_policy

= 7.0NG. 725

ポリシーの全コレクションを返します。ポリシー ID が指定されていない場合は、全ポリシーの全コレクションを返します。

書式:

  • op=get
  • op2=collections_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json.

get plugins_policy

= 7.0NG. 725

ポリシーの全プラグインを返します。ポリシー ID が指定されていない場合は、全ポリシーの全プラグインを返します。

書式:

  • op=get
  • op2=plugins_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json.

get inventory_policy

= 7.0NG. 725

ポリシーのインベントリモジュールを返します。ポリシー ID が指定されていない場合は、全ポリシーの全インベントリモジュールを返します。

書式:

  • op=get
  • op2=inventory_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2

get unlinking_policy

= 7.0NG. 725

ポリシーの全未リンクモジュールを返します。ポリシー ID が指定されていない場合は、全ポリシーの全未リンクモジュールを返します。

書式:

  • op=get
  • op2=unlinking_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json.

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).

http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2.

get alerts_actions_policy

= 7.0NG. 725

以下を考慮して、ポリシーのアラートの全アクションを返します。

  • ポリシー ID が指定されている場合は、そのポリシーのアラートのアクションを返します。指定されていない場合は、全ポリシーの全アラートの全アクションを返します。
  • アラート ID が指定されている場合は、そのアラートのアクションを返します。

書式:

  • op=get
  • op2=alerts_actions_policy
  • id=<ポリシーID> (オプション)
  • id2=<ポリシーアラートID> (オプション)
  • return_type=(json, csv, string).

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

get agents_policy

= 7.0NG. 725

ポリシーの全エージェントを返します。ポリシー ID が指定されていない場合は、全ポリシーの全エージェントを返します。

書式:

  • op=get
  • op2=agents_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json.

get groups_policy

= 7.0NG. 725

ポリシーの全グループを返します。ポリシー ID が指定されていない場合は、全ポリシーの全グループを返します。

書式:

  • op=get
  • op2=groups_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2
get queue_policy
= 7.0NG. 725

ポリシーのキューを返します。ポリシー ID が指定されていない場合は、全ポリシーの全キューを返します。

書式:

  • op=get
  • op2=queue_policy
  • id=<ポリシーID> (オプション)
  • return_type=(json, csv, string).

http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json
get traps
= 7.0NG. 728

指定されたソーストラップを返します。また、タイムスタンプやその他のデータをフィルタリングすることもできます。

書式:

  • op=get
  • op2=traps
  • other=<オプションパラメータ»
    • <timestamp>
    • <limit>
    • <offset>
    • <status>
    • <oid_custom>

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
get event_responses

Pandora FMS でユーザがアクセスするイベント応答の一覧を返します。

書式:

  • op=get (必須)
  • op2=event_reponses (必須)
  • return_type=csv|json (必須)

この例では、csv フォーマットで全システムイベント応答を返します。

http://localhost/pandora_console/include/api.php?op=get&op2=event_responses&return_type=csv&apipass=1234&user=admin&pass=pandora
get users

Pandora FMS のユーザ一覧を返します。

書式:

  • op=get (必須)
  • op2=users (必須)
  • return_type=csv|json (必須)

この例では、全ユーザを 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_&

get list all user

この機能はメタコンソールのみです。

全 Pandora FMS ユーザ一覧を出力します。

書式:

  • op=get (必須)
  • op2=list_all_user(必須)
  • return_type=csv|json (必須)

Json または CSV にて返すことができます。この戻り値は URL を介して指定します。 応答タイプのみの指定で、その他変数は使用しません。

http://localhost/pandora_console/include/api.php?op=get&op2=list_all_user&return_type=json&apipass=1234&user=admin&pass=pandora

get info user name

この機能はメタコンソールのみです。

ユーザデータの一覧を返します。

書式:

  • op=get (必須)
  • op2=list_all_user(必須)
  • return_type=csv|json (必須)
  • other=usernarme (必須)

指定のユーザに関するすべての情報を取得します。 Json または CSV にて返すことができます。この戻り値は URL を介して指定します。 応答タイプのみの指定で、その他変数は使用しません。

http://localhost/pandora_console/include/api.php?op=get&op2=info_user_name&return_type=json&other=admin&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

get user_profiles_info

Pandora FMS のユーザプロファイル一覧を返します。

書式:

  • op=get (必須)
  • op2=user_profiles_info (必須)
  • return_type=csv|json (必須)

この例では、全システムユーザプロファイルを json フォーマットで返します。

http://localhost/pandora_console/include/api.php?op=get&op2=user_profiles_info&return_type=csv&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_&

get migrate_agent

= 7.21 メタコンソールのみ

エージェントマイグレーションキューに、指定のエージェントが存在するかを確認します。

  • op=get
  • op2=migrate_agent
  • id=id_agente a migrar
  • return_type=string, json, etc

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

get language

= 7.0NG 730

Pandora FMS に設定されている言語を返します。

書式:

  • op=get
  • op2=language

http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=language

get session_timeout

= 7.0NG 730

Pandora FMS に設定されたセッションタイムアウトを返します。

書式:

  • op=get
  • op2=session_timeout

http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=session_timeout

get groups

= 7.0NG 732

存在するグループを返します。

書式:

  • op=get
  • op2=groups
  • other=<オプションパラメータ»
    • <csv_separator» デフォルトは ';'。
    • <return_all_group» 'すべて' グループを返します。
    • <return_all_columns» 全カラムを返します。

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

get filter user group

この機能はメタコンソールのみです。

フィルタリングを行ったユーザグループを取得します。

書式:

  • op=get (必須)
  • op2=filter_user_group (必須)
  • return_type=csv|json(必須)
  • other=id group(必須)|Enabled or not(Disabled)(必須)

Json または CSV にて返すことができます。この戻り値は URL を介して指定します。 2つの変数(グループIDまたは有効化)の 1つは空ですが、少なくとも 1つは入力する必要があることに注意してください。

2つの変数(グループIDまたは Enabled)のうちいずれかが空でも構いませんが、少なくとも一つは指定する必要があることに注意してください。

http://localhost/pandora_console/include/api.php?op=get&op2=filter_user_group&return_type=json&other=0|0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

get inventory_modules

Pandora インベントリモジュールの一覧を返します。

書式:

  • op=get (必須)
  • op2=inventory_modules (必須)
  • return_type=csv|json (必須)

この例では、全インベントリの情報を json フォーマットで返します。

http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora

get inventory_modules_by_name

エージェント名を用いてエージェントからインベントリモジュールを取得します。

書式:

  • op=get (必須)
  • op2=inventory_modules_by_name (必須)
  • id=<エージェント名> (必須)

http://localhost/pandora_console/include/api.phpop=get&op2=inventory_modules_by_name&id=name&return_type=csv&apipass=1234&user=admin&pass=pandora

get inventory_modules_by_alias

エージェントの別名を用いて、エージェントからインベントリモジュールを取得します。

書式:

  • op=get (必須)
  • op2=inventory_modules_by_alias (必須)
  • id=<エージェントの別名> (必須)

http://localhost/pandora_console/include/api.phpop=get&op2=inventory_modules_by_alias&id=alias&return_type=csv&apipass=1234&user=admin&pass=pandora

get inventory_module_data

エージェント名とモジュールを用いて、インベントリモジュールからデータを取得します。

書式:

  • op=get (必須)
  • op2=inventory_module_data (必須)
  • id=<エージェント名> (必須)
  • id2=<インベントリモジュール名> (オプション)
  • other=<連続パラメータ> (オプション), 次の順番で指定します:
    • <separator>
    • <date_from» <year><month><day>T<hour»<minute>
    • <date_to» <year><month><day>T<hour»<minute>
    • <use_agent_alias> (オプション) 0 または 1

http://127.0.0.1/pandora_console/include/api.phpop=get&op2=inventory_module_data&id=e14ae3b959b08a1fb7a057281401a08063cf04eb714efa5fbf1cf4043cfa1314&id2=Routes&other=,%7C20191010T13:40%7C20191211T13:40%7C0&return_type=csv&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

get list_collections

Pandora の全コレクションの一覧を返します。

書式:

  • op=get (必須)
  • op2=list_collections (必須)

この例では、全コレクションの情報を json フォーマットで返します。

http://localhost/pandora_console/include/api.php?op=get&op2=list_collections&apipass=1234&user=admin&pass=pandora

get list_collection_files

コレクション内の全ファイル一覧を返します。コレクション ID を指定しなかった場合、全コレクションの全ファイルを返します。

書式:

  • op=get (必須)
  • op2=list_collections_files (必須)
  • id=id_collection

この例では、コレクション内の全ファイル名を json フォーマットで返します。

http://localhost/pandora_console/include/api.php?op=get&op2=list_collection_files&id=1&apipass=1234&user=admin&pass=pandora

get all_event_filters

存在するイベントフィルタの一覧を返します。

書式:

  • op=get (必須)
  • op2=all_event_filters (必須)
  • other=cvs_separator (オプション)

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

get event_mcid

ノードの ID および、ノードのイベント ID を用いて、メタコンソールでのイベント ID を返します。

この機能はメタコンソールのみです。

書式:

  • op=get (必須)
  • op2=event_mcid (必須)
  • id=<server_id> (必須) ノードの ID です。
  • id2=<id_source_event> (必須) ノードのイベント ID です。

http://172.16.0.3/pandora_console/include/api.php?op=get&op2=event_mcid&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora

get is_centralized

Returns whether a node is centralized ( 1 ) or not ( 0 ). If the node does not exist it will return a text string informing about it. It can be used in Metaconsole or directly in the node.

ノードが中央管理されているか(1)、そうでないか(0)を返します。 ノードが存在しない場合は、その旨を通知するテキスト文字列が返されます。メタコンソールおよびノードで直接使用することができます。

Call syntax:

書式:

  • op=get (required).
  • op2=is_centralized (required).
  • id=(required for Metaconsole, no need for node).
  • op=get (必須)
  • op2=is_centralized (必須)
  • id=(メタコンソールでは必須。ノードでは不要。)

Example at node:

ノードでの例:

 http://localhost/pandora_console/include/api.php?op=get&op2=is_centralized&apipass=1234&user=admin&pass=pandora

Example at Metaconsole:

メタコンソールでの例:

http://localhost/pandora_console/include/api.php?op=get&op2=is_centralized&id=3&apipass=1234&user=admin&pass=pandora

データを送信します。

set new_agent

パラメータで指定した内容で新たなエージェントを作成します。

書式:

  • op=set (required).
  • op2=new_agent (required).
  • id= (Metaconsole) Numerical identifier of the node to which the agent will belong (required).
  • other=<serialized parameters> (required). They are the agent configuration and data, serialized in the following order:
    • <agent_alias>
    • <ip>
    • <id_parent>
    • <id_group>
    • <cascade_protection>
    • <cascade_protection_module>
    • <interval_sec>
    • <id_os>
    • <name_server>
    • <custom_id>
    • <learning_mode>
    • <disabled>
    • <description>
    • <alias_as_name>
  • op=set (必須)
  • op2=new_agent (必須)
  • id= (メタコンソール) エージェントが属するノードの数値識別子(必須)
  • other=<連続したパラメータ> (必須) エージェントの設定とデータを次の順番に指定します。
    • <エージェントの別名>
    • <IP>
    • <親エージェントのID>
    • <グループID>
    • <関連障害検知抑制>
    • <関連障害検知抑制モジュール>
    • <間隔(秒)>
    • <OSのID>
    • <サーバ名>
    • <カスタムID>
    • <学習モード>
    • <無効化>
    • <説明>
    • <alias_as_name>

Call example for node :

ノード での呼び出し例:

.../include/api.php?op=set&op2=new_agent&other=agent_api|1.1.1.1|0|4|0|0|300|10|pandorafms|8|10||description|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

Call example for Metaconsole :

メタコンソール での呼び出し例:

.../include/api.php?op=set&op2=new_agent&id=1&other=agent_api|1.1.1.1|0|4|0|0|300|10|pandorafms|8|10||description|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
  • Note: If <alias_as_name> is 1, the agent name will be the same as the alias. If it is 0, the agent name will be automatically generated.
  • 注意: alias_as_name1 の場合はエージェント名は別名と同じです。0 の場合はエージェント名は自動的に生成されます。

set update_agent

It updates an agent with data as parameters.

パラメータで渡したデータで、エージェントを更新します。

書式:

  • op=set (required)
  • op2=update_agent (required)
  • id=<id_agent> (required)
  • other=<serialized parameters> (required). They are agent configuration and data, serialized in the following order:
    • <agent_alias>
    • <ip_address>
    • <id_parent>
    • <id_group>
    • <cascade_protection>
    • <cascade_protection_module>
    • <interval_sec>
    • <id_os>
    • <name_server>
    • <custom_id>
    • <learning_mode>
    • <disabled>
    • <description>
    • <os_version>
  • op=set (必須)
  • op2=update_agent (必須)
  • id=<エージェントID> (必須)
  • other=<連続パラメータ> (必須) エージェントの設定データで次の順番で設定します。
    • <エージェントの別名>
    • <ipアドレス>
    • <親ID>
    • <グループID>
    • <関連障害検知抑制>
    • <関連障害検知抑制モジュール>
    • <間隔(秒)>
    • <OSのID>
    • <サーバ名>
    • <カスタムID>
    • <学習モード>
    • <無効化>
    • <説明>
    • <OSバージョン>

Example (see call syntax):

例 (書式を参照):

.../include/api.php?op=set&op2=update_agent&id=5&other=agent_name%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20description|Ubuntu&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set update_agent_field

This call updates the field(s) of one or more Agents (the latter if it uses aliases and there are several matching ones.

この呼び出しは、1つもしくは、(別名を利用し一致するエージェントが複数ある場合は)複数のエージェントのフィールドを更新します。

Call syntax:

  • op=set (required)
  • op2=update_agent (required)
  • id=<id_agent> or <alias> (required), <alias> depends of id2 parameter.
  • id2= <0> if is<id_agente> (opcional), <1> if is <alias> (required).
  • other=<serialized parameters> (required). They are agent configuration and data, serialized in the following order:
  • <agent_alias>
  • <ip>
  • <id_parent>
  • <id_group>
  • <cascade_protection>
  • <cascade_protection_module>
  • <interval_sec>
  • <id_os>
  • <name_server>
  • <custom_id>
  • <learning_mode>
  • <disabled>
  • <description>

書式:

  • op=set (必須)
  • op2=update_agent (必須)
  • id=<id_agent> or <alias> (必須), <alias> id2 パラメータに依存します。
  • id2= <id_agente> の場合 0 (オプション), <alias> の場合 1 (必須)
  • other=<連続パラメータ> (必須) 次の順番でエージェント設置とデータを指定します。
  • <エージェントの別名>
  • <ip>
  • <親 ID>
  • <グループ ID>
  • <関連障害検知抑制>
  • <関連障害検知抑制モジュール>
  • <秒単位の間隔>
  • <OS ID>
  • <サーバ名>
  • <カスタム ID>
  • <学習モード>
  • <無効化>
  • <説明>

In case of using the Agent's identifier:

エージェント名を利用する場合:

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_agent_field&id=1&other=id_os,1|alias,pandora|direccion,192.168.10.16|id_parent,1cascade_protection,1|cascade_protection_module,1|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

In case of using aliases, it modifies all the agents that contain that alias:

別名を利用する場合。別名を含む全エージェントを編集します:

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_agent_field&id=pandora&id2=1&other=id_os,1|alias,pandora|direccion,192.168.10.16|id_parent,1cascade_protection,1|cascade_protection_module,1|intervalo,5||modo|3|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set delete_agent

指定した名前のエージェントを削除します。

書式:

  • op=set (必須)
  • op2=delete_agent (必須)
  • id=<エージェント名> (必須) エージェント名でなければいけません。
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 1 です)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_agent&id=agente_erroneo

set create_module_template

id に指定したテンプレート、other に指定したエージェント、モジュール ID から、アラートを作成します。

書式:

  • op=set (必須)
  • op2=create_module_template (必須)
  • id=<テンプレートID> (必須) テンプレートIDでなければいけません。
  • other=<id_module>|<id_agent>

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

set apply_module_template

モジュールテンプレートをエージェントへ適用します。

モジュールテンプレートは、ネットワークモジュールを集めたものです。このテンプレートは、直接エージェントに適用することができ、モジュールを一つ一つ追加する必要はありません。

書式:

  • op=set (必須)
  • op2=apply_module_template (必須)
  • id<id_template> (必須) 適用されるテンプレートの ID
  • id2<id_agente> (必須) モジュールが作成されるエージェントの ID

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

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 以降のみ)
    • <エージェントの別名の利用> (値は 0 または 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_|

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": ""
 }
}
  • <エージェントの別名の利用> (値は 0 または 1 です)
  • <モジュールマクロ> (バージョン 5 以降のみ) それぞれのマクロを一つのプロパティで表した base 64 でエンコードした JSON 文字列でなければいけません。JSON プロパティの書式は、“<macro name>”: “<macro value>” です。
  • <個別状態変化の利用> (バージョン 5.1 以降のみ)
  • <正常移行時連続抑制回数> (バージョン 5.1 以降のみ)
  • <警告移行時連続抑制回数> (バージョン 5.1 以降のみ)
  • <障害移行時連続抑制回数> (バージョン 5.1 以降のみ)
  • <障害条件の反転> (バージョン 6.0SP1 以降のみ)
  • <警告条件の反転> (バージョン 6.0SP1 以降のみ)
  • <ff_type> (バージョン 733 以降のみ)

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_|

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 以降のみ)
    • <エージェントの別名の利用> (値は 0 または 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_|

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 以降のみ)
    • <エージェントの別名の利用> (値は 0 または 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_|

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 以降のみ)

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_|

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 以降のみ)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_plugin_module&id=2343&other=44|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_|

set update_data_module

With this call, a database module data can be added but the configuration file of the agents associated to the module cannot be modified.

これによりデータベースにモジュールデータを追加することはできますが、該当モジュールに関するエージェントの設定ファイルを変更することはできません。

ローカルモジュールを更新します。

Call syntax:

書式:

  • op=set (required).
  • op2=update_data_module (required).
  • id=< id_module_agent > (required) module's numeric ID to update.
  • other=< serialized parameters > (required) module data and module configuration in serialized order:
    • < id_agent >
    • < disabled > use 1 for disable, 0 for no changes.
    • < description >
    • < id_module_group > see get_module_groups.
    • < min >
    • < max >
    • < post_process > ( Enterprise versiononly for Software Agents with remote configuration enabled).
    • < min_warning >
    • < max_warning >
    • < str_warning >
    • < min_critical >
    • < max_critical >
    • < str_critical >
    • < history_data > If it is set at 0, module data will not be saved at tagente_datos, only tagent_estado will be updated.
    • < disabled_types_event > JSON forma, example: {“going_unknown”:1} .
    • < module_macros > It should be a base64 encoded JSON document made up by an object with one property for each macro. The format of the JSON properties should be “<macro name>”: “<macro value>”.
    • < min_ff_event > Number of times a change of state condition has to occur before the change of state can take place (flipflop ).
    • < each_ff >
    • < min_ff_event_normal >
    • < min_ff_event_warning >
    • < min_ff_event_critical >
    • < ff_timeout >
    • < critical_inverse >
    • < warning_inverse >
    • < policy_linked >
    • < ff_type >
  • op=set (必須)
  • op2=update_data_module (必須)
  • id=<モジュールID> (必須) 更新するモジュールの数値 ID。
  • other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。
    • < エージェントID >
    • < 無効化 > 無効化の場合は 1変更なし0
    • < 説明 >
    • < モジュールグループID > get_module_groups を参照。
    • < 最小 >
    • < 最大 >
    • < 保存倍率 > ( Enterprise 版(ソフトウエアエージェント でリモート設定が有効な場合のみ)
    • < 警告の最小値 >
    • < 警告の最大値 >
    • < 警告文字列 >
    • < 障害の最小値 >
    • < 障害の最大値 >
    • < 障害文字列 >
    • < データの保存 > 0 に設定するとモジュールのデータは、tagente_datos に保存されません。tagent_estado のみ更新されます。
    • < 無効化イベント > JSON フォーマット。例: {“going_unknown”:1}
    • < モジュールマクロ > これは、マクロごとに 1 つのプロパティを持つオブジェクトで構成された、base64 でエンコードされた JSON ドキュメントである必要があります。JSON プロパティのフォーマット: “<macro name>”: “<macro value>”
    • < 連続抑制回数 > モジュールの監視結果が何回連続で変化したらモジュールの状態を変更するかの値。(連続抑制回数 )
    • < 個別状態変化の利用 >
    • < 正常移行時連続抑制回数 >
    • < 警告移行時連続抑制回数 >
    • < 障害移行時連続抑制回数 >
    • < 連続抑制タイムアウト >
    • < 障害条件の反転 >
    • < 警告条件の反転 >
    • < 関連ポリシー >
    • < 連続抑制カウンタの維持 >

Example (see call syntax):

例 (書式を参照):

.../include/api.php?op=set&op2=update_data_module&id=123&other=44|0|data%20module%20modified%20from%20API|6|0|0|50.00|300|10|15||16|18||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set update_data_module_policy

ポリシーのデータモジュールを更新し、新たなモジュールの ID を返します。

書式:

  • op=set (required).
  • op2=update_data_module_policy (required).
  • id=<id_policy> (required). Numeric identificator of the target policy.
  • other=<serialized parameters> (required). They are module configuration and data, serialized in the following order:
    • <id_policy_module>
    • <description>
    • <id_module_group>
    • <min>
    • <max>
    • <post_process>
    • <module_interval>
    • <min_warning>
    • <max_warning>
    • <min_critical>
    • <max_critical>
    • <str_critical>
    • <history_data>
    • <configuration_data>
    • <disabled_types_event>
    • <module_macros> It should be a base64 encoded JSON document made up by an object with one property for each macro. The format of the JSON properties should be:
      • < macro name >:< macro value >.
  • op=set (必須)
  • op2=update_data_module_policy (必須)
  • id=<id_policy> (必須) 対象のポリシーモジュールID。
  • other=<連続パラメータ> (必須) 次の順番でモジュールの設定とデータを指定します。:
    • <ポリシーモジュールID>
    • <説明>
    • <モジュールグループID>
    • <最小>
    • <最大>
    • <事前処理>
    • <モジュールの間隔>
    • <警告の最小値>
    • <警告の最大値>
    • <障害の最小値>
    • <障害の最大値>
    • <障害の文字列>
    • <データの保存>
    • <設定データ>
    • <disabled_types_event>
    • <モジュールマクロ> (バージョン 5以降) 各マクロに対して 1つのプロパティを持つオブジェクトによって形成された、base64 でエンコードされた JSON ドキュメントである必要があります。JSON フォーマットは、次のようになっている必要があります。
      • <マクロ名>:<マクロ値>

(呼び出し書式を参照):

.../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_|&apipass=1234&user=admin&pass=pandora

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 以降のみ)

例 (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_|

set apply_policy

ひとつもしくは複数のエージェントに、ID を指定してポリシーを適用します。

書式:

  • op=set (必須)
  • op2=apply_policy (必須)
  • id=<id_policy> (必須)
  • id2=<id_agent> (オプション) 他のパラメータに示されているエージェントのIDまたは名前。 空の場合、ポリシーはすべてのエージェントに適用されます。
  • other=<連続パラメータ>
    • <name_agent (整数)> エージェントを ID(0) で指定するか、名前(1) で指定するか、別名(2) で指定するかを示します。
    • <server_id> (メタコンソールの場合必要です) ポリシーを適用するサーバの ID です。

http://192.168.70.102/pandora_console/include/api.php?op=set&op2=apply_policy&id=22&id2=3e&other=0 |1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set apply_all_policies

Pandora 内にある全ポリシーを適用します。

書式:

  • op=set (必須)
  • op2=apply_all_policies (必須)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_all_policies&apipass=1234&user=admin&pass=pandora

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 以降のみ)

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_|

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 以降のみ)

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_|

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 以降のみ)

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_~

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 以降のみ)

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_|

set add_agent_policy_by_id

エージェント ID を用いてポリシーにエージェントを追加します。

書式:

  • op=set (必須)
  • op2=add_agent_policy_by_id (必須)
  • id=<id_policy> (必須) ポリシー ID である必要があります。
  • other=<serialized parameters> (必須) エージェント設定とデータで、次の順番で指定する必要があります:
    • <id_agent>
    • <id_node> (メタコンソールの場合は必須) ポリシーに追加するエージェントが属するノードのID。

  • ノード:
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_id&id=2&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
  • メタコンソール:
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_id&id=2&other=1%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set add_agent_policy_by_name

エージェント名を用いてポリシーへエージェントを追加します。

書式:

  • op=set (必須)
  • op2=add_agent_policy_by_name (必須)
  • id=<id_policy> (必須) ポリシー ID である必要があります。
  • other=<serialized parameters> (必須) エージェント設定とデータで、次の順番で指定する必要があります:
    • <agent_name>

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_name&id=4&other=e76774025b24057cc71df514f27027c43484c3af766ed40f259a86a4fd568f9d&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set remove_agent_from_policy_by_id

エージェント ID を用いて、ポリシーからエージェントを削除します。

書式:

  • op=set (必須)
  • op2=remove_agent_from_policy_by_id (必須)
  • id=<id_política> (必須) ポリシー ID である必要があります。
  • other=<serialized parameters> (必須) エージェント設定とデータで、次の順番で指定する必要があります:
    • <id_agent>
    • <id_node> (required when using the Metaconsole). ID of the node the agent you wish to remove from the policy belongs to.

必須

  • ノード:
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_id&id=2&other=2&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
  • メタコンソール:
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_id&id=4&other=1%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set remove_agent_from_policy_by_name

エージェント名を用いて、ポリシーからエージェントを削除します。

書式:

  • op=set (必須)
  • op2=remove_agent_from_policy_by_name (必須)
  • id=<id_policy> (必須) ポリシー ID である必要があります。
  • other=<serialized parameters> (必須) エージェント設定とデータで、次の順番で指定する必要があります:
    • <agent_name>

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_name&id=4&other=e76774025b24057cc71df514f27027c43484c3af766ed40f259a86a4fd568f9d&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

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 以降のみ)

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_|

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 以降のみ)

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_|

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 以降のみ)

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_|

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 以降のみ)

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_~

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|not_normal]>
    • <説明>
    • <アラートアクションID>
    • <フィールド1>
    • <フィールド2>
    • <フィールド3>
    • <値>
    • <マッチする値>
    • <最大値>
    • <最小値>
    • <再通知間隔>
    • <最大アラート数>
    • <最小アラート数>
    • <開始時間>
    • <終了時間>
    • <月曜>
    • <火曜>
    • <水曜>
    • <木曜>
    • <金曜>
    • <土曜>
    • <日曜>
    • <復旧アラート>
    • <復旧時のフィールド2>
    • <復旧時のフィールド3>
    • <優先度>
    • <グループID>
    • <特別日の利用>
    • <アラートが継続しない場合にカウンターをリセット>
    • <復旧時のフィールド1>
    • <フィールド4>
    • <フィールド5>
    • <フィールド6>
    • <フィールド7>
    • <フィールド8>
    • <フィールド9>
    • <フィールド10>
    • <フィールド11>
    • <フィールド12>
    • <フィールド13>
    • <フィールド14>
    • <フィールド15>
    • <復旧時のフィールド4>
    • <復旧時のフィールド5>
    • <復旧時のフィールド6>
    • <復旧時のフィールド7>
    • <復旧時のフィールド8>
    • <復旧時のフィールド9>
    • <復旧時のフィールド10>
    • <復旧時のフィールド11>
    • <復旧時のフィールド12>
    • <復旧時のフィールド13>
    • <復旧時のフィールド14>
    • <復旧時のフィールド15>

例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=example&other=regex|template%20based%20in%20regexp|1||||pp|1||||10|0|||||||||||||3|8&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

例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|1||||||10|5||||00:00:00|15:00:00|||||||||||4|2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

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>
    • <フィールド4>
    • <フィールド5>
    • <フィールド6>
    • <フィールド7>
    • <フィールド8>
    • <フィールド9>
    • <フィールド10>
    • <フィールド11>
    • <フィールド12>
    • <フィールド13>
    • <フィールド14>
    • <フィールド15>
    • <復旧時のフィールド4>
    • <復旧時のフィールド5>
    • <復旧時のフィールド6>
    • <復旧時のフィールド7>
    • <復旧時のフィールド8>
    • <復旧時のフィールド9>
    • <復旧時のフィールド10>
    • <復旧時のフィールド11>
    • <復旧時のフィールド12>
    • <復旧時のフィールド13>
    • <復旧時のフィールド14>
    • <復旧時のフィールド15>

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_alert_template&id=18&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%202|field%20recovery%20example%203|1|8&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set delete_alert_template

アラートテンプレートと、テンプレートで使われているアラートを削除します。

書式:

  • op=set (必須)
  • op2=delete_alert_template (必須)
  • id=<テンプレートID> (必須) テンプレートIDでなければいけません。

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38

set delete_module_template

モジュールテンプレートを削除します。

書式:

  • op=set (必須)
  • op2=delete_module_template (必須)
  • id=<alert_template_module ID> (必須) alert_template_module のIDでなければいけません。

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38

set delete_module_template_by_names

モジュールテンプレートを削除します。

書式:

  • op=set (必須)
  • op2=delete_module_template_by_names (必須)
  • id=<エージェント名> (必須)
  • id2=<アラートテンプレート名> (必須)
  • other=<連続パラメータ> (必須) 次の順番でデータを指定します。
    • <モジュール名> (必須)
    • <エージェントの別名の利用> (値は 0 または 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

set stop_dowtime

計画停止を停止します。

書式:

  • op=set (必須)
  • op2=stop_downtime (必須)
  • id=<計画停止ID> (必須) 計画停止IDでなければいけません。

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1

set new_user

It creates a new user in Pandora FMS.

Pandora FMS に新たなユーザを作成します。

Call Syntax:

書式:

  • op=set (required).
  • op2=new_user (required).
  • id=< identification_user > (required).
  • other=< serialized_parameters > (all and each one are required) they are user configuration and data, serialized in the following order:
    1. < full_name > (replace spaces with %20 )
    2. < first_name >
    3. < surname >
    4. < middle_name >
    5. < e_mail >
    6. < phone_number >
    7. < comments >
    8. < time_autorefresh >
    9. < default_event_filter >
    10. < console_section >
  • op=set (必須)
  • op2=new_user (必須)
  • id=<ユーザ名> (必須)
  • other=<連続パラメータ> (必須) 次の順番でユーザ設定とデータを指定します。
    1. <フルネーム> (スペースは %20 に置き換えます)
    2. <名前>
    3. <名字>
    4. <ミドルネーム>
    5. <電子メールアドレス>
    6. <電話番号>
    7. <コメント>
    8. <自動更新時間>
    9. <デフォルトイベントフィルタ>
    10. <コンソールセクション>

If you lack any of the above thirteen fields simply type the separator (see call syntax) but in any case you must always place 13 separators.

上記の 13 個のフィールドのいずれかを指定しない場合は、セパレーターを入力するだけです (呼び出し書式 を参照)。

Example (see call syntax):

(書式を参照):

.../include/api.php?op=set&op2=new_user&id=id_nu&other=John%20J.%20Doe|John|Doe|Jay|1234|johndoe@example.com|5555555|en||30|||-1|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

Set update_user

指定した ID のユーザを指定したパラメータで更新します。

書式:

  • op=set (必須)
  • op2=update_user (必須)
  • id=<ユーザ名> (必須) ユーザ名でなければいけません。
  • other=<連続パラメータ> (必須) 次の順番で設定とデータを指定します。
    • <フルネーム>
    • <名前>
    • <名字>
    • <ミドルネーム>
    • <パスワード>
    • <電子メールアドレス>
    • <電話番号>
    • <言語>
    • <コメント>
    • <管理者>
    • <一画面の表示数>
    • <フラッシュグラフ>

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_|

set delete_user

Deletes a user by means of its identifier.

ID で指定したユーザを削除します。

Call syntax:

書式:

  • op=set (required).
  • op2=delete_user (required).
  • id=< id_user > (required) the identifier of the user to delete (User ID).
  • op=set (必須)
  • op2=delete_user (必須)
  • id=<ユーザID> (必須) 削除するユーザの ID です。

Example ( see call syntax):

(書式を参照):

../include/api.php?op=set&op2=delete_user&id=md&apipass=1234&user=admin&pass=pandora

Set delete_user_permissions

この機能はメタコンソールのみです。

ユーザのパーミッションを削除します。

書式:

  • op=set(必須)
  • op2=delete_user_permission(必須)
  • return_type=csv|json(必須)
  • other=id profile(必須)

ユーザのパーミッションを削除します。 Json または CSV にて返すことができます。この戻り値は URL を介して指定します。

http://localhost/pandora_console/include/api.php?op=set&op2=delete_user_permission&return_type=json&other=2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

Set add_permission_user_group

この機能はメタコンソールのみです。

ユーザグループへパーミッションを追加します。

書式:

  • op=set(必須)
  • op2=add_permission_user_to_group(必須)
  • return_type=csv|json(必須)
  • other=user id(必須)|group_id(必須)|profile id(必須)|No hierarchy(オプション)| profile id(オプション)

Json または CSV にて返すことができます。この戻り値は URL を介して指定します。

no_hierarchy が空の場合、値が 0 になることに注意してください。

既存のプロファイルを変更する場合は、profile_user テーブルのプロファイルIDが使用されることに注意してください。

http://localhost/pandora_console/include/api.php?op=set&op2=add_permission_user_to_group&return_type=json&other=admin|0|1|1|20&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set enable_disable_user

ユーザを無効化・有効化します。

書式:

  • op=set (必須)
  • op2=enable_disable_user (必須)
  • id=<ユーザ名> (必須) ユーザ名でなければいけません。
  • other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。

例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_|&apipass=1234&user=admin&pass=pandora

例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_|&apipass=1234&user=admin&pass=pandora

set meta_synch_user

Template:メタコンソール ノードへメタコンソールユーザを同期します。

書式:

  • 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)> (オプション)

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_|

set create_group

グループを作成します。

書式:

  • op=set (必須)
  • op2=create_group (必須)
  • id=<グループ名> (必須) グループ名を指定します。
  • other=<連続パラメータ> (必須) 次の順番で指定します。
    • <アイコン名>
    • <親グループID> (オプション)
    • <説明> (オプション)
    • <ACLの伝播> (オプション)
    • <アラートの無効化> (オプション)
    • <カスタムID> (オプション)
    • <連絡先> (オプション)
    • <その他> (オプション)
    • <グループ内の最大エージェント数> (必須, 0 は制限なしを意味します)
    • <パスワード付きでエージェントグループを作成> (オプション)

例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_|

例3 (パスワード “1234” かつ、グループ内のエージェント数制限 3 でエージェントグループを作成)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name&other=applications|2|||||||3|1234&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set update_group

グループの設定を更新します。

書式:

  • op=set (必須)
  • op2=update_group (必須)
  • id=<グループID> (必須) グループIDを指定します。
  • other=<連続パラメータ> (必須) 次の順番で指定します。
    • <グループ名>
    • <アイコン名>
    • <親グループID>
    • <説明>
    • <ACLの伝播>
    • <アラートの無効化>
    • <カスタムID>
    • <連絡先>
    • <その他>

 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

set delete_group

グループを削除します。

書式:

  • op=set (必須)
  • op2=update_group (必須)
  • id=<グループID> (必須) グループIDを指定します。

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora

set add_user_profile

ユーザにプロファイルを追加します。

書式:

  • op=set (必須)
  • op2=add_user_profile (必須)
  • id=<ユーザ名> (必須) ユーザ名でなければいけません。
  • other=<連続パラメータ> (必須) 次の順番でグループの設定、プロファイルを指定します。
    • <グループ>
    • <プロファイル>

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_|

set delete_user_profile

ユーザのプロファイルを削します。

書式:

  • op=set (必須)
  • op2=delete_user_profile (必須)
  • id=<ユーザ名> (必須) ユーザ名でなければいけません。
  • other=<連続パラメータ> (必須) 次の順番でグループおよびプロファイルを指定します。
    • <グループ>
    • <プロファイル>

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_|

set new_incident

新たなインシデントを作成します。

書式:

  • op=set (必須)
  • op2=new_incident (必須)
  • other=<連続パラメータ> (必須) 次の順番でインシデントの設定とデータを指定します。
    • <タイトル>
    • <説明>
    • <作成者>
    • <優先度>
    • <状態>
    • <グループ>

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_|

set new_note_incident

インシデントにコメントを追加します。

書式:

  • op=set (必須)
  • op2=new_note_incident (必須)
  • id=<インシデントID> (必須) インシデントのIDです。
  • id2=<ユーザ名> (必須) ユーザ名です。
  • other=<コメント> (必須) URLエンコードされたコメントです。

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

set validate_all_alerts

全アラートを承諾します。

書式:

  • op=set (必須)
  • op2=validate_all_alerts (必須)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts

set validate_all_policy_alerts

ポリシーから作成されたアラートを承諾します。

書式:

  • op=set (必須)
  • op2=validate_all_policy_alerts (必須)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts

set event_validate_filter

指定したフィルタにマッチするすべてのイベントを承諾します。

書式:

  • op=set (必須)
  • op2=event_validate_filter (必須)
  • other_mode=url_encode_separator_|(オプション)
  • other=<連続パラメータ> (オプション) 次の順番で指定します。
    • <セパレータ>
    • <重要度> 0 から 4
    • <エージェント名>
    • <モジュール名>
    • <アラートテンプレート名>
    • <ユーザ>
    • < 最小レベルの数値間隔> UNIXタイムスタンプ
    • < 最大レベルの数値間隔> UNIXタイムスタンプ
    • <エージェントの別名の利用> (値は 0 または 1 です)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2

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タイムスタンプ

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_|&other=;|2

set validate_event_by_id

指定した ID のイベントを承諾します。

書式:

  • op=set (必須)
  • op2=validate_event_by_id (必須)
  • id=<event_id> (必須) イベント ID です。

http://localhost/pandora_console/include/api.php?op=set&op2=validate_event_by_id&id=23&apipass=1234&user=admin&pass=pandora

set new_alert_template

テンプレートおよび、エージェントIDおよびモジュール名からモジュールを指定して、新たなアラートを適用します。

書式:

  • op=set (必須)
  • op2=new_alert_template (必須)
  • id=<エージェント名> (必須)
  • id2=<アラートテンプレート名> (必須)
  • other_mode=url_encode_separator_| (オプション)
  • other=<連続パラメータ> (必須) 次の順番で指定します。
    • <モジュール名> (必須)
    • <エージェントの別名の利用> (値は 0 または 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

set alert_actions

アラートにアクションを追加します。

書式:

  • op=set (必須)
  • op2=alert_actions (必須)
  • id=<エージェント名> (必須)
  • id2=<アラートテンプレート名> (必須)
  • other_mode=url_encode_separator_| (オプション)
  • other=<連続パラメータ> (必須) 次の順番で指定します。
    • <モジュール名> (必須)
    • <アクション名> (必須)
    • <開始アラート数> (オプション)
    • <終了アラート数> (オプション)
    • <エージェントの別名の利用> (値は 0 または 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

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>

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

set new_module

新たなモジュールを作成します。

書式:

  • op=set (必須)
  • op2=new_module (必須)
  • id=<エージェント名> (必須)
  • id2=<新たなモジュール名> (必須)
  • other_mode=url_encode_separator_| (オプション)
  • other=<連続パラメータ> (必須) 次の順番で指定します。
    • <ネットワークモジュールの種類> (必須)
    • <アクション名> (必須)
    • <IP または URL> (必須)
    • <ポート> (オプション)
    • <説明> (オプション)
    • <最小値> (オプション)
    • <最大値> (オプション)
    • <データ保存倍率> (オプション)
    • <モジュールの間隔> (オプション)
    • <警告の最小値> (オプション)
    • <警告の最大値> (オプション)
    • <障害の最小値> (オプション)
    • <障害の最大値> (オプション)
    • <データの保存> (オプション)
    • <不明イベントの有効化> (バージョン 5 のみ)
    • <エージェントの別名の利用> (値は 0 または 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

set delete_module

モジュールを削除します。

From version 768 onwards, if the module to be deleted (e.g. Host Alive ) is the parent of another module (“Cascading Protection Services” functionality), the child modules will also be deleted.

バージョン 768 以降、削除するモジュール (例: Host Alive ) が別のモジュールの (“関連障害検知抑制” が有効)である場合、 モジュールも削除されます。

Call syntax:

書式:

  • op=set (required).
  • op2=delete_module (obligatorio)
  • id=< agent name > (obligatorio).
  • id2=< module name > (obligatorio).
  • op=set (必須)
  • op2=delete_module (必須)
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)

Example (see call syntax):

例 (書式を参照):

.../include/api.php?op=set&op2=delete_module&id=example&id2=example2&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|

simulate parameter

simulate パラメータ

It is absolutely essential to use

other_mode=url_encode_separator_< separator >

with this parameter!

このパラメータを利用する場合は、以下を利用する必要があります。

other_mode=url_encode_separator_< セパレータ >

If you want to confirm if the agent exists and its module also exists, before executing the final deletion you can use the simulate parameter. If your test call is incorrect the PFMS API 1.0 will return the following message: Parameter error..

エージェントが存在し、そのモジュールも存在するかどうかを確認したい場合は、最終的な削除を実行する前にsimulate パラメータを使用できます。 テスト呼び出しが正しくない場合、Pandora FMS API 1.0 は次のメッセージを返します: Parameter error.

Example (see call syntax):

例 (書式を参照):

.../include/api.php?op=set&op2=delete_module&id=agent_name_example&id2=module_name_example&other=simulate&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set enable_alert

エージェントのアラートを有効化します。

書式:

  • op=set (必須)
  • op2=enable_alert
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other: アラートテンプレート名 (例: Warning イベント) (必須)

http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition

set enable_alert_alias

エイリアスでエージェントのアラートを有効化します。

書式:

  • op=set (必須)
  • op2=enable_alert_alias
  • id=<エージェントの別名> (必須)
  • id2=<モジュール名> (必須)
  • other: アラートテンプレート名 (p.e: 警告イベント) (必須)

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

set disable_alert

エージェントのアラートを無効化します。

書式:

  • op=set (必須)
  • op2=disable_alert
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other: アラートテンプレート名 (例: Warning イベント) (必須)

http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition

set disable_alert_alias

エージェントのアラートを無効化します。

書式:

  • op=set (必須)
  • op2=disable_alert_alias
  • id=<エージェントエイリアス> (必須)
  • id2=<モジュール名> (必須)
  • other: アラートテンプレート名 (例: 警告イベント) (必須)

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

set enable_module_alerts

enable_alert と同じです。

書式:

  • op=set (必須)
  • op2=enable_module_alerts
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 1 です)

http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status

set disable_module_alerts

disable_alert と同じです。

書式:

  • op=set (必須)
  • op2=disable_module_alerts
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 1 です)

http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status

set enable_module

モジュールを有効化します。

書式:

  • op=set (必須)
  • op2=enable_module
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 1 です)

http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status

set disable_module

モジュールを無効化します。

書式:

  • op=set (必須)
  • op2=disable_module
  • id=<エージェント名> (必須)
  • id2=<モジュール名> (必須)
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 1 です)

http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status

set create_network_module_from_component

コンポーネントから新たなネットワークモジュールを作成します。

書式:

  • op=set (必須)
  • op2=create_network_module_from_component (必須)
  • id=<エージェント名> (必須)
  • id2=<コンポーネント名> (必須)
  • other (オプション)=<エージェントの別名の利用> (値は 0 または 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

set module_data

モジュールに値を追加します。この機能は、サーバに送信するデータを含む XML を生成します。このデータはデータベースを更新するためのものです。

この API 呼び出しは、XML ファイルの生成を制御し、そのプロセスの状態をメッセージで表示します。

書式:

  • op=set (必須)
  • op2=module_data (必須)
  • id=<エージェントモジュールID> (必須)
  • other: モジュールのデータとタイムスタンプ
    • dato: Pandora のデータタイプ
    • tiempo: タイムスタンプ、“now” を指定できます。

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

XML ファイルの生成が成功しても、データがデータベースに保存されることは保証されません。

set new_module_group

新たなモジュールグループを作成します。

書式:

  • op=set (必須)
  • op2=new_module_group (必須)
  • id=<モジュールグループ名> (必須)

http://localhost/pandora_console/include/api.php?op=set&op2=new_module_group&id=Module_group_name&apipass=1234&user=admin&pass=pandora

set module_group_synch

Template:メタコンソール メタコンソールからモジュールグループを同期します。

書式:

  • op=set (必須)
  • op2=module_group_synch (必須)
  • other=<連続パラメータ> (必須) メタコンソールと同期するサーバの名前が必須です。
    • <server_name_1><server_name_2>…<server_name_n> (必須)

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

set add_module_in_conf

= 5.0 (エンタープライズ版のみ)

ローカルモジュールに設定を追加します。

書式:

  • op=set (必須)
  • op2=add_module_in_conf (必須)
  • id=<エージェントID> (必須)
  • id2=<モジュール名> (必須)
  • other: conf ファイルに書くモジュール設定を base64 でエンコードしたもの (必須)

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' を返します。

set delete_module_in_conf

= 5.0 (エンタープライズ版のみ)

ローカルモジュールの設定を削除します。

書式:

  • op=set (必須)
  • op2=add_module_in_conf (必須)
  • id=<エージェントID> (必須)
  • id2=<モジュール名> (必須)

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' を返します。

set update_module_in_conf

= 5.0 (エンタープライズ版のみ)

ローカルモジュールの設定を更新します。

書式:

  • op=set (必須)
  • op2=update_module_in_conf (必須)
  • id=<エージェントID> (必須)
  • id2=<モジュール名> (必須)
  • other: conf ファイル内のモジュール設定を置き換える内容を、base64 でエンコードしたもの。(必須)

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' を返します。

set module_custom_id

モジュール ID とカスタム ID の値をパラメータとして渡すことにより、カスタムID の値を設定または削除します。

書式:

  • op=set (必須)
  • op2=module_custom_id (必須)
  • id=id_agent_module (必須)
  • id2=カスタムIDの値、もしくは、削除する場合は何も指定しない (必須)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=module_custom_id&id=5&id2=1521&apipass=1234&user=admin&pass=pandora

set create_event

Pandora 内に新たなイベントを作成します。

This feature also works in Metaconsole.

この機能は、Metaconsole でも使えます。

Call syntaxis:

書式:

  • op=set (required).
  • op2=create_event (required).
  • other=< serialized_parameters > (required), they are the configuration and event data, serialized in the following order:
    • < event_text > (required, string type).
    • < id_group > (required, string type).
    • < id_agent> (required, numeric type).
    • < status > 0 New, 1 Validated, 2 In process.
    • < id_user >(numeric type).
    • < event_type > Any of the following values:
      • unknown
      • alert_fired
      • alert_recovered
      • alert_ceased
      • alert_manual_validation
      • system
      • error
      • new_agent
      • configuration_change
      • going_unknown
      • going_down_critical
      • going_down_warning
      • going_up_normal
    • < severity > Any of the following values:
      • 0 Maintenance.
      • 1 Informative.
      • 2 Normal.
      • 3 Warning.
      • 4 Critical.
      • 5 Minor.
      • 6 Major.
    • < id_agent_module > (numeric type).
    • < id_alert_am> ( ID Alert Module linked to event, numeric type).
    • < critical_instructions > (string type).
    • < warning_instructions > (string type).
    • < unknown_instructions > (string type).
    • < comment > (string type).
    • < owner_user_name > (string type).
    • < event_source > (string type).
    • < tags > (string type).
    • < custom_data> Custom data should be a base64 encoded JSON document.
    • < server_id > (only for Metaconsole) The id of the child node.
    • <id_extra> (alphanumeric type).
  • op=set (必須)
  • op2=create_event (必須)
  • other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
    • < イベントテキスト > (必須、文字列)
    • < グループ ID > (必須、文字列)
    • < エージェント ID> (必須、数値)
    • < 状態 > 0 新規, 1 承諾済, 2 処理中
    • < ユーザ ID >(数値)
    • < イベントタイプ > 以下の値のいずれか:
      • unknown
      • alert_fired
      • alert_recovered
      • alert_ceased
      • alert_manual_validation
      • system
      • error
      • new_agent
      • configuration_change
      • going_unknown
      • going_down_critical
      • going_down_warning
      • going_up_normal
    • < 重要度 > 以下の値のいずれか:
      • 0 メンテナンス
      • 1 情報
      • 2 正常
      • 3 警告
      • 4 障害
      • 5 マイナー
      • 6 メジャー
    • < エージェントモジュール ID > (数値)
    • < alert_am ID> ( イベントにリンクしたアラートモジュール ID、数値)
    • < 障害手順 > (文字列)
    • < 警告手順 > (文字列)
    • < 不明手順 > (文字列)
    • < コメント > (文字列)
    • < 所有者ユーザ名 > (文字列)
    • < イベントソース > (文字列)
    • < タグ > (文字列)
    • < カスタムデータ > base64 でエンコードした JSON 形式でなければいけません
    • < サーバ ID > (メタコンソールのみ) 子ノードの ID です。
    • <extra ID> (英数字)

Example ( see call syntaxis):

(書式を参照):

The event to be created has the following custom JSON data:

作成するイベントの JSON は次の通りとします。

{"Answer to the Ultimate Question of Life, the Universe, and Everything": 42}

The above is encoded in base64 and inserted in the call:

上記を base64 でエンコードし、次のように呼び出しに含めます。

../include/api.php?op=set&op2=create_event&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora&other=Event_name|0|1|0|admin|alert_fired|4|1|||||comment|admin||tags|eyJBbnN3ZXIgdG8gdGhlIFVsdGltYXRlIFF1ZXN0aW9uIG9mIExpZmUsIHRoZSBVbml2ZXJzZSwgYW5kIEV2ZXJ5dGhpbmciOiA0Mn0=||12

set add_event_comment

イベントにコメントを追加します。

これはメタコンソールでも利用できます。

書式:

  • op=set (必須)
  • op2=create_event (必須)
  • other=<連続パラメータ> (必須) 次の順番でイベントデータを指定します:
    • <コメント> (必須)

メタコンソールで利用するには、“string” の後に “true” をパラメータで指定してください。

  • ノード
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

set update_event

API を通してイベントを更新します。

この機能は、メタコンソールでも利用できます。

書式:

  • op=set (必須)
  • op2=event (必須)
  • id=event_id (必須)
  • other=<連続パラメータ> (必須) field.value フォーマットおよび url_encode_separator (例: |) で分割した、更新するイベントフィールド
  • <comment> (必須)

設定可能フィールド

  • estado: イベントの状態表す数値。以下を指定可能です。
    • 0 (新規)
    • 1 (承諾済)
    • 2 (処理中)
  • evento: イベント名。
  • event_type: イベントタイプ。以下を指定可能です。
    • going_unknown
    • unknown
    • alert_fired
    • alert_recovered
    • alert_ceased
    • alert_manual_validation
    • recon_host_detected
    • system
    • error
    • new_agent
    • going_up_warning
    • going_up_critical
    • going_down_warning
    • going_down_normal
    • going_down_critical
    • going_up_normal
    • configuration_change
  • criticity: イベントの重要度を表す数値。以下を指定可能です。
    • 0 (メンテナンス)
    • 1 (情報)
    • 2 (正常)
    • 3 (マイナー)
    • 4 (警告)
    • 5 (メジャー)
    • 6 (障害)
    • 20 (警告または障害)
    • 21 (正常以外)
    • 34 (障害または正常)
  • tags: イベントに関連付けられたタグ。
  • source: イベントのデータソース。
  • id_extra: この機能を使用すると、新しいイベントと同じ追加 ID を持つ古いイベントが自動的に承諾されます。
  • critical_instructions: モジュールが障害状態になったときに実行するアクションに関するオペレーター向けの手順。モジュールが障害状態の場合にのみイベントに表示されます。
  • warning_instructions: モジュールが警告状態になったときに実行するアクションに関するオペレーター向けの手順。モジュールが警告状態の場合にのみイベントに表示されます。
  • unknown_instructions: モジュールが不明状態になったときに実行するアクションに関するオペレーター向けの手順。モジュールが不明状態の場合にのみイベントに表示されます。
  • owner_user: イベントに割り当てられたユーザ。
  • custom_data: カスタム情報をイベントに追加できます。base64 でエンコードされた json フォーマット(例: {“field1”:“value1”,“field2”:“value2”}) である必要があります。以下の例を参照ください。
  • module_status: イベントを発生させたモジュールの状態を表す数値です。以下を指定可能です。
    • 0 (正常)
    • 1 (障害)
    • 2 (警告)
    • 3 (不明)
    • 4 (未初期化)

  • ノード:
http://192.168.80.190/pandora_console/include/api.php?op=set&op2=event&apipass=pandora&user=admin&pass=pandora&id=175&other_mode=url_encode_separator_|&other=estado,2|evento,Updated event|custom_data,eyJmaWVsZDEiOiJ2YWx1ZTEiLCJmaWVsZDIiOiJ2YWx1ZTIifQo=
  • メタコンソール:
http://192.168.80.35/pandora_console/include/api.php?op=set&op2=event&apipass=1234&user=admin&pass=pandora&id=315132&other_mode=url_encode_separator_|&other=estado,0|owner_user,operator|evento,Updated event

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) (必須)

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_|

set create_custom_field

= 5.0

新たなカスタムフィールドを作成します。

書式:

  • op=set (必須)
  • op2=create_custom_field (必須)
  • other=<連続パラメータ> (必須) カスタムフィールドを設定するパラメータ
    • <名前> (必須)
    • <フロント表示フラグ> (必須; 0:操作画面でフィールドを表示しない。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

set create_tag

= 5.0

新たなタグを作成します。

書式:

  • op=set (必須)
  • op2=create_tag (必須)
  • other=<連続パラメータ> (必須) タグの設定パラメータ
    • <名前> タグ名 (必須)
    • <説明> タグの説明
    • <url> タグの URL
    • <email> タグのメールアドレス

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

set enable_disable_agent

エージェントを有効化/無効化します。

書式:

  • op=set (必須)
  • op2=enable_disable_agent (必須)
  • id=<エージェントID> (必須) エージェントIDでなければいけません。
  • other=<フラグ> (必須) 有効化する場合は 1、無効化する場合は 0 を指定します。

例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

set gis_agent_only_position

= 5.0

エージェントに、新たな GIS 位置情報を追加します。

書式:

  • op=set (必須)
  • op2=gis_agent_only_position (必須)
  • id=<id> (必須) エージェントID
  • other=<連続パラメータ> (必須) 位置情報パラメータ
    • <緯度>
    • <経度>
    • <高度>

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

set gis_agent

= 5.0

エージェントに gis データを追加します。

書式:

  • op=set (必須)
  • op2=gis_agent_only_position (必須)
  • id=<id> (必須) エージェントID
  • other=<連続パラメータ> (必須) gisデータ
    • <緯度>
    • <経度>
    • <高度>
    • <新たなgisデータの無視>
    • <手動位置決め>
    • <開始タイムスタンプ>
    • <終了タイムスタンプ>
    • <データ数>
    • <履歴保存の説明>
    • <gis更新の説明>
    • <初回挿入の説明>

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_|&other=2%7C2%7C0%7C0%7C0%7C2000-01-01+01%3A01%3A01%7C0%7C666%7Caaa%7Cbbb%7Cccc

set reset_agent_counts

エージェントのモジュールおよびアラートカウントを更新します。

書式:

  • op=set (必須)
  • op2=reset_agent_counts (必須)
  • id=<id_agent> (必須) エージェント ID もしくは “All” である必要があります。

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=reset_agent_counts&apipass=1234&user=admin&pass=pandora&id=All

set create_special_day

= 5.1

新たな特別日を追加します。

書式:

  • op=set (必須)
  • op2=update_special_day (必須)
  • id=<id> (必須) エージェントID
  • other=<連続パラメータ> (必須)
    • <特別日>
    • <同一の日>
    • <説明>
    • <グループID>

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

set update_special_day

= 5.1

定義済の特別日の設定を更新します。

書式:

  • op=set (必須)
  • op2=update_special_day (必須)
  • id=<特別日ID> (compulsory)
  • other=<連続パラメータ> (必須)
    • <特別日>
    • <同一の日>
    • <説明>
    • <グループID>

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

set delete_special_day

= 5.1

特別日を削除。

書式:

  • op=set (必須)
  • op2=update_special_day (必須)
  • id=<特別日ID> (必須)

http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1

set pagerduty_webhook

= 5.1

Pandora FMS アラートと PagerDuty 通知を接続します。PagerDuty サービスの webhooks オプションを、PagerDuty からアラートを承諾した場合の動作に対して、あらかじめ PagerDuty にリンクさせた Pandora FMS のアラートの承諾に設定します。

書式:

  • op=set (必須)
  • op2=pagerduty_webhook (必須)
  • id=alert (必須)

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=pagerduty_webhook&apipass=1234&user=admin&pass=pandora&id=alert

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> (必須)

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

set tag

= 6

pandora にタグを追加します。

書式:

  • op=set (必須)
  • op2=tag (必須)
  • id=name (必須)
  • other_mode=url_encode_separator_| (必須)
  • other=<description>|<url>|<email>|<phone>

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|test@artica.es|01189998819991197253

set add_tag_module

= 6

モジュールにタグを追加します。

書式:

  • op=set (必須)
  • op2=add_tag_module (必須)
  • id=id_module (必須)
  • id2=id_tag (必須)

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

set remove_tag_module

= 6

モジュールのタグを削除します。

書式:

  • op=set (必須)
  • op2=add_tag_module (必須)
  • id=id_module (必須)
  • id2=id_tag (必須)

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

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>

この呼び出しが正しく動作するためには、日付のフォーマットは MM/DD/YYYY である必要があります。

一回:

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_|

set planned_downtimes_additem

= 5.1

計画停止に対象エージェント(および対象モジュール)を追加します

書式:

  • op=set
  • op2=planned_downtimes_additem
  • id=<計画停止ID>
  • other=<連続パラメータ> (必須) 追加対象
  • <エージェントID1;エージェントID2;エージェントID3;…エージェントIDn>
  • <モジュール名1;モジュール名2;モジュール名3;…モジュール名n>

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_|

set planned_downtimes_deleted

= 5.1

計画停止を削除します。

書式:

  • op=set
  • op2=planned_downtimes_deleted
  • id=<計画停止ID>

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_deleted&apipass=1234&user=admin&pass=pandora&id=10

set create_synthetic_module

= 5.1SP4

新たな統合モジュールを作成します。

書式:

  • op=set
  • op2=create_synthetic_module
  • id=モジュールを追加するエージェント名
  • id2=<エージェントの別名の利用>
  • other=<モジュール名><統合タイプ><エージェント名;演算タイプ;モジュール名> または <エージェント名;モジュール名> または <演算タイプ;値>
  • モジュールのデータ:
演算設定の場合で、エージェントとモジュール名を指定して演算タイプを指定しない場合: <エージェント名;モジュール名>、値を指定する場合: <演算タイプ;値>. それ以外: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値>
 平均: <エージェント名;演算タイプ;モジュール名> または <演算タイプ;値>
  • *演算タイプ:
  演算: ADD, SUB, MUL, DIV
  平均: AVG のみ

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_|

set create_service

= 7

新たなサービスを作成します。

書式:

  • op=set
  • op2=create_service
  • id=サービスID
  • other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;

<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;

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

set update_service

= 7

サービスを更新します。

書式:

  • op=set
  • op2=update_service
  • id=サービスID
  • other=<名前>;<説明>;<グループID>;<障害>;<警告>;<エージェントID>;<SLA間隔>;<SLA制限>;

<警告モジュールアラートテンプレートID>;<障害モジュールアラートテンプレートID>;<障害モジュールSLAアラートテンプレートID>;

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

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 です。

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

set metaconsole_synch

= 7

ライセンスキーをメタコンソールへ追加し、ノードへ同期します。

  • op=set
  • op2=metaconsole_synch
  • id=License key

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

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

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

set new_cluster

= 7.0

エージェントのクラスタを作成します。

異なるノードを監視するためのエージェントとアイテムを持つ監視クラスタを作成します。

書式:

  • op=set
  • op2=new_cluster
  • other=クラスタ名| クラスタタイプ| 説明| グループID
  • other_mode=url_encode_separator_

 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

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
  }
]

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_agent&other=WwogIHsKICAgICJpZCI6IDUsCiAgICAiaWRfYWdlbnQiOiAyCiAgfSwKICB7CiAgICAiaWQiOiA1LAogICAgImlkX2FnZW50IjogMwogIH0KXQ==&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

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
  }
]

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=WwogIHsKICAgICJuYW1lIjogIlN3YXBfVXNlZCIsCiAgICAiaWRfY2x1c3RlciI6IDUsCiAgICAidHlwZSI6ICJBQSIsCiAgICAiY3JpdGljYWxfbGltaXQiOiA4MCwKICAgICJ3YXJuaW5nX2xpbWl0IjogNjAKICB9LAogIHsKICAgICJuYW1lIjogIlRDUF9Db25uZWN0aW9ucyIsCiAgICAiaWRfY2x1c3RlciI6IDUsCiAgICAidHlwZSI6ICJBQSIsCiAgICAiY3JpdGljYWxfbGltaXQiOiA4MCwKICAgICJ3YXJuaW5nX2xpbWl0IjogNjAKICB9Cl0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

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
  }
]

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=WwogIHsKICAgICJuYW1lIjogIkRpc2tVc2VkXy9wcm9jL2tjb3JlIiwKICAgICJpZF9jbHVzdGVyIjogNSwKICAgICJ0eXBlIjogIkFQIiwKICAgICJpc19jcml0aWNhbCI6IDEKICB9LAogIHsKICAgICJuYW1lIjogIkRpc2tVc2VkXy9wcm9jL3NjaGVkX2RlYnVnIiwKICAgICJpZF9jbHVzdGVyIjogNSwKICAgICJ0eXBlIjogIkFQIiwKICAgICJpc19jcml0aWNhbCI6IDEKICB9Cl0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set delete_cluster

= 7.0

クラスタを削除します。

書式:

  • op=set
  • op2=delete_cluster
  • id=<削除するクラスタID>

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster&id=7&apipass=1234&user=admin&pass=pandora

set delete_cluster_agents

= 7.0

クラスタからエージェントを削除します。

書式:

  • op=set
  • op2=delete_cluster_agents
  • Other=JSON format with elements (see structure below)
  • other_mode=url_encode_separator_
  • op=set
  • op2=delete_cluster_agents
  • Other=要素を含んだ JSON フォーマット (以下の構造を参照ください)
  • other_mode=url_encode_separator_

json の構造は次のようになっている必要があります。

[
  {
    "id": 5,
    "id_agent": 2
  },
  {
    "id": 5,
    "id_agent": 3
  }
]

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_agents&other=WwogIHsKICAgICJpZCI6IDUsCiAgICAiaWRfYWdlbnQiOiAyCiAgfSwKICB7CiAgICAiaWQiOiA1LAogICAgImlkX2FnZW50IjogMwogIH0KXQ==&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora

set delete_cluster_item

= 7.0

クラスタからアイテムを削除します。

書式:

  • op=set
  • op2=delete_cluster_item
  • id=<削除するアイテムID>

 http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_item&id=9&apipass=1234&user=admin&pass=pandora

set create_policy

= 7.0. 725

ポリシーを作成します。 ポリシー名を指定する必要があります。複数設定はできません。また、グループ ID がデータベースに存在する必要があります。

書式:

  • op=set
  • op2=create_policy
  • other=ポリシー名(必須) | グループID(必須) | 説明;
  • other_mode=url_encode_separator_|
  • return_type=(string, csv, json).

http://localhost/pandora_console/include/api.php?op=set&op2=create_policy&apipass=1234&user=admin&pass=pandora&other=name%20Policy|11|this%20description&other_mode=url_encode_separator_|&return_type=json

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).

http://localhost/pandora_console/include/api.php?op=set&op2=update_policy&apipass=1234&user=admin&pass=pandora&id=17&other=policy2|11|this%20description&other_mode=url_encode_separator_|&return_type=json

set delete_policy

= 7.0. 725

ポリシーを削除します。存在するポリシー ID を指定する必要があります。0(失敗した場合) または、1(成功した場合) を返します。

書式:

  • op=set
  • op2=delete_policy
  • id=ポリシーID
  • return_type=(string, csv, json).

http://localhost/pandora_console/include/api.php?op=set&op2=delete_policy&apipass=1234&user=admin&pass=pandora&id=10&return_type=json

set add_collections_policy

= 7.0. 725

ポリシーにコレクションを追加します。存在するポリシー ID と、コレクションの名前または短い名前を指定する必要があります。いずれも必須です。 0(失敗した場合) または、ポリシーへ追加したコレクション ID (成功した場合) を返します。

書式:

  • op=set
  • op2=add_collections_policy
  • id=ポリシー ID
  • id2=名前または短い名前
  • return_type=(string, csv, json).

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

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).

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.

set create_plugins_policy

= 7.0. 725

ポリシーにプラグインを追加します。

  • 存在するポリシーIDを指定する必要があります。
  • 実行するプラグイン文字列を指定する必要があります。

0(失敗) または、ポリシーへ追加したプラグイン ID (成功)を返します。

書式:

  • op=set
  • op2=create_plugins_policy
  • id=ポリシーID
  • id2=テキスト文字列
  • return_type=(string, csv, json).

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

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).

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

set linking_policy

= 7.0. 725

ポリシーに未リンクのモジュールをリンクします。

  • 未リンクのエージェントモジュール ID を指定する必要があります。

0(失敗) または 1(成功) を返します。

書式:

  • op=set
  • op2=linking_policy
  • id=エージェントモジュールID
  • return_type=(string, csv, json).

http://localhost/pandora_console/include/api.php?op=set&op2=linking_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=28

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).

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|2|1|cpu%20load&other_mode=url_encode_separator_|

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).

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|1&other_mode=url_encode_separator_|

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).

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

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).

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|2&other_mode=url_encode_separator_|

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).

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

set remove_agents_policy

= 7.0. 725

ポリシーからエージェントを削除します。

  • 存在するポリシーIDを指定する必要があります。
  • 存在するエージェントIDを指定する必要があります。

書式:

  • op=set
  • op2=remove_agents_policy
  • id=ポリシーID
  • id2=エージェントID
  • return_type=(string, csv, json).

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

set add_groups_policy

= 7.0. 725

ポリシーのグループを追加します。

  • 存在するポリシーIDを指定する必要があります。
  • 存在するグループIDを指定する必要があります。

書式:

  • op=set
  • op2=add_groups_policy
  • id=ポリシーID
  • id2=グループID
  • return_type=(string, csv, json).

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

set remove_groups_policy

= 7.0. 725

ポリシーからグループを削除します。

  • 存在するポリシーIDを指定する必要があります。
  • 存在するグループIDを指定する必要があります。

書式:

  • op=set
  • op2=add_groups_policy
  • id=ポリシーID
  • id2=グループID
  • return_type=(string, csv, json).

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

set create_os

= 7.0. 727

パラメータで渡したデータで OS を作成します。

書式:

  • op=set (必須)
  • op2=create_os (必須)
  • other=<連続パラメータ> (必須) 次の順番で指定するデータです。
    • <名前>
    • <説明>
    • <アイコン>

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

set update_os

= 7.0. 727

パラメータで渡したデータで OS を更新します。

書式:

  • op=set (必須)
  • op2=create_os (必須)
  • other=<連続パラメータ> (必須) 次の順番で指定するデータです。
    • <名前>
    • <説明>
    • <アイコン>

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

set disabled_and_standby

= 7.0. 728

エージェントを無効化し、またリモート設定がある場合はスタンバイモードにします。

書式:

  • op=set (必須)
  • op2=disabled_and_standby (必須)
  • id=<エージェント ID> (必須) メタコンソールでは tagente の ID で、つまりノード ID です。
  • id2=<ノード ID> (メタコンソールでは必須、ノードでは不要)
  • other=<値> (オプション) 新たな状態(0 で有効化、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

set validate_traps

= 7.0. 728

トラップの承諾をします。

  • op=set
  • op2=validate_traps
  • id=トラップID

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

set delete_traps

= 7.0. 728

トラップを削除します。

  • op=set
  • op2=delete_traps
  • id=トラップID

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

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 監査で登録およびチェックされ、アプリケーション内のユーザのアクセス状況をチェックします。

  • <管理者アクセスのみ>

非管理者ユーザのアクセスを禁止します。

例 (適応環境が必要)

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

set create_event_response

新たなイベント応答を作成します。

Syntax:

書式:

  • op=set (required).
  • op2=create_event_response (required).
  • return_type=csv or return_type=json (one of two required)
  • other=< serialized parameters > (all required). In the following order:
    • < name >
    • < description >
    • < target > : If the forth parameter (< type >) is command, here it is necessary to indicate the desired command to execute the response to the event. On the other hand, if it is url, indicate the URL you wish to access as a response to the event.
    • < type > : command or url.
    • < group id > The user must have permissions over the indicated group.
    • < modal window width > In pixels.
    • < modal window height > In pixels.
    • < new window > 1 or 0. It indicates whether the URL is shown on a new window (1) or on a modal window (0).
    • < command timeout > Time for wait a response in seconds.
    • < parameters > Parameters that complement the execution of the command.
    • < server id > Id of the server in which the command is to be executed. For the local console, the value is 0.
  • op=set (必須)
  • op2=create_event_response (必須)
  • return_type=csv または return_type=json (いずれか必須)
  • other=<連続パラメータ> (以下の順番ですべて必須):
    • <名前>
    • <説明>
    • <対象> 4つ目のパラメータ (<タイプ>) が command の場合、ここでは、イベントへの応答を実行するために必要なコマンドを指定する必要があります。一方、url の場合は、イベントへの応答としてアクセスしたい URL を指定する必要があります。
    • <タイプ> command または url.
    • <グループID> 指定したグループに対してユーザがアクセス権を持っている必要があります。
    • <モーダルウインドウの幅> ピクセル単位。
    • <モーダルウインドウの高さ> ピクセル単位。
    • <新規ウインドウ> 1 または 0URL を新規ウインドウで表示する(1)か、モーダルウインドウで表示する(0)かを指定します。
    • <コマンドタイムアウト> 秒単位での応答時間です。
    • <パラメータ> コマンドの実行を補完するパラメータ。
    • <サーバ ID> コマンドを実行するサーバの ID。ローカルコンソールの場合、値は 0 です。

Example (see call syntax):

例 ( 書式を参照):

/include/api.php?op=set&op2=create_event_response&other=response|description%20response|touch|command|0|650|400|0|response|0|90&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

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 です。

http://localhost/pandora_console/include/api.php?op=set&op2=update_event_response&id=5&other=response|description%20response|touch|command|0|650|400|0|response|0|90&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set delete_event_response

イベント応答を削除します。イベント応答の削除にはそれが所属するグループにユーザがアクセスできる権限を持っている必要があります。

書式:

  • op=set (必須)
  • op2=delete_event_reponse (必須)
  • return_type=csv|json
  • id=<イベント応答ID> (必須)

http://localhost/pandora_console/include/api.php?op=set&op2=delete_event_response&id=7&apipass=1234&user=admin&pass=pandora

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.

どの権限を有効化すべきかは、こちらを参照してください。

この例では、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

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.

どの権限を有効化すべきかは、こちらを参照してください。

以下の例では、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

set delete_user_profile_info

ユーザプロファイルを削除します。また該当のプロファイルのユーザへの割り当ても削除します。

書式:

  • op=set (必須)
  • op2=delete_user_profile_info (必須)
  • return_type=csv|json
  • id=<削除するプロファイルID> (必須)

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

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>

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

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>

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

set delete_event_filter

イベントフィルタを削除します。

書式:

  • op=set (必須)
  • op2=delete_event_filter (必須)
  • id=<event_filter_id> (必須) 存在するイベントフィルタ ID でなければいけません。

http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_event_filter&id=38&apipass=1234&user=admin&pass=pandora

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

この例では、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

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

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

set delete_inventory_module

インベントリモジュールを削除します。

書式:

  • op=set (必須)
  • op2=delete_inventory_module (必須)
  • return_type=csv|json
  • id=<inventory module ID> (必須)

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

set create_collection

コレクションを作成します。

書式:

  • op=set (必須)
  • op2=create_collection (必須)
  • other=<連続パラメータ> (必須) コレクションを作成するための連続パラメータ
  • <name>
  • <short_name>
  • <id_group>
  • <description>

連続パラメータのセパレータを渡すために、次のように 'other_mode' が必要です: other_mode=url_encode_separator_<separator>

http://localhost/pandora_console/include/api.php?op=set&op2=create_collection&other=test_plugin|test_p|0|test&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set delete_collection

コレクションを削除します。

書式:

  • op=set (必須)
  • op2=delete_collection (必須)
  • id=id_collection (必須)

http://localhost/pandora_console/include/api.php?op=set&op2=delete_collection&id=15&apipass=1234&user=admin&pass=pandora

set enable_disable_discovery_task

自動検出タスク一覧 にあるタスクを有効化または無効化します。

書式:

  • op=set (必須)
  • op2=enable_disable_discovery_task (必須)
  • id=task identifier (必須)
  • other=1 で無効化、0 で有効化

http://localhost/pandora_console/include/api.php?op=set&op2=enable_disable_discovery_task&id=1&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora

set create_module_policy_json

Adds a Module to the target policy by means of a definition made in JSON format.

JSON 形式で作成された定義を使用して、モジュールをターゲットポリシーに追加します。

Call syntax:

書式:

  • op=set (required)
  • op2=create_module_policy_json (required)
  • id=policy id (required)
  • other =JSON encoded base64 with the module definition. Possible fields (JSON pseudo format):
  • op=set (必須)
  • op2=create_module_policy_json (必須)
  • id=ポリシーID (必須)
  • other =モジュール定義の base64 エンコードした JSON。フィールド(JSONフォーマット)は以下の通りです。
{
name: <value>, // mandatory
id_module: <value>, // mandatory
id_tipo_modulo: <value>, // mandatory
configuration_data: <value>,
description: <value>,
unit: <value>,
max: <value>,
min: <value>,
module_interval: <value>,
ip_target: <value>,
tcp_port: <value>,
tcp_send: <value>,
tcp_rcv: <value>,
snmp_community: <value>,
snmp_oid: <value>,
id_module_group: <value>,
flag: <value>,
disabled: <value>,
id_export: <value>,
plugin_user: <value>,
plugin_pass: <value>,
plugin_parameter: <value>,
id_plugin: <value>,
post_process: <value>,
prediction_module: <value>,
max_timeout: <value>,
max_retries: <value>,
custom_id: <value>,
history_data: <value>,
min_warning: <value>,
max_warning: <value>,
str_warning: <value>,
min_critical: <value>,
max_critical: <value>,
str_critical: <value>,
min_ff_event: <value>,
custom_string_1: <value>,
custom_string_2: <value>,
custom_string_3: <value>,
custom_integer_1: <value>,
custom_integer_2: <value>,
pending_delete: <value>,
critical_instructions: <value>,
warning_instructions: <value>,
unknown_instructions: <value>,
critical_inverse: <value>,
warning_inverse: <value>,
id_category: <value>,
module_ff_interval: <value>,
quiet: <value>,
cron_interval: <value>,
macros: <value>,
disabled_types_event: {
"going_unknwon": 1, // Disable going unknown events.
},
module_macros: <value>,
min_ff_event_normal: <value>,
min_ff_event_warning: <value>,
min_ff_event_critical: <value>,
ff_type: <value>,
each_ff: <value>,
ff_timeout: <value>,
dynamic_interval: <value>,
dynamic_max: <value>,
dynamic_min: <value>,
dynamic_next: <value>,
dynamic_two_tailed: <value>,
prediction_sample_window: <value>,
prediction_samples: <value>,
prediction_threshold: <value>,
cps: <value>,
}

Examples

In JSON format before converting to base64:

base64 へ変換する前の JSON フォーマット:

{
  "id_tipo_modulo": 1,
  "id_modulo": 10,
  "name": "sample module",
  "description": "Module created by API",
  "configuration_data": "module_begin\nmodule_name sample module\nmodule_type generic_data\nmodule_exec echo 1\nmodule_end",
  "min_warning": 2,
  "max_warning": 5,
  "min_critical": 5,
  "max_critical": 7
}

Once base64 encoded:

base64 へのエンコード後:

http://localhost/pandora_console/include/api.php?op=set&op2=create_module_policy_json&id=1&other=ewogICJpZF90aXBvX21vZHVsbyI6IDEsCiAgImlkX21vZHVsbyI6IDEwLAogICJuYW1lIjogInNhbXBsZSBtb2R1bGUiLAogICJkZXNjcmlwdGlvbiI6ICJNb2R1bGUgY3JlYXRlZCBieSBBUEkiLAogICJjb25maWd1cmF0aW9uX2RhdGEiOiAibW9kdWxlX2JlZ2luXG5tb2R1bGVfbmFtZSBzYW1wbGUgbW9kdWxlXG5tb2R1bGVfdHlwZSBnZW5lcmljX2RhdGFcbm1vZHVsZV9leGVjIGVjaG8gMVxubW9kdWxlX2VuZCIsCiAgIm1pbl93YXJuaW5nIjogMiwKICAibWF4X3dhcm5pbmciOiA1LAogICJtaW5fY3JpdGljYWwiOiA1LAogICJtYXhfY3JpdGljYWwiOiA3Cn0=&apipass=pandora&user=admin&pass=pandora

set update_module_policy_json

Update a existing Module to the target policy by means of a definition made in JSON format.

JSON 形式で作成された定義を使用して、ターゲットポリシーの既存のモジュールを更新します。

Call syntax:

書式:

  • op=set (required)
  • op2=update_module_policy_json (required)
  • id=policy id (required)
  • other =JSON encoded base64 with the module definition. Possible fields (JSON pseudo format):
  • op=set (必須)
  • op2=update_module_policy_json (必須)
  • id=ポリシーID (必須)
  • other =モジュール定義をbase64 でエンコードした JSON。フィールド(JSON フォーマット)は次の通りです。
{
name: <value>, // mandatory
id_module: <value>, // mandatory
id_tipo_modulo: <value>, // mandatory
configuration_data: <value>,
description: <value>,
unit: <value>,
max: <value>,
min: <value>,
module_interval: <value>,
ip_target: <value>,
tcp_port: <value>,
tcp_send: <value>,
tcp_rcv: <value>,
snmp_community: <value>,
snmp_oid: <value>,
id_module_group: <value>,
flag: <value>,
disabled: <value>,
id_export: <value>,
plugin_user: <value>,
plugin_pass: <value>,
plugin_parameter: <value>,
id_plugin: <value>,
post_process: <value>,
prediction_module: <value>,
max_timeout: <value>,
max_retries: <value>,
custom_id: <value>,
history_data: <value>,
min_warning: <value>,
max_warning: <value>,
str_warning: <value>,
min_critical: <value>,
max_critical: <value>,
str_critical: <value>,
min_ff_event: <value>,
custom_string_1: <value>,
custom_string_2: <value>,
custom_string_3: <value>,
custom_integer_1: <value>,
custom_integer_2: <value>,
pending_delete: <value>,
critical_instructions: <value>,
warning_instructions: <value>,
unknown_instructions: <value>,
critical_inverse: <value>,
warning_inverse: <value>,
id_category: <value>,
module_ff_interval: <value>,
quiet: <value>,
cron_interval: <value>,
macros: <value>,
disabled_types_event: {
"going_unknwon": 1, // Disable going unknown events.
},
module_macros: <value>,
min_ff_event_normal: <value>,
min_ff_event_warning: <value>,
min_ff_event_critical: <value>,
ff_type: <value>,
each_ff: <value>,
ff_timeout: <value>,
dynamic_interval: <value>,
dynamic_max: <value>,
dynamic_min: <value>,
dynamic_next: <value>,
dynamic_two_tailed: <value>,
prediction_sample_window: <value>,
prediction_samples: <value>,
prediction_threshold: <value>,
cps: <value>,
}

Examples

In JSON format before converting to base64:

base64 へ変換する前の JSON フォーマット:

{
  "id_tipo_modulo": 1,
  "id_modulo": 1,
  "name": "name edited",
  "description": "Module created by API",
  "configuration_data": "module_begin\nmodule_name sample module\nmodule_type generic_data\nmodule_exec echo 1\nmodule_end",
  "min_warning": 3,
  "max_warning": 6,
  "min_critical": 6,
  "max_critical": 8
}

Once base64 encoded:

base64 へのエンコード後:

http://localhost/pandora_console/include/api.php?op=set&op2=update_module_policy_json&id=1&id2=43&other=ewogICJpZF90aXBvX21vZHVsbyI6IDEsCiAgImlkX21vZHVsbyI6IDEsCiAgIm5hbWUiOiAibmFtZSBlZGl0ZWQiLAogICJkZXNjcmlwdGlvbiI6ICJNb2R1bGUgY3JlYXRlZCBieSBBUEkiLAogICJjb25maWd1cmF0aW9uX2RhdGEiOiAibW9kdWxlX2JlZ2luXG5tb2R1bGVfbmFtZSBzYW1wbGUgbW9kdWxlXG5tb2R1bGVfdHlwZSBnZW5lcmljX2RhdGFcbm1vZHVsZV9leGVjIGVjaG8gMVxubW9kdWxlX2VuZCIsCiAgIm1pbl93YXJuaW5nIjogMywKICAibWF4X3dhcm5pbmciOiA2LAogICJtaW5fY3JpdGljYWwiOiA2LAogICJtYXhfY3JpdGljYWwiOiA4Cn0=&apipass=pandora&user=admin&pass=pandora

set event_custom_id

To set a custom identifier in an event.

イベントにカスタム ID を設定します。

Call syntax:

書式:

  • op=get (required).
  • op2=set (required).
  • id= < id_event > (required, numerical value).
  • id2= < id_custom_event > (required, alphanumeric value).
  • op=get (必須)
  • op2=set (必須)
  • id= < id_event > (必須、数値)
  • id2= < id_custom_event > (必須、文字列)

Example (see call syntax):

例 (書式 を参照):

/include/api.php?op=set&op2=event_custom_id&id=110&id2=9999&apipass=1234&user=admin&pass=pandora

Pandora API を呼び出すためのいくつかの言語での例です。

<?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>";
}
?>
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()
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");
}
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
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
[-]>[-]<
>+++++++++[<+++++++++>-]<-.
>+++++[<+++++>-]<----.
>++++[<++++>-]<---.
>++++[<---->-]<++.
>+++[<+++>-]<++.
-.
>++++++++[<-------->-]<--.
>+++[<--->-]<---.
>++++++++[<++++++++>-]<++++.
+.
>++++++++[<-------->-]<-----.
>+++++++++[<+++++++++>-]<----.
++.
--.
>+++[<--->-]<+.
>+++[<+++>-]<.
>++[<++>-]<++.
>++[<-->-]<-.
>+++++++++[<--------->-]<++.
>+++++++++[<+++++++++>-]<---.
+.
>+++++++++[<--------->-]<++.
>+++++++++[<+++++++++>-]<+++.
>++++[<---->-]<+.
>+++[<+++>-]<.
>+++[<--->-]<++.
>+++[<+++>-]<-.
>+++++++++[<--------->-]<++.
>+++++++++[<+++++++++>-]<+++.
>+++[<--->-]<--.
----.
>+++[<+++>-]<-.
+++.
-.
>+++++++++[<--------->-]<++.
>+++++++++[<+++++++++>-]<-.
>++++[<---->-]<+.
>++++[<++++>-]<+.
>++++[<---->-]<-.
>++++++++[<-------->-]<-.
>++++++++[<++++++++>-]<++++++++.
>+++[<--->-]<++.
++.
++.
>++++[<++++>-]<---.
>++[<-->-]<--.
+++.
>++++++++[<-------->-]<---.
>+++[<--->-]<---.
>+++++++++[<+++++++++>-]<-.
>+++[<--->-]<--.
>++++[<++++>-]<---.
---.
>+++++++++[<--------->-]<++.
>+++++++++[<+++++++++>-]<+++++.
>+++++[<----->-]<++++.
>+++[<+++>-]<++.
>+++[<--->-]<++.
>++++++++[<-------->-]<-----.
>+++++++++[<+++++++++>-]<----.
>+++[<+++>-]<-.
>++++[<---->-]<--.
>++[<++>-]<+.
>+++[<+++>-]<--.
++++.
>+++++++++[<--------->-]<--.
>++++++++[<++++++++>-]<++++++.
>+++[<+++>-]<+++.
>+++[<--->-]<.
++.
--.
>+++[<+++>-]<--.
>++[<++>-]<+.
>+++[<--->-]<++.
>++[<++>-]<++.
>++[<-->-]<-.
++++.
>++++++++[<-------->-]<-----.

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;
		}
	}

API の新たな呼び出しを開発するには、以下を考慮してください。

  • The call has to be inscribed as a function in the file <installation Pandora FMS Console>/include/functions_api.php .
  • The function must have this structure: The prefix api, the kind of operation get, set or help (depending on whether it is a data read, data write or retrieve help operation) and the name of the call, trying to be coherent with the operation, as for example: function api_get_[call_name](parameters) .
  • The function can have no parameters, but if it has them, the parameters received will be the following in the same order:
  • id: first operator or parameter, it contains a string.
  • id2: second operator or parameter, it contains a string.
  • other: rest of operators or parameters, it contains as an array of two positions:
    • $other['type']: That might be be a string or an array.
    • $other['data']: That will be a string with the parameter or an array of numeric index with the past parameters.
  • returnType: string that specifies the kind of return that the call will have. It is usually visible for you, but you may use or modify it if necessary.
  • 呼び出しは <Pandoraコンソールインストール場所>/include/functions_api.php ファイル内の関数として実装されます。
  • 呼び出しは、“get”、“set”、または、“help” と新たな呼び出し名の組み合わせで、操作とつじつまが合うようにします。例えば、function api_get_<呼び出し名>(パラメータ) です。
  • 全てを利用しない場合でも、任意の名前で良いですが、呼び出しパラメータは次に示す全てを受け渡す必要があります。
  • id: 1番目の操作またはパラメータで、文字列を含みます。
  • id2: 2番目の操作またはパラメータで、文字列を含みます。
  • other: 残りの操作またはパラメータで、以下の2種類の配列を含みます。
    • $other['type']: 文字列または配列です。
    • $other['data']: パラメータを持った文字列または、パラメータの数値インデックスの配列です。
  • returnType: 呼び出しの戻値の種類を指定する文字列です。通常は透過的ですが必要であれば編集できます。

It is possible to create new API calls without using …/include/functions_api.php. The process consists of adding into a Pandora FMS extension directory a file with the following name:

…/include/functions_api.php を利用せずに新たな API 呼び出しを作成することができます。それには、Pandora FMS の extension ディレクトリに次の名前でファイルを追加します。

<extension_name>.api.php

and into this file create the desired functions with the same considerations of the standard API but with apiextension prefix instead of api.

そして、標準の API と同じように欲しい関数を作成します。ただし、プリフィックスは、api ではなく、apiextension です。

For example, having an extension called module_groups with the path

You must create a file called module_groups.api.php into this directory.

例えば、module_groups という名前の拡張を <Pandora installation>/extensions/module_groups に作る場合は、module_groups.api.php というファイルを作成する必要があります。

The desired functions will be within this file, for example a function to get the number of modules in a group. This function must have a name like: apiextension_get_groupmodules.

このファイルに、例えば、グループのモジュール数を取得する関数などの欲しい関数を入れます。この関数の名前は、apiextension_get_groupmodules といった名前である必要があります。

In this function, made up functions have been used.

この関数では、独自の関数が使用されています。

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;
}

呼び出し例

This call example gets the number of modules of the Servers group.

この呼び出し例では、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

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' (必須): データの内容または、英数字インデックスの配列、または、データと数値インデックスです。

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);
	}
}

今後の api.php では次のようなことを考えています。

  • Broading the API call ensemble.
  • Returning and getting values in xml, JSON…
  • Increasing security call for insecure environments.
  • Integration with third tool standards.
  • APIの追加
  • xml や jason 等でのデータの取得
  • セキュアではない環境向けのセキュリティ強化
  • 他のツール標準との統合

Pandora FMS ドキュメント一覧に戻る

  • ja/documentation/pandorafms/technical_reference/02_annex_externalapi.txt
  • 最終更新: 2024/02/06 07:28
  • by junichi