Difference between revisions of "Pandora: Documentation en: Annex ExternalAPI"
From Pandora FMS Wiki
(→Ejemplo) |
(→set update_module_policy_json: Boleto GitLab # 7216 ''ticket''.) |
||
(516 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
[[Pandora:Documentation_en|Go back to Pandora FMS documentation index]] | [[Pandora:Documentation_en|Go back to Pandora FMS documentation index]] | ||
+ | |||
= Pandora FMS External API = | = Pandora FMS External API = | ||
− | The Pandora FMS External API is used doing remote calls (through HTTP) on the | + | The Pandora FMS External API is used doing remote calls (through HTTP) on the '''/include/api.php''' file. |
− | This is the method that has been defined in Pandora FMS to integrate applications from third | + | This is the method that has been defined in Pandora FMS to integrate applications from third parties to Pandora FMS. It basically consists on a call with the parameters formatted to receive a value or a list of values that after its application will be used to do operations. |
A call to the API.php is as simple as this: | A call to the API.php is as simple as this: | ||
Line 10: | Line 11: | ||
<nowiki>http://</nowiki><Pandora Console install>/include/api.php<parameters> | <nowiki>http://</nowiki><Pandora Console install>/include/api.php<parameters> | ||
− | The API only | + | The API can only receive the following parameters: |
− | *op (required): is the first parameter that | + | *op (required): It is the first parameter that specifies the nature of the operation, which could be "get" or "set" or "help": |
− | :*get: returns a value or values. | + | :*get: It returns a value or values. |
− | :*set: | + | :*set: It sends a value or values. |
− | :*help: returns a little help from the calls | + | :*help: It returns a little help from the calls |
− | *op2 (required): | + | *op2 (required): The call with an explanatory name of the one that it works on. |
− | *id (optional): first parameter | + | *id (optional): The first call parameter. |
− | *id2 (optional): second parameter | + | *id2 (optional): The second call parameter. |
− | *other (optional): third parameter | + | *other (optional): The third call parameter, sometimes it could be a list of serial values. |
− | *other_mode (optional): format | + | *other_mode (optional): Serial format. list of posible values: |
− | :*url_encode: | + | :*url_encode: the othervalue is an alphanumeric formtted as [http://en.wikipedia.org/wiki/Percent-encoding UrlEncode]. |
− | :*url_encode_separator_<separador>: | + | :*url_encode_separator_<separador>: The value will be a serial value list with the divider character, for example: |
...other=peras|melones|sandias&other_mode=url_encode_separator_| | ...other=peras|melones|sandias&other_mode=url_encode_separator_| | ||
*returnType (optional): return format of the value or values. The current available values are: | *returnType (optional): return format of the value or values. The current available values are: | ||
− | :*string: returns the value as it is as an alphanumeric one. | + | :*string: It returns the value as it is as an alphanumeric one. |
− | :*csv: | + | :*csv: It returns the values as a CSV separated with the ";" character (fields) and with CR (files) by default |
− | :*csv_head: returns same as with "csv" except that it adds a first file with the field names to return. | + | :*csv_head: It returns the same as with "csv", except that it adds a first file with the field names to return. |
==Security== | ==Security== | ||
− | At the moment, | + | At the moment, security is based on an IP list that will have access to the tool. And it will be configured as seen in the image, in Pandora FMS Console configuration options. |
− | If you | + | 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. |
<center> | <center> | ||
Line 39: | Line 40: | ||
</center> | </center> | ||
− | You can also set a password for | + | You can also set a password for API actions. |
− | In order to setup the password | + | In order to setup the password, follow these steps: |
− | *''apipass'': Api password configured in the console. | + | *''apipass'': Api password configured in the console. Do it in the following configuration view (Administration>Setup>): |
− | |||
− | |||
<center> | <center> | ||
Line 51: | Line 50: | ||
</center> | </center> | ||
− | To access | + | Nota: Before version 4.0.2, this parameter was ''pass'' |
+ | |||
+ | To access API actions, it is necessary to give a Pandora FMS valid user and password. | ||
− | *''user'': Valid | + | *''user'': Valid Pandora FMS user |
− | *''pass'': The password | + | *''pass'': The user password |
− | '''Note: In | + | '''Note: In API calls, passwords are uncoded. Be careful and use SSL connections to avoid sniffers. The API allows POST petitions to encrypt them when using SSL/HTTPS.''' |
=== Return === | === Return === | ||
− | When the API denies the access, | + | When the API denies the access, the simple string "auth error" is returned. |
=== Examples === | === Examples === | ||
− | In this case, | + | In this case, the API password ''1234'' is used. The user is ''admin'' and the password is ''pandora''. |
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
Access conditions: | Access conditions: | ||
− | * The | + | * The source IP is in the ACLs IP list |
− | * The API password is not | + | * The API password is not set or is ''1234'' |
− | * The user ''admin'' exists and | + | * The user ''admin'' exists and its password is ''pandora'' |
=== Security Workflow === | === Security Workflow === | ||
Line 78: | Line 79: | ||
'''Starting from version 4.0.2''', the API will have several security improvements, and this is implemented by three factors: | '''Starting from version 4.0.2''', the API will have several security improvements, and this is implemented by three factors: | ||
− | * IP filtering. Only listed / filtered IP will be allowed to connect the API. | + | * IP filtering. Only listed / filtered IP will be allowed to connect to the API. |
* Global API password, if defined, needed to use the API. | * Global API password, if defined, needed to use the API. | ||
− | * User & | + | * User & password valid in the console. Permissions will be used each time there is a requested operation. |
− | + | It is explained in this workflow: | |
<center> | <center> | ||
Line 88: | Line 89: | ||
</center> | </center> | ||
− | == New | + | == New calls extension in the API == |
− | To develop new calls for the API | + | To develop new calls for the API, keep in mind that: |
− | * The call has to be inscribed as a function in the file < | + | * The call has to be inscribed as a function in the file <installation Pandora FMS Console>/include/functions_api.php . |
− | * The function must have | + | * 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 | + | *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, contains | + | *id: first operator or parameter, it contains a string. |
− | *id2: second operator or parameter, contains | + | *id2: second operator or parameter, it contains a string. |
− | *other: rest of operators or parameters, contains as an array of two positions: | + | *other: rest of operators or parameters, it contains as an array of two positions: |
− | :*$other['type']: | + | :*$other['type']: That might be be a string or an array. |
− | :*$other['data']: | + | :*$other['data']: That will be a string with the parameter or an array of numeric index with the past parameters. |
− | *returnType: string that | + | *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. |
− | === New Calls in the API from | + | === New Calls in the API from Pandora FMS extensions === |
− | + | 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: <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". | |
− | For example, having an extension called "module_groups" with the path <Pandora installation>/extensions/module_groups | + | For example, having an extension called "module_groups" with the path <Pandora installation>/extensions/module_groups, create a file called module_groups.api.php into this directory. |
− | + | 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". | |
==== Function example ==== | ==== Function example ==== | ||
− | In this function have been used | + | In this function, made up functions have been used. |
<code><pre> | <code><pre> | ||
Line 132: | Line 133: | ||
==== Call example ==== | ==== Call example ==== | ||
− | This call example gets the number of modules of the | + | This call example gets the number of modules of the "Servers" group. |
− | 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 | + | <nowiki>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</nowiki> |
===API Functions=== | ===API Functions=== | ||
− | The following functions could be used in | + | The following functions could be used in your call function code: |
− | *returnError(typeError, returnType): gives back an error in an standardized way for all calls. | + | *returnError(typeError, returnType): It gives back an error in an standardized way for all calls. |
− | :*typeError: | + | :*typeError: By now 'id_not_found' or null. |
− | :*returnType: | + | :*returnType: By now 'string' or error message. |
− | *returnData(returnType, data, separator): is the function that returns the API call data. | + | *returnData(returnType, data, separator): It is the function that returns the API call data. |
− | :*returnType: | + | :*returnType: That could be 'string', 'csv', 'csv_head' |
− | :*data: is an array that contains the data, as well as its format. It has the following fields: | + | :*data: It is an array that contains the data, as well as its format. It has the following fields: |
− | ::*'type' (required): | + | ::*'type' (required): It could be 'string' and 'array'. |
− | ::*'list_index' (optional): contains a numeric index array containing the alphanumeric index | + | ::*'list_index' (optional): It contains a numeric index array containing the alphanumeric index to be taken out through exit. |
− | ::*'data' (required): contains | + | ::*'data' (required): It contains a string with the data or an array of alphanumeric index or numeric index with data. |
===Example=== | ===Example=== | ||
Line 185: | Line 186: | ||
==API Calls== | ==API Calls== | ||
− | They are divided | + | They are divided into two groups, depending on whether they return or write data in Pandora FMS. |
There is an exception: The info retrieving call. | There is an exception: The info retrieving call. | ||
Line 191: | Line 192: | ||
===INFO RETRIEVING=== | ===INFO RETRIEVING=== | ||
− | + | It returns the version of Pandora FMS Console in a similar way as the ''get test'' call but without checking the API connection. | |
− | This call is useful to verify that this path allows a Pandora FMS installation and to retrieve the version before | + | This call is useful to verify that this path allows a Pandora FMS installation and to retrieve the version before authentication. |
− | The returned info can be retrieved from the login screen, so it | + | The returned info can be retrieved from the login screen, so it is not considered a security vulnerability. |
− | http://127.0.0.1/pandora_console/include/api.php?info=version | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?info=version</nowiki> |
A return sample could be: ''Pandora FMS v5.0 - PC131015'' | A return sample could be: ''Pandora FMS v5.0 - PC131015'' | ||
Line 203: | Line 204: | ||
===GET=== | ===GET=== | ||
− | It | + | It returns the required data. |
====get test==== | ====get test==== | ||
− | + | It checks the connection to the API and returns the version of Pandora FMS Console. | |
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
Line 217: | Line 219: | ||
This example will return OK,[version],[build] | This example will return OK,[version],[build] | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | A return sample could be: ''OK,v7.0NG.751,PC201215'' | ||
+ | |||
+ | ====get license==== | ||
+ | >= 7.0NG 752 | ||
+ | |||
+ | To consult the Pandora FMS use licence status, depending on the access level of the user's credentials. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=license (required) | ||
+ | *return_type=json (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=license&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
+ | For ''Community'' version, it returns: | ||
− | + | { | |
+ | "type":"array", | ||
+ | "data":{ | ||
+ | "license_mode":"PANDORA-FREE", | ||
+ | } | ||
+ | } | ||
====get all_agents==== | ====get all_agents==== | ||
− | + | It returns a list of agent filters according to the filter in some other parameter. | |
Call syntax: | Call syntax: | ||
Line 228: | Line 252: | ||
*op2=all_agents (required) | *op2=all_agents (required) | ||
*return_type= csv or json (required) | *return_type= csv or json (required) | ||
− | *other=<serialized parameters> (optional) | + | *other=<serialized parameters> (optional). Serialized parameters to filter the agent search: |
:*<filter_so> | :*<filter_so> | ||
:*<filter_group> | :*<filter_group> | ||
Line 235: | Line 259: | ||
:*<filter_policy> | :*<filter_policy> | ||
:*<csv_separator> | :*<csv_separator> | ||
+ | :*Recursion (<b>1</b> or <b>0</b>) | ||
=====Examples===== | =====Examples===== | ||
− | This example will return all agents | + | This example will return all agents whose id_os is equal to 1, id_group equals 2, state equal to warning, their alias contains 'j', and the policy associated equals 2. |
− | CSV example: 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 | + | CSV example: <nowiki>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</nowiki> |
− | JSON example: 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 | + | JSON example: <nowiki>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</nowiki> |
+ | ====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. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=license_remaining (required) | ||
+ | *return_type= json (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=license_remaining&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | ||
====get module_last_value==== | ====get module_last_value==== | ||
− | Returns the last value | + | Returns the last module value. This module is filtered by the ID which has gone through the id parameter. With the other parameter you may add an error code that your application knows and it is out of range of module values. |
Call syntax: | Call syntax: | ||
*op=get (required) | *op=get (required) | ||
*op2=module_last_value (required) | *op2=module_last_value (required) | ||
− | *id=<índex> (required) should be | + | *id=<índex> (required). It should be an agent module index. |
− | *other=<error return> (optional) | + | *other=<error return> (optional). What you wish to receive if there is an error(usually not located in the database). |
− | :*Error return | + | :*Error return codes are: |
− | ::*'error_message' returns an error in a text message. | + | ::*'error_message'. It returns an error in a text message. |
− | ::*'error_value'<separator><code or value> | + | ::*'error_value'<separator><code or value>. It returns this code or error value. But it is necessary to enclose it with 'other_mode', like other_mode=url_encode_separator_<separador> to place the divider on another one. |
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62&apipass=1234&user=admin&pass=pandora</nowiki> |
====get agent_module_name_last_value==== | ====get agent_module_name_last_value==== | ||
− | + | It returns the last module value. This module is filtered by the agent name which has gone through id parameter and module name which has gone through id2 parameter. With the other parameter, you may add an error code recognized by your application and which is out of range of module values. | |
Line 268: | Line 305: | ||
*op=get (required) | *op=get (required) | ||
*op2=agent_module_name_last_value (required) | *op2=agent_module_name_last_value (required) | ||
− | *id=<alphanumeric>(required) contains the agent name. | + | *id=<alphanumeric>(required). It contains the agent name. |
− | *id2=<alphanumeric> (required) contains the module name. | + | *id2=<alphanumeric> (required). It contains the module name. |
− | *other=<error return> (optional) | + | *other=<error return> (optional). What you wish to receive if there is an error (that usually has not been found in the DB). |
:*Codes of error return are: | :*Codes of error return are: | ||
− | ::*'error_message' returns error in a text message. | + | ::*'error_message'. It returns error in a text message. |
− | ::*'error_value'<separator><code or value> | + | ::*'error_value'<separator><code or value>. It returns this code or error value, but it must come with 'other_mode' such as other_mode=url_encode_separator_<separator> to use the divider on another one. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user&apipass=1234&user=admin&pass=pandora</nowiki> |
====get agent_module_name_last_value_alias==== | ====get agent_module_name_last_value_alias==== | ||
=> 7.0NG | => 7.0NG | ||
− | + | It returns the last module value. This module is filtered by the agent alias which has gone through id parameter and module name which has gone through parameter id2. With the other parameter, you may add an error recognized by your application and which is out range of module values. | |
Call Syntax: | Call Syntax: | ||
Line 288: | Line 325: | ||
*op=get (required) | *op=get (required) | ||
*op2=module_last_value_alias (required) | *op2=module_last_value_alias (required) | ||
− | *id=<alphanumeric>(required) contains the agent alias. | + | *id=<alphanumeric>(required). It contains the agent alias. |
− | *id2=<alphanumeric> (required) contains the module name. | + | *id2=<alphanumeric> (required). It contains the module name. |
− | *other=<error return> (optional) | + | *other=<error return> (optional). What you wish to receive if there is an error ( that usually has not been found in the DB). |
:*Codes of error return are: | :*Codes of error return are: | ||
− | ::*'error_message' returns error in a text message. | + | ::*'error_message'. It returns error in a text message. |
− | ::*'error_value'<separator><code or value> | + | ::*'error_value'<separator><code or value>. It returns this code or error value, but it must come with 'other_mode' such as other_mode=url_encode_separator_<separator> to use the divider on another one. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value_alias&id=pandorafms&id2=Memory_Used&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value_alias&id=pandorafms&id2=Memory_Used&apipass=1234&user=admin&pass=pandora</nowiki> |
====get module_value_all_agents==== | ====get module_value_all_agents==== | ||
− | + | It returns a list of agent and module values, these modules are in all of the agents of the list and they are filtered by the name of module which has gone through the id parameter. | |
Call syntax: | Call syntax: | ||
Line 307: | Line 344: | ||
*op=get (required) | *op=get (required) | ||
*op2=module_value_all_agents (required) | *op2=module_value_all_agents (required) | ||
− | *id=<name of the module> (required) This is the module name. | + | *id=<name of the module> (required). This is the module name. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_value_all_agents&id=example_module_name&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_value_all_agents&id=example_module_name&apipass=1234&user=admin&pass=pandora</nowiki> |
====get agent_modules==== | ====get agent_modules==== | ||
− | + | It returns the list of agent modulest, this agent is filtered by the id agent which has gone through id parameter. | |
Call syntax: | Call syntax: | ||
Line 323: | Line 360: | ||
*other=<serialized values> (required) Serialized values in order to filter by agent: | *other=<serialized values> (required) Serialized values in order to filter by agent: | ||
:*<id_agent> | :*<id_agent> | ||
− | + | The 'other_mode' parameter must be completed like this other_mode=url_encode_separator_<separador> in order to configure the separator in other field. | |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====get module_id==== | ====get module_id==== | ||
− | + | It returns the id of an agent module. | |
Call syntax: | Call syntax: | ||
Line 341: | Line 378: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
+ | |||
+ | ====get module_custom_id==== | ||
+ | Returns the value of the ''Custom_id'' field of a specific module of an agent passing as parameter the module id. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=module_custom_id (required) | ||
+ | *id= id_agent_module (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_custom_id&id=5&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
+ | ====set module_custom_id==== | ||
+ | Changes or clears the value of the ''Custom ID'' field passing as parameters the module id and the value of the custom id. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=module_custom_id (required) | ||
+ | *id=id_agent_module (required) | ||
+ | *id2=value, or vacuum to clean (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>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</nowiki> | ||
====get locate_agent==== | ====get locate_agent==== | ||
− | + | It gets the id server where the agent is located, and prints all the results like a csv. | |
Call syntax: | Call syntax: | ||
Line 350: | Line 410: | ||
*op=get (required) | *op=get (required) | ||
*op2=locate_agent (required) | *op2=locate_agent (required) | ||
− | *return_type=<csv> (required) Output format. | + | *return_type=<csv> (required). Output format. |
*id=id_agent (required) | *id=id_agent (required) | ||
*other_mode= other_mode=url_encode_separator_<separator> (required) | *other_mode= other_mode=url_encode_separator_<separator> (required) | ||
Line 356: | Line 416: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get policies==== | ====get policies==== | ||
− | + | It returns the list of agent policies, whose id which has gone through the other parameter. | |
Call syntax: | Call syntax: | ||
Line 366: | Line 426: | ||
*op2=policies (required) | *op2=policies (required) | ||
*return_type=<csv> (required) | *return_type=<csv> (required) | ||
− | *other=<serialized values> (optional) Serialized values for | + | *other=<serialized values> (optional). Serialized values for filtering policies by policy agent: |
:*<id_agent> | :*<id_agent> | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ==== | + | ====get tree_agents==== |
− | + | It returns a complete list structured by the groups in the first level, agents in the second level and modules in the third level. This list is filtered by the other parameter. | |
Call Syntax: | Call Syntax: | ||
*op=get (required) | *op=get (required) | ||
*op2=tree_agents (required) | *op2=tree_agents (required) | ||
− | *return_type=<return kind> (required) | + | *return_type=<return kind> (required). That could be 'csv' or 'csv_head'. |
− | *other=<string or serialized parameters> (optional) | + | *other=<string or serialized parameters> (optional). In this case, it could be the divider or a parameter list ordered and separated by the divider character. Both cases are described here: |
::*<separator> The divider "yes" of the 'csv'. | ::*<separator> The divider "yes" of the 'csv'. | ||
− | ::*<separator csv>|<character that replaces the CR|<fields 1>,<fields 2>,<fields N> | + | ::*<separator csv>|<character that replaces the CR|<fields 1>,<fields 2>,<fields N>. It will place the following parameters in order (the divider character '|' could be specified in "other_mode"): |
− | :::*<separator csv> | + | :::*<separator csv>. Field divider in the CSV. |
− | :::*<character that replaces the CR> | + | :::*<character that replaces the CR>. Character that will be replaced if it finds in any returned character the character RC, in order to avoid the ambiguity with the standard use of the RC character to specify registers/files in the CSV. If you make an string go through other, the replacing character is the blank space. |
:::*<fields 1>,<fields2>,<fields N> :the fields to show in the CSV are: | :::*<fields 1>,<fields2>,<fields N> :the fields to show in the CSV are: | ||
Line 522: | Line 582: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
− | 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_name&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_name&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====get module_data==== | ====get module_data==== | ||
Line 541: | Line 601: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get graph_module_data==== | ====get graph_module_data==== | ||
− | Returns the chart of a module as | + | Returns the chart of a module as an image file, this chart is generated with the same method of static graphs of Pandora FMS. It is necesary to include the width, height, period, label and start date of chart (knowing in Pandora FMS the date indicated in graphs is always the data end) into the other parameter. |
Line 552: | Line 612: | ||
*op2=module_data (required) | *op2=module_data (required) | ||
*id=<id_modulo> (required) | *id=<id_modulo> (required) | ||
− | *other=<serialized parameters> (required). | + | *other=<serialized parameters> (required). They are the following in this order: |
:*<period> | :*<period> | ||
:*<width> | :*<width> | ||
Line 561: | Line 621: | ||
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====get events==== | ====get events==== | ||
− | + | It returns a list of events filtered by the other parameter. | |
+ | |||
− | |||
Call syntax: | Call syntax: | ||
Line 573: | Line 633: | ||
*return_type=csv (required) | *return_type=csv (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameters> (optional). | + | *other=<serialized parameters> (optional). They are the following in this order: |
:*<separator> | :*<separator> | ||
− | :*<criticity> | + | :*<criticity> Values from 0 to 4, or -1 to avoid this param |
:*<agent alias> | :*<agent alias> | ||
:*<module name> | :*<module name> | ||
Line 586: | Line 646: | ||
:*<register limit> | :*<register limit> | ||
:*<offset register> | :*<offset register> | ||
− | :*<optional style [total|more_criticity]> (total - returns the number of the records, more_criticity - returns the | + | :*<optional style [total|more_criticity]> (total - it returns the number of the records, more_criticity - it returns the highest criticity value) |
− | :*<event type> unknown, alert_fired, alert_recovered,.. or its substring. | + | :*<id_grupo> |
+ | :*<tags> | ||
+ | :*<event type> unknown, alert_fired, alert_recovered,.. or its substring. You may also use 'not_normal'. | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki> |
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ==== | + | ====get all_alert_templates==== |
− | + | It returns the list of alert templates defined in Pandora FMS. | |
− | + | Call syntax: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | *op=get (required) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | *op=get (required) | ||
*op2=all_alert_templates (required) | *op2=all_alert_templates (required) | ||
*other=cvs_separator (optional) | *other=cvs_separator (optional) | ||
Line 648: | Line 668: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
====get module_groups==== | ====get module_groups==== | ||
− | + | It returns the list of module groups. | |
Call syntax: | Call syntax: | ||
Line 671: | Line 682: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
====get plugins==== | ====get plugins==== | ||
− | + | It returns the list of Pandora FMS server plugins. | |
Call syntax: | Call syntax: | ||
Line 684: | Line 695: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
====get tags==== | ====get tags==== | ||
− | + | It returns the list of tags defined in Pandora FMS. | |
Call syntax: | Call syntax: | ||
Line 699: | Line 710: | ||
This example will return all tags in the system. | This example will return all tags in the system. | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki> |
====get module_from_conf==== | ====get module_from_conf==== | ||
>= 5.0 (Only Enterprise) | >= 5.0 (Only Enterprise) | ||
− | + | It returns the configuration of a local module. | |
Call syntax: | Call syntax: | ||
*op=get (required) | *op=get (required) | ||
*op2=update_module_in_conf (required) | *op2=update_module_in_conf (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
− | *id2=< | + | *id2=<module name> (required) |
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | It returns | + | It returns an empty string if no modules are found. |
====get total_modules==== | ====get total_modules==== | ||
Line 728: | Line 739: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | If the group id is 0, it returns the total amount of modules. | ||
====get total_agents==== | ====get total_agents==== | ||
Line 741: | Line 754: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora</nowiki> |
====get agent_name==== | ====get agent_name==== | ||
Line 749: | Line 762: | ||
*op=get (required) | *op=get (required) | ||
*op2=agent_name (required) | *op2=agent_name (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====get agent_alias==== | ====get agent_alias==== | ||
Line 762: | Line 775: | ||
*op=get (required) | *op=get (required) | ||
*op2=agent_alias (required) | *op2=agent_alias (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
− | *id2=<id | + | *id2=<node id> (required in the meta console, unnecessary in the node) |
=====Examples===== | =====Examples===== | ||
− | Node: | + | * Node: |
− | http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
− | Metaconsole: | + | * Metaconsole: |
− | http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====get module_name==== | ====get module_name==== | ||
Line 781: | Line 794: | ||
*op=get (required) | *op=get (required) | ||
*op2=module_name (required) | *op2=module_name (required) | ||
− | *id=<id | + | *id=<module id> (required) |
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====get alert_action_by_group==== | ====get alert_action_by_group==== | ||
Line 792: | Line 805: | ||
*op=get (required) | *op=get (required) | ||
*op2=alert_action_by_group (required) | *op2=alert_action_by_group (required) | ||
− | *id=<id | + | *id=<group id> (required) |
− | *id2=<id | + | *id2=<action id> (required) |
− | |||
− | |||
− | |||
=====Examples===== | =====Examples===== | ||
− | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alert_action_by_group&id=0&id2=3&apipass=1234&user=admin&pass=pandora</nowiki> | |
− | http:// | ||
====get alert_actions==== | ====get alert_actions==== | ||
Line 809: | Line 818: | ||
*op=get (required) | *op=get (required) | ||
*op2=alert_actions (required) | *op2=alert_actions (required) | ||
− | *return_type=<return type> (required) | + | *return_type=<return type> (required). It can be 'csv' or 'json'. |
*other=<serialized parameters> (optional): | *other=<serialized parameters> (optional): | ||
:*<action_name> (optional) | :*<action_name> (optional) | ||
Line 815: | Line 824: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions&apipass=1234&user=admin&pass=pandora&other=Create|&other_mode=url_encode_separator_|&return_type=json | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions&apipass=1234&user=admin&pass=pandora&other=Create|&other_mode=url_encode_separator_|&return_type=json</nowiki> |
====get alert_actions_meta==== | ====get alert_actions_meta==== | ||
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
List of node alert actions from Metaconsole. | List of node alert actions from Metaconsole. | ||
Line 824: | Line 834: | ||
*op=get (required) | *op=get (required) | ||
*op2=alert_actions_meta (required) | *op2=alert_actions_meta (required) | ||
− | *return_type=<return type> (required) | + | *return_type=<return type> (required). It can be 'csv' o 'json'. |
*other=<serialized parameters> (optional): | *other=<serialized parameters> (optional): | ||
:*<server_name> (optional) | :*<server_name> (optional) | ||
Line 831: | Line 841: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2= | + | <nowiki>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</nowiki> |
+ | |||
+ | |||
+ | ====get all_alert_commands==== | ||
+ | It returns all the alert commands. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=all_alert_commands (required) | ||
+ | *other=cvs_separator(optional) | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=all_alert_commands&return_type=csv&other=$&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
====get event_info==== | ====get event_info==== | ||
− | + | It returns all event data by typing in the event id. | |
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
Line 844: | Line 868: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora</nowiki> |
====get tactical_view==== | ====get tactical_view==== | ||
− | + | It returns the following value list (this values can be seen in the tactical page in Pandora FMS Console) | |
* monitor_checks | * monitor_checks | ||
* monitor_not_init | * monitor_not_init | ||
Line 883: | Line 907: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora</nowiki> |
====get pandora_servers==== | ====get pandora_servers==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It returns the list of Pandora FMS servers. | |
− | + | Call syntax: | |
*op=get (required) | *op=get (required) | ||
*op2=pandora_servers (required) | *op2=pandora_servers (required) | ||
Line 897: | Line 921: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki> |
It returns the fields in this order: | It returns the fields in this order: | ||
Line 915: | Line 939: | ||
>= 5.0 | >= 5.0 | ||
− | + | It translates the name of custom field into the id in the data base. | |
Call syntax: | Call syntax: | ||
*op=get (required) | *op=get (required) | ||
*op2=custom_field_id (required) | *op2=custom_field_id (required) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). In this case, custom field name. |
:*<name> (required) | :*<name> (required) | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get gis_agent==== | ====get gis_agent==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It returns the last GIS agent data. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=gis_agent (required) | *op2=gis_agent (required) | ||
− | *id=<index> (required) agent index. | + | *id=<index> (required). It must be an agent index. |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1 | + | <nowiki>http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1</nowiki> |
====get special_days==== | ====get special_days==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns special day's list. | |
Call syntax: | Call syntax: | ||
Line 950: | Line 974: | ||
*op=get (required) | *op=get (required) | ||
*op2=special_days (required) | *op2=special_days (required) | ||
− | *other=<csv separator> (optional) CSV separator | + | *other=<csv separator> (optional). CSV separator |
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days</nowiki> |
====get module_properties==== | ====get module_properties==== | ||
>= 5.1SP2 | >= 5.1SP2 | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 965: | Line 989: | ||
*op2=module_properties (required) | *op2=module_properties (required) | ||
*id=module-id (required) | *id=module-id (required) | ||
− | *return_type=<return kind> (required) | + | *return_type=<return kind> (required). That could be 'csv' or 'csv_head'. |
− | *other=<string or serialized parameters> (optional) | + | *other=<string or serialized parameters> (optional). In this case, it could be the divider or a parameter list ordered and separated by the divider character. Both cases are exposed: |
− | ::*<separator> The divider "yes" of the 'csv'. | + | ::*<separator>. The divider "yes" of the 'csv'. |
− | ::*<separator csv>|< | + | ::*<separator csv>|<. Character that replaces the CR|<fields 1>,<fields 2>,<fields N>. It will make up the following parameters in order (the divider character '|' could be specified in "other_mode"): |
− | :::*<separator csv> | + | :::*<separator csv>. Field divider in the CSV. |
− | :::*<character that replaces the CR> | + | :::*<character that replaces the CR>. Character that will be replaced if it finds in any returned character the character RC, in order to avoid the ambiguity with the standard use of the RC character to specify registers/files in the CSV. If you make a string go through other, the replacing character is the blank space. |
− | :::*<fields 1>,<fields2>,<fields N> | + | :::*<fields 1>,<fields2>,<fields N>. The fields to output in CSV are: |
− | ::::* | + | ::::*module_id_agent_module |
::::*module_id_agent | ::::*module_id_agent | ||
::::*module_id_module_type | ::::*module_id_module_type | ||
Line 1,025: | Line 1,049: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | 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 | + | <nowiki>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</nowiki> |
====get module_properties_by_name==== | ====get module_properties_by_name==== | ||
>= 5.1SP2 | >= 5.1SP2 | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 1,038: | Line 1,062: | ||
*id=agent_name (required) | *id=agent_name (required) | ||
*id2=agentmodule_name (required) | *id2=agentmodule_name (required) | ||
− | *return_type=<return kind> (required) | + | *return_type=<return kind> (required). That could be 'csv' or 'csv_head'. |
− | *other=<string or serialized parameters> (optional) | + | *other=<string or serialized parameters> (optional). In this case, it could be the divider or a parameter list in order and separated by the divider character. (the same as 'get module_properties'. For details, see 'get module_properties') |
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | 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 | + | <nowiki>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</nowiki> |
====get module_properties_by_alias==== | ====get module_properties_by_alias==== | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 1,056: | Line 1,080: | ||
*id=agent_alias (required) | *id=agent_alias (required) | ||
*id2=agentmodule_name (required) | *id2=agentmodule_name (required) | ||
− | *return_type=<return kind> (required) | + | *return_type=<return kind> (required). That could be 'csv' or 'csv_head'. |
− | *other=<string or serialized parameters> (optional) | + | *other=<string or serialized parameters> (optional). In this case, it could be the divider or a parameter list ordered and separated by the divider character (the same as 'get module_properties'. For details, see 'get module_properties'). |
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get module_graph==== | ====get module_graph==== | ||
− | |||
− | + | It returns a Module graph [https://docs.python.org/3/library/base64.html encoded with base64].. | |
Call Syntax: | Call Syntax: | ||
+ | |||
*op=get (required) | *op=get (required) | ||
*op2=module_graph (required) | *op2=module_graph (required) | ||
Line 1,074: | Line 1,098: | ||
*other=<period in seconds> (optional) 3600 by default (1 hour). Period of time used in the data recovery. | *other=<period in seconds> (optional) 3600 by default (1 hour). Period of time used in the data recovery. | ||
− | ==== | + | From version NG 752 onwards, more parameters are available, please pay attention to the mandatory fields and their separators <code>|</code> or its [Escape character https://en.wikipedia.org/wiki/Escape_character] <code> %7C </code>. |
+ | |||
+ | *op=get (required) | ||
+ | *op2=module_graph (required) | ||
+ | *id=<module id> (required) | ||
+ | *other= | ||
+ | ** Time range in seconds (default 3600 ) in which data will be collected from the date of the request backwards (required). | ||
+ | ** Separator. | ||
+ | ** 0 for base64 graphics, 1 for image (required). | ||
+ | ** Separator. | ||
+ | ** 0 without thresholds, 1 with thresholds - if the Module has active thresholds - (required). | ||
+ | ** Separator. | ||
+ | ** Height of the graph, in pixels (required). Additionally it needs 49 pixels to display the captions. | ||
− | 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 | + | |
+ | =====Examples===== | ||
+ | |||
+ | Prior to version NG 752: | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | Version NG 752 or higher: | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
====get all_planned_downtimes==== | ====get all_planned_downtimes==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns all matches of planned downtime. | |
op=get | op=get | ||
op2=all_planned_downtimes | op2=all_planned_downtimes | ||
return_type=csv | return_type=csv | ||
− | other=<name> <group> <type_downtime> <type_execution> <type_periodicity> (for | + | other=<name> <group> <type_downtime> <type_execution> <type_periodicity> (for filtering) |
Line 1,092: | Line 1,137: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | 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 | + | <nowiki>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</nowiki> |
====get planned_downtimes_items==== | ====get planned_downtimes_items==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns all matches of planned downtime items. | |
op=get | op=get | ||
Line 1,107: | Line 1,152: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | 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 | + | <nowiki>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</nowiki> |
====get id_group_agent_by_name==== | ====get id_group_agent_by_name==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns the group id of an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,119: | Line 1,164: | ||
* op=get | * op=get | ||
* op2=id_group_agent_by_name | * op2=id_group_agent_by_name | ||
− | * other=<string or serialized parameters> Agent name and filtering parameters (optional) | + | * other=<string or serialized parameters>. Agent name and filtering parameters (optional). |
:* <agent_name> | :* <agent_name> | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get id_group_agent_by_alias==== | ====get id_group_agent_by_alias==== | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group id of an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,134: | Line 1,179: | ||
* op=get | * op=get | ||
* op2=id_group_agent_by_alias | * op2=id_group_agent_by_alias | ||
− | * other=<string or serialized parameters> Agent alias and filtering parameters (optional) | + | * other=<string or serialized parameters>. Agent alias and filtering parameters (optional) |
:* <agent_alias> | :* <agent_alias> | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get group_agent_by_name==== | ====get group_agent_by_name==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns the group name for a agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,153: | Line 1,198: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get group_agent_by_alias==== | ====get group_agent_by_alias==== | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group name for an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,164: | Line 1,209: | ||
* op=get | * op=get | ||
* op2=group_agent_by_alias | * op2=group_agent_by_alias | ||
− | * other=<string or serialized parameters> Agent alias and filtering parameters (optional). | + | * other=<string or serialized parameters>. Agent alias and filtering parameters (optional). |
:* <agent_alias> | :* <agent_alias> | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | |||
====get group_id_by_name==== | ====get group_id_by_name==== | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group id from the name. | |
Call syntax: | Call syntax: | ||
Line 1,184: | Line 1,228: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | ==== | + | ====get_timezone==== |
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the timezone with which pandora is configured. | |
Call syntax: | Call syntax: | ||
Line 1,196: | Line 1,240: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone</nowiki> |
====get cluster_status==== | ====get cluster_status==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the cluster status by id | |
*op=get | *op=get | ||
Line 1,207: | Line 1,251: | ||
*id=cluster id | *id=cluster id | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_status&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_status&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====get cluster_id_by_name==== | ====get cluster_id_by_name==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id of the cluster by name | |
*op=get | *op=get | ||
Line 1,218: | Line 1,262: | ||
*id=cluster name | *id=cluster name | ||
− | 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 | + | <nowiki>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</nowiki> |
====get agents_id_name_by_cluster_id==== | ====get agents_id_name_by_cluster_id==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id => cluster agents names by cluster id | |
*op=get | *op=get | ||
Line 1,229: | Line 1,273: | ||
*id=cluster id | *id=cluster 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 | + | <nowiki>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</nowiki> |
====get agents_id_name_by_cluster_name==== | ====get agents_id_name_by_cluster_name==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id => cluster agents names by cluster name | |
*op=get | *op=get | ||
Line 1,239: | Line 1,283: | ||
*id=cluster id | *id=cluster 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 | + | <nowiki>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</nowiki> |
====get modules_id_name_by_cluster_id==== | ====get modules_id_name_by_cluster_id==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id => all the module names of the cluster agents by cluster id | |
*op=get | *op=get | ||
Line 1,250: | Line 1,294: | ||
*id=cluster id | *id=cluster 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 | + | <nowiki>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</nowiki> |
====get modules_id_name_by_cluster_name==== | ====get modules_id_name_by_cluster_name==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id => all the module names of the cluster agents by cluster name | |
*op=get | *op=get | ||
Line 1,261: | Line 1,305: | ||
*id=cluster name | *id=cluster name | ||
− | 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 | + | <nowiki>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</nowiki> |
====get cluster_items==== | ====get cluster_items==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the items of a json object with the format: item id => (name,id,module_agent,type,pcrit,pwarn), by cluster id | |
pcrit: % for the critic state if its AA or 1 o 0 if its AP | pcrit: % for the critic state if its AA or 1 o 0 if its AP | ||
Line 1,276: | Line 1,320: | ||
*id=cluster id | *id=cluster id | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_items&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_items&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====get policy==== | ====get policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all data from a policy. If no policy id is specified, it will return all data from all policies. | |
Line 1,289: | Line 1,333: | ||
* op2=policy | * op2=policy | ||
* id=id_policy (optional) | * id=id_policy (optional) | ||
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki> |
====get collections_policy==== | ====get collections_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all policy colections. If no policy id is specified, it returns all policy colections. | |
Line 1,305: | Line 1,349: | ||
* op2=collections_policy | * op2=collections_policy | ||
* id=id_policy (optional) | * id=id_policy (optional) | ||
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki> |
====get plugins_policy==== | ====get plugins_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all policy plugins. If no policy id is specified, it returns all policy plugins. | |
Call syntax: | Call syntax: | ||
Line 1,323: | Line 1,367: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki> |
====get inventory_policy==== | ====get inventory_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all inventory modules of a policy. If no policy id is specified, it returns all inventory modules of all policies. | |
Line 1,336: | Line 1,380: | ||
* op2=inventory_policy | * op2=inventory_policy | ||
* id=id_policy (optional) | * id=id_policy (optional) | ||
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2</nowiki> |
====get unlinking_policy==== | ====get unlinking_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all unlinked modules of a policy. If no policy id is specified, it returns all unlinked modules of all policies. | |
Line 1,352: | Line 1,396: | ||
* op2=unlinking_policy | * op2=unlinking_policy | ||
* id=id_policy(optional) | * id=id_policy(optional) | ||
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki> |
====get alerts_policy==== | ====get alerts_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns the alerts of a policy, taking into account: | |
* If a policy id is specified, it returns the alerts of that policy. If not, it returns all alerts of all policies. | * If a policy id is specified, it returns the alerts of that policy. If not, it returns all alerts of all policies. | ||
− | * If the type of alert is specified:(three options). | + | * If the type of alert is specified: (three options). |
** 0: it shows all by default. | ** 0: it shows all by default. | ||
** 1: Shows only the normal alerts. | ** 1: Shows only the normal alerts. | ||
Line 1,372: | Line 1,416: | ||
* op=get | * op=get | ||
* op2=alerts_policy | * op2=alerts_policy | ||
− | * id=id_policy(optional) | + | * id=id_policy(optional) |
* id2= 0:all(by default), 1:normal, 2:external. | * id2= 0:all(by default), 1:normal, 2:external. | ||
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2.</nowiki> |
====get alerts_actions_policy==== | ====get alerts_actions_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all actions of the alerts of a policy, taking into account: | |
* If a policy id is specified, it returns the actions of the alerts of that policy. If not, it returns all the actions of all the alerts of all policies. | * If a policy id is specified, it returns the actions of the alerts of that policy. If not, it returns all the actions of all the alerts of all policies. | ||
* If an alert id is specified, it returns the action of that alert. | * If an alert id is specified, it returns the action of that alert. | ||
− | + | Call syntax: | |
* op = get | * op = get | ||
* op2 = alerts_actions_policy | * op2 = alerts_actions_policy | ||
− | * id = id_policy(optional) | + | * id = id_policy(optional) |
− | * id2 = id_policy_alert(optional) | + | * id2 = id_policy_alert(optional) |
− | * return_type=(json, csv, string) | + | * return_type=(json, csv, string) |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get agents_policy==== | ====get agents_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all policy agents. If no policy id is specified, it returns all agents of all policies. | |
Line 1,409: | Line 1,453: | ||
* op2 = agents_policy | * op2 = agents_policy | ||
* id = id_policy(optional) | * id = id_policy(optional) | ||
− | * return_type = (json, csv, string) | + | * return_type = (json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json. | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki> |
====get groups_policy==== | ====get groups_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all groups of a policy. If no policy id is specified, it returns all groups of all policies. | |
Call syntax: | Call syntax: | ||
Line 1,424: | Line 1,468: | ||
* op2 = groups_policy | * op2 = groups_policy | ||
* id = id_policy(optional) | * id = id_policy(optional) | ||
− | * return_type = (json, csv, string) | + | * return_type = (json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2</nowiki> |
====get queue_policy==== | ====get queue_policy==== | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns the queue of a policy. If no id policy is specified, its returns all queues of all policies. | |
Call syntax: | Call syntax: | ||
Line 1,439: | Line 1,483: | ||
* op2 = queue_policy | * op2 = queue_policy | ||
* id = id_policy(optional) | * id = id_policy(optional) | ||
− | * return_type = (json, csv, string) | + | * return_type = (json, csv, string) |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json</nowiki> |
====get traps==== | ====get traps==== | ||
>= 7.0NG. 728 | >= 7.0NG. 728 | ||
− | + | It returns the specified source traps, they can also be filtered by timestamp and other data. | |
Call syntax: | Call syntax: | ||
Line 1,461: | Line 1,505: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====get event_responses==== | ====get event_responses==== | ||
− | + | It returns the response list of events the user has access to in Pandora FMS. | |
Call syntax: | Call syntax: | ||
Line 1,476: | Line 1,520: | ||
This example will return all system event responses in csv format. | This example will return all system event responses in csv format. | ||
− | http://localhost/pandora_console/include/api.php?op=get&op2=event_responses&return_type=csv&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=event_responses&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====get | + | ====get users==== |
− | + | It returns the list of Pandora FMS users. | |
Call syntax: | Call syntax: | ||
*op=get (required) | *op=get (required) | ||
− | *op2= | + | *op2=users (required) |
*return_type=csv|json (required) | *return_type=csv|json (required) | ||
=====Example===== | =====Example===== | ||
− | This example will return all | + | This example will return all users in csv format. |
− | http://localhost/pandora_console/include/api.php?op=get&op2= | + | <nowiki>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_&</nowiki> |
− | ====get | + | ====get list all user==== |
− | + | {{metaconsole}} | |
− | + | It lists all Pandora FMS users. | |
− | *op=get | + | Call syntax: |
− | *op2= | + | *op=get (required) |
− | + | *op2=list_all_user(required) | |
− | *return_type = | + | *return_type=csv|json (required) |
=====Example===== | =====Example===== | ||
+ | It can return Json or CSV, this return is remarked through the URL. | ||
+ | Only the type of return is remarked, it does not use any specific variable | ||
+ | |||
+ | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_all_user&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | ||
− | + | ====get info user name==== | |
− | + | {{metaconsole}} | |
− | ====get | ||
− | |||
− | + | It lists user data. | |
Call syntax: | Call syntax: | ||
− | * op=get | + | *op=get (required) |
− | * op2= | + | *op2=list_all_user(required) |
+ | *return_type=csv|json (required) | ||
+ | *other= usernarme (requiered) | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=language | + | It obtains all the information about a specific user. |
+ | It can return Json or CSV. This return is specified through the URL. | ||
+ | Only the username is used to obtain said information: | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====get user_profiles_info==== | ||
+ | |||
+ | It returns the list of Pandora FMS user profiles. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=user_profiles_info (required) | ||
+ | *return_type=csv|json (required) | ||
+ | |||
+ | =====Example===== | ||
+ | |||
+ | This example will return all user profiles in json format. | ||
+ | |||
+ | <nowiki>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_&</nowiki> | ||
+ | |||
+ | ====get migrate_agent==== | ||
+ | >= 7.21 ONLY METACONSOLE | ||
+ | |||
+ | It looks up whether an especific agent exists in migration queue, returning the data of migration_queue. | ||
+ | |||
+ | *op=get | ||
+ | *op2=migrate_agent | ||
+ | *id=id_agente a migrar | ||
+ | *return_type = string, json, etc | ||
+ | |||
+ | =====Example===== | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====get language==== | ||
+ | >= 7.0NG 730 | ||
+ | |||
+ | It returns the language with which Pandora FMS is configured. | ||
+ | |||
+ | Call syntax: | ||
+ | * op=get | ||
+ | * op2=language | ||
+ | |||
+ | =====Example===== | ||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=language</nowiki> | ||
====get session_timeout==== | ====get session_timeout==== | ||
Line 1,523: | Line 1,616: | ||
>= 7.0NG 730 | >= 7.0NG 730 | ||
− | + | It returns the session time with which Pandora FMS is configured. | |
Call syntax: | Call syntax: | ||
Line 1,531: | Line 1,624: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=session_timeout | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=session_timeout</nowiki> |
====get groups==== | ====get groups==== | ||
>= 7.0NG 732 | >= 7.0NG 732 | ||
− | + | It returns the existing groups. | |
Call syntax: | Call syntax: | ||
Line 1,544: | Line 1,637: | ||
* other=<optional parameters>: | * other=<optional parameters>: | ||
:* <csv_separator>: ';' by default. | :* <csv_separator>: ';' by default. | ||
− | :* <return_all_group> | + | :* <return_all_group>. It returns the group 'All'. |
− | :* <return_all_columns> | + | :* <return_all_columns>. It returns all columns. |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | ====get | + | ====get filter user group==== |
+ | {{metaconsole}} | ||
− | + | It obtains user groups through filtering. | |
− | + | Call syntax: | |
− | + | * op=get (requiered) | |
− | *op=get ( | + | * op2=filter_user_group (requiered) |
− | *op2= | + | * return_type=csv|json(requiered) |
− | *return_type=csv|json ( | + | *other= id group(requiered)|Enabled or not(Disabled)(requiered) |
− | ===== | + | =====Example===== |
+ | It can return Json or CSV. This return is remarked through the URL. | ||
− | + | {{Warning|Be careful, one of the two variables (group id or Enabled) may be empty, but at least one of them should be filled out.}} | |
− | http://localhost/pandora_console/include/api.php?op=get&op2= | + | |
+ | <nowiki>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</nowiki> | ||
− | === | + | ====get inventory_modules==== |
− | + | It returns the list of Pandora inventory modules. | |
− | |||
− | |||
− | |||
− | |||
Call syntax: | Call syntax: | ||
+ | *op=get (required) | ||
+ | *op2=inventory_modules (required) | ||
+ | *return_type=csv|json (required) | ||
− | + | =====Examples===== | |
− | |||
− | |||
− | + | This example will return information from all of the system's inventories in json format. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ===== | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> |
− | + | ====get inventory_modules_by_name==== | |
+ | Obtains the inventory modules from an agent using the agent name. | ||
− | * | + | Call syntax: |
+ | *op=get (required) | ||
+ | *op2=inventory_modules_by_name (required) | ||
+ | *id=<agent name> (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | 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==== |
− | + | Obtains the inventory modules from an agent using the agent alias. | |
Call syntax: | Call syntax: | ||
− | + | *op=get (required) | |
− | *op= | + | *op2=inventory_modules_by_alias (required) |
− | *op2= | + | *id=<agent alias> (required) |
− | *id= | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=====Examples===== | =====Examples===== | ||
+ | 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==== | |
+ | Obtains the data from an inventory module using agent name and module. | ||
− | ==== | + | Call syntax: |
− | + | *op=get (required) | |
+ | *op2=inventory_module_data (required) | ||
+ | *id=<agent name> (required) | ||
+ | *id2=<inventory module name> (optional) | ||
+ | *other=<serialized parameters> (optional), the following ones in this order: | ||
+ | **<separator> | ||
+ | **<date_from>: <year><month><day>T<hour>:<minute> | ||
+ | **<date_to>: <year><month><day>T<hour>:<minute> | ||
+ | **<use_agent_alias> (optional) values 0 and 1. | ||
+ | |||
+ | =====Examples===== | ||
+ | http://127.0.0.1/pandora_console/include/api.phpop=get&op2=inventory_module_data&id=e14ae3b959b08a1fb7a057281401a08063cf04eb714efa5fbf1cf4043cfa1314&id2=Routes&other=,|20191010T13:40|20191211T13:40|0&return_type=csv&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | ||
+ | |||
+ | ====get list_collections==== | ||
+ | It returns the list of all the collections in Pandora FMS. | ||
Call syntax: | Call syntax: | ||
− | *op= | + | *op=get (required) |
− | *op2= | + | *op2=list_collections (required) |
− | |||
=====Examples===== | =====Examples===== | ||
− | + | This example will return information from all collections in json format. | |
− | ==== | + | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collections&apipass=1234&user=admin&pass=pandora</nowiki> |
− | + | ====get list_collection_files==== | |
+ | It returns the list of all files in a collection. If it does not receive a collection id, it will return all files from all collections. | ||
Call syntax: | Call syntax: | ||
− | *op= | + | *op=get (required) |
− | *op2= | + | *op2=list_collections_files (required) |
− | *id= | + | *id=id_collection |
− | |||
=====Examples===== | =====Examples===== | ||
− | http:// | + | This example will return the names of all files in a collection in json format. |
+ | |||
+ | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collection_files&id=1&apipass=1234&user=admin&pass=pandora</nowiki> | ||
− | ==== | + | ====get event_mcid==== |
+ | It returns the ID of the events in the metaconsole, using the ID of the node and the ID of the event from the node. | ||
+ | |||
+ | {{metaconsole}} | ||
− | + | Call syntax: | |
− | + | *op=get (required) | |
+ | *op2=event_mcid (required) | ||
+ | *id=<server_id> (required) the ID of one of the nodes. | ||
+ | *id2 = <id_source_event> (required) The ID of the event from the node. | ||
− | + | =====Example===== | |
− | |||
− | |||
− | |||
− | |||
− | ===== | + | <nowiki>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</nowiki> |
− | + | ===SET=== | |
− | + | It sends data. | |
− | + | ====set new_agent==== | |
+ | It creates a new agent with the data sent as parameters. | ||
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=new_agent (required) |
− | + | *other=<serialized parameters> (required). They are the agent configuration and data, serialized in the following order: | |
− | *other=<serialized parameters> (required) are the | + | |
− | :*< | + | :*<agent_alias> |
+ | :*<ip> | ||
+ | :*<id_parent> | ||
+ | :*<id_group> | ||
+ | :*<cascade_protection> | ||
+ | :*<cascade_protection_module> | ||
+ | :*<interval_sec> | ||
+ | :*<id_os> | ||
+ | :*<name_server> | ||
+ | :*<custom_id> | ||
+ | :*<learning_mode> | ||
:*<disabled> | :*<disabled> | ||
− | + | :*<description> | |
− | + | :*<alias_as_name> | |
− | + | ||
− | + | =====Example===== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :*<description> | ||
− | :*< | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ===== | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_agent&other=agente_alias%7C1.1.1.1%7C0%7C4%7C0%7C0%7C300%7C10%7Cpandorafms%7C8%7C10%7C%7Cla%20descripcion%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
− | + | *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. | |
− | ====set | + | ====set update_agent==== |
− | + | It updates a new agent with data as parameters. | |
− | Call | + | Call syntax: |
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=update_agent (required) |
− | *id=< | + | *id=<id_agent> (required) |
− | *other=<serialized parameters> (required) are | + | *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> | :*<custom_id> | ||
+ | :*<learning_mode> | ||
+ | :*<disabled> | ||
:*<description> | :*<description> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?id=5&op=set&op2=update_agent&other=agente_nombre%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20descripcion&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | ====Set delete_agent==== | ||
+ | It deletes an agent that has the name as parameter. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=delete_agent (required) | ||
+ | *id=<name_agent> (required). It should be an agent name. | ||
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_agent&id=agente_erroneo&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
+ | ====set create_module_template==== | ||
+ | |||
+ | It creates an alert from a template as id parameter, in a module chosen by the module id agent id in other. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=create_module_template (required) | ||
+ | *id=<id_template> (required). It should be a template id. | ||
+ | *other=<id_module>|<id_agent> | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
− | ====set | + | ====set apply_module_template==== |
− | + | It applies module template to agent. | |
− | + | Module template is an group which contains network check modules. These templates can be applied directly to agents, avoiding adding modules one by one. | |
Call Syntax: | Call Syntax: | ||
+ | *op=set (required) | ||
+ | *op2=apply_module_template (required) | ||
+ | *id<id_template> (required). Id of the template that will be applied on the module. | ||
+ | *id2<id_agente> (required). Id of the agent in which the modules will be created. | ||
+ | |||
+ | =====Examples===== | ||
− | *op=set (required) | + | <nowiki>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</nowiki> |
− | *op2= | + | |
− | *id=<agent_name> (required) should be an agent name. | + | ====set create_network_module==== |
− | *other=<serialized parameters> (required) are | + | |
− | :*<name_module> | + | It creates a network module from data as parameters. |
+ | |||
+ | Call syntax: | ||
+ | |||
+ | *op=set (required) | ||
+ | *op2=create_network_module (required) | ||
+ | *id=<agent_name> (required). It should be an agent name. | ||
+ | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: | ||
+ | :*<name_module> | ||
:*<disabled> | :*<disabled> | ||
:*<id_module_type> | :*<id_module_type> | ||
− | |||
:*<id_module_group> | :*<id_module_group> | ||
− | |||
− | |||
− | |||
− | |||
:*<min_warning> | :*<min_warning> | ||
:*<max_warning> | :*<max_warning> | ||
Line 1,813: | Line 1,884: | ||
:*<max_critical> | :*<max_critical> | ||
:*<str_critical> | :*<str_critical> | ||
+ | :*<ff_threshold> | ||
:*<history_data> | :*<history_data> | ||
+ | :*<ip_target> | ||
+ | :*<tcp_port> | ||
+ | :*<snmp_community> | ||
+ | :*<snmp_oid> | ||
+ | :*<module_interval> | ||
+ | :*<post_process> | ||
+ | :*<min> | ||
+ | :*<max> | ||
+ | :*<custom_id> | ||
+ | :*<description> | ||
:*<enable_unknown_events> (only in version 5 or later) | :*<enable_unknown_events> (only in version 5 or later) | ||
− | :*<module_macros> (only in version 5 or later) | + | :*<module_macros> (only in version 5 or later). 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>". |
− | |||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
− | |||
:*<critical_inverse> (only in version 6.0SP1 or later) | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
:*<warning_inverse> (only in version 6.0SP1 or later) | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|127.0.0.1|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set create_plugin_module==== |
+ | It creates a module plugin with data as parameters. | ||
− | + | Call Syntax: | |
− | |||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=create_plugin_module (required) |
− | *id=<agent_name> (required) should be an agent name. | + | *id=<agent_name> (required). It should be an agent name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
:*<name_module> | :*<name_module> | ||
:*<disabled> | :*<disabled> | ||
Line 1,851: | Line 1,933: | ||
:*<history_data> | :*<history_data> | ||
:*<ip_target> | :*<ip_target> | ||
− | :*< | + | :*<tcp_port> |
− | |||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
Line 1,861: | Line 1,942: | ||
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<id_plugin> |
− | :*< | + | :*<plugin_user> |
− | :*< | + | :*<plugin_pass> |
− | :*< | + | :*<plugin_parameter> |
− | |||
− | |||
:*<enable_unknown_events> (only in version 5 or later) | :*<enable_unknown_events> (only in version 5 or later) | ||
+ | :*<macros> (only in version 5 or later). It should be a base64 encoded JSON document. The content should be an object made up by objects with the following properties: | ||
+ | :**''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. | ||
+ | :**''"desc"'': Descriptive macro name. | ||
+ | :**''"help"'': Macro description. | ||
+ | :**''"value"'': Macro value. | ||
+ | :**''"hide"'': Set to "1" to hide the macro value (useful for storing passwords). | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
+ | |||
+ | =====Example===== | ||
+ | { | ||
+ | "1": { | ||
+ | "macro": "_field1_", | ||
+ | "desc": "Target IP", | ||
+ | "help": "", | ||
+ | "value": "192.168.0.1", | ||
+ | "hide": "" | ||
+ | }, | ||
+ | "2": { | ||
+ | "macro": "_field2_", | ||
+ | "desc": "Port", | ||
+ | "help": "", | ||
+ | "value": "80", | ||
+ | "hide": "" | ||
+ | } | ||
+ | } | ||
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | |
− | + | ====set create_data_module==== | |
− | + | It creates a module with the given parameters. | |
− | + | {{warning|With this call, you may add database module data but the configuration file of the agents associated to the module cannot be modified.}} | |
− | + | Call Syntax: | |
− | |||
− | |||
− | |||
− | Call | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=create_data_module (required) |
− | *id=< | + | *id=<agent_name> (required). It should be an agent name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
− | :*< | + | :*<name_module> |
:*<disabled> | :*<disabled> | ||
+ | :*<id_module_type> | ||
+ | :*<description> | ||
:*<id_module_group> | :*<id_module_group> | ||
+ | :*<min_value> | ||
+ | :*<max_value> | ||
+ | :*<post_process> | ||
+ | :*<module_interval> | ||
:*<min_warning> | :*<min_warning> | ||
:*<max_warning> | :*<max_warning> | ||
Line 1,902: | Line 2,012: | ||
:*<max_critical> | :*<max_critical> | ||
:*<str_critical> | :*<str_critical> | ||
− | |||
:*<history_data> | :*<history_data> | ||
− | :*< | + | :*<enable_unknown_events> (only in version 5 or later) |
− | + | :*<module_macros> (only in version 5 or later). 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>". | |
− | + | :*<ff_threshold> (only in version 5.1 or later) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :*<module_macros> (only in version 5 or later) | ||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<ff_timeout> (only in version 5.1 or later) | ||
:*<critical_inverse> (only in version 6.0SP1 or later) | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
:*<warning_inverse> (only in version 6.0SP1 or later) | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set create_SNMP_module==== |
− | + | It creates an SNMP module. | |
Call Syntax: | Call Syntax: | ||
− | |||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=create_snmp_module (required) |
− | *id=< | + | *id=<agent_name> (required). It should be an agent name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
− | :*< | + | :*<name_module> |
:*<disabled> | :*<disabled> | ||
+ | :*<id_module_type> | ||
:*<id_module_group> | :*<id_module_group> | ||
:*<min_warning> | :*<min_warning> | ||
Line 1,950: | Line 2,053: | ||
:*<ip_target> | :*<ip_target> | ||
:*<module_port> | :*<module_port> | ||
+ | :*<snmp_version> | ||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
Line 1,958: | Line 2,062: | ||
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<snmp3_priv_method [AES|DES]> |
− | :*< | + | :*<snmp3_priv_pass> |
− | :*< | + | :*<snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]> |
− | :*< | + | :*<snmp3_auth_method [MD5|SHA]> |
− | :*< | + | :*<snmp3_auth_user> |
− | :*< | + | :*<snmp3_auth_pass> |
− | + | :*<enable_unknown_events> (only in version 5 or later) | |
− | + | :*<each_ff> (only in version 5.1 or later) | |
− | + | :*<ff_threshold_normal> (only in version 5.1 or later) | |
− | + | :*<ff_threshold_warning> (only in version 5.1 or later) | |
− | + | :*<ff_threshold_critical> (only in version 5.1 or later) | |
− | + | :*<ff_type> (only in version 733 or later) | |
− | + | :*<use_agent_alias> (Values 0 and 1 supported) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :*< | ||
− | :*<each_ff> (only in version 5.1 or later) | ||
− | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
− | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
− | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
− | :*< | ||
− | :*< | ||
=====Examples===== | =====Examples===== | ||
− | + | Example 1 (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw) | |
− | ====set | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | Example 2 (snmp v: 1) | ||
+ | |||
+ | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | ||
− | + | ====set update_network_module==== | |
− | + | It updates the network module. | |
− | Call | + | Call syntax: |
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=update_network_module (required) |
− | *id=<module_id> (required) should be a module id. | + | *id=<module_id> (required). It should be a module id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
:*<id_agent> | :*<id_agent> | ||
:*<disabled> | :*<disabled> | ||
Line 2,024: | Line 2,113: | ||
:*<module_interval> | :*<module_interval> | ||
:*<post_process> | :*<post_process> | ||
− | :*< | + | :*<min> |
− | :*< | + | :*<max> |
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
:*<disabled_types_event> (only in version 5 or later) | :*<disabled_types_event> (only in version 5 or later) | ||
− | :*<module_macros> (only in version 5 or later) | + | :*<module_macros> (only in version 5 or later). 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>". |
− | |||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
− | |||
:*<critical_inverse> (only in version 6.0SP1 or later) | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
:*<warning_inverse> (only in version 6.0SP1 or later) | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set update_plugin_module==== |
− | + | It updates the plugin module. | |
Call Syntax: | Call Syntax: | ||
+ | |||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=update_plugin_module (required) |
− | *id=< | + | *id=<module_id> (required). It should be a module id. |
− | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: | |
− | + | :*<id_agent> | |
− | + | :*<disabled> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | *other=<serialized parameters> (required) are | ||
− | :*<id_agent> | ||
− | :*<disabled> | ||
:*<id_module_group> | :*<id_module_group> | ||
:*<min_warning> | :*<min_warning> | ||
Line 2,095: | Line 2,154: | ||
:*<ip_target> | :*<ip_target> | ||
:*<module_port> | :*<module_port> | ||
− | |||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
Line 2,104: | Line 2,162: | ||
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<id_plugin> |
− | :*< | + | :*<plugin_user> |
− | :*< | + | :*<plugin_pass> |
− | :*< | + | :*<plugin_parameter> |
− | |||
− | |||
:*<disabled_types_event> (only in version 5 or later) | :*<disabled_types_event> (only in version 5 or later) | ||
− | :*<each_ff> (only in version 5.1 or later) | + | :*<macros> (only in version 5 or later). It should be a base64 encoded JSON document. The content should be an object made up by objects with the following properties: |
− | :*<ff_threshold_normal> (only in version 5.1 or later) | + | ** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. |
− | :*<ff_threshold_warning> (only in version 5.1 or later) | + | **''"desc"'': Descriptive name of the macro. |
+ | **''"help"'': Macro description. | ||
+ | **''"value"'':Macro value. | ||
+ | =====Example===== | ||
+ | { | ||
+ | "1": { | ||
+ | "macro": "_field1_", | ||
+ | "desc": "Target IP", | ||
+ | "help": "", | ||
+ | "value": "192.168.0.1" | ||
+ | }, | ||
+ | "2": { | ||
+ | "macro": "_field2_", | ||
+ | "desc": "Port", | ||
+ | "help": "", | ||
+ | "value": "80" | ||
+ | } | ||
+ | } | ||
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
+ | :*<each_ff> (only in version 5.1 or later) | ||
+ | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
+ | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | |
− | + | ====set update_data_module==== | |
− | + | {{warning|With this call, a database module data can be added but the configuration file of the agents associated to the module cannot be modified.}} | |
− | + | It updates the local module. | |
− | Call | + | Call Syntax: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=update_data_module (required) |
− | + | *id=<module_id> (required). It should be the module id to be updated. | |
− | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: | |
− | + | :*<id_agent> | |
− | + | :*<disabled> | |
− | + | :*<id_module_group> | |
− | + | :*<min_warning> | |
− | + | :*<max_warning> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | *id=< | ||
− | *other=<serialized parameters> (required) are | ||
− | :*< | ||
− | :*< | ||
− | :*<id_module_group | ||
− | |||
− | |||
− | |||
− | |||
− | :*<min_warning> | ||
− | :*<max_warning> | ||
:*<str_warning> | :*<str_warning> | ||
:*<min_critical> | :*<min_critical> | ||
:*<max_critical> | :*<max_critical> | ||
:*<str_critical> | :*<str_critical> | ||
+ | :*<ff_threshold> | ||
:*<history_data> | :*<history_data> | ||
− | :*< | + | :*<ip_target> |
− | |||
:*<module_port> | :*<module_port> | ||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
+ | :*<module_interval> | ||
+ | :*<post_process> | ||
+ | :*<min_value> | ||
+ | :*<max_value> | ||
:*<custom_id> | :*<custom_id> | ||
− | :*< | + | :*<description> |
− | :*<module_macros> (only in version 5 or later) | + | :*<disabled_types_event> (only in version 5 or later) |
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
+ | :*<ff_threshold> (only in version 5.1 or later) | ||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<ff_timeout> (only in version 5.1 or later) | ||
+ | :*<critical_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<warning_inverse> (only in version 6.0SP1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module&id=23234&other=44|0|data%20module%20modified%20from%20API|6|0|0|50.00|300|10|15||16|18||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set update_data_module_policy==== |
− | + | It updates a data module in a policy and returns an id from the new module. | |
− | Call | + | Call Syntax: |
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=update_data_module (required) |
− | *id=< | + | *id=<id_agent_module> (required). Id of the target policy module. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
− | :*< | + | :*<id_policy_module> |
− | + | :*<description> | |
− | :*< | ||
:*<id_module_group> | :*<id_module_group> | ||
− | :*<min_warning> | + | :*<min> |
+ | :*<max> | ||
+ | :*<post_process> | ||
+ | :*<module_interval> | ||
+ | :*<min_warning> | ||
+ | :*<max_warning> | ||
+ | :*<min_critical> | ||
+ | :*<max_critical> | ||
+ | :*<str_critical> | ||
+ | :*<history_data> | ||
+ | :*<configuration_data> | ||
+ | :*<disabled_types_event> (only in version 5 or later) | ||
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module_policy&id=1&other=10~data%20module%20updated%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_</nowiki> | ||
+ | |||
+ | ====set update_SNMP_module==== | ||
+ | |||
+ | It updates an SNMP module. | ||
+ | |||
+ | Call Syntax: | ||
+ | *op=set (required) | ||
+ | *op2=update_snmp_module (required) | ||
+ | *id=<module_id> (required). It should be a module id. | ||
+ | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: | ||
+ | :*<id_agent> | ||
+ | :*<disabled> | ||
+ | :*<id_module_group> | ||
+ | :*<min_warning> | ||
:*<max_warning> | :*<max_warning> | ||
:*<str_warning> | :*<str_warning> | ||
Line 2,208: | Line 2,299: | ||
:*<ff_threshold> | :*<ff_threshold> | ||
:*<history_data> | :*<history_data> | ||
+ | :*<ip_target> | ||
:*<module_port> | :*<module_port> | ||
+ | :*<snmp_version> | ||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
Line 2,217: | Line 2,310: | ||
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<snmp3_priv_method [AES|DES]> |
− | :*< | + | :*<snmp3_priv_pass> |
− | :*< | + | :*<snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]> |
− | :*< | + | :*<snmp3_auth_method [MD5|SHA]> |
− | :*< | + | :*<snmp3_auth_user> |
− | :*< | + | :*<snmp3_auth_pass> |
− | + | :*<disabled_types_event> (only in version 5 or later) | |
− | + | :*<each_ff> (only in version 5.1 or later) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :*< | ||
− | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | + | Example (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw) | |
− | ====set | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | ====set apply_policy==== | ||
+ | It applies the policy, once it has gone through id, in one or several agents. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=apply_policy (required) | ||
+ | *id=<id_policy> (required) | ||
+ | *id2=<id_agent> (optional). Id or name of the agent as indicated in the other parameter. If it is empty, the policy will be applied to all its agents. | ||
+ | *other=<serialized parameters> | ||
+ | :*<name_agent (Integer)>. It indicates whether the agent will be sent by Id (0), by name (1) or by alias (2). | ||
+ | :*<server_id> (required when using Metaconsole). Id of the server in which the policy will be applied. | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set apply_all_policies==== | ||
+ | |||
+ | It applies all policies within Pandora FMS. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=apply_all_policies (required) | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_all_policies&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
+ | ====set add_network_module_policy==== | ||
− | + | It adds a network module in the policy after it has gone through id in the parameter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=add_network_module_policy (required) |
− | *id=<id_policy> (required) should be a policy Id. | + | *id=<id_policy> (required). It should be a policy Id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
− | |||
:*<id_module_type> | :*<id_module_type> | ||
:*<description> | :*<description> | ||
Line 2,276: | Line 2,380: | ||
:*<str_critical> | :*<str_critical> | ||
:*<history_data> | :*<history_data> | ||
− | :*< | + | :*<ff_threshold> |
− | :*<enable_unknown_events> (only in version 5 or later) | + | :*<disabled> |
− | :*<module_macros> (only in version 5 or later) | + | :*<module_port> |
− | + | :*<snmp_community> | |
+ | :*<snmp_oid> | ||
+ | :*<custom_id> | ||
+ | :*<enable_unknown_events> (only in version 5 or later) | ||
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
− | :*< | + | :*<ff_type> (only in version 733 or later) |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set add_plugin_module_policy==== |
− | + | It adds a plugin module in the policy that has gone through id in the parameter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=add_plugin_module_policy (required) |
− | *id=<id_policy> (required) should be a policy Id. | + | *id=<id_policy> (required). It should be a policy Id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
:*<name_module> | :*<name_module> | ||
:*<disabled> | :*<disabled> | ||
Line 2,312: | Line 2,420: | ||
:*<history_data> | :*<history_data> | ||
:*<module_port> | :*<module_port> | ||
− | |||
:*<snmp_community> | :*<snmp_community> | ||
:*<snmp_oid> | :*<snmp_oid> | ||
Line 2,321: | Line 2,428: | ||
:*<custom_id> | :*<custom_id> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<id_plugin> |
− | :*< | + | :*<plugin_user> |
− | :*< | + | :*<plugin_pass> |
− | :*< | + | :*<plugin_parameter> |
− | :*< | + | :*<enable_unknown_events> (only in version 5) |
− | :*< | + | :*<macros> (only in version 5 or later). It should be a base64 encoded JSON document. The content should be an object made up by objects with the following properties: |
− | :*< | + | ** ''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. |
+ | **''"desc"'': Descriptive macro name. | ||
+ | **''"help"'': Macro description. | ||
+ | **''"value"'':Macro value. | ||
+ | =====Example===== | ||
+ | { | ||
+ | "1": { | ||
+ | "macro": "_field1_", | ||
+ | "desc": "Target IP", | ||
+ | "help": "", | ||
+ | "value": "192.168.0.1" | ||
+ | }, | ||
+ | "2": { | ||
+ | "macro": "_field2_", | ||
+ | "desc": "Port", | ||
+ | "help": "", | ||
+ | "value": "80" | ||
+ | } | ||
+ | } | ||
+ | :*<module_macros> (only in version 5 or later). 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>". | ||
:*<each_ff> (only in version 5.1 or later) | :*<each_ff> (only in version 5.1 or later) | ||
:*<ff_threshold_normal> (only in version 5.1 or later) | :*<ff_threshold_normal> (only in version 5.1 or later) | ||
:*<ff_threshold_warning> (only in version 5.1 or later) | :*<ff_threshold_warning> (only in version 5.1 or later) | ||
:*<ff_threshold_critical> (only in version 5.1 or later) | :*<ff_threshold_critical> (only in version 5.1 or later) | ||
+ | :*<ff_type> (only in version 733 or later) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set add_data_module_policy==== |
− | + | It adds a local module in the policy which has gone through id in the parameter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=add_data_module_policy (required) |
− | *id=<id_policy> (required) | + | *id=<id_policy> (required). It should be a policy Id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
− | :*< | + | :*<name_module> |
+ | :*<id_module_type> | ||
+ | :*<description> | ||
+ | :*<id_module_group> | ||
+ | :*<min_value> | ||
+ | :*<max_value> | ||
+ | :*<post_process> | ||
+ | :*<module_interval> | ||
+ | :*<min_warning> | ||
+ | :*<max_warning> | ||
+ | :*<str_warning> | ||
+ | :*<min_critical> | ||
+ | :*<max_critical> | ||
+ | :*<str_critical> | ||
+ | :*<history_data> | ||
+ | :*<configuration_data>. This is the definition block of the agent that will be entered in the config file of the policy agent. | ||
+ | :*<enable_unknown_events> (only in version 5 or later) | ||
+ | :*<module_macros> (only in version 5). 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>". | ||
+ | :*<ff_threshold> (only in version 5.1 ) | ||
+ | :*<each_ff> (only in version 5.1) | ||
+ | :*<ff_threshold_normal> (only in version 5.1) | ||
+ | :*<ff_threshold_warning> (only in version 5.1) | ||
+ | :*<ff_threshold_critical> (only in version 5.1) | ||
+ | :*<ff_timeout> (only in version 5.1) | ||
+ | :*<ff_type> (only in version 734) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_~&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set add_SNMP_module_policy==== |
− | + | It adds a SNMP module in the policy which has gone through id in the parameter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=add_snmp_module_policy (required) |
− | *id=< | + | *id=<id_policy> (required). It should be a policy Id. |
− | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: | |
− | + | :*<name_module> | |
− | + | :*<disabled> | |
− | + | :*<id_module_type> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | *other=<serialized parameters> (required) are | ||
− | :*< | ||
− | |||
− | |||
− | |||
− | :*< | ||
− | :*< | ||
:*<id_module_group> | :*<id_module_group> | ||
− | |||
− | |||
:*<min_warning> | :*<min_warning> | ||
:*<max_warning> | :*<max_warning> | ||
Line 2,391: | Line 2,523: | ||
:*<str_critical> | :*<str_critical> | ||
:*<ff_threshold> | :*<ff_threshold> | ||
− | :*<post_process> | + | :*<history_data> |
− | :*< | + | :*<module_port> |
− | :*<enable_unknown_events> (only in version 5) | + | :*<snmp_version> |
− | :*<each_ff> (only in version 5.1 | + | :*<snmp_community> |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<snmp_oid> |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<module_interval> |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<post_process> |
+ | :*<min_value> | ||
+ | :*<max_value> | ||
+ | :*<custom_id> | ||
+ | :*<description> | ||
+ | :*<snmp3_priv_method [AES|DES]> | ||
+ | :*<snmp3_priv_pass> | ||
+ | :*<snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]> | ||
+ | :*<snmp3_auth_method [MD5|SHA]> | ||
+ | :*<snmp3_auth_user> | ||
+ | :*<snmp3_auth_pass> | ||
+ | :*<enable_unknown_events> (only in version 5 or later) | ||
+ | :*<each_ff> (only in version 5.1) | ||
+ | :*<ff_threshold_normal> (only in version 5.1) | ||
+ | :*<ff_threshold_warning> (only in version 5.1) | ||
+ | :*<ff_threshold_critical> (only in version 5.1) | ||
+ | :*<ff_type> (only in version 734) | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | ||
+ | |||
+ | ====set add_agent_policy_by_id==== | ||
+ | |||
+ | It adds an agent to a policy using the agent ID | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=add_agent_policy_by_id (mandatory) | ||
+ | *id=<id_policy> (required). It must be a policy Id. | ||
+ | *other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order: | ||
+ | :*<id_agent> | ||
+ | :*<id_node> (required when using the Metaconsole). ID of the node the agent you wish to add to the policy belongs to. | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | * Node: |
+ | <nowiki>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</nowiki> | ||
− | ====set | + | * Metaconsole: |
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set add_agent_policy_by_name==== | ||
− | + | It adds an agent to a policy using the agent name. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=add_agent_policy_by_name (required) |
− | *id=< | + | *id=<id_policy> (required). It must be a policy Id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order: |
− | :*< | + | :*<agent_name> |
− | + | ||
− | + | =====Examples===== | |
− | + | ||
− | : | + | <nowiki>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</nowiki> |
− | + | ||
− | + | ====set remove_agent_from_policy_by_id==== | |
− | + | ||
− | + | It deletes an agent from a policy using the agent ID. | |
− | + | ||
− | + | Call syntax: | |
− | + | *op=set (required) | |
− | + | *op2=remove_agent_from_policy_by_id (required) | |
− | : | + | *id=<id_política> (required). It must be a policy Id. |
− | + | *other=<serialized parameters> (required). These are the agent’s configuration and data, serialized in the following order: | |
− | + | :*<id_agent> | |
− | + | :*<id_node> (required when using the Metaconsole). ID of the node the agent you wish to remove from the policy belongs to. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | :*< | ||
− | :*< | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | * Node: |
+ | <nowiki>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</nowiki> | ||
− | ====set | + | * Metaconsole: |
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set remove_agent_from_policy_by_name==== | ||
− | + | It deletes an agent from a policy using the agent name. | |
Call syntax: | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=remove_agent_from_policy_by_name (required) | ||
+ | *id=<id_policy> (required). It must be a policy Id. | ||
+ | *other=<serialized parameters> (required). These are the agent’s configuration and data, serialized in the following order: | ||
+ | :*<agent_name> | ||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set new_network_component==== | ||
+ | |||
+ | It creates a new network component. | ||
+ | |||
+ | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=new_network_component (required) |
− | *id=< | + | *id=<network_component_name> (required). It should be the network component name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are agent configuration and data of the network component, serialized in the following order: |
− | :*< | + | :*<network_component_type> |
:*<description> | :*<description> | ||
:*<module_interval> | :*<module_interval> | ||
:*<max_value> | :*<max_value> | ||
:*<min_value> | :*<min_value> | ||
+ | :*<snmp_community> | ||
:*<id_module_group> | :*<id_module_group> | ||
:*<max_timeout> | :*<max_timeout> | ||
Line 2,467: | Line 2,647: | ||
:*<ff_threshold> | :*<ff_threshold> | ||
:*<post_process> | :*<post_process> | ||
− | :*< | + | :*<network_component_group> |
− | :*< | + | :*<enable_unknown_events> (only in version 5) |
− | :*< | + | :*<each_ff> (only in version 5.1) |
− | + | :*<ff_threshold_normal> (only in version 5.1) | |
− | + | :*<ff_threshold_warning> (only in version 5.1) | |
− | + | :*<ff_threshold_critical> (only in version 5.1) | |
− | + | :*<ff_type> (only in version 734) | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | :*< | ||
− | :*< | ||
− | :*< | ||
− | :*< | ||
− | |||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set new_plugin_component==== |
− | + | It creates a new plugin component. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=new_plugin_component (required) |
− | *id=< | + | *id=<plugin_component_name> (required). It should be the plugin component name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are agent configuration and data of the plugin component, serialized in the following order: |
+ | :*<plugin_component_type> | ||
:*<description> | :*<description> | ||
− | :*< | + | :*<module_interval> |
− | :*< | + | :*<max_value> |
− | :*< | + | :*<min_value> |
− | :*< | + | :*<module_port> |
− | :*<ff_threshold> (only in version 5 | + | :*<id_module_group> |
− | :*<each_ff> (only in version 5.1 | + | :*<id_plugin> |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<max_timeout> |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<history_data> |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<min_warning> |
− | :*< | + | :*<max_warning> |
− | + | :*<str_warning> | |
− | + | :*<min_critical> | |
+ | :*<max_critical> | ||
+ | :*<str_critical> | ||
+ | :*<ff_threshold> | ||
+ | :*<post_process> | ||
+ | :*<plugin_component_group> | ||
+ | :*<enable_unknown_events> (only in version 5) | ||
+ | :*<each_ff> (only in version 5.1) | ||
+ | :*<ff_threshold_normal> (only in version 5.1) | ||
+ | :*<ff_threshold_warning> (only in version 5.1) | ||
+ | :*<ff_threshold_critical> (only in version 5.1) | ||
+ | :*<ff_type> (only in version 734) | ||
− | + | =====Examples===== | |
+ | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | ||
− | ====set | + | ====set new_snmp_component==== |
− | + | It creates a new SNMP component. | |
− | Call | + | Call syntax: |
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=new_snmp_component (required) |
− | *id=< | + | *id=<snmp_component_name> (required). It should be the SNMP component name. |
− | *other=<serialized parameters> (required) are the | + | *other=<serialized parameters> (required). These are the configuration and data of the snmp component, serialized in the following order: |
− | :*< | + | :*<snmp_component_type> |
:*<description> | :*<description> | ||
− | :*< | + | :*<module_interval> |
− | |||
− | |||
− | |||
− | |||
− | |||
:*<max_value> | :*<max_value> | ||
:*<min_value> | :*<min_value> | ||
− | :*< | + | :*<id_module_group> |
− | :*< | + | :*<max_timeout> |
− | :*< | + | :*<history_data> |
− | :*< | + | :*<min_warning> |
− | :*< | + | :*<max_warning> |
− | :*< | + | :*<str_warning> |
− | :*< | + | :*<min_critical> |
− | :*< | + | :*<max_critical> |
− | :*< | + | :*<str_critical> |
− | :*< | + | :*<ff_threshold> |
− | :*< | + | :*<post_process> |
− | :*< | + | :*<snmp_version> |
− | :*< | + | :*<snmp_oid> |
− | :*< | + | :*<snmp_community> |
− | :*< | + | :*<snmp3_auth_user> |
− | :*< | + | :*<snmp3_auth_pass> |
− | :*< | + | :*<module_port> |
+ | :*<snmp3_privacy_method> | ||
+ | :*<snmp3_privacy_pass> | ||
+ | :*<snmp3_auth_method> | ||
+ | :*<snmp3_security_level> | ||
+ | :*<snmp_component_group> | ||
+ | :*<enable_unknown_events> (only in version 5) | ||
+ | :*<each_ff> (only in version 5.1) | ||
+ | :*<ff_threshold_normal> (only in version 5.1) | ||
+ | :*<ff_threshold_warning> (only in version 5.1) | ||
+ | :*<ff_threshold_critical> (only in version 5.1) | ||
+ | :*<ff_type> (only in version 734) | ||
=====Examples===== | =====Examples===== | ||
− | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> | |
+ | |||
+ | ====set new_local_component==== | ||
+ | |||
+ | It creates a new local component. | ||
− | + | Call syntax: | |
+ | *op=set (required) | ||
+ | *op2=new_local_component (required) | ||
+ | *id=<local_component_name> (required). It should be a local component name. | ||
+ | *other=<serialized parameters> (required). They are configuration and data of the local component, serialized in the following order: | ||
+ | :*<description> | ||
+ | :*<id_os> | ||
+ | :*<local_component_group> | ||
+ | :*<configuration_data>. This is the module configuration block. | ||
+ | :*<enable_unknown_events> (only in version 5) | ||
+ | :*<ff_threshold> (only in version 5.1) | ||
+ | :*<each_ff> (only in version 5.1) | ||
+ | :*<ff_threshold_normal> (only in version 5.1) | ||
+ | :*<ff_threshold_warning> (only in version 5.1) | ||
+ | :*<ff_threshold_critical> (only in version 5.1) | ||
+ | :*<ff_timeout> (only in version 5.1) | ||
+ | :*<ff_type> (only in version 734) | ||
− | + | =====Examples===== | |
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>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_~&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set create_alert_template==== |
− | + | It creates an alert template. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
− | *op2= | + | *op2=create_alert_template (required) |
− | *id=< | + | *id=<template_name> (required). It is the template name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are template configuration and data, serialized in the following order: |
− | + | :*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always|not_normal]> | |
− | :*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]> | ||
:*<description> | :*<description> | ||
:*<id_alert_action> | :*<id_alert_action> | ||
Line 2,600: | Line 2,809: | ||
:*<priority> | :*<priority> | ||
:*<id_group> | :*<id_group> | ||
+ | :*<special_day> | ||
+ | :*<min_alerts_reset_counter> | ||
+ | :*<field1_recovery> | ||
+ | :*<field4> | ||
+ | :*<field5> | ||
+ | :*<field6> | ||
+ | :*<field7> | ||
+ | :*<field8> | ||
+ | :*<field9> | ||
+ | :*<field10> | ||
+ | :*<field11> | ||
+ | :*<field12> | ||
+ | :*<field13> | ||
+ | :*<field14> | ||
+ | :*<field15> | ||
+ | :*<field4_recovery> | ||
+ | :*<field5_recovery> | ||
+ | :*<field6_recovery> | ||
+ | :*<field7_recovery> | ||
+ | :*<field8_recovery> | ||
+ | :*<field9_recovery> | ||
+ | :*<field10_recovery> | ||
+ | :*<field11_recovery> | ||
+ | :*<field12_recovery> | ||
+ | :*<field13_recovery> | ||
+ | :*<field14_recovery> | ||
+ | :*<field15_recovery> | ||
=====Examples===== | =====Examples===== | ||
− | + | Example 1 (condition: regexp =~ /pp/, action: Mail to XXX, max_alert: 10, min_alert: 0, priority: WARNING, group: databases): | |
− | ==== | + | <nowiki>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</nowiki> |
− | + | Example 2 (condition: value is not between 5 and 10, max_value: 10.00, min_value: 5.00, time_from: 00:00:00, time_to: 15:00:00, priority: CRITICAL, group: Servers): | |
− | Call Syntax: | + | <nowiki>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</nowiki> |
+ | |||
+ | ====set update_alert_template==== | ||
+ | |||
+ | It updates the template alert. | ||
+ | |||
+ | Call Syntax: | ||
+ | |||
+ | *op=set (required) | ||
+ | *op2=update_alert_template (required) | ||
+ | *id=<id_template> (required). It should be a template id. | ||
+ | *other=<serialized parameters> (required). They are template configuration and data, serialized in the following order: | ||
+ | :*<template_name> | ||
+ | :*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]> | ||
+ | :*<description> | ||
+ | :*<id_alert_action> | ||
+ | :*<field1> | ||
+ | :*<field2> | ||
+ | :*<field3> | ||
+ | :*<value> | ||
+ | :*<matches_value> | ||
+ | :*<max_value> | ||
+ | :*<min_value> | ||
+ | :*<time_threshold> | ||
+ | :*<max_alerts> | ||
+ | :*<min_alerts> | ||
+ | :*<time_from> | ||
+ | :*<time_to> | ||
+ | :*<monday> | ||
+ | :*<tuesday> | ||
+ | :*<wednesday> | ||
+ | :*<thursday> | ||
+ | :*<friday> | ||
+ | :*<saturday> | ||
+ | :*<sunday> | ||
+ | :*<recovery_notify> | ||
+ | :*<field2_recovery> | ||
+ | :*<field3_recovery> | ||
+ | :*<priority> | ||
+ | :*<id_group> | ||
+ | :*<special_day> | ||
+ | :*<min_alerts_reset_counter> | ||
+ | :*<field1_recovery> | ||
+ | :*<field4> | ||
+ | :*<field5> | ||
+ | :*<field6> | ||
+ | :*<field7> | ||
+ | :*<field8> | ||
+ | :*<field9> | ||
+ | :*<field10> | ||
+ | :*<field11> | ||
+ | :*<field12> | ||
+ | :*<field13> | ||
+ | :*<field14> | ||
+ | :*<field15> | ||
+ | :*<field4_recovery> | ||
+ | :*<field5_recovery> | ||
+ | :*<field6_recovery> | ||
+ | :*<field7_recovery> | ||
+ | :*<field8_recovery> | ||
+ | :*<field9_recovery> | ||
+ | :*<field10_recovery> | ||
+ | :*<field11_recovery> | ||
+ | :*<field12_recovery> | ||
+ | :*<field13_recovery> | ||
+ | :*<field14_recovery> | ||
+ | :*<field15_recovery> | ||
+ | |||
+ | =====Examples===== | ||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set delete_alert_template==== | ||
+ | |||
+ | It deletes a alert template and deletes all the alerts it defines. | ||
+ | |||
+ | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_alert_template (required) | *op2=delete_alert_template (required) | ||
− | *id=<id_template> (required) should be a template id. | + | *id=<id_template> (required). It should be a template id. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_module_template==== | ====set delete_module_template==== | ||
− | + | It deletes a module template. | |
Call Syntax: | Call Syntax: | ||
Line 2,627: | Line 2,938: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_module_template (required) | *op2=delete_module_template (required) | ||
− | *id=<id_alert_template_module> (required) should be | + | *id=<id_alert_template_module> (required). It should be an alert_template_module id. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_module_template_by_names==== | ====set delete_module_template_by_names==== | ||
− | + | It deletes a module template. | |
Call Syntax: | Call Syntax: | ||
Line 2,643: | Line 2,954: | ||
*id=<agent name> (required) | *id=<agent name> (required) | ||
*id2=<alert template name> (required) | *id2=<alert template name> (required) | ||
− | *other=<serialized parameter> (required) | + | *other=<serialized parameter> (required). They are the following in this order: |
:*<module name> (required) | :*<module name> (required) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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&other_mode=url_encode_separator_|</nowiki> |
====set stop_downtime==== | ====set stop_downtime==== | ||
− | + | It stops a downtime. | |
Call Syntax: | Call Syntax: | ||
Line 2,658: | Line 2,970: | ||
*op=set (required) | *op=set (required) | ||
*op2=stop_downtime (required) | *op2=stop_downtime (required) | ||
− | *id=<id_downtime> (required) should be | + | *id=<id_downtime> (required). It should be an id downtime. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1&apipass=1234&user=admin&pass=pandora</nowiki> |
====set new_user==== | ====set new_user==== | ||
− | + | It creates a new user in Pandora FMS. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_user (required) | *op2=new_user (required) | ||
− | *id=<user_name> (required) | + | *id=<user_name> (required). It is an user name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are user configuration and data, serialized in the following order: |
:*<fullname> | :*<fullname> | ||
:*<firstname> | :*<firstname> | ||
Line 2,682: | Line 2,994: | ||
:*<languages> | :*<languages> | ||
:*<comments> | :*<comments> | ||
+ | :*<time_autorefresh> | ||
+ | :*<default_event_filter> | ||
+ | :*<section> | ||
+ | :*<session_time> (-1 to establish the session as permanent) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel|de%20dios|matias|kkk|pandora|[email protected]|666|es|descripcion%20y%20esas%20cosas&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel|de%20dios|matias|kkk|pandora|[email protected]|666|es|descripcion%20y%20esas%20cosas&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====Set update_user==== | ====Set update_user==== | ||
− | + | It updates a user selected by the id in the id parameter. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_user (required) | *op2=update_user (required) | ||
− | *id=<user_name> (required) should be | + | *id=<user_name> (required). It should be a user name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are module configuration and data, serialized in the following order: |
:*<fullname> | :*<fullname> | ||
:*<firstname> | :*<firstname> | ||
Line 2,711: | Line 3,027: | ||
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====Set delete_user==== | ====Set delete_user==== | ||
− | + | It deletes a selected user. | |
Call syntax: | Call syntax: | ||
Line 2,721: | Line 3,037: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_user (required) | *op2=delete_user (required) | ||
− | *id=<nombre_usuario> (required) should be | + | *id=<nombre_usuario> (required). It should be a username. |
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | ====Set delete_user_permissions==== | ||
+ | {{metaconsole}} | ||
+ | It deletes user permissions. | ||
+ | |||
+ | Call syntax: | ||
+ | |||
+ | *Op = set(requiered) | ||
+ | *Op2 =delete_user_permission(requiered) | ||
+ | *Return_type = csv|json(requiered) | ||
+ | *Other = id profile(requiered) | ||
+ | |||
+ | |||
+ | =====Example===== | ||
+ | It deletes user permissions. | ||
+ | It can return Json or CSV, this return is remarked through the URL. | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====Set add_permission_user_group==== | ||
+ | {{metaconsole}} | ||
+ | |||
+ | It adds permissions to a user group. | ||
+ | |||
+ | Call syntax: | ||
+ | * Op = set(requiered) | ||
+ | * Op2 =add_permission_user_to_group(requiered) | ||
+ | * Return_type = csv|json(requiered) | ||
+ | * Other = user id(requiered)|group_id(requiered)|profile id(requiered)|No hierarchy(Optional)| profile id(Optional) | ||
+ | |||
+ | |||
+ | |||
+ | =====Examples===== | ||
+ | It can return Json or CSV, this return is remarked through the URL. | ||
+ | {{Warning|Be careful, no_hierarchy may be empty. If that is the case, it takes value 0.}} | ||
+ | |||
+ | {{Warning|Be careful, permission id (id_up) in the table can be used if an existing permission must be modified.}} | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
====set enable_disable_user==== | ====set enable_disable_user==== | ||
− | + | It enables a disabled user. | |
Call syntax: | Call syntax: | ||
Line 2,735: | Line 3,090: | ||
*op=set (required) | *op=set (required) | ||
*op2=enable_disable_user (required) | *op2=enable_disable_user (required) | ||
− | *id=<user_name> (required) should be | + | *id=<user_name> (required). It should be a username. |
=====Examples===== | =====Examples===== | ||
Line 2,741: | Line 3,096: | ||
Example 1 (Disable user 'example_name') | Example 1 (Disable user '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 | + | <nowiki>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</nowiki> |
Example 2 (Enable user 'example_name') | Example 2 (Enable user '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 | + | <nowiki>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</nowiki> |
====set meta_synch_user==== | ====set meta_synch_user==== | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | ||
+ | It syncronizes metaconsole users to the node | ||
Call syntax: | Call syntax: | ||
Line 2,756: | Line 3,112: | ||
*op2=meta_synch_user (required) | *op2=meta_synch_user (required) | ||
*other=<serialized parameters> (opcional): | *other=<serialized parameters> (opcional): | ||
− | :*<user_name_1,user_name_2,user_name_3..> ( | + | :*<user_name_1,user_name_2,user_name_3..> (Usernames separated by comma and without spaces at the beginning or the end, required) |
:*<server_name> (required) | :*<server_name> (required) | ||
− | :*<profile_mode(1-0)> ( | + | :*<profile_mode(1-0)> (optional) |
− | :*<group_name> ( | + | :*<group_name> (optional) |
− | :*<profile_1,profile_2,profile_3> ( | + | :*<profile_1,profile_2,profile_3> (Profiles separated by comma and without spaces at the beginning or at the end, optional) |
− | :*<create_groups(1-0)> ( | + | :*<create_groups(1-0)> (optional) |
=====Example===== | =====Example===== | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
====set create_group==== | ====set create_group==== | ||
− | + | It creates a group. | |
Call syntax: | Call syntax: | ||
Line 2,775: | Line 3,131: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_group (required) | *op2=create_group (required) | ||
− | *id=<group_name> (required) should be a group name. | + | *id=<group_name> (required). It should be a group name. |
− | *other=<serialized_parameters> (required). | + | *other=<serialized_parameters> (required). They are the following in this order: |
:*<icon name> | :*<icon name> | ||
:*<parent group id> (optional) | :*<parent group id> (optional) | ||
Line 2,790: | Line 3,146: | ||
Example 1 (with parent group: Servers) | Example 1 (with parent group: 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
Example 2 (without parent group) | Example 2 (without parent group) | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_group==== | ====set update_group==== | ||
− | + | It updates a group with past data as parameters. | |
Call syntax: | Call syntax: | ||
Line 2,804: | Line 3,160: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_group (required) | *op2=update_group (required) | ||
− | *id=<group_id> (required) should be a group id | + | *id=<group_id> (required). It should be a group id |
− | *other=<serialized_parameters> (required). | + | *other=<serialized_parameters> (required). They are the following in this order: |
:*<group name> | :*<group name> | ||
:*<icon name> | :*<icon name> | ||
Line 2,818: | Line 3,174: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set delete_group==== | ====set delete_group==== | ||
− | + | It deletes a group. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_group (required) | *op2=delete_group (required) | ||
− | *id=<group_id> (required) should be a group id | + | *id=<group_id> (required) it should be a group id |
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora</nowiki> |
====Set add_user_profile==== | ====Set add_user_profile==== | ||
− | + | It adds a profile into user. | |
Call syntax: | Call syntax: | ||
Line 2,841: | Line 3,197: | ||
*op=set (required) | *op=set (required) | ||
*op2=add_user_profile (required) | *op2=add_user_profile (required) | ||
− | *id=<user_name> (required) should be | + | *id=<user_name> (required). It should be a user name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are group and profile configuration and data, serialized in the following order: |
:*<group> | :*<group> | ||
:*<profile> | :*<profile> | ||
Line 2,848: | Line 3,204: | ||
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_user_profile==== | ====set delete_user_profile==== | ||
− | + | It deletes a profile from a user. | |
Call syntax: | Call syntax: | ||
Line 2,858: | Line 3,214: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_user_profile (required) | *op2=delete_user_profile (required) | ||
− | *id=<user_name> (required) should be | + | *id=<user_name> (required). It should be a user name. |
− | *other=<serialized parameters> (required) are the group configuration, data and profile, serialized in the following order: | + | *other=<serialized parameters> (required). They are the group configuration, data and profile, serialized in the following order: |
:*<group> | :*<group> | ||
:*<profile> | :*<profile> | ||
Line 2,865: | Line 3,221: | ||
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set new_incident==== | ====set new_incident==== | ||
− | + | It creates a new incident. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_incident (required) | *op2=new_incident (required) | ||
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are incident configuration and data, serialized in the following order: |
:*<title> | :*<title> | ||
:*<description> | :*<description> | ||
Line 2,884: | Line 3,240: | ||
=====Examples===== | =====Examples===== | ||
− | 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_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>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_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====Set new_note_incident==== | ====Set new_note_incident==== | ||
− | + | It adds a note within an incident. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_note_incident (required) | *op2=new_note_incident (required) | ||
− | *id=<id_incident> (required )the incident id. | + | *id=<id_incident> (required). It is the incident id. |
− | *id2=<user_name> (required) | + | *id2=<user_name> (required). Username. |
− | *other=<note> (required) is the note codified in url encode. | + | *other=<note> (required). It is the note codified in url encode. |
=====Examples===== | =====Examples===== | ||
− | 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&apipass=1234&user=admin&pass=pandora | + | <nowiki>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&apipass=1234&user=admin&pass=pandora</nowiki> |
====set validate_all_alerts==== | ====set validate_all_alerts==== | ||
− | + | It validates all alerts. | |
Call syntax: | Call syntax: | ||
Line 2,910: | Line 3,266: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts&apipass=1234&user=admin&pass=pandora</nowiki> |
====set validate_all_policy_alerts==== | ====set validate_all_policy_alerts==== | ||
− | + | It validates the alerts created from a policy. | |
Call syntax: | Call syntax: | ||
Line 2,921: | Line 3,277: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts&apipass=1234&user=admin&pass=pandora</nowiki> |
====set event_validate_filter==== | ====set event_validate_filter==== | ||
− | + | It validates all events that pass the past filter as parameters. | |
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
Line 2,934: | Line 3,291: | ||
*op2=event_validate_filter (required) | *op2=event_validate_filter (required) | ||
*other_mode=url_encode_separator_|(optional) | *other_mode=url_encode_separator_|(optional) | ||
− | *other=<serialized_parameters> (optional). | + | *other=<serialized_parameters> (optional). They are the following in this order: |
:*<separator> | :*<separator> | ||
− | :*<criticity> | + | :*<criticity> From 0 to 4 |
:*<agent name> | :*<agent name> | ||
:*<module name> | :*<module name> | ||
Line 2,943: | Line 3,300: | ||
:*< numeric interval minimum level> en unix timestamp | :*< numeric interval minimum level> en unix timestamp | ||
:*< numeric interval maximum level> en unix timestamp | :*< numeric interval maximum level> en unix timestamp | ||
+ | :*<use_agent_name> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora</nowiki> |
====set event_validate_filter_pro==== | ====set event_validate_filter_pro==== | ||
− | It is | + | It is similar to previous call. |
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
Line 2,959: | Line 3,318: | ||
*op2=event_validate_filter_pro (required) | *op2=event_validate_filter_pro (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameters> (optional) | + | *other=<serialized parameters> (optional). They are the following in this order: |
:*<separator> | :*<separator> | ||
:*<criticity> From 0 to 4 | :*<criticity> From 0 to 4 | ||
Line 2,971: | Line 3,330: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | ====set validate_event_by_id==== | ||
+ | |||
+ | Validates an event given its id. | ||
+ | |||
+ | Call syntax: | ||
+ | |||
+ | op=set (required) | ||
+ | op2=validate_event_by_id (required) | ||
+ | id=<event_id> (required) event id. | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=validate_event_by_id&id=23&apipass=1234&user=admin&pass=pandora</nowiki> | ||
====set new_alert_template==== | ====set new_alert_template==== | ||
− | + | It applies a new alert from a template and module which has gone through id agent and module name. | |
Call syntax: | Call syntax: | ||
Line 2,984: | Line 3,357: | ||
*id2=<alert template name> (required) | *id2=<alert template name> (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameter> (required) | + | *other=<serialized parameter> (required). They are the following in this order: |
:*<module name> (required) | :*<module name> (required) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | 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&apipass=1234&user=admin&pass=pandora | + | <nowiki>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&apipass=1234&user=admin&pass=pandora</nowiki> |
====set alert_actions==== | ====set alert_actions==== | ||
− | + | It adds actions within an alert. | |
Call syntax: | Call syntax: | ||
Line 3,001: | Line 3,375: | ||
*id2=<alert template name> (required) | *id2=<alert template name> (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). They are the following in this order: |
:*<module name> (required) | :*<module name> (required) | ||
:*<action name> (required) | :*<action name> (required) | ||
:*<fires min > (optional) | :*<fires min > (optional) | ||
:*<fires max > (optional) | :*<fires max > (optional) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | 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&apipass=1234&user=admin&pass=pandora | + | <nowiki>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&apipass=1234&user=admin&pass=pandora</nowiki> |
− | 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&apipass=1234&user=admin&pass=pandora | + | <nowiki>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&apipass=1234&user=admin&pass=pandora</nowiki> |
====set alert_commands==== | ====set alert_commands==== | ||
− | + | It adds commands within an alert. | |
Call syntax: | Call syntax: | ||
Line 3,021: | Line 3,396: | ||
*id=<name of the command> (required) | *id=<name of the command> (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). They are the following in this order: |
:*<command> (required) | :*<command> (required) | ||
:*<id_group> (required) | :*<id_group> (required) | ||
Line 3,029: | Line 3,404: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set new_module==== | ====set new_module==== | ||
− | + | It creates a new module. | |
Call Syntax: | Call Syntax: | ||
Line 3,041: | Line 3,416: | ||
*id2=<new module name> (required) | *id2=<new module name> (required) | ||
*other_mode=url_encode_separator_| (optional) | *other_mode=url_encode_separator_| (optional) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). They are the following in this order: |
:*<network module kind > (required) | :*<network module kind > (required) | ||
:*<action name> (required) | :*<action name> (required) | ||
Line 3,057: | Line 3,432: | ||
:*<history data > (optional) | :*<history data > (optional) | ||
:*<enable_unknown_events> (only in version 5) | :*<enable_unknown_events> (only in version 5) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | 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&apipass=1234&user=admin&pass=pandora | + | <nowiki>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&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_module==== | ====set delete_module==== | ||
− | + | It deletes a module. | |
Call syntax: | Call syntax: | ||
Line 3,072: | Line 3,448: | ||
*id2=<module name> (required) | *id2=<module name> (required) | ||
*other=simulate (optional) | *other=simulate (optional) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&other=simulate&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&other=simulate&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|</nowiki> |
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|</nowiki> |
====set enable_alert==== | ====set enable_alert==== | ||
− | + | It enables an agent alert. | |
Call syntax | Call syntax | ||
Line 3,093: | Line 3,470: | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora</nowiki> |
====set enable_alert_alias==== | ====set enable_alert_alias==== | ||
− | + | It enables agent alert by alias. | |
Call syntax: | Call syntax: | ||
Line 3,109: | Line 3,486: | ||
===== Examples ===== | ===== Examples ===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set disable_alert==== | ====set disable_alert==== | ||
− | + | It disables an agent alert. | |
Call syntax: | Call syntax: | ||
Line 3,127: | Line 3,504: | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora</nowiki> |
====set disable_alert_alias==== | ====set disable_alert_alias==== | ||
− | + | It disables an agent alert. | |
Call syntax: | Call syntax: | ||
Line 3,145: | Line 3,522: | ||
===== Examples ===== | ===== Examples ===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set enable_module_alerts==== | ====set enable_module_alerts==== | ||
− | + | Same as enable_alert api call. | |
Call syntax: | Call syntax: | ||
Line 3,157: | Line 3,534: | ||
*id=<Name of the agent> (required) | *id=<Name of the agent> (required) | ||
*id2=<Name of the module> (required) | *id2=<Name of the module> (required) | ||
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora</nowiki> |
====set disable_module_alerts==== | ====set disable_module_alerts==== | ||
− | + | Same as api disable_alert. | |
Call syntax: | Call syntax: | ||
Line 3,173: | Line 3,551: | ||
*id=<Name of the agent> (required) | *id=<Name of the agent> (required) | ||
*id2=<Name of the module> (required) | *id2=<Name of the module> (required) | ||
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora</nowiki> |
====set enable_module==== | ====set enable_module==== | ||
− | + | It enables the module. | |
Call syntax | Call syntax | ||
Line 3,188: | Line 3,567: | ||
*id=<Agent name> (required) | *id=<Agent name> (required) | ||
*id2=<Module name> (required) | *id2=<Module name> (required) | ||
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora</nowiki> |
====set disable_module==== | ====set disable_module==== | ||
− | + | It disables the module. | |
− | Call syntax | + | Call syntax: |
*op=set (required) | *op=set (required) | ||
Line 3,203: | Line 3,583: | ||
*id=<Agent name> (required) | *id=<Agent name> (required) | ||
*id2=<Module name> (required) | *id2=<Module name> (required) | ||
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
===== Examples ===== | ===== Examples ===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_network_module_from_component==== | ====set create_network_module_from_component==== | ||
− | + | It creates a new network module from a component. | |
Call syntax: | Call syntax: | ||
Line 3,216: | Line 3,597: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_network_module_from_component (required) | *op2=create_network_module_from_component (required) | ||
− | *id=< | + | *id=<Agent name> (required) |
− | *id2=< | + | *id2=<Component name> (required) |
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
===== Examples ===== | ===== Examples ===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set module_data==== | ====set module_data==== | ||
− | + | It adds a module value. This function generates an XML with the data that will be sent to the server, which will be the one to update the database. | |
+ | |||
+ | This API call just controls the XML file generation, displaying in a message the status of that process. | ||
Call syntax: | Call syntax: | ||
Line 3,232: | Line 3,616: | ||
*op=set (required) | *op=set (required) | ||
*op2=module_data (required) | *op2=module_data (required) | ||
− | *id=<id | + | *id=<id module agent> (required) |
*other: module data and timestamp serialized. | *other: module data and timestamp serialized. | ||
− | **dato: data which must belong to any Pandora data type. | + | **dato: data which must belong to any Pandora FMS data type. |
− | **tiempo: could be a specified timestamp of the string "now". | + | **tiempo: it could be a specified timestamp of the string "now". |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
+ | |||
+ | {{Warning|The successful generation of the XML file doesn't guarantee that the data has been stored in the database.}} | ||
====set new_module_group==== | ====set new_module_group==== | ||
− | + | It creates a new module group. | |
Call syntax: | Call syntax: | ||
Line 3,249: | Line 3,635: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=new_module_group&id=Module_group_name&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=new_module_group&id=Module_group_name&apipass=1234&user=admin&pass=pandora</nowiki> |
====set module_group_synch==== | ====set module_group_synch==== | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It syncronizes a module group from the Metaconsole. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=module_group_synch (required) | *op2=module_group_synch (required) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). In this case, the name of the server(s)that are required to sync with the meta. |
:*<server_name_1><server_name_2>...<server_name_n> (required) | :*<server_name_1><server_name_2>...<server_name_n> (required) | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set add_module_in_conf==== | ====set add_module_in_conf==== | ||
>= 5.0 (Only Enterprise) | >= 5.0 (Only Enterprise) | ||
− | + | It adds the configuration to a local module. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=add_module_in_conf (required) | *op2=add_module_in_conf (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
− | *id2=< | + | *id2=<module name> (required) |
*other: The module data that will be placed in the conf file encoded in base64 (required) (required) | *other: The module data that will be placed in the conf file encoded in base64 (required) (required) | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | + | It will return '0' when it is successful, '-1' when there is an error and '-2' if it already exists. | |
====set delete_module_in_conf==== | ====set delete_module_in_conf==== | ||
>= 5.0 (Only Enterprise) | >= 5.0 (Only Enterprise) | ||
− | + | It deletes a local module configuration. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=add_module_in_conf (required) | *op2=add_module_in_conf (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
*id2=<module name> (required) | *id2=<module name> (required) | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki><nowiki>Insert non-formatted text here</nowiki> |
− | + | It will return '0' when it is successful or '-1' when there is an error | |
====set update_module_in_conf==== | ====set update_module_in_conf==== | ||
>= 5.0 (Only Enterprise) | >= 5.0 (Only Enterprise) | ||
− | + | It updates a local module configuration. | |
Call syntax: | Call syntax: | ||
Line 3,310: | Line 3,696: | ||
=====Examples===== | =====Examples===== | ||
− | 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 | + | <nowiki>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</nowiki> |
− | + | It will return '1' when there are no changes, '0' when it is successful, '-1' when there is an error and '-2' if does not exist. | |
====set create_event==== | ====set create_event==== | ||
− | + | It creates a new event in Pandora FMS. | |
+ | |||
{{metaconsole}} | {{metaconsole}} | ||
Line 3,323: | Line 3,710: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_event (required) | *op2=create_event (required) | ||
− | *other=<serialized_parameters> (required) | + | *other=<serialized_parameters> (required). Event configuration data as follows: |
:*<event_text> (required)(string) | :*<event_text> (required)(string) | ||
:*<id_group> (required)(string) | :*<id_group> (required)(string) | ||
Line 3,340: | Line 3,727: | ||
:*<source>(string) | :*<source>(string) | ||
:*<tags>(string) | :*<tags>(string) | ||
− | :*<custom_data> Custom data should be a | + | :*<custom_data>. Custom data should be a base64 encoded JSON document. |
− | :*<server_id> The id of the child node (only for | + | :*<server_id>. The id of the child node (only for Metaconsole). |
:*<id_extra> (alphanumeric) | :*<id_extra> (alphanumeric) | ||
Line 3,347: | Line 3,734: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/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 | + | <nowiki>http://127.0.0.1/pandora_console/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</nowiki> |
====set add_event_comment==== | ====set add_event_comment==== | ||
− | + | It adds an event comment. | |
− | + | {{Tip|This feature can be also used in the Metaconsole}} | |
− | |||
− | |||
− | {{ | ||
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=add_event_comment (required) | *op2=add_event_comment (required) | ||
− | *other=<serialized_parameters> (required) | + | *other=<serialized_parameters> (required). Event configuration data serialized as follows: |
:*<comment> (required) | :*<comment> (required) | ||
+ | |||
+ | {{Tip|Enter the parameter "true" after "string" to use it in the Metaconsole}} | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | * Node | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | * Metaconsole | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set update_event==== | ||
+ | |||
+ | Updates events through API. | ||
+ | |||
+ | {{Tip|This feature can be also used in the Metaconsole}} | ||
+ | |||
+ | Call syntax: | ||
+ | |||
+ | *op=set (required) | ||
+ | *op2=event (required) | ||
+ | *id=event_id (required) | ||
+ | *other=<serialized_parameters> (required). Event fields to be updated, formatted as ''field,value'' and separated by the chosen url_encode_separator (e.g. |). | ||
+ | |||
+ | =====Available fields===== | ||
+ | * '''estado''': Numeric identifier of the event status. It can be: | ||
+ | ** 0 (New) | ||
+ | ** 1 (Validated) | ||
+ | ** 2 (In process) | ||
+ | * '''evento''': Event name. | ||
+ | * '''event_type''': Event type. It can be: | ||
+ | ** 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''': Numeric identifier of the event's criticity. It can be: | ||
+ | ** 0 (Maintenance) | ||
+ | ** 1 (Informational) | ||
+ | ** 2 (Normal) | ||
+ | ** 3 (Minor) | ||
+ | ** 4 (Warning) | ||
+ | ** 5 (Major) | ||
+ | ** 6 (Critical) | ||
+ | ** 20 (Warning o Critical) | ||
+ | ** 21 (Distinto a Normal) | ||
+ | ** 34 (Critical o normal) | ||
+ | * '''tags''': Tags associated to the event. | ||
+ | * '''source''': Source of the event's data. | ||
+ | * '''id_extra''': When using this feature, older events with the same Extra ID as the new one will be automatically validated. | ||
+ | * '''critical_instructions''': Instructions for operators on the actions to be done when a module goes to Critical status. Only shown in the event if module is on Critical status. | ||
+ | * '''warning_instructions''': Instructions for operators on the actions to be done when a module goes to Warning status. Only shown in the event if module is on Warning status. | ||
+ | * '''unknown_instructions''': Instructions for operators on the actions to be done when a module goes to Unknown status. Only shown in the event if module is on Unknown status. | ||
+ | * '''owner_user''': User assigned to the event. | ||
+ | * '''custom_data''': It allows to add custom information to the event. It must be formated as a base64 encoded json (e.g. <nowiki>{"field1":"value1","field2":"value2"}</nowiki>). See example below. | ||
+ | * '''module_status''': Numeric identifier for the status of the module that triggered the event. It can be: | ||
+ | ** 0 (Normal) | ||
+ | ** 1 (Critical) | ||
+ | ** 2 (Warning) | ||
+ | ** 3 (Unknown) | ||
+ | ** 4 (Not init) | ||
=====Examples===== | =====Examples===== | ||
+ | * Node: | ||
− | http:// | + | <nowiki>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=</nowiki> |
+ | |||
+ | * Metaconsole: | ||
+ | |||
+ | <nowiki>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</nowiki> | ||
====set create_netflow_filter==== | ====set create_netflow_filter==== | ||
(>=5.0) | (>=5.0) | ||
− | + | It creates a new netflow filter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_netflow_filter (required) | *op2=create_netflow_filter (required) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). It filters data in this order: |
:*<filter_name> (required) | :*<filter_name> (required) | ||
:*<group_id> (required) | :*<group_id> (required) | ||
Line 3,384: | Line 3,848: | ||
=====Examples===== | =====Examples===== | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
====set create_custom_field==== | ====set create_custom_field==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It creates a new custom field. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_custom_field (required) | *op2=create_custom_field (required) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). Parameters to configure the custom field. |
:*<name> (required) | :*<name> (required) | ||
− | :*<flag_display_front> (required; 0 the field | + | :*<flag_display_front> (required; 0 for the field to not be displayed on operation view, 1 for the field to be displayed) |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set create_tag==== | ====set create_tag==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It creates a new tag. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_tag (required) | *op2=create_tag (required) | ||
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). Parameters to configure the tag. |
− | :*<name> Tag | + | :*<name> Tag name (required) |
− | :*<description> Tag | + | :*<description> Tag description |
− | :*<eurl> Tag | + | :*<eurl> Tag URL |
− | :*<email> Tag | + | :*<email> Tag email |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set enable_disable_agent==== | ====set enable_disable_agent==== | ||
− | + | It enables a disabled agent. | |
Call syntax: | Call syntax: | ||
Line 3,428: | Line 3,892: | ||
*op=set (required) | *op=set (required) | ||
*op2=enable_disable_agent (required) | *op2=enable_disable_agent (required) | ||
− | *id=<agent_id> (required) should be an agent id. | + | *id=<agent_id> (required). It should be an agent id. |
=====Examples===== | =====Examples===== | ||
Line 3,434: | Line 3,898: | ||
Example 1 (Disable agent 'example_id') | Example 1 (Disable agent '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 | + | <nowiki>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</nowiki> |
Example 2 (Enable agent 'example_id') | Example 2 (Enable agent '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 | + | <nowiki>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</nowiki> |
====set gis_agent_only_position==== | ====set gis_agent_only_position==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It adds a new GIS position within any agent. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=gis_agent_only_position (required) | *op2=gis_agent_only_position (required) | ||
− | *id=<índice> (required) | + | *id=<índice> (required). Agent index. |
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). Parameters to set the GIS. |
− | :*<latitude> Latitude | + | :*<latitude> Latitude. |
− | :*<longitude> Longitude | + | :*<longitude> Longitude. |
− | :*<altitude> Altitude | + | :*<altitude> Altitude. |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set gis_agent==== | ====set gis_agent==== | ||
>= 5.0 | >= 5.0 | ||
− | + | It adds a gis data agent. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=gis_agent_only_position (required) | *op2=gis_agent_only_position (required) | ||
− | *id=<índice> (compolsory) | + | *id=<índice> (compolsory). Agent index. |
− | *other=<serialized parameters> (required) | + | *other=<serialized parameters> (required). Gis data. |
:*<latitude> | :*<latitude> | ||
:*<longitude> | :*<longitude> | ||
Line 3,479: | Line 3,943: | ||
:*<description_update_gis> | :*<description_update_gis> | ||
:*<description_first_insert> | :*<description_first_insert> | ||
+ | |||
+ | =====Ejemplo===== | ||
+ | <nowiki>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</nowiki> | ||
+ | |||
+ | ====set reset_agent_counts==== | ||
+ | |||
+ | It updates agent alert and module counting. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=reset_agent_counts (required) | ||
+ | *id=<id_agent> (required). It must be an agent id or "All". | ||
+ | |||
+ | =====Example===== | ||
+ | |||
+ | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=reset_agent_counts&apipass=1234&user=admin&pass=pandora&id=All</nowiki> | ||
====set create_special_day==== | ====set create_special_day==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It adds a new special day. | |
Call syntax: | Call syntax: | ||
Line 3,490: | Line 3,970: | ||
*op2=create_special_day (required) | *op2=create_special_day (required) | ||
*other=<serialized parameters> (required) | *other=<serialized parameters> (required) | ||
− | :*<special day> Special day | + | :*<special day> Special day. |
− | :*<same day> Same day | + | :*<same day> Same day. |
− | :*<description> Description | + | :*<description> Description. |
− | :*<id_group> Group ID | + | :*<id_group> Group ID. |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set update_special_day==== | ====set update_special_day==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It updates an already defined special day configuration. | |
Call syntax: | Call syntax: | ||
Line 3,510: | Line 3,990: | ||
*id=<special day's id> (required) | *id=<special day's id> (required) | ||
*other=<serialized parameters> (required) | *other=<serialized parameters> (required) | ||
− | :*<special day> Special day | + | :*<special day> Special day. |
− | :*<same day> Same day | + | :*<same day> Same day. |
− | :*<description> Description | + | :*<description> Description. |
− | :*<id_group> Group ID | + | :*<id_group> Group ID. |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set delete_special_day==== | ====set delete_special_day==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It deletes a special day. | |
Call syntax: | Call syntax: | ||
Line 3,532: | Line 4,012: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1 | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1</nowiki> |
====set pagerduty_webhook==== | ====set pagerduty_webhook==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It connects PagerDuty notifications with Pandora FMS alerts. This call is set in the Webhook option in PagerDuty's service to validate Pandora FMS alerts which have been previously linked to Pager Duty when they were validated from PagerDuty. | |
Call syntax: | Call syntax: | ||
Line 3,547: | Line 4,027: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=pagerduty_webhook&apipass=1234&user=admin&pass=pandora&id=alert | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=pagerduty_webhook&apipass=1234&user=admin&pass=pandora&id=alert</nowiki> |
====set tag_user_profile==== | ====set tag_user_profile==== | ||
>= 6 | >= 6 | ||
− | + | It adds a tag into a user profile. | |
Call syntax: | Call syntax: | ||
Line 3,566: | Line 4,046: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set tag==== | ====set tag==== | ||
>= 6 | >= 6 | ||
− | + | It adds a tag into Pandora FMS. | |
Call syntax: | Call syntax: | ||
Line 3,584: | Line 4,064: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=tag&apipass=1234&user=admin&pass=pandora&id=test&other_mode=url_encode_separator_|&other="a test"|http://www.artica.es|[email protected]|01189998819991197253 | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=tag&apipass=1234&user=admin&pass=pandora&id=test&other_mode=url_encode_separator_|&other="a test"|http://www.artica.es|[email protected]|01189998819991197253</nowiki> |
====set add_tag_module==== | ====set add_tag_module==== | ||
>= 6 | >= 6 | ||
− | + | It adds a tag to a module. | |
Call syntax: | Call syntax: | ||
Line 3,601: | Line 4,081: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set remove_tag_module==== | ====set remove_tag_module==== | ||
>= 6 | >= 6 | ||
− | + | It removes a tag from a module. | |
Call syntax: | Call syntax: | ||
Line 3,618: | Line 4,098: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set planned_downtimes_created==== | ====set planned_downtimes_created==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It adds new planned downtime. | |
*op=set | *op=set | ||
Line 3,630: | Line 4,110: | ||
* <tuesday>;<wednesday>;<thursday>;<friday>;<saturday>;<sunday>;<periodically_time_from>;<periodically_time_to>; | * <tuesday>;<wednesday>;<thursday>;<friday>;<saturday>;<sunday>;<periodically_time_from>;<periodically_time_to>; | ||
* <periodically_day_from>;<periodically_day_to>;<type_downtime>;<type_execution>;<type_periodicity>;<id_user>; | * <periodically_day_from>;<periodically_day_to>;<type_downtime>;<type_execution>;<type_periodicity>;<id_user>; | ||
+ | |||
+ | {{Warning|Date format needs to be MM/DD/YYYY for this call to work properly.}} | ||
=====Examples===== | =====Examples===== | ||
Line 3,635: | Line 4,117: | ||
Once: | Once: | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
Periodically: | Periodically: | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
====set planned_downtimes_additem==== | ====set planned_downtimes_additem==== | ||
>= 5.1 | >= 5.1 | ||
− | + | It adds new items of a planned downtime. | |
*op=set | *op=set | ||
*op2=planned_downtimes_additem | *op2=planned_downtimes_additem | ||
Line 3,651: | Line 4,133: | ||
=====Example===== | =====Example===== | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
====set planned_downtimes_deleted==== | ====set planned_downtimes_deleted==== | ||
>=5.1 | >=5.1 | ||
− | + | It deletes a planned downtime | |
*op=set | *op=set | ||
*op2=planned_downtimes_deleted | *op2=planned_downtimes_deleted | ||
Line 3,663: | Line 4,145: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_deleted&apipass=1234&user=admin&pass=pandora&id=10 | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=planned_downtimes_deleted&apipass=1234&user=admin&pass=pandora&id=10</nowiki> |
====set create_synthetic_module==== | ====set create_synthetic_module==== | ||
>=5.1SP4 | >=5.1SP4 | ||
− | + | It adds a new synthetic module: | |
*op=set | *op=set | ||
*op2=create_synthetic_module | *op2=create_synthetic_module | ||
− | *id= | + | *id=Agent name to add module |
+ | *id2=<use_agent_alias> | ||
*other= <name_module><synthetic_type><AgentName;Operation;NameModule> OR <AgentName;NameModule> OR <Operation;Value> | *other= <name_module><synthetic_type><AgentName;Operation;NameModule> OR <AgentName;NameModule> OR <Operation;Value> | ||
− | **Data of module: | + | :**Data of module: |
− | In arithmetic creations the | + | In arithmetic creations the first piece of data is Agent without operator: AgentName;NameModule or if you type in a value: <Operation;Value>. The rest of values follow this one: <AgentName;Operation;NameModule> or <Operation;Value> |
average: <AgentName;Operation;NameModule> or <Operation;Value> | average: <AgentName;Operation;NameModule> or <Operation;Value> | ||
− | **Operation: | + | :**Operation: |
arithmetic: ADD, SUB, MUL, DIV | arithmetic: ADD, SUB, MUL, DIV | ||
average: Only AVG | average: Only AVG | ||
Line 3,684: | Line 4,167: | ||
=====Example===== | =====Example===== | ||
− | 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_| | + | <nowiki>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_|</nowiki> |
− | 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_| | + | <nowiki>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_|</nowiki> |
====set create_service==== | ====set create_service==== | ||
>= 7 | >= 7 | ||
− | + | It creates a new service. | |
*op=set | *op=set | ||
Line 3,700: | Line 4,183: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set update_service==== | ====set update_service==== | ||
>= 7 | >= 7 | ||
− | + | It modifies a service. | |
*op=set | *op=set | ||
Line 3,715: | Line 4,198: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set add_element_service==== | ====set add_element_service==== | ||
>= 7 | >= 7 | ||
− | + | It adds elements to a service. | |
*op=set | *op=set | ||
Line 3,733: | Line 4,216: | ||
In each type, the id field refers to different things: | In each type, the id field refers to different things: | ||
− | - If it | + | - If it belongs to agent type, it is agent id |
− | - If it | + | - If it belongs to module type, it is agent module id |
− | - If it | + | - If it belongs to service type, it is the service id to be added. |
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set metaconsole_synch==== | ====set metaconsole_synch==== | ||
>= 7 | >= 7 | ||
− | + | It adds license key to the Metaconsole and performs the synchronization with nodes. | |
*op=set | *op=set | ||
Line 3,755: | Line 4,238: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set migrate_agent==== | ====set migrate_agent==== | ||
>= 7.21 ONLY METACONSOLE | >= 7.21 ONLY METACONSOLE | ||
− | + | It adds a selected agent to the agent migration queue. | |
*op=set | *op=set | ||
Line 3,771: | Line 4,254: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set new_cluster==== | ====set new_cluster==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It creates an agent cluster | |
− | + | It creates a monitoring cluster with agents and items to monitor different nodes. | |
*op=set | *op=set | ||
*op2=new_cluster | *op2=new_cluster | ||
− | *other= | + | *other=cluster_name| cluster_type| description| group_id |
*other_mode=url_encode_separator_ | *other_mode=url_encode_separator_ | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set add_cluster_agent==== | ====set add_cluster_agent==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It adds an agent to a cluster. | |
*op=set | *op=set | ||
Line 3,804: | Line 4,287: | ||
{"id":5,"id_agent":3}] | {"id":5,"id_agent":3}] | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_agent&other=W3siaWQiOjUsImlkX2FnZW50IjoyfSwKeyJpZCI6NSwiaWRfYWdlbnQiOjN9XQ==&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_agent&other=W3siaWQiOjUsImlkX2FnZW50IjoyfSwKeyJpZCI6NSwiaWRfYWdlbnQiOjN9XQ==&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set add_cluster_item (activo/activo)==== | ====set add_cluster_item (activo/activo)==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It adds an active/active item to a cluster | |
*op=set | *op=set | ||
Line 3,821: | Line 4,304: | ||
{"name":"TCP_Connections","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=W3sibmFtZSI6IlN3YXBfVXNlZCIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBQSIsImNyaXRpY2FsX2xpbWl0Ijo4MCwid2FybmluZ19saW1pdCI6NjB9LAp7Im5hbWUiOiJUQ1BfQ29ubmVjdGlvbnMiLCJpZF9jbHVzdGVyIjo1LCJ0eXBlIjoiQUEiLCJjcml0aWNhbF9saW1pdCI6ODAsIndhcm5pbmdfbGltaXQiOjYwfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=W3sibmFtZSI6IlN3YXBfVXNlZCIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBQSIsImNyaXRpY2FsX2xpbWl0Ijo4MCwid2FybmluZ19saW1pdCI6NjB9LAp7Im5hbWUiOiJUQ1BfQ29ubmVjdGlvbnMiLCJpZF9jbHVzdGVyIjo1LCJ0eXBlIjoiQUEiLCJjcml0aWNhbF9saW1pdCI6ODAsIndhcm5pbmdfbGltaXQiOjYwfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set add_cluster_item (active/passive)==== | ====set add_cluster_item (active/passive)==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It adds a passive/actve item to a cluster. | |
*op=set | *op=set | ||
Line 3,838: | Line 4,321: | ||
{"name":"DiskUsed_/proc/sched_debug","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=W3sibmFtZSI6IkRpc2tVc2VkXy9wcm9jL2tjb3JlIiwiaWRfY2x1c3RlciI6NSwidHlwZSI6IkFQIiwiaXNfY3JpdGljYWwiOjF9LAp7Im5hbWUiOiJEaXNrVXNlZF8vcHJvYy9zY2hlZF9kZWJ1ZyIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBUCIsImlzX2NyaXRpY2FsIjoxfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_cluster_item&other=W3sibmFtZSI6IkRpc2tVc2VkXy9wcm9jL2tjb3JlIiwiaWRfY2x1c3RlciI6NSwidHlwZSI6IkFQIiwiaXNfY3JpdGljYWwiOjF9LAp7Im5hbWUiOiJEaXNrVXNlZF8vcHJvYy9zY2hlZF9kZWJ1ZyIsImlkX2NsdXN0ZXIiOjUsInR5cGUiOiJBUCIsImlzX2NyaXRpY2FsIjoxfV0=&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_cluster==== | ====set delete_cluster==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It deletes a cluster. | |
*op=set | *op=set | ||
Line 3,849: | Line 4,332: | ||
*id=id of the cluster to delete | *id=id of the cluster to delete | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster&id=7&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster&id=7&apipass=1234&user=admin&pass=pandora</nowiki> |
− | ====set | + | ====set delete_cluster_agents==== |
>= 7.0 | >= 7.0 | ||
− | + | It unpairs an agent from a cluster | |
*op=set | *op=set | ||
− | *op2= | + | *op2=delete_cluster_agents |
*other=id_agente| id_cluster| | *other=id_agente| id_cluster| | ||
*other_mode=url_encode_separator_ | *other_mode=url_encode_separator_ | ||
+ | |||
+ | The json structure should be: | ||
+ | [{"id":5,"id_agent":2}, {"id":5,"id_agent":3}] | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2= | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_agents&other=2%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_cluster_item==== | ====set delete_cluster_item==== | ||
>= 7.0 | >= 7.0 | ||
− | + | It deletes an item from a cluster. | |
*op=set | *op=set | ||
Line 3,874: | Line 4,360: | ||
*id=id of item to eliminate | *id=id of item to eliminate | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_item&id=9&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_cluster_item&id=9&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_policy==== | ====set create_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | + | It creates a policy. | |
− | + | Both the policy name, which cannot be repeated, and the id_group, which must exist in the database, are required. | |
*op = set | *op = set | ||
Line 3,890: | Line 4,376: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set update_policy==== | ====set update_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | + | It updates a policy. | |
− | The policy name | + | The policy name cannot be repeated and the id_group must exist in the database. It returns 0 (false) or the updated policy id (true). |
*op = set | *op = set | ||
*op2 = update_policy | *op2 = update_policy | ||
− | *id = id | + | *id = policy id |
− | *other = policy name | | + | *other = policy name | group_id | description; |
*other_mode = url_encode_separator_| | *other_mode = url_encode_separator_| | ||
*return_type = (string, csv, json). | *return_type = (string, csv, json). | ||
− | ===== | + | =====Example===== |
− | 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 | + | <nowiki>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</nowiki> |
====set delete_policy==== | ====set delete_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | + | It deletes a policy. It is required to enter the policy id, which must exist in order to delete it. It returns 0 (false) or 1 (true). | |
*op = set | *op = set | ||
Line 3,922: | Line 4,408: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_policy&apipass=1234&user=admin&pass=pandora&id=10&return_type=json | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_policy&apipass=1234&user=admin&pass=pandora&id=10&return_type=json</nowiki> |
====set add_collections_policy==== | ====set add_collections_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | + | It adds a collection to a policy. It is necessary to enter the policy id and for such a policy to exist, as an id, name or short name of the collection you wish to add, which should exist too. Both fields are required. | |
− | + | It returns 0 (false) or the id of the collection added to a policy (true). | |
*op = set | *op = set | ||
Line 3,938: | Line 4,424: | ||
=====Example===== | =====Example===== | ||
− | 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 | + | <nowiki>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</nowiki> |
====set remove_collections_policy==== | ====set remove_collections_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To mark a collection | + | To mark a policy collection that is yet to be deleted, it is necessary: |
− | * A policy id and | + | * A policy id, and for such a policy to exist. Mandatory. |
− | * An id, name or short name of the collection you | + | * An id, name or short name of the collection you wish to remove, which must exist. Mandatory. |
− | * | + | * And 0 or 1: 1 marks it as yet to be deleted and 0 removes said state. If this field is empty, it will try to check it so that it can be deleted by default. |
− | returns 0 (false) or 1 (true). | + | It returns 0 (false) or 1 (true). |
*op = set | *op = set | ||
Line 3,959: | Line 4,445: | ||
=====Example===== | =====Example===== | ||
− | 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. | + | <nowiki>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.</nowiki> |
====set create_plugins_policy==== | ====set create_plugins_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To add a plugin to a policy | + | To add a plugin to a policy the following are necessary: |
− | * A policy id and | + | * A policy id and for such a policy to exist. Mandatory. |
− | * The plugin string to run. | + | * The plugin string to run. Mandatory. |
− | returns 0 (false) or the plugin id that | + | It returns 0 (false) or the plugin id that has been added to a policy (true). |
*op = set |