Difference between revisions of "Pandora: Documentation en: Annex ExternalAPI"
(→Examples) |
Laura.cano (talk | contribs) (→Examples) |
||
(288 intermediate revisions by 9 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''. |
<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> | <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. |
<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> | <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> | ||
Line 138: | Line 139: | ||
===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. |
<nowiki>http://127.0.0.1/pandora_console/include/api.php?info=version</nowiki> | <nowiki>http://127.0.0.1/pandora_console/include/api.php?info=version</nowiki> | ||
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. | |
Line 220: | Line 221: | ||
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test&apipass=1234&user=admin&pass=pandora</nowiki> | <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, | + | 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 229: | 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 236: | 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: <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> | 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: <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> | 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===== | ||
Line 262: | Line 298: | ||
====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 269: | 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===== | ||
Line 283: | Line 319: | ||
=> 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 289: | 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===== | ||
Line 302: | Line 338: | ||
====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 308: | 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===== | ||
Line 315: | Line 351: | ||
====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 324: | 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===== | ||
Line 331: | Line 367: | ||
====get module_id==== | ====get module_id==== | ||
− | + | It returns the id of an agent module. | |
Call syntax: | Call syntax: | ||
Line 343: | Line 379: | ||
<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> | <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 351: | 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 360: | Line 419: | ||
====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 367: | 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> | ||
Line 374: | Line 433: | ||
<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> | <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 545: | Line 604: | ||
====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 553: | 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 565: | Line 624: | ||
====get events==== | ====get events==== | ||
− | + | It returns a list of events filtered by the other parameter. | |
− | |||
− | |||
Call syntax: | Call syntax: | ||
Line 576: | 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 589: | 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===== | ||
Line 597: | Line 656: | ||
<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> | <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) | |
+ | *op2=all_alert_templates (required) | ||
+ | *other=cvs_separator (optional) | ||
− | + | =====Examples===== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | =====Examples===== | ||
<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> | <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 677: | Line 685: | ||
====get plugins==== | ====get plugins==== | ||
− | + | It returns the list of Pandora FMS server plugins. | |
Call syntax: | Call syntax: | ||
Line 690: | Line 698: | ||
====get tags==== | ====get tags==== | ||
− | + | It returns the list of tags defined in Pandora FMS. | |
Call syntax: | Call syntax: | ||
Line 707: | Line 715: | ||
>= 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===== | ||
<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> | <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 732: | Line 740: | ||
=====Examples===== | =====Examples===== | ||
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora</nowiki> | <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 752: | Line 762: | ||
*op=get (required) | *op=get (required) | ||
*op2=agent_name (required) | *op2=agent_name (required) | ||
− | *id=<id | + | *id=<agent id> (required) |
=====Examples===== | =====Examples===== | ||
Line 765: | 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===== | ||
Line 784: | Line 794: | ||
*op=get (required) | *op=get (required) | ||
*op2=module_name (required) | *op2=module_name (required) | ||
− | *id=<id | + | *id=<module id> (required) |
=====Examples===== | =====Examples===== | ||
Line 795: | 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> | <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> | ||
− | |||
− | |||
− | |||
− | |||
====get alert_actions==== | ====get alert_actions==== | ||
Line 812: | 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 828: | 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 836: | Line 842: | ||
=====Examples===== | =====Examples===== | ||
<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> | <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. | |
Line 853: | Line 872: | ||
====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 893: | Line 912: | ||
>= 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 920: | 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) | ||
Line 935: | Line 954: | ||
>= 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===== | ||
Line 949: | Line 968: | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns special day's list. | |
Call syntax: | Call syntax: | ||
Line 955: | 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===== | ||
Line 964: | Line 983: | ||
>= 5.1SP2 | >= 5.1SP2 | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 970: | 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,036: | Line 1,055: | ||
>= 5.1SP2 | >= 5.1SP2 | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 1,043: | 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===== | ||
Line 1,054: | Line 1,073: | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns a list of module properties. The list could be filtered by parameter. | |
Call Syntax: | Call Syntax: | ||
Line 1,061: | 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===== | ||
Line 1,069: | Line 1,088: | ||
====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) | ||
*id=<module id> (required) | *id=<module id> (required) | ||
*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). | ||
+ | |||
=====Examples===== | =====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> | <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,103: | Line 1,143: | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns all matches of planned downtime items. | |
op=get | op=get | ||
Line 1,118: | Line 1,158: | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns the group id of an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,124: | 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> | ||
Line 1,133: | Line 1,173: | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group id of an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,139: | 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> | ||
Line 1,148: | Line 1,188: | ||
>= 5.1 | >= 5.1 | ||
− | + | It returns the group name for a agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,163: | Line 1,203: | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group name for an agent. | |
Call Syntax: | Call Syntax: | ||
Line 1,169: | 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> | ||
Line 1,178: | Line 1,218: | ||
>= 7.0NG | >= 7.0NG | ||
− | + | It returns the group id from the name. | |
Call syntax: | Call syntax: | ||
Line 1,190: | Line 1,230: | ||
<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> | <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,205: | Line 1,245: | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the cluster status by id | |
*op=get | *op=get | ||
Line 1,216: | Line 1,256: | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id of the cluster by name | |
*op=get | *op=get | ||
Line 1,227: | Line 1,267: | ||
>= 7.0 | >= 7.0 | ||
− | + | It returns the id => cluster agents names by cluster id | |
*op=get | *op=get | ||
Line 1,237: | Line 1,277: | ||
====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,248: | Line 1,288: | ||
>= 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,259: | Line 1,299: | ||
>= 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,270: | Line 1,310: | ||
>= 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,285: | Line 1,325: | ||
>= 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,293: | 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===== | ||
Line 1,301: | Line 1,341: | ||
>= 7.0NG. 725 | >= 7.0NG. 725 | ||
− | + | It returns all policy colections. If no policy id is specified, it returns all policy colections. | |
Line 1,309: | 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===== | ||
Line 1,317: | Line 1,357: | ||
>= 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,332: | Line 1,372: | ||
>= 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,340: | 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===== | ||
Line 1,348: | Line 1,388: | ||
>= 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,356: | 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===== | ||
Line 1,364: | Line 1,404: | ||
>= 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,376: | 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===== | ||
Line 1,386: | Line 1,426: | ||
>= 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===== | ||
Line 1,405: | Line 1,445: | ||
>= 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,413: | 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===== | ||
Line 1,421: | Line 1,461: | ||
>= 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,428: | 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===== | ||
Line 1,436: | Line 1,476: | ||
>= 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,443: | 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===== | ||
Line 1,451: | Line 1,491: | ||
>= 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,469: | Line 1,509: | ||
====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,484: | Line 1,524: | ||
====get users==== | ====get users==== | ||
− | + | It returns the list of Pandora FMS users. | |
Call syntax: | Call syntax: | ||
Line 1,500: | Line 1,540: | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It lists all Pandora FMS users. | |
Call syntax: | Call syntax: | ||
Line 1,508: | Line 1,548: | ||
=====Example===== | =====Example===== | ||
− | It can return Json or CSV, this return is remarked through the URL | + | 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> | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_all_user&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | ||
Line 1,516: | Line 1,556: | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It lists user data. | |
Call syntax: | Call syntax: | ||
Line 1,525: | Line 1,565: | ||
=====Example===== | =====Example===== | ||
− | + | It obtains all the information about a specific user. | |
− | It can return Json or CSV | + | It can return Json or CSV. This return is specified through the URL. |
Only the username is used to obtain said information: | Only the username is used to obtain said information: | ||
Line 1,533: | Line 1,573: | ||
====get user_profiles_info==== | ====get user_profiles_info==== | ||
− | + | It returns the list of Pandora FMS user profiles. | |
Call syntax: | Call syntax: | ||
Line 1,545: | Line 1,585: | ||
<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> | <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==== | ====get migrate_agent==== | ||
>= 7.21 ONLY METACONSOLE | >= 7.21 ONLY METACONSOLE | ||
− | + | It looks up whether an especific agent exists in migration queue, returning the data of migration_queue. | |
*op=get | *op=get | ||
Line 1,578: | Line 1,603: | ||
>= 7.0NG 730 | >= 7.0NG 730 | ||
− | + | It returns the language with which Pandora FMS is configured. | |
Call syntax: | Call syntax: | ||
Line 1,591: | 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,604: | Line 1,629: | ||
>= 7.0NG 732 | >= 7.0NG 732 | ||
− | + | It returns the existing groups. | |
Call syntax: | Call syntax: | ||
Line 1,612: | 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===== | ||
Line 1,621: | Line 1,646: | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It obtains user groups through filtering. | |
Call syntax: | Call syntax: | ||
Line 1,631: | Line 1,656: | ||
=====Example===== | =====Example===== | ||
− | It can return Json or CSV | + | It can return Json or CSV. This return is remarked through the URL. |
− | Be careful, | + | |
+ | {{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.}} | ||
+ | |||
<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> | <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==== | ====get inventory_modules==== | ||
− | + | It returns the list of Pandora inventory modules. | |
Call syntax: | Call syntax: | ||
Line 1,650: | Line 1,677: | ||
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki> | ||
− | ====get | + | ====get inventory_modules_by_name==== |
− | + | Obtains the inventory modules from an agent using the agent name. | |
Call syntax: | Call syntax: | ||
*op=get (required) | *op=get (required) | ||
− | *op2= | + | *op2=inventory_modules_by_name (required) |
+ | *id=<agent name> (required) | ||
=====Examples===== | =====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. | ||
− | <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collections&apipass=1234&user=admin&pass=pandora</nowiki> | + | Call syntax: |
+ | *op=get (required) | ||
+ | *op2=inventory_modules_by_alias (required) | ||
+ | *id=<agent alias> (required) | ||
+ | |||
+ | =====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: | ||
+ | *op=get (required) | ||
+ | *op2=list_collections (required) | ||
+ | |||
+ | =====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==== | ====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: | ||
Line 1,676: | Line 1,742: | ||
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collection_files&id=1&apipass=1234&user=admin&pass=pandora</nowiki> | <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=== | ===SET=== | ||
− | + | It sends data. | |
− | ==== | + | ====set new_agent==== |
− | + | It creates a new agent with the data sent as parameters. | |
Call syntax: | Call syntax: | ||
Line 1,688: | Line 1,770: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_agent (required) | *op2=new_agent (required) | ||
− | *other=<serialized parameters> (required).They are the agent configuration and data, | + | *other=<serialized parameters> (required). They are the agent configuration and data, serialized in the following order: |
:*<agent_alias> | :*<agent_alias> | ||
Line 1,711: | Line 1,793: | ||
*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. | *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 update_agent==== |
− | + | It updates a new agent with data as parameters. | |
Call syntax: | Call syntax: | ||
Line 1,719: | Line 1,801: | ||
*op2=update_agent (required) | *op2=update_agent (required) | ||
*id=<id_agent> (required) | *id=<id_agent> (required) | ||
− | *other=<serialized parameters> (required).They are | + | *other=<serialized parameters> (required). They are agent configuration and data, serialized in the following order: |
:*<agent_alias> | :*<agent_alias> | ||
Line 1,726: | Line 1,808: | ||
:*<id_group> | :*<id_group> | ||
:*<cascade_protection> | :*<cascade_protection> | ||
+ | :*<cascade_protection_module> | ||
:*<interval_sec> | :*<interval_sec> | ||
:*<id_os> | :*<id_os> | ||
Line 1,739: | Line 1,822: | ||
====Set delete_agent==== | ====Set delete_agent==== | ||
− | + | It deletes an agent that has the name as parameter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_agent (required) | *op2=delete_agent (required) | ||
− | *id=<name_agent> (required) should be an agent name. | + | *id=<name_agent> (required). It should be an agent name. |
+ | *other (optional)=<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
Line 1,752: | Line 1,836: | ||
====set create_module_template==== | ====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: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_module_template (required) | *op2=create_module_template (required) | ||
− | *id=<id_template> (required) should be a template id. | + | *id=<id_template> (required). It should be a template id. |
*other=<id_module>|<id_agent> | *other=<id_module>|<id_agent> | ||
Line 1,766: | Line 1,850: | ||
====set apply_module_template==== | ====set apply_module_template==== | ||
− | + | It applies module template to agent. | |
− | Module template | + | 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) | *op=set (required) | ||
*op2=apply_module_template (required) | *op2=apply_module_template (required) | ||
− | *id<id_template> (required) | + | *id<id_template> (required). Id of the template that will be applied on the module. |
− | *id2<id_agente> (required) | + | *id2<id_agente> (required). Id of the agent in which the modules will be created. |
=====Examples===== | =====Examples===== | ||
Line 1,782: | Line 1,866: | ||
====set create_network_module==== | ====set create_network_module==== | ||
− | + | It creates a network module from data as parameters. | |
Call syntax: | Call syntax: | ||
Line 1,788: | Line 1,872: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_network_module (required) | *op2=create_network_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,813: | Line 1,897: | ||
:*<description> | :*<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) | ||
Line 1,821: | Line 1,905: | ||
:*<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) | :*<ff_type> (only in version 733 or later) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
Line 1,827: | Line 1,912: | ||
====set create_plugin_module==== | ====set create_plugin_module==== | ||
− | + | It creates a module plugin with data as parameters. | |
Call Syntax: | Call Syntax: | ||
Line 1,833: | Line 1,918: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_plugin_module (required) | *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,862: | Line 1,947: | ||
:*<plugin_parameter> | :*<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) | + | :*<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. | + | :**''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. |
− | **''"desc"'': Descriptive name | + | :**''"desc"'': Descriptive macro name. |
− | **''"help"'': | + | :**''"help"'': Macro description. |
− | **''"value"'': | + | :**''"value"'': Macro value. |
− | **''"hide"'': Set to "1" to hide the value | + | :**''"hide"'': Set to "1" to hide the macro value (useful for storing passwords). |
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
+ | |||
=====Example===== | =====Example===== | ||
{ | { | ||
Line 1,885: | Line 1,972: | ||
} | } | ||
} | } | ||
− | :*<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) | ||
Line 1,900: | Line 1,987: | ||
====set create_data_module==== | ====set create_data_module==== | ||
− | + | It creates a module with the given parameters. | |
− | {{warning|With this call you | + | {{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 Syntax: | ||
Line 1,908: | Line 1,995: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_data_module (required) | *op2=create_data_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,927: | Line 2,014: | ||
:*<history_data> | :*<history_data> | ||
:*<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>". |
:*<ff_threshold> (only in version 5.1 or later) | :*<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) | ||
Line 1,937: | Line 2,024: | ||
:*<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) | :*<ff_type> (only in version 733 or later) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
Line 1,944: | Line 2,032: | ||
====set create_SNMP_module==== | ====set create_SNMP_module==== | ||
− | + | It creates an SNMP module. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_snmp_module (required) | *op2=create_snmp_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,986: | Line 2,074: | ||
:*<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) | :*<ff_type> (only in version 733 or later) | ||
+ | :*<use_agent_alias> (Values 0 and 1 supported) | ||
=====Examples===== | =====Examples===== | ||
Line 1,999: | Line 2,088: | ||
====set update_network_module==== | ====set update_network_module==== | ||
− | + | It updates the network module. | |
Call syntax: | Call syntax: | ||
Line 2,005: | Line 2,094: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_network_module (required) | *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,029: | Line 2,118: | ||
:*<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) | ||
Line 2,044: | Line 2,133: | ||
====set update_plugin_module==== | ====set update_plugin_module==== | ||
− | + | It updates the plugin module. | |
Call Syntax: | Call Syntax: | ||
Line 2,050: | Line 2,139: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_plugin_module (required) | *op2=update_plugin_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,078: | Line 2,167: | ||
:*<plugin_parameter> | :*<plugin_parameter> | ||
:*<disabled_types_event> (only in version 5 or later) | :*<disabled_types_event> (only in version 5 or later) | ||
− | :*<macros> (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. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. | ** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. | ||
**''"desc"'': Descriptive name of the macro. | **''"desc"'': Descriptive name of the macro. | ||
− | **''"help"'': | + | **''"help"'': Macro description. |
− | **''"value"'': | + | **''"value"'':Macro value. |
=====Example===== | =====Example===== | ||
{ | { | ||
Line 2,098: | Line 2,187: | ||
} | } | ||
} | } | ||
− | :*<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) | ||
Line 2,113: | Line 2,202: | ||
====set update_data_module==== | ====set update_data_module==== | ||
− | {{warning|With this call | + | {{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 Syntax: | Call Syntax: | ||
Line 2,121: | Line 2,210: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_data_module (required) | *op2=update_data_module (required) | ||
− | *id=<module_id> (required) should be | + | *id=<module_id> (required). It should be the module id to be updated. |
− | *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,145: | Line 2,234: | ||
:*<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>". |
:*<ff_threshold> (only in version 5.1 or later) | :*<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) | ||
Line 2,162: | Line 2,251: | ||
====set update_data_module_policy==== | ====set update_data_module_policy==== | ||
− | + | It updates a data module in a policy and returns an id from the new module. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_data_module (required) | *op2=update_data_module (required) | ||
− | *id=<id_agent_module> (required) Id of the target policy module. | + | *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> | :*<id_policy_module> | ||
:*<description> | :*<description> | ||
Line 2,184: | Line 2,273: | ||
:*<configuration_data> | :*<configuration_data> | ||
:*<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>". |
=====Examples===== | =====Examples===== | ||
Line 2,192: | Line 2,281: | ||
====set update_SNMP_module==== | ====set update_SNMP_module==== | ||
− | + | It updates an SNMP module. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_snmp_module (required) | *op2=update_snmp_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,241: | Line 2,330: | ||
====set apply_policy==== | ====set apply_policy==== | ||
− | + | It applies the policy, once it has gone through id, in one or several agents. | |
Call syntax: | Call syntax: | ||
Line 2,247: | Line 2,336: | ||
*op2=apply_policy (required) | *op2=apply_policy (required) | ||
*id=<id_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 | + | *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> | *other=<serialized parameters> | ||
− | :*<name_agent ( | + | :*<name_agent (Integer)>. It indicates whether the agent will be sent by Id (0), by name (1) or by alias (2). |
− | :*<server_id> (required | + | :*<server_id> (required when using Metaconsole). Id of the server in which the policy will be applied. |
− | |||
=====Examples===== | =====Examples===== | ||
Line 2,259: | Line 2,347: | ||
====set apply_all_policies==== | ====set apply_all_policies==== | ||
− | + | It applies all policies within Pandora FMS. | |
Call syntax: | Call syntax: | ||
Line 2,271: | Line 2,359: | ||
====set add_network_module_policy==== | ====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=add_network_module_policy (required) | *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,299: | Line 2,387: | ||
:*<custom_id> | :*<custom_id> | ||
:*<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) | ||
Line 2,312: | Line 2,400: | ||
====set add_plugin_module_policy==== | ====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=add_plugin_module_policy (required) | *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,345: | Line 2,433: | ||
:*<plugin_parameter> | :*<plugin_parameter> | ||
:*<enable_unknown_events> (only in version 5) | :*<enable_unknown_events> (only in version 5) | ||
− | :*<macros> (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. | + | ** ''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''. |
− | **''"desc"'': Descriptive name | + | **''"desc"'': Descriptive macro name. |
− | **''"help"'': | + | **''"help"'': Macro description. |
− | **''"value"'': | + | **''"value"'':Macro value. |
=====Example===== | =====Example===== | ||
{ | { | ||
Line 2,365: | Line 2,453: | ||
} | } | ||
} | } | ||
− | :*<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) | ||
Line 2,378: | Line 2,466: | ||
====set add_data_module_policy==== | ====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=add_data_module_policy (required) | *op2=add_data_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> | ||
:*<id_module_type> | :*<id_module_type> | ||
Line 2,400: | Line 2,488: | ||
:*<str_critical> | :*<str_critical> | ||
:*<history_data> | :*<history_data> | ||
− | :*<configuration_data> This is the definition block of the agent that will be | + | :*<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) | :*<enable_unknown_events> (only in version 5 or later) | ||
− | :*<module_macros> (only in version 5 | + | :*<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 | + | :*<ff_threshold> (only in version 5.1 ) |
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_timeout> (only in version 5.1 | + | :*<ff_timeout> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
=====Examples===== | =====Examples===== | ||
Line 2,417: | Line 2,505: | ||
====set add_SNMP_module_policy==== | ====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=add_snmp_module_policy (required) | *op2=add_snmp_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,453: | Line 2,541: | ||
:*<snmp3_auth_pass> | :*<snmp3_auth_pass> | ||
:*<enable_unknown_events> (only in version 5 or later) | :*<enable_unknown_events> (only in version 5 or later) | ||
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
− | + | ||
=====Examples===== | =====Examples===== | ||
Line 2,465: | Line 2,553: | ||
====set add_agent_policy_by_id==== | ====set add_agent_policy_by_id==== | ||
− | + | It adds an agent to a policy using the agent ID | |
Call syntax: | Call syntax: | ||
− | *op=set ( | + | *op=set (required) |
*op2=add_agent_policy_by_id (mandatory) | *op2=add_agent_policy_by_id (mandatory) | ||
− | *id=<id_policy> ( | + | *id=<id_policy> (required). It must be a policy Id. |
− | *other=<serialized parameters> ( | + | *other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order: |
:*<id_agent> | :*<id_agent> | ||
− | :*<id_node> ( | + | :*<id_node> (required when using the Metaconsole). ID of the node the agent you wish to add to the policy belongs to. |
=====Examples===== | =====Examples===== | ||
Line 2,485: | Line 2,573: | ||
====set add_agent_policy_by_name==== | ====set add_agent_policy_by_name==== | ||
− | + | It adds an agent to a policy using the agent name. | |
Call syntax: | Call syntax: | ||
− | *op=set ( | + | *op=set (required) |
− | *op2=add_agent_policy_by_name ( | + | *op2=add_agent_policy_by_name (required) |
− | *id=<id_policy> ( | + | *id=<id_policy> (required). It must be a policy Id. |
− | *other=<serialized parameters> ( | + | *other=<serialized parameters> (required). These are agent configuration and data, serialized in the following order: |
:*<agent_name> | :*<agent_name> | ||
Line 2,500: | Line 2,588: | ||
====set remove_agent_from_policy_by_id==== | ====set remove_agent_from_policy_by_id==== | ||
− | + | It deletes an agent from a policy using the agent ID. | |
Call syntax: | Call syntax: | ||
− | *op=set ( | + | *op=set (required) |
− | *op2=remove_agent_from_policy_by_id ( | + | *op2=remove_agent_from_policy_by_id (required) |
− | *id=<id_política> ( | + | *id=<id_política> (required). It must be a policy Id. |
− | *other=<serialized parameters> ( | + | *other=<serialized parameters> (required). These are the agent’s configuration and data, serialized in the following order: |
:*<id_agent> | :*<id_agent> | ||
− | :*<id_node> ( | + | :*<id_node> (required when using the Metaconsole). ID of the node the agent you wish to remove from the policy belongs to. |
=====Examples===== | =====Examples===== | ||
Line 2,520: | Line 2,608: | ||
====set remove_agent_from_policy_by_name==== | ====set remove_agent_from_policy_by_name==== | ||
− | + | It deletes an agent from a policy using the agent name. | |
Call syntax: | Call syntax: | ||
− | *op=set ( | + | *op=set (required) |
− | *op2=remove_agent_from_policy_by_name ( | + | *op2=remove_agent_from_policy_by_name (required) |
− | *id=<id_policy> ( | + | *id=<id_policy> (required). It must be a policy Id. |
− | *other=<serialized parameters> ( | + | *other=<serialized parameters> (required). These are the agent’s configuration and data, serialized in the following order: |
:*<agent_name> | :*<agent_name> | ||
Line 2,535: | Line 2,623: | ||
====set new_network_component==== | ====set new_network_component==== | ||
− | + | It creates a new network component. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_network_component (required) | *op2=new_network_component (required) | ||
− | *id=<network_component_name> (required) should be the network component name. | + | *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> | :*<network_component_type> | ||
:*<description> | :*<description> | ||
Line 2,561: | Line 2,649: | ||
:*<network_component_group> | :*<network_component_group> | ||
:*<enable_unknown_events> (only in version 5) | :*<enable_unknown_events> (only in version 5) | ||
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
=====Examples===== | =====Examples===== | ||
Line 2,573: | Line 2,661: | ||
====set new_plugin_component==== | ====set new_plugin_component==== | ||
− | + | It creates a new plugin component. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_plugin_component (required) | *op2=new_plugin_component (required) | ||
− | *id=<plugin_component_name> (required) | + | *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> | :*<plugin_component_type> | ||
:*<description> | :*<description> | ||
Line 2,599: | Line 2,687: | ||
:*<post_process> | :*<post_process> | ||
:*<plugin_component_group> | :*<plugin_component_group> | ||
− | :*<enable_unknown_events> (only in version 5 | + | :*<enable_unknown_events> (only in version 5) |
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
=====Examples===== | =====Examples===== | ||
Line 2,612: | Line 2,700: | ||
====set new_snmp_component==== | ====set new_snmp_component==== | ||
− | + | It creates a new SNMP component. | |
Call syntax: | Call syntax: | ||
Line 2,618: | Line 2,706: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_snmp_component (required) | *op2=new_snmp_component (required) | ||
− | *id=<snmp_component_name> (required) should be the | + | *id=<snmp_component_name> (required). It should be the SNMP component name. |
− | *other=<serialized parameters> (required) are the configuration and data of the snmp component, serialized in the following order: | + | *other=<serialized parameters> (required). These are the configuration and data of the snmp component, serialized in the following order: |
:*<snmp_component_type> | :*<snmp_component_type> | ||
:*<description> | :*<description> | ||
Line 2,647: | Line 2,735: | ||
:*<snmp3_security_level> | :*<snmp3_security_level> | ||
:*<snmp_component_group> | :*<snmp_component_group> | ||
− | :*<enable_unknown_events> (only in version 5 | + | :*<enable_unknown_events> (only in version 5) |
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
=====Examples===== | =====Examples===== | ||
Line 2,660: | Line 2,748: | ||
====set new_local_component==== | ====set new_local_component==== | ||
− | + | It creates a new local component. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=new_local_component (required) | *op2=new_local_component (required) | ||
− | *id=<local_component_name> (required) should be a local component name. | + | *id=<local_component_name> (required). It should be a local component name. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are configuration and data of the local component, serialized in the following order: |
:*<description> | :*<description> | ||
:*<id_os> | :*<id_os> | ||
:*<local_component_group> | :*<local_component_group> | ||
− | :*<configuration_data> This is the configuration block | + | :*<configuration_data>. This is the module configuration block. |
− | :*<enable_unknown_events> (only in version 5 | + | :*<enable_unknown_events> (only in version 5) |
− | :*<ff_threshold> (only in version 5.1 | + | :*<ff_threshold> (only in version 5.1) |
− | :*<each_ff> (only in version 5.1 | + | :*<each_ff> (only in version 5.1) |
− | :*<ff_threshold_normal> (only in version 5.1 | + | :*<ff_threshold_normal> (only in version 5.1) |
− | :*<ff_threshold_warning> (only in version 5.1 | + | :*<ff_threshold_warning> (only in version 5.1) |
− | :*<ff_threshold_critical> (only in version 5.1 | + | :*<ff_threshold_critical> (only in version 5.1) |
− | :*<ff_timeout> (only in version 5.1 | + | :*<ff_timeout> (only in version 5.1) |
− | :*<ff_type> (only in version | + | :*<ff_type> (only in version 734) |
=====Examples===== | =====Examples===== | ||
Line 2,686: | Line 2,774: | ||
====set create_alert_template==== | ====set create_alert_template==== | ||
− | + | It creates an alert template. | |
Call Syntax: | Call Syntax: | ||
Line 2,692: | Line 2,780: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_alert_template (required) | *op2=create_alert_template (required) | ||
− | *id=<template_name> (required) | + | *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]> | + | :*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always|not_normal]> |
:*<description> | :*<description> | ||
:*<id_alert_action> | :*<id_alert_action> | ||
Line 2,721: | 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===== | ||
Line 2,726: | Line 2,841: | ||
Example 1 (condition: regexp =~ /pp/, action: Mail to XXX, max_alert: 10, min_alert: 0, priority: WARNING, group: databases): | 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= | + | <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): | 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): | ||
− | <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| | + | <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==== | ====set update_alert_template==== | ||
− | + | It updates the template alert. | |
Call Syntax: | Call Syntax: | ||
Line 2,740: | Line 2,855: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_alert_template (required) | *op2=update_alert_template (required) | ||
− | *id=<id_template> (required) should be a template id. | + | *id=<id_template> (required). It should be a template id. |
− | *other=<serialized parameters> (required) are | + | *other=<serialized parameters> (required). They are template configuration and data, serialized in the following order: |
:*<template_name> | :*<template_name> | ||
:*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]> | :*<type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]> | ||
Line 2,770: | Line 2,885: | ||
:*<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===== | ||
− | + | <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> | |
− | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_alert_template&id= | ||
====set delete_alert_template==== | ====set delete_alert_template==== | ||
− | + | It deletes a alert template and deletes all the alerts it defines. | |
Call Syntax: | Call Syntax: | ||
Line 2,783: | Line 2,924: | ||
*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===== | ||
Line 2,791: | Line 2,932: | ||
====set delete_module_template==== | ====set delete_module_template==== | ||
− | + | It deletes a module template. | |
Call Syntax: | Call Syntax: | ||
Line 2,797: | 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===== | ||
Line 2,805: | Line 2,946: | ||
====set delete_module_template_by_names==== | ====set delete_module_template_by_names==== | ||
− | + | It deletes a module template. | |
Call Syntax: | Call Syntax: | ||
Line 2,813: | 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===== | ||
− | <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</nowiki> | + | <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,828: | 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===== | ||
Line 2,836: | Line 2,978: | ||
====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,852: | Line 2,994: | ||
:*<languages> | :*<languages> | ||
:*<comments> | :*<comments> | ||
+ | :*<time_autorefresh> | ||
+ | :*<default_event_filter> | ||
+ | :*<section> | ||
+ | :*<session_time> (-1 to establish the session as permanent) | ||
=====Examples===== | =====Examples===== | ||
Line 2,859: | Line 3,005: | ||
====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,885: | Line 3,031: | ||
====Set delete_user==== | ====Set delete_user==== | ||
− | + | It deletes a selected user. | |
Call syntax: | Call syntax: | ||
Line 2,891: | 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===== | ||
Line 2,899: | Line 3,045: | ||
====Set delete_user_permissions==== | ====Set delete_user_permissions==== | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It deletes user permissions. | |
Call syntax: | Call syntax: | ||
Line 2,909: | Line 3,055: | ||
− | ===== | + | =====Example===== |
− | + | It deletes user permissions. | |
It can return Json or CSV, this return is remarked through the URL. | It can return Json or CSV, this return is remarked through the URL. | ||
Line 2,918: | Line 3,064: | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It adds permissions to a user group. | |
Call syntax: | Call syntax: | ||
Line 2,930: | Line 3,076: | ||
=====Examples===== | =====Examples===== | ||
It can return Json or CSV, this return is remarked through the URL. | It can return Json or CSV, this return is remarked through the URL. | ||
− | Be careful, no_hierarchy may be empty | + | {{Warning|Be careful, no_hierarchy may be empty. If that is the case, it takes value 0.}} |
− | Be careful, | + | |
+ | {{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> | <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> | ||
Line 2,937: | Line 3,084: | ||
====set enable_disable_user==== | ====set enable_disable_user==== | ||
− | + | It enables a disabled user. | |
Call syntax: | Call syntax: | ||
Line 2,943: | 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,959: | Line 3,106: | ||
{{metaconsole}} | {{metaconsole}} | ||
− | + | It syncronizes metaconsole users to the node | |
Call syntax: | Call syntax: | ||
Line 2,965: | 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===== | ||
Line 2,978: | Line 3,125: | ||
====set create_group==== | ====set create_group==== | ||
− | + | It creates a group. | |
Call syntax: | Call syntax: | ||
Line 2,984: | 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 3,007: | Line 3,154: | ||
====set update_group==== | ====set update_group==== | ||
− | + | It updates a group with past data as parameters. | |
Call syntax: | Call syntax: | ||
Line 3,013: | 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 3,031: | Line 3,178: | ||
====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===== | ||
Line 3,044: | Line 3,191: | ||
====Set add_user_profile==== | ====Set add_user_profile==== | ||
− | + | It adds a profile into user. | |
Call syntax: | Call syntax: | ||
Line 3,050: | 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 3,061: | Line 3,208: | ||
====set delete_user_profile==== | ====set delete_user_profile==== | ||
− | + | It deletes a profile from a user. | |
Call syntax: | Call syntax: | ||
Line 3,067: | 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 3,078: | Line 3,225: | ||
====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 3,097: | Line 3,244: | ||
====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===== | ||
Line 3,112: | Line 3,259: | ||
====set validate_all_alerts==== | ====set validate_all_alerts==== | ||
− | + | It validates all alerts. | |
Call syntax: | Call syntax: | ||
Line 3,123: | Line 3,270: | ||
====set validate_all_policy_alerts==== | ====set validate_all_policy_alerts==== | ||
− | + | It validates the alerts created from a policy. | |
Call syntax: | Call syntax: | ||
Line 3,134: | Line 3,281: | ||
====set event_validate_filter==== | ====set event_validate_filter==== | ||
− | + | It validates all events that pass the past filter as parameters. | |
Line 3,144: | 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 3,153: | 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===== | ||
Line 3,160: | Line 3,308: | ||
====set event_validate_filter_pro==== | ====set event_validate_filter_pro==== | ||
− | It is | + | It is similar to previous call. |
Line 3,170: | 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 3,183: | Line 3,331: | ||
<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> | <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 3,195: | 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===== | ||
Line 3,204: | Line 3,367: | ||
====set alert_actions==== | ====set alert_actions==== | ||
− | + | It adds actions within an alert. | |
Call syntax: | Call syntax: | ||
Line 3,212: | 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===== | ||
Line 3,225: | Line 3,389: | ||
====set alert_commands==== | ====set alert_commands==== | ||
− | + | It adds commands within an alert. | |
Call syntax: | Call syntax: | ||
Line 3,232: | 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,243: | Line 3,407: | ||
====set new_module==== | ====set new_module==== | ||
− | + | It creates a new module. | |
Call Syntax: | Call Syntax: | ||
Line 3,252: | 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,268: | 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===== | ||
Line 3,274: | Line 3,439: | ||
====set delete_module==== | ====set delete_module==== | ||
− | + | It deletes a module. | |
Call syntax: | Call syntax: | ||
Line 3,283: | 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===== | ||
− | <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</nowiki> | + | <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> |
− | <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> | + | <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,308: | Line 3,474: | ||
====set enable_alert_alias==== | ====set enable_alert_alias==== | ||
− | + | It enables agent alert by alias. | |
Call syntax: | Call syntax: | ||
Line 3,324: | Line 3,490: | ||
====set disable_alert==== | ====set disable_alert==== | ||
− | + | It disables an agent alert. | |
Call syntax: | Call syntax: | ||
Line 3,342: | Line 3,508: | ||
====set disable_alert_alias==== | ====set disable_alert_alias==== | ||
− | + | It disables an agent alert. | |
Call syntax: | Call syntax: | ||
Line 3,360: | Line 3,526: | ||
====set enable_module_alerts==== | ====set enable_module_alerts==== | ||
− | + | Same as enable_alert api call. | |
Call syntax: | Call syntax: | ||
Line 3,368: | 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) | ||
Line 3,376: | Line 3,543: | ||
====set disable_module_alerts==== | ====set disable_module_alerts==== | ||
− | + | Same as api disable_alert. | |
Call syntax: | Call syntax: | ||
Line 3,384: | 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 ===== | ||
Line 3,391: | Line 3,559: | ||
====set enable_module==== | ====set enable_module==== | ||
− | + | It enables the module. | |
Call syntax | Call syntax | ||
Line 3,399: | 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 ===== | ||
Line 3,406: | Line 3,575: | ||
====set disable_module==== | ====set disable_module==== | ||
− | + | It disables the module. | |
− | Call syntax | + | Call syntax: |
*op=set (required) | *op=set (required) | ||
Line 3,414: | 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 ===== | ||
Line 3,421: | Line 3,591: | ||
====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,427: | 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) | ||
Line 3,437: | Line 3,608: | ||
====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,443: | 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===== | ||
<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> | <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,464: | Line 3,639: | ||
====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) | ||
Line 3,478: | Line 3,653: | ||
>= 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) | ||
Line 3,490: | Line 3,665: | ||
<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> | <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) | ||
Line 3,506: | Line 3,681: | ||
<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> | <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,523: | Line 3,698: | ||
<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> | <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. | |
Line 3,535: | 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,552: | 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,563: | Line 3,738: | ||
====set add_event_comment==== | ====set add_event_comment==== | ||
− | + | It adds an event comment. | |
− | {{Tip|This | + | {{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| | + | {{Tip|Enter the parameter "true" after "string" to use it in the Metaconsole}} |
=====Examples===== | =====Examples===== | ||
Line 3,583: | Line 3,758: | ||
<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> | <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===== | ||
+ | * Node: | ||
+ | |||
+ | <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,606: | Line 3,853: | ||
>= 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,645: | 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,651: | 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,696: | 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==== | ====set reset_agent_counts==== | ||
− | + | It updates agent alert and module counting. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=reset_agent_counts (required) | *op2=reset_agent_counts (required) | ||
− | *id=<id_agent> (required) must be an | + | *id=<id_agent> (required). It must be an agent id or "All". |
=====Example===== | =====Example===== | ||
− | 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>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,720: | 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,740: | 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,762: | 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,777: | 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,796: | 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,814: | 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,831: | 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,848: | 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,860: | 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,865: | 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,881: | 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,893: | 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,914: | 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,930: | 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,945: | 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,963: | 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,985: | 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 4,001: | 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 4,034: | 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 4,051: | 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 4,068: | 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 4,079: | 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 4,104: | 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 4,120: | 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 4,152: | 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 4,168: | 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 4,189: | 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 | *op = set | ||
Line 4,208: | Line 4,464: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2&id2=echo%201 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2&id2=echo%201</nowiki> |
====set delete_plugins_policy==== | ====set delete_plugins_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | + | These are the requirements to remove a plugin from a policy: | |
− | * A policy id and | + | * A policy id and for such a policy to exist. Mandatory. |
− | * A plugin id | + | * A plugin id to be removed. Mandatory. |
− | * 0 or 1: | + | * 0 or 1: 1 means the plugin is yet to be deleted and 0 removes this state. If not added, this field is marked as pending to be deleted by default. |
− | returns 0 (false) or 1 (true). | + | It returns 0 (false) or 1 (true). |
*op = set | *op = set | ||
Line 4,228: | Line 4,484: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&id2=1&other=1 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&id2=1&other=1</nowiki> |
====set linking_policy==== | ====set linking_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To link an unlinked module | + | To link an unlinked policy module it is necessary: |
* An agent id module that is unlinked. | * An agent id module that is unlinked. | ||
− | returns 0 (false) or 1 (true). | + | It returns 0 (false) or 1 (true). |
*op = set | *op = set | ||
Line 4,245: | Line 4,501: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=linking_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=28 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=linking_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=28</nowiki> |
====set create_alerts_policy==== | ====set create_alerts_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To create policy | + | To create policy alert, these are necessary: |
* A policy id that must exist (required). | * A policy id that must exist (required). | ||
− | * A policy module id if it | + | * A policy module id, if it belongs to the normal type it is mandatory. |
* A template id that must exist (required). | * A template id that must exist (required). | ||
− | * Whether | + | * Whether it is external or not: 0 (normal), 1 (external). It is 0 (normal) by default. |
− | * | + | * If it belongs to the external type (1) a module name that must match it. |
− | returns 0 (false) or the id of the alert added in the policy (true). | + | It returns 0 (false) or the id of the alert added in the policy (true). |
*op = set | *op = set | ||
Line 4,268: | Line 4,524: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&other=0|2|1|cpu%20load&other_mode=url_encode_separator_| | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=2&other=0|2|1|cpu%20load&other_mode=url_encode_separator_|</nowiki> |
====set update_alerts_policy==== | ====set update_alerts_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To update policy alerts is necessary: | + | To update policy alerts, it is necessary: |
* A policy id that must exist (required). | * A policy id that must exist (required). | ||
* Active 0 | Waiting 1 | * Active 0 | Waiting 1 | ||
* enable 0 | disable 1 | * enable 0 | disable 1 | ||
− | returns 0 (false) or the id of the updated alert in the policy (true). | + | It returns 0 (false) or the id of the updated alert in the policy (true). |
*op = set | *op = set | ||
Line 4,288: | Line 4,544: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=update_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&other=1|1&other_mode=url_encode_separator_| | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=update_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&other=1|1&other_mode=url_encode_separator_|</nowiki> |
====set delete_alerts_policy==== | ====set delete_alerts_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To remove an alert from a policy is necessary: | + | To remove an alert from a policy it is necessary: |
* A policy alert id that must exist (required). | * A policy alert id that must exist (required). | ||
− | * 0 | 1 mark | + | * 0 | 1 mark it as yet to bet removed or not. If this field is empty, 1 is set by default. |
* Active 0 | Standby 1 | * Active 0 | Standby 1 | ||
− | returns 0 (false) or 1 (true). | + | It returns 0 (false) or 1 (true). |
*op = set | *op = set | ||
Line 4,307: | Line 4,563: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=1 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=1</nowiki> |
====set create_alerts_actions_policy==== | ====set create_alerts_actions_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To add an action to a policy alert is necessary: | + | To add an action to a policy alert it is necessary: |
* A policy alert id that must exist (required). | * A policy alert id that must exist (required). | ||
* A policy action id that must exist (required). | * A policy action id that must exist (required). | ||
− | * You | + | * You may add a minimum number of shots or a maximum number of shots by default: 0. |
− | returns 0 (false) or the id of the action added to the alert | + | It returns 0 (false) or the id of the action added to the policy alert (true). |
*op = set | *op = set | ||
Line 4,328: | Line 4,584: | ||
=====Example===== | =====Example===== | ||
− | http://172.16.0.2/pandora_console/include/api.php?op=set&op2=create_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4&other=5|2&other_mode=url_encode_separator_| | + | <nowiki>http://172.16.0.2/pandora_console/include/api.php?op=set&op2=create_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4&other=5|2&other_mode=url_encode_separator_|</nowiki> |
====set delete_alerts_actions_policy==== | ====set delete_alerts_actions_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To remove an action from a policy alert is necessary: | + | To remove an action from a policy alert, it is necessary: |
* A policy alert id that must exist (required). | * A policy alert id that must exist (required). | ||
* A policy action id that must exist (required). | * A policy action id that must exist (required). | ||
Line 4,345: | Line 4,601: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=1&id2=4</nowiki> |
====set remove_agents_policy==== | ====set remove_agents_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To remove an agent from a policy is necessary: | + | To remove an agent from a policy, it is necessary: |
* A policy id that must exist (required). | * A policy id that must exist (required). | ||
* An agent id that must exist (required). | * An agent id that must exist (required). | ||
Line 4,362: | Line 4,618: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=remove_agents_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=remove_agents_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2</nowiki> |
====set add_groups_policy==== | ====set add_groups_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To add a group | + | To add a policy group, it is necessary: |
− | * | + | * An existing policy id (required). |
− | * | + | * An existing group id (required). |
*op = set | *op = set | ||
Line 4,379: | Line 4,635: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=add_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=12 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=add_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=7&id2=12</nowiki> |
====set remove_groups_policy==== | ====set remove_groups_policy==== | ||
>= 7.0. 725 | >= 7.0. 725 | ||
− | To remove an agent from a policy is necessary: | + | To remove an agent from a policy, it is necessary: |
− | * | + | * An existing policy id (required). |
− | * | + | * An existing group id (required). |
*op = set | *op = set | ||
Line 4,396: | Line 4,652: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=remove_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2 | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=remove_groups_policy&apipass=1234&user=admin&pass=pandora&return_type=string&id=5&id2=2</nowiki> |
====set create_os==== | ====set create_os==== | ||
>= 7.0. 727 | >= 7.0. 727 | ||
− | + | It creates a new operating system with the data as parameters. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_os (required) | *op2=create_os (required) | ||
− | *other=<serializead parameters> (required) are the system's data, serializead in this order: | + | *other=<serializead parameters> (required). They are the system's data, serializead in this order: |
:*<name> | :*<name> | ||
:*<description> | :*<description> | ||
Line 4,413: | Line 4,669: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_os&other=os_name%7Cos_description%7Cos_icon.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_os&other=os_name%7Cos_description%7Cos_icon.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_os==== | ====set update_os==== | ||
>= 7.0. 727 | >= 7.0. 727 | ||
− | + | It updates the operating system with data as parameters. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_os (required) | *op2=create_os (required) | ||
− | *other=<serializead parameters> (required) are the operating system's data, | + | *other=<serializead parameters> (required). They are the operating system's data, serialized in this order: |
:*<name> | :*<name> | ||
:*<description> | :*<description> | ||
Line 4,430: | Line 4,686: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?id=107&op=set&op2=update_os&other=os_name_to_update%7Cos_description_to_update%7Cos_icon_to_update.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?id=107&op=set&op2=update_os&other=os_name_to_update%7Cos_description_to_update%7Cos_icon_to_update.png&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set disabled_and_standby==== | ====set disabled_and_standby==== | ||
>= 7.0. 728 | >= 7.0. 728 | ||
− | + | It disables an agent and, if it has remote configuration, it makes it go into standby mode. | |
Call Syntax: | Call Syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=disabled_and_standby (required) | *op2=disabled_and_standby (required) | ||
− | *id=<agent id> (required). In the | + | *id=<agent id> (required). In the Metaconsole, it is the id of the agent, that is to say, the id of the node. |
− | *id2=<id del nodo> (required in the | + | *id2=<id del nodo> (required in the Metaconsole, not needed in the node) |
*other=<valor> (optional) Value (0 to enable and 1 to disable) of the new status. If no value is specified, it disables the agent. | *other=<valor> (optional) Value (0 to enable and 1 to disable) of the new status. If no value is specified, it disables the agent. | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
− | http://127.0.0.1/pandora_console/include/api.php?id=2&id2=1&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?id=2&id2=1&op=set&op2=disabled_and_standby&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set validate_traps==== | ====set validate_traps==== | ||
>= 7.0. 728 | >= 7.0. 728 | ||
− | + | It allows to validate traps. | |
*op = set | *op = set | ||
Line 4,461: | Line 4,717: | ||
=====Example===== | =====Example===== | ||
− | https://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>https://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_traps==== | ====set delete_traps==== | ||
>= 7.0. 728 | >= 7.0. 728 | ||
− | + | It allows to delete a trap: | |
*op = set | *op = set | ||
Line 4,474: | Line 4,730: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=delete_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?id=2&op=set&op2=delete_traps&id=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set access_process==== | ====set access_process==== | ||
>= 7.0NG. 728 | >= 7.0NG. 728 | ||
− | This function allows to manage the access to a third application from records in the system audit log of | + | This function allows to manage the access to a third application from records in the system audit log of Pandora FMS. It uses different parameters to process one of these registry actions in your application and avoids concurrent access by administrator users. Optionally, it can ban access to non-administrator users. |
Call syntax: | Call syntax: | ||
Line 4,488: | Line 4,744: | ||
:* <user_id> | :* <user_id> | ||
− | The id of the user trying to access the application, this data is recorded and checked in the audit to filter | + | The id of the user trying to access the application, this data is recorded and checked in the audit to filter user access, exit, exploration or navigation through the application. |
:* <action> - (login,logout,exclude,browse) | :* <action> - (login,logout,exclude,browse) | ||
− | login: It is used to request access to the application. It deletes the text string "free" and registers | + | login: It is used to request access to the application. It deletes the text string "free" and registers your access in Pandora FMS audit or returns the text string "denied" if there is another user in the audit records who has previously logged in the system and has not yet logged out. It will also return denied if the administrator-only access parameter is enabled and the user is not an admin. |
− | logout: Logs a user's | + | logout: Logs a user's application logout so that other users are again allowed to access. |
browse: It must be used on all pages of the external application, as it checks whether this user is still the last one to access or be expelled from the application. | browse: It must be used on all pages of the external application, as it checks whether this user is still the last one to access or be expelled from the application. | ||
− | exclude: | + | exclude: It expels the currently registered user and registers the access of another one sent in the user_id parameter |
:* <app ip address> | :* <app ip address> | ||
− | IP address of the application from which you | + | IP address of the application from which you access it. It is registered and checked in the Pandora FMS audit to check user access status in the application. |
:* <app name> | :* <app name> | ||
− | Name of the application you are accessing from. It is registered and checked in the | + | Name of the application you are accessing from. It is registered and checked in the Pandora FMS audit to check the user access status in the application. |
:* <only admin access> | :* <only admin access> | ||
− | + | It forbids the access to non-administrator users. | |
=====Example (requires adapted environment)===== | =====Example (requires adapted environment)===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=access_process&other=1%7Clogin%7C192.168.50.25%7Cexternal_app%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=access_process&other=1%7Clogin%7C192.168.50.25%7Cexternal_app%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_event_response==== | ====set create_event_response==== | ||
− | + | It creates a new event response. | |
Call syntax: | Call syntax: | ||
Line 4,524: | Line 4,780: | ||
*op2=create_event_response (required) | *op2=create_event_response (required) | ||
*return_type=csv|json (required) | *return_type=csv|json (required) | ||
− | *other=<serialized parameters> (all required). In | + | *other=<serialized parameters> (all required). In the following order: |
:*<name> | :*<name> | ||
:*<description> | :*<description> | ||
− | :*<target> If the forth parameter (<type>) is ''command'', here it is necessary to indicate the | + | :*<target> If the forth parameter (<type>) is ''command'', here it is necessary to indicate the desired command to execute the response to the event. On the other hand, if it is ''url'', indicate the URL you wish to access as a response to the event. |
:*<type> ''command'' or ''url''. | :*<type> ''command'' or ''url''. | ||
:*<group id> The user must have permissions over the indicated group. | :*<group id> The user must have permissions over the indicated group. | ||
:*<modal window width> In pixels. | :*<modal window width> In pixels. | ||
:*<modal window height> In pixels. | :*<modal window height> In pixels. | ||
− | :*<new window> 1 or 0. | + | :*<new window> 1 or 0. It indicates whether the URL is shown on a new window (1) or on a modal window (0). |
+ | :*<command timeout> Response in seconds. | ||
:*<parameters> Parameters that complement the execution of the command. | :*<parameters> Parameters that complement the execution of the command. | ||
− | :*<server> Id of the server in which the command is | + | :*<server> Id of the server in which the command is to be executed. For the local console, the value is 0. |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_event_response&other=response | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_event_response&other=response|description%20response|touch|command|0|650|400|0|response|0|90&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_event_response==== | ====set update_event_response==== | ||
− | + | It edits an existing event response. The user must have permissions on the group to which the response belongs, in order to edit it. | |
Call syntax: | Call syntax: | ||
Line 4,549: | Line 4,806: | ||
*return_type=csv|json (required) | *return_type=csv|json (required) | ||
*id=<id of event response> (required) | *id=<id of event response> (required) | ||
− | *other=<serialized parameters> (optional). In | + | *other=<serialized parameters> (optional). In the following order: |
:*<name> | :*<name> | ||
:*<description> | :*<description> | ||
− | :*<target> If the fourth parameter (<type>) is ''command'', here | + | :*<target> If the fourth parameter (<type>) is ''command'', indicate here the command that you wish for the event response to execute. On the other hand, if it is ''url'', indicate the URL you wish to access as a response to the event. |
:*<type> ''command'' or ''url''. | :*<type> ''command'' or ''url''. | ||
:*<group id> The user must have permissions on the indicated group. | :*<group id> The user must have permissions on the indicated group. | ||
:*<modal window width> In pixels. | :*<modal window width> In pixels. | ||
:*<modal window height> In pixels. | :*<modal window height> In pixels. | ||
− | :*<new window> 1 or 0. | + | :*<new window> 1 or 0. It indicates whether the URL is displayed on a new window (1) or on a modal window (0). |
+ | :*<command timeout> Response in seconds. | ||
:*<parameters> Parameters that complement the command's execution. | :*<parameters> Parameters that complement the command's execution. | ||
− | :*<server> Id of the server where the command is | + | :*<server> Id of the server where the command is to be executed. For the local console the value is 0. |
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=update_event_response&id= | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=update_event_response&id=5&other=response|description%20response|touch|command|0|650|400|0|response|0|90&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_event_response==== | ====set delete_event_response==== | ||
− | + | It deletes an event response. The user must have permissions on the group to which the response belongs in order to delete it. | |
Call syntax: | Call syntax: | ||
Line 4,576: | Line 4,834: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_event_response&id=7&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_event_response&id=7&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_user_profile_info==== | ====set create_user_profile_info==== | ||
− | + | It creates a new user profile. | |
Call syntax: | Call syntax: | ||
Line 4,586: | Line 4,844: | ||
*op2=create_user_profile_info (required) | *op2=create_user_profile_info (required) | ||
*return_type=csv|json (required) | *return_type=csv|json (required) | ||
− | *other=<serialized parameters> In | + | *other=<serialized parameters> In the following order: |
:*<name> (required) | :*<name> (required) | ||
− | :*<access bits>: 1 if bit is to be set and 0 if not. They are not required but if no value is specified the bit will be marked as not active. In this order: | + | :*<access bits>: 1 if bit is to be set and 0 if not. They are not required but if no value is specified, the bit will be marked as not active. In this order: |
'''IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM'''. | '''IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM'''. | ||
− | {{Tip|To know which permissions | + | {{Tip|To know which permissions should be activated, click on the following [[Pandora:Documentation_en:Managing_and_Administration#Profiles_in_Pandora_FMS | link.]]}} |
=====Example===== | =====Example===== | ||
− | This example creates a profile that gives | + | This example creates a profile that gives read-only access to Pandora, that is, it is the same as the predefined profile ''Operator (read)''. |
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_user_profile_info&return_type=json&other=API_profile%7C1%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_user_profile_info&return_type=json&other=API_profile%7C1%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C1%7C0%7C0%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_user_profile_info==== | ====set update_user_profile_info==== | ||
− | + | It updates a new existing user profile. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_user_profile_info (required) | *op2=update_user_profile_info (required) | ||
− | *other=<serialized parameters> (all optional) | + | *other=<serialized parameters> (all optional). In the following order: |
:*<name> | :*<name> | ||
:*<access bits>: 1 if you want to set the bit and 0 if you want to disable it. If no value is specified, it will not change. In this order: | :*<access bits>: 1 if you want to set the bit and 0 if you want to disable it. If no value is specified, it will not change. In this order: | ||
'''IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM'''. | '''IR|IW|IM|AR|AW|AD|LW|LM|UM|DM|ER|EW|EM|RR|RW|RM|MR|MW|MM|VR|VW|VM|PM'''. | ||
− | {{Tip|To | + | {{Tip|To find out which permissions should be activated, click on the following [[Pandora:Documentation_en:Managing_and_Administration#Profiles_in_Pandora_FMS | link.]]}} |
=====Example===== | =====Example===== | ||
− | In this example | + | In this example the name of the profile with ID 6 is replaced by ''API_profile_updated'' and it is granted all permissions (read, write and management) related to agents and permission to read events is withdrawn. |
− | http://localhost/pandora_console/include/api.php?op=set&op2=update_user_profile_info&return_type=json&id=6&other=API_profile_updated%7C%7C%7C%7C1%7C1%7C1%7C%7C%7C%7C%7C0%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=update_user_profile_info&return_type=json&id=6&other=API_profile_updated%7C%7C%7C%7C1%7C1%7C1%7C%7C%7C%7C%7C0%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_user_profile_info==== | ====set delete_user_profile_info==== | ||
− | + | It deletes a user profile. It also deletes all that profile assignments to any user. | |
Call syntax: | Call syntax: | ||
Line 4,631: | Line 4,889: | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_user_profile_info&return_type=json&id=8&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_user_profile_info&return_type=json&id=8&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_event_filter==== | ====set create_event_filter==== | ||
− | + | It creates an event filter. | |
Call syntax: | Call syntax: | ||
Line 4,664: | Line 4,922: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event_filter&id=test&other=%7C%7Cerror%7C4%7C%7C%7C1%7C%7C12%7C%7C%7C2018-12-09%7C2018-12-13%7C[%226%22]%7C[%2210%22,%226%22,%223%22]%7C1%7C10%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event_filter&id=test&other=%7C%7Cerror%7C4%7C%7C%7C1%7C%7C12%7C%7C%7C2018-12-09%7C2018-12-13%7C[%226%22]%7C[%2210%22,%226%22,%223%22]%7C1%7C10%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_event_filter==== | ====set update_event_filter==== | ||
− | + | It updates an event filter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=update_event_filter (required) | *op2=update_event_filter (required) | ||
− | *id=<event_filter_id> (required) must be an existing event filter id. | + | *id=<event_filter_id> (required). It must be an existing event filter id. |
− | *other=<serialized parameters> (optional). In | + | *other=<serialized parameters> (optional). In the following order: |
:*<id_group_filter> | :*<id_group_filter> | ||
:*<id_group> | :*<id_group> | ||
Line 4,697: | Line 4,955: | ||
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_event_filter&id=195&other=new_name%7C%7C%7Calert_recovered%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_event_filter&id=195&other=new_name%7C%7C%7Calert_recovered%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_event_filter==== | ====set delete_event_filter==== | ||
− | + | It deletes an event filter. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=delete_event_filter (required) | *op2=delete_event_filter (required) | ||
− | *id=<event_filter_id> (required) must be an existing event filter id. | + | *id=<event_filter_id> (required). It must be an existing event filter id. |
=====Example===== | =====Example===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_event_filter&id=38&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_event_filter&id=38&apipass=1234&user=admin&pass=pandora</nowiki> |
====get all_event_filters==== | ====get all_event_filters==== | ||
− | + | It returns the list of existing event filters. | |
Call syntax: | Call syntax: | ||
Line 4,723: | Line 4,981: | ||
=====Examples===== | =====Examples===== | ||
− | http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_event_filters&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_event_filters&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_inventory_module==== | ====set create_inventory_module==== | ||
− | + | It creates a new inventory module. | |
Call syntax: | Call syntax: | ||
Line 4,732: | Line 4,990: | ||
*op2=create_inventory_module (required) | *op2=create_inventory_module (required) | ||
*return_type=csv|json | *return_type=csv|json | ||
− | *other=<serialized parameters> In | + | *other=<serialized parameters> In the following order: |
:*<name> (required) | :*<name> (required) | ||
:*<description>: (required, but can be empty) | :*<description>: (required, but can be empty) | ||
:*<operation system id>: (required). Numerical Id of the table ''tconfig_os''. | :*<operation system id>: (required). Numerical Id of the table ''tconfig_os''. | ||
:*<interpreter>: (required, but can be empty). If the interpreter is empty, it is interpreted as just a local inventory module. | :*<interpreter>: (required, but can be empty). If the interpreter is empty, it is interpreted as just a local inventory module. | ||
− | :*< code >: (required, but can be empty) ''Script'' that | + | :*< code >: (required, but can be empty). ''Script'' that must be executed to obtain the inventory data. Must be in '''base64'''. |
− | :*< data format >: (required) Header of the | + | :*< data format >: (required). Header of the retrieved data (separated by '';''). |
:*<block mode>: (required) 1 or 0. | :*<block mode>: (required) 1 or 0. | ||
Line 4,745: | Line 5,003: | ||
This example creates an inventory module called '''OS''' that collects the ''kernel-name'' and ''nodename'' data from a Linux system. | This example creates an inventory module called '''OS''' that collects the ''kernel-name'' and ''nodename'' data from a Linux system. | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_inventory_module&return_type=json&other=OS%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_inventory_module&return_type=json&other=OS%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set update_inventory_module==== | ====set update_inventory_module==== | ||
− | + | It updates an inventory module. | |
Call syntax: | Call syntax: | ||
Line 4,755: | Line 5,013: | ||
*id= inventory module ID (required) | *id= inventory module ID (required) | ||
*return_type=csv|json | *return_type=csv|json | ||
− | *other=<serialized parameters> In | + | *other=<serialized parameters>. In the following order: |
:*<name> (required) | :*<name> (required) | ||
− | :*<description>: (required, but can be empty) | + | :*<description>: (required, but it can be empty) |
− | :*<operation system id>: (required). Numerical Id of the | + | :*<operation system id>: (required). Numerical Id of the ''tconfig_os'' table. |
:*<interpreter>: (required, but can be empty). If the interpreter is empty, it is interpreted as just a local inventory module. | :*<interpreter>: (required, but can be empty). If the interpreter is empty, it is interpreted as just a local inventory module. | ||
− | :*< code >: (required, but can be empty) ''Script'' that | + | :*< code >: (required, but it can be empty). ''Script'' that must be executed to obtain inventory data. It must be in '''base64'''. |
− | :*< data format >: (required) Header of the | + | :*< data format >: (required) Header of the retrieved data (separated by '';''). |
:*<block mode>: (required) 1 or 0. | :*<block mode>: (required) 1 or 0. | ||
=====Example===== | =====Example===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=update_inventory_module&return_type=json&id=42&other=OS_easy%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=update_inventory_module&return_type=json&id=42&other=OS_easy%7COS_name_description%7C1%7C/bin/bash%7CIyEvYmluL2Jhc2gKZWNobyB1bmFtZSAtbiAtcw==%7Ckernelname;nodename%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_inventory_module==== | ====set delete_inventory_module==== | ||
− | + | It deletes a user profile. It also deletes all assignments from that profile to any user. | |
Call syntax: | Call syntax: | ||
Line 4,779: | Line 5,037: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_inventory_module&return_type=json&id=42&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_inventory_module&return_type=json&id=42&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki> |
====set create_collection==== | ====set create_collection==== | ||
− | + | It creates a collection. | |
Call syntax: | Call syntax: | ||
*op=set (required) | *op=set (required) | ||
*op2=create_collection (required) | *op2=create_collection (required) | ||
− | *other=<serialized values> (required) Serialized values to create the collection | + | *other=<serialized values> (required) Serialized values to create the collection. |
:*<name> | :*<name> | ||
:*<short_name> | :*<short_name> | ||
:*<id_group> | :*<id_group> | ||
:*<description> | :*<description> | ||
− | It is necessary to | + | It is necessary to pair it with 'other_mode' as follows: other_mode=url_encode_separator_<separator> to pass the separator of the serialized values of other. |
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=create_collection&other=test_plugin|test_p|0|test&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=create_collection&other=test_plugin|test_p|0|test&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki> |
====set delete_collection==== | ====set delete_collection==== | ||
− | + | It deletes a collection. | |
Call syntax: | Call syntax: | ||
Line 4,808: | Line 5,066: | ||
=====Examples===== | =====Examples===== | ||
− | http://localhost/pandora_console/include/api.php?op=set&op2=delete_collection&id=15&apipass=1234&user=admin&pass=pandora | + | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_collection&id=15&apipass=1234&user=admin&pass=pandora</nowiki> |
+ | |||
+ | ====set enable_disable_discovery_task==== | ||
+ | |||
+ | Enables or disables a task in the [[Pandora:Documentation_en:Discovery#Discovery_Task_list|Discovery Task list]]. | ||
+ | |||
+ | Call syntax: | ||
+ | *op=set (required) | ||
+ | *op2=enable_disable_discovery_task (required) | ||
+ | *id= task identifier (required) | ||
+ | *other= 1 for disable and 0 for enable | ||
+ | |||
+ | =====Examples===== | ||
+ | |||
+ | <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=enable_disable_discovery_task&id=1&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass= | ||
+ | pandora</nowiki> | ||
== Examples == | == Examples == | ||
− | + | These are several examples in several languages about calling Pandora FMS API. | |
===Example=== | ===Example=== | ||
− | 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>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> |
=== PHP === | === PHP === | ||
Line 5,240: | Line 5,513: | ||
=== Java (Android) === | === Java (Android) === | ||
− | + | See our project (Pandora FMS Event Viewer) in [https://sourceforge.net/p/pandora/code/8678/tree/trunk/extras/pandroid_event_viewer/ Pandroid FMS Event Viewer source code in SourceForge SVN repository] but this is the most important piece of code, which calls the API to get event data. | |
<pre> | <pre> | ||
Line 5,306: | Line 5,579: | ||
Some ideas for the future of api.php are: | Some ideas for the future of api.php are: | ||
− | * | + | * Broading the API call ensemble. |
− | * | + | * Returning and getting values in xml, JSON... |
− | * | + | * Increasing security call for insecure environments. |
− | * | + | * Integration with third tool standards. |
Revision as of 11:59, 18 February 2021
Go back to Pandora FMS documentation index
Contents
- 1 Pandora FMS External API
- 1.1 Security
- 1.2 New calls extension in the API
- 1.3 API Calls
- 1.3.1 INFO RETRIEVING
- 1.3.2 GET
- 1.3.2.1 get test
- 1.3.2.2 get license
- 1.3.2.3 get all_agents
- 1.3.2.4 get license_remaining
- 1.3.2.5 get module_last_value
- 1.3.2.6 get agent_module_name_last_value
- 1.3.2.7 get agent_module_name_last_value_alias
- 1.3.2.8 get module_value_all_agents
- 1.3.2.9 get agent_modules
- 1.3.2.10 get module_id
- 1.3.2.11 get module_custom_id
- 1.3.2.12 set module_custom_id
- 1.3.2.13 get locate_agent
- 1.3.2.14 get policies
- 1.3.2.15 get tree_agents
- 1.3.2.16 get module_data
- 1.3.2.17 get graph_module_data
- 1.3.2.18 get events
- 1.3.2.19 get all_alert_templates
- 1.3.2.20 get module_groups
- 1.3.2.21 get plugins
- 1.3.2.22 get tags
- 1.3.2.23 get module_from_conf
- 1.3.2.24 get total_modules
- 1.3.2.25 get total_agents
- 1.3.2.26 get agent_name
- 1.3.2.27 get agent_alias
- 1.3.2.28 get module_name
- 1.3.2.29 get alert_action_by_group
- 1.3.2.30 get alert_actions
- 1.3.2.31 get alert_actions_meta
- 1.3.2.32 get all_alert_commands
- 1.3.2.33 get event_info
- 1.3.2.34 get tactical_view
- 1.3.2.35 get pandora_servers
- 1.3.2.36 get custom_field_id
- 1.3.2.37 get gis_agent
- 1.3.2.38 get special_days
- 1.3.2.39 get module_properties
- 1.3.2.40 get module_properties_by_name
- 1.3.2.41 get module_properties_by_alias
- 1.3.2.42 get module_graph
- 1.3.2.43 get all_planned_downtimes
- 1.3.2.44 get planned_downtimes_items
- 1.3.2.45 get id_group_agent_by_name
- 1.3.2.46 get id_group_agent_by_alias
- 1.3.2.47 get group_agent_by_name
- 1.3.2.48 get group_agent_by_alias
- 1.3.2.49 get group_id_by_name
- 1.3.2.50 get_timezone
- 1.3.2.51 get cluster_status
- 1.3.2.52 get cluster_id_by_name
- 1.3.2.53 get agents_id_name_by_cluster_id
- 1.3.2.54 get agents_id_name_by_cluster_name
- 1.3.2.55 get modules_id_name_by_cluster_id
- 1.3.2.56 get modules_id_name_by_cluster_name
- 1.3.2.57 get cluster_items
- 1.3.2.58 get policy
- 1.3.2.59 get collections_policy
- 1.3.2.60 get plugins_policy
- 1.3.2.61 get inventory_policy
- 1.3.2.62 get unlinking_policy
- 1.3.2.63 get alerts_policy
- 1.3.2.64 get alerts_actions_policy
- 1.3.2.65 get agents_policy
- 1.3.2.66 get groups_policy
- 1.3.2.67 get queue_policy
- 1.3.2.68 get traps
- 1.3.2.69 get event_responses
- 1.3.2.70 get users
- 1.3.2.71 get list all user
- 1.3.2.72 get info user name
- 1.3.2.73 get user_profiles_info
- 1.3.2.74 get migrate_agent
- 1.3.2.75 get language
- 1.3.2.76 get session_timeout
- 1.3.2.77 get groups
- 1.3.2.78 get filter user group
- 1.3.2.79 get inventory_modules
- 1.3.2.80 get inventory_modules_by_name
- 1.3.2.81 get inventory_modules_by_alias
- 1.3.2.82 get inventory_module_data
- 1.3.2.83 get list_collections
- 1.3.2.84 get list_collection_files
- 1.3.2.85 get event_mcid
- 1.3.3 SET
- 1.3.3.1 set new_agent
- 1.3.3.2 set update_agent
- 1.3.3.3 Set delete_agent
- 1.3.3.4 set create_module_template
- 1.3.3.5 set apply_module_template
- 1.3.3.6 set create_network_module
- 1.3.3.7 set create_plugin_module
- 1.3.3.8 set create_data_module
- 1.3.3.9 set create_SNMP_module
- 1.3.3.10 set update_network_module
- 1.3.3.11 set update_plugin_module
- 1.3.3.12 set update_data_module
- 1.3.3.13 set update_data_module_policy
- 1.3.3.14 set update_SNMP_module
- 1.3.3.15 set apply_policy
- 1.3.3.16 set apply_all_policies
- 1.3.3.17 set add_network_module_policy
- 1.3.3.18 set add_plugin_module_policy
- 1.3.3.19 set add_data_module_policy
- 1.3.3.20 set add_SNMP_module_policy
- 1.3.3.21 set add_agent_policy_by_id
- 1.3.3.22 set add_agent_policy_by_name
- 1.3.3.23 set remove_agent_from_policy_by_id
- 1.3.3.24 set remove_agent_from_policy_by_name
- 1.3.3.25 set new_network_component
- 1.3.3.26 set new_plugin_component
- 1.3.3.27 set new_snmp_component
- 1.3.3.28 set new_local_component
- 1.3.3.29 set create_alert_template
- 1.3.3.30 set update_alert_template
- 1.3.3.31 set delete_alert_template
- 1.3.3.32 set delete_module_template
- 1.3.3.33 set delete_module_template_by_names
- 1.3.3.34 set stop_downtime
- 1.3.3.35 set new_user
- 1.3.3.36 Set update_user
- 1.3.3.37 Set delete_user
- 1.3.3.38 Set delete_user_permissions
- 1.3.3.39 Set add_permission_user_group
- 1.3.3.40 set enable_disable_user
- 1.3.3.41 set meta_synch_user
- 1.3.3.42 set create_group
- 1.3.3.43 set update_group
- 1.3.3.44 set delete_group
- 1.3.3.45 Set add_user_profile
- 1.3.3.46 set delete_user_profile
- 1.3.3.47 set new_incident
- 1.3.3.48 Set new_note_incident
- 1.3.3.49 set validate_all_alerts
- 1.3.3.50 set validate_all_policy_alerts
- 1.3.3.51 set event_validate_filter
- 1.3.3.52 set event_validate_filter_pro
- 1.3.3.53 set validate_event_by_id
- 1.3.3.54 set new_alert_template
- 1.3.3.55 set alert_actions
- 1.3.3.56 set alert_commands
- 1.3.3.57 set new_module
- 1.3.3.58 set delete_module
- 1.3.3.59 set enable_alert
- 1.3.3.60 set enable_alert_alias
- 1.3.3.61 set disable_alert
- 1.3.3.62 set disable_alert_alias
- 1.3.3.63 set enable_module_alerts
- 1.3.3.64 set disable_module_alerts
- 1.3.3.65 set enable_module
- 1.3.3.66 set disable_module
- 1.3.3.67 set create_network_module_from_component
- 1.3.3.68 set module_data
- 1.3.3.69 set new_module_group
- 1.3.3.70 set module_group_synch
- 1.3.3.71 set add_module_in_conf
- 1.3.3.72 set delete_module_in_conf
- 1.3.3.73 set update_module_in_conf
- 1.3.3.74 set create_event
- 1.3.3.75 set add_event_comment
- 1.3.3.76 set update_event
- 1.3.3.77 set create_netflow_filter
- 1.3.3.78 set create_custom_field
- 1.3.3.79 set create_tag
- 1.3.3.80 set enable_disable_agent
- 1.3.3.81 set gis_agent_only_position
- 1.3.3.82 set gis_agent
- 1.3.3.83 set reset_agent_counts
- 1.3.3.84 set create_special_day
- 1.3.3.85 set update_special_day
- 1.3.3.86 set delete_special_day
- 1.3.3.87 set pagerduty_webhook
- 1.3.3.88 set tag_user_profile
- 1.3.3.89 set tag
- 1.3.3.90 set add_tag_module
- 1.3.3.91 set remove_tag_module
- 1.3.3.92 set planned_downtimes_created
- 1.3.3.93 set planned_downtimes_additem
- 1.3.3.94 set planned_downtimes_deleted
- 1.3.3.95 set create_synthetic_module
- 1.3.3.96 set create_service
- 1.3.3.97 set update_service
- 1.3.3.98 set add_element_service
- 1.3.3.99 set metaconsole_synch
- 1.3.3.100 set migrate_agent
- 1.3.3.101 set new_cluster
- 1.3.3.102 set add_cluster_agent
- 1.3.3.103 set add_cluster_item (activo/activo)
- 1.3.3.104 set add_cluster_item (active/passive)
- 1.3.3.105 set delete_cluster
- 1.3.3.106 set delete_cluster_agents
- 1.3.3.107 set delete_cluster_item
- 1.3.3.108 set create_policy
- 1.3.3.109 set update_policy
- 1.3.3.110 set delete_policy
- 1.3.3.111 set add_collections_policy
- 1.3.3.112 set remove_collections_policy
- 1.3.3.113 set create_plugins_policy
- 1.3.3.114 set delete_plugins_policy
- 1.3.3.115 set linking_policy
- 1.3.3.116 set create_alerts_policy
- 1.3.3.117 set update_alerts_policy
- 1.3.3.118 set delete_alerts_policy
- 1.3.3.119 set create_alerts_actions_policy
- 1.3.3.120 set delete_alerts_actions_policy
- 1.3.3.121 set remove_agents_policy
- 1.3.3.122 set add_groups_policy
- 1.3.3.123 set remove_groups_policy
- 1.3.3.124 set create_os
- 1.3.3.125 set update_os
- 1.3.3.126 set disabled_and_standby
- 1.3.3.127 set validate_traps
- 1.3.3.128 set delete_traps
- 1.3.3.129 set access_process
- 1.3.3.130 set create_event_response
- 1.3.3.131 set update_event_response
- 1.3.3.132 set delete_event_response
- 1.3.3.133 set create_user_profile_info
- 1.3.3.134 set update_user_profile_info
- 1.3.3.135 set delete_user_profile_info
- 1.3.3.136 set create_event_filter
- 1.3.3.137 set update_event_filter
- 1.3.3.138 set delete_event_filter
- 1.3.3.139 get all_event_filters
- 1.3.3.140 set create_inventory_module
- 1.3.3.141 set update_inventory_module
- 1.3.3.142 set delete_inventory_module
- 1.3.3.143 set create_collection
- 1.3.3.144 set delete_collection
- 1.3.3.145 set enable_disable_discovery_task
- 1.4 Examples
- 1.5 Future of API.php
1 Pandora FMS External API
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 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:
http://<Pandora Console install>/include/api.php<parameters>
The API can only receive the following parameters:
- op (required): It is the first parameter that specifies the nature of the operation, which could be "get" or "set" or "help":
- get: It returns a value or values.
- set: It sends a value or values.
- help: It returns a little help from the calls
- op2 (required): The call with an explanatory name of the one that it works on.
- id (optional): The first call parameter.
- id2 (optional): The second call parameter.
- other (optional): The third call parameter, sometimes it could be a list of serial values.
- other_mode (optional): Serial format. list of posible values:
- url_encode: the othervalue is an alphanumeric formtted as UrlEncode.
- 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_|
- returnType (optional): return format of the value or values. The current available values are:
- string: It returns the value as it is as an alphanumeric one.
- csv: It returns the values as a CSV separated with the ";" character (fields) and with CR (files) by default
- csv_head: It returns the same as with "csv", except that it adds a first file with the field names to return.
1.1 Security
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 enter the character * in the box text, the ACL check will be omitted relegating the security to the protocol and to the environment.
You can also set a password for API actions.
In order to setup the password, follow these steps:
- apipass: Api password configured in the console. Do it in the following configuration view (Administration>Setup>):
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 Pandora FMS user
- pass: The user password
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.
1.1.1 Return
When the API denies the access, the simple string "auth error" is returned.
1.1.2 Examples
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
Access conditions:
- The source IP is in the ACLs IP list
- The API password is not set or is 1234
- The user admin exists and its password is pandora
1.1.3 Security Workflow
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 to the API.
- Global API password, if defined, needed to use the API.
- User & password valid in the console. Permissions will be used each time there is a requested operation.
It is explained in this workflow:
1.2 New calls extension in 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 <installation Pandora FMS Console>/include/functions_api.php .
- The function must have this structure: The prefix "api", the kind of operation "get", "set" or "help" (depending on whether it is a data read, data write or retrieve help operation) and the name of the call, trying to be coherent with the operation, as for example: function api_get_[call_name](parameters) .
- The function can have no parameters, but if it has them, the parameters received will be the following in the same order:
- id: first operator or parameter, it contains a string.
- id2: second operator or parameter, it contains a string.
- other: rest of operators or parameters, it contains as an array of two positions:
- $other['type']: That might be be a string or an array.
- $other['data']: That will be a string with the parameter or an array of numeric index with the past parameters.
- returnType: string that specifies the kind of return that the call will have. It is usually visible for you, but you may use or modify it if necessary.
1.2.1 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, 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".
1.2.1.1 Function example
In this function, made up functions have been used.
function apiextension_get_groupmodules($group_name) {
$group_id = group_id_from_name($group_name);
if($group_id == false) {
echo 'Group doesnt exist';
return;
}
$number_of_modules = group_modules($group_id);
echo $number_of_modules;
}
1.2.1.2 Call example
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
1.2.2 API Functions
The following functions could be used in your call function code:
- returnError(typeError, returnType): It gives back an error in an standardized way for all calls.
- typeError: By now 'id_not_found' or null.
- returnType: By now 'string' or error message.
- returnData(returnType, data, separator): It is the function that returns the API call data.
- returnType: That could be 'string', 'csv', 'csv_head'
- data: It is an array that contains the data, as well as its format. It has the following fields:
- 'type' (required): It could be 'string' and 'array'.
- 'list_index' (optional): It contains a numeric index array containing the alphanumeric index to be taken out through exit.
- 'data' (required): It contains a string with the data or an array of alphanumeric index or numeric index with data.
1.2.3 Example
function api_get_module_last_value($idAgentModule, $trash1, $other = ';', $returnType)
{
$sql = sprintf('SELECT datos FROM tagente_estado WHERE id_agente_modulo = %d', $idAgentModule);
$value = get_db_value_sql($sql);
if ($value === false) {
switch ($other['type']) {
case 'string':
switch ($other['data']) {
case 'error_message':
default:
returnError('id_not_found', $returnType);
break;
}
break;
case 'array':
switch ($other['data'][0]) {
case 'error_value':
returnData($returnType, array('type' => 'string', 'data' => $other['data'][1]));
break;
}
break;
}
}
else {
$data = array('type' => 'string', 'data' => $value);
returnData($returnType, $data);
}
}
1.3 API Calls
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.
1.3.1 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 authentication.
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
A return sample could be: Pandora FMS v5.0 - PC131015
1.3.2 GET
It returns the required data.
1.3.2.1 get test
It checks the connection to the API and returns the version of Pandora FMS Console.
This feature is in Metaconsole.
Call syntax: Without parameters
1.3.2.1.1 Examples
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
A return sample could be: OK,v7.0NG.751,PC201215
1.3.2.2 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)
1.3.2.2.1 Examples
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=license&return_type=json&apipass=1234&user=admin&pass=pandora
For Community version, it returns:
{ "type":"array", "data":{ "license_mode":"PANDORA-FREE", } }
1.3.2.3 get all_agents
It returns a list of agent filters according to the filter in some other parameter.
Call syntax:
- op=get (required)
- op2=all_agents (required)
- return_type= csv or json (required)
- other=<serialized parameters> (optional). Serialized parameters to filter the agent search:
- <filter_so>
- <filter_group>
- <filter_module_states>
- <filter_alias>
- <filter_policy>
- <csv_separator>
- Recursion (1 or 0)
1.3.2.3.1 Examples
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 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
1.3.2.4 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)
1.3.2.4.1 Examples
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=license_remaining&return_type=json&apipass=1234&user=admin&pass=pandora
1.3.2.5 get module_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:
- op=get (required)
- op2=module_last_value (required)
- id=<índex> (required). It should be an agent module index.
- other=<error return> (optional). What you wish to receive if there is an error(usually not located in the database).
- Error return codes are:
- 'error_message'. It returns an error in a text message.
- '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.
1.3.2.5.1 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 http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62&apipass=1234&user=admin&pass=pandora
1.3.2.6 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.
Call Syntax:
- op=get (required)
- op2=agent_module_name_last_value (required)
- id=<alphanumeric>(required). It contains the agent name.
- id2=<alphanumeric> (required). It contains the module name.
- 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:
- 'error_message'. It returns error in a text message.
- '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.
1.3.2.6.1 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
1.3.2.7 get agent_module_name_last_value_alias
=> 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:
- op=get (required)
- op2=module_last_value_alias (required)
- id=<alphanumeric>(required). It contains the agent alias.
- id2=<alphanumeric> (required). It contains the module name.
- 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:
- 'error_message'. It returns error in a text message.
- '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.
1.3.2.7.1 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
1.3.2.8 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:
- op=get (required)
- op2=module_value_all_agents (required)
- id=<name of the module> (required). This is the module name.
1.3.2.8.1 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
1.3.2.9 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:
- op=get (required)
- op2=agent_modules (required)
- return_type=<csv> (required) Output format.
- other=<serialized values> (required) Serialized values in order to filter by agent:
- <id_agent>
The 'other_mode' parameter must be completed like this other_mode=url_encode_separator_<separador> in order to configure the separator in other field.
1.3.2.9.1 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
1.3.2.10 get module_id
It returns the id of an agent module.
Call syntax:
- op=get (required)
- op2=module_id (required)
- id=id agent (required)
- other=module name (required)
1.3.2.10.1 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
1.3.2.11 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)
1.3.2.11.1 Examples
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_custom_id&id=5&apipass=1234&user=admin&pass=pandora
1.3.2.12 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)
1.3.2.12.1 Examples
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
1.3.2.13 get locate_agent
It gets the id server where the agent is located, and prints all the results like a csv.
Call syntax:
- op=get (required)
- op2=locate_agent (required)
- return_type=<csv> (required). Output format.
- id=id_agent (required)
- other_mode= other_mode=url_encode_separator_<separator> (required)
1.3.2.13.1 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
1.3.2.14 get policies
It returns the list of agent policies, whose id which has gone through the other parameter.
Call syntax:
- op=get (required)
- op2=policies (required)
- return_type=<csv> (required)
- other=<serialized values> (optional). Serialized values for filtering policies by policy agent:
- <id_agent>
1.3.2.14.1 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
1.3.2.15 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:
- op=get (required)
- op2=tree_agents (required)
- return_type=<return kind> (required). That could be 'csv' or 'csv_head'.
- 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 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>. Field divider in the CSV.
- <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:
- type_row
- group_id
- group_name
- group_parent
- disabled
- custom_id
- group_description
- group_contact
- group_other
- agent_id
- alias
- agent_direction
- agent_commentary
- agent_id_group
- agent_last_contact
- agent_mode
- agent_interval
- agent_id_os
- agent_os_version
- agent_version
- agent_last_remote_contact
- agent_disabled
- agent_id_parent
- agent_custom_id
- agent_server_name
- agent_cascade_protection
- agent_name
- module_id_agent_modulo
- module_id_agent
- module_id_module_type
- module_description
- module_name
- module_max
- module_min
- module_interval
- module_tcp_port
- module_tcp_send
- module_tcp_rcv
- module_snmp_community
- module_snmp_oid
- module_ip_target
- module_id_module_group
- module_flag
- module_id_module
- module_disabled
- module_id_export
- module_plugin_user
- module_plugin_pass
- module_plugin_parameter
- module_id_plugin
- module_post_process
- module_prediction_module
- module_max_timeout
- module_custom_id
- module_history_data
- module_min_warning
- module_max_warning
- module_min_critical
- module_max_critical
- module_min_ff_event
- module_delete_pending
- module_id_agent_state
- module_data
- module_timestamp
- module_state
- module_last_try
- module_utimestamp
- module_current_interval
- module_running_by
- module_last_execution_try
- module_status_changes
- module_last_status
- module_plugin_macros
- module_macros
- module_critical_inverse (only in version 6.0SP1 or later)
- module_warning_inverse (only in version 6.0SP1 or later)
- alert_id_agent_module
- alert_id_alert_template
- alert_internal_counter
- alert_last_fired
- alert_last_reference
- alert_times_fired
- alert_disabled
- alert_force_execution
- alert_id_alert_action
- alert_type
- alert_value
- alert_matches_value
- alert_max_value
- alert_min_value
- alert_time_threshold
- alert_max_alerts
- alert_min_alerts
- alert_time_from
- alert_time_to
- alert_monday
- alert_tuesday
- alert_wednesday
- alert_thursday
- alert_friday
- alert_saturday
- alert_sunday
- alert_recovery_notify
- alert_field2_recovery
- alert_field3_recovery
- alert_id_alert_template_module
- alert_fires_min
- alert_fires_max
- alert_id_alert_command
- alert_command
- alert_internal
- alert_template_modules_id
- alert_templates_id
- alert_template_module_actions_id
- alert_actions_id
- alert_commands_id
- alert_templates_name
- alert_actions_name
- alert_commands_name
- alert_templates_description
- alert_commands_description
- alert_template_modules_priority
- alert_templates_priority
- alert_templates_field1
- alert_actions_field1
- alert_templates_field2
- alert_actions_field2
- alert_templates_field3
- alert_actions_field3
- alert_templates_id_group
- alert_actions_id_group'
1.3.2.15.1 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 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
1.3.2.16 get module_data
Returns a list of values of a module, this module is filtered by the id of module pass as id in the url. And the list of values is from the now to the period limit passed as second parameter into the other parameter, the first is the CSV separator.
Call syntax:
- op=set (required)
- op2=module_data (required)
- id=<id_modulo> (required)
- other_mode=url_encode_separator_<separator> (required)
- other=<serialized parameters> (optional)
- The CSV divider character (point by default)
- The period (in seconds)
- Start time (<year><month><day>T<hour>:<minute>)
- End time (<year><month><day>T<hour>:<minute>)
1.3.2.16.1 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
1.3.2.17 get graph_module_data
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.
Call syntax:
- op=set (required)
- op2=module_data (required)
- id=<id_modulo> (required)
- other=<serialized parameters> (required). They are the following in this order:
- <period>
- <width>
- <height>
- <label>
- <start_date>
1.3.2.17.1 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
1.3.2.18 get events
It returns a list of events filtered by the other parameter.
Call syntax:
- op=get (required)
- op2=events (required)
- return_type=csv (required)
- other_mode=url_encode_separator_| (optional)
- other=<serialized parameters> (optional). They are the following in this order:
- <separator>
- <criticity> Values from 0 to 4, or -1 to avoid this param
- <agent alias>
- <module name>
- <alert template name>
- <user>
- <numeric interval minimum level > in unix timestamp
- <numeric interval maximum level > in unix timestamp
- <status>
- <event substring>
- <register limit>
- <offset register>
- <optional style [total|more_criticity]> (total - it returns the number of the records, more_criticity - it returns the highest criticity value)
- <id_grupo>
- <tags>
- <event type> unknown, alert_fired, alert_recovered,.. or its substring. You may also use 'not_normal'.
1.3.2.18.1 Examples
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora
1.3.2.19 get all_alert_templates
It returns the list of alert templates defined in Pandora FMS.
Call syntax:
- op=get (required)
- op2=all_alert_templates (required)
- other=cvs_separator (optional)
1.3.2.19.1 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
1.3.2.20 get module_groups
It returns the list of module groups.
Call syntax:
- op=get (required)
- op2=module_groups (required)
- other=cvs_separator (optional)
1.3.2.20.1 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
1.3.2.21 get plugins
It returns the list of Pandora FMS server plugins.
Call syntax:
- op=get (required)
- op2=plugins (required)
- other=cvs_separator (optional)
1.3.2.21.1 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
1.3.2.22 get tags
It returns the list of tags defined in Pandora FMS.
Call syntax:
- op=get (required)
- op2=tags (required)
- return_type=csv (required)
1.3.2.22.1 Examples
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
1.3.2.23 get module_from_conf
>= 5.0 (Only Enterprise)
It returns the configuration of a local module.
Call syntax:
- op=get (required)
- op2=update_module_in_conf (required)
- id=<agent id> (required)
- id2=<module name> (required)
1.3.2.23.1 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
It returns an empty string if no modules are found.
1.3.2.24 get total_modules
Total modules by group.
Call syntax:
- op=get (required)
- op2=total_modules (required)
- id=<id group> (required)
1.3.2.24.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora
If the group id is 0, it returns the total amount of modules.
1.3.2.25 get total_agents
Total agents by group.
Call syntax:
- op=get (required)
- op2=total_agents (required)
- id=<id group> (required)
1.3.2.25.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora
1.3.2.26 get agent_name
Agent name for a given id
Call syntax:
- op=get (required)
- op2=agent_name (required)
- id=<agent id> (required)
1.3.2.26.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.27 get agent_alias
>= 7.0NG
Agent alias for a given id.
Call syntax:
- op=get (required)
- op2=agent_alias (required)
- id=<agent id> (required)
- id2=<node id> (required in the meta console, unnecessary in the node)
1.3.2.27.1 Examples
- Node:
http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora
- 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
1.3.2.28 get module_name
Module name for a given id.
Call syntax:
- op=get (required)
- op2=module_name (required)
- id=<module id> (required)
1.3.2.28.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora
1.3.2.29 get alert_action_by_group
Total alert execution with an action by group.
Call syntax:
- op=get (required)
- op2=alert_action_by_group (required)
- id=<group id> (required)
- id2=<action id> (required)
1.3.2.29.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=alert_action_by_group&id=0&id2=3&apipass=1234&user=admin&pass=pandora
1.3.2.30 get alert_actions
List of alert actions
Call syntax:
- op=get (required)
- op2=alert_actions (required)
- return_type=<return type> (required). It can be 'csv' or 'json'.
- other=<serialized parameters> (optional):
- <action_name> (optional)
- <separator> (optional)
1.3.2.30.1 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
1.3.2.31 get alert_actions_meta
This feature is in Metaconsole.
List of node alert actions from Metaconsole.
Call syntax:
- op=get (required)
- op2=alert_actions_meta (required)
- return_type=<return type> (required). It can be 'csv' o 'json'.
- other=<serialized parameters> (optional):
- <server_name> (optional)
- <action_name> (optional)
- <separator> (optional)
1.3.2.31.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions_meta&apipass=1234&user=admin&pass=pandora&other=nodo|Create|&other_mode=url_encode_separator_|&return_type=json
1.3.2.32 get all_alert_commands
It returns all the alert commands.
Call syntax:
- op=get (required)
- op2=all_alert_commands (required)
- other=cvs_separator(optional)
1.3.2.32.1 Examples
http://localhost/pandora_console/include/api.php?op=get&op2=all_alert_commands&return_type=csv&other=$&apipass=1234&user=admin&pass=pandora
1.3.2.33 get event_info
It returns all event data by typing in the event id.
This feature is in Metaconsole.
Call syntax:
- op=get (required)
- op2=event_info (required)
- id=<id_event> (required)
1.3.2.33.1 Examples
http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora
1.3.2.34 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_not_init
- monitor_unknown
- monitor_ok
- monitor_bad
- monitor_warning
- monitor_critical
- monitor_not_normal
- monitor_alerts
- monitor_alerts_fired
- monitor_alerts_fire_count
- total_agents
- total_alerts
- total_checks
- alerts
- agents_unknown
- monitor_health
- alert_level
- module_sanity
- server_sanity
- total_not_init
- monitor_non_init
- agent_ok
- agent_warning
- agent_critical
- agent_unknown
- agent_not_init
- global_health
Call syntax:
- op=get (required)
- op2=tactical_view (required)
1.3.2.34.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora
1.3.2.35 get pandora_servers
>= 5.0
It returns the list of Pandora FMS servers.
Call syntax:
- op=get (required)
- op2=pandora_servers (required)
- other=cvs_separator (optional)
- return_type=csv (required)
1.3.2.35.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora
It returns the fields in this order:
- name
- status (1 - up, 0 - down)
- type (human readable string)
- master (1 - master, 0 - not master)
- running modules
- total modules
- max delay (sec)
- delayed modules
- threads
- queued_modules
- timestamp of update (human readable string)
1.3.2.36 get custom_field_id
>= 5.0
It translates the name of custom field into the id in the data base.
Call syntax:
- op=get (required)
- op2=custom_field_id (required)
- other=<serialized parameters> (required). In this case, custom field name.
- <name> (required)
1.3.2.36.1 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
1.3.2.37 get gis_agent
>= 5.0
It returns the last GIS agent data.
Call syntax:
- op=set (required)
- op2=gis_agent (required)
- id=<index> (required). It must be an agent index.
1.3.2.37.1 Example
http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1
1.3.2.38 get special_days
>= 5.1
It returns special day's list.
Call syntax:
- op=get (required)
- op2=special_days (required)
- other=<csv separator> (optional). CSV separator
1.3.2.38.1 Example
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days
1.3.2.39 get module_properties
>= 5.1SP2
It returns a list of module properties. The list could be filtered by parameter.
Call Syntax:
- op=get (required)
- op2=module_properties (required)
- id=module-id (required)
- return_type=<return kind> (required). That could be 'csv' or 'csv_head'.
- 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 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>. Field divider in the CSV.
- <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>. The fields to output in CSV are:
- module_id_agent_module
- module_id_agent
- module_id_module_type
- module_description
- module_name
- module_max
- module_min
- module_interval
- module_tcp_port
- module_tcp_send
- module_tcp_rcv
- module_snmp_community
- module_snmp_oid
- module_ip_target
- module_id_module_group
- module_flag
- module_id_module
- module_disabled
- module_id_export
- module_plugin_user
- module_plugin_pass
- module_plugin_parameter
- module_id_plugin
- module_post_process
- module_prediction_module
- module_max_timeout
- module_custom_id
- module_history_data
- module_min_warning
- module_max_warning
- module_min_critical
- module_max_critical
- module_min_ff_event
- module_delete_pending
- module_id_agent_state
- module_data
- module_timestamp
- module_state
- module_last_try
- module_utimestamp
- module_current_interval
- module_running_by
- module_last_execution_try
- module_status_changes
- module_last_status
- module_plugin_macros
- module_macros
- module_critical_inverse (only in version 6.0SP1 or later)
- module_warning_inverse (only in version 6.0SP1 or later)
1.3.2.39.1 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 http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=1103&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.40 get module_properties_by_name
>= 5.1SP2
It returns a list of module properties. The list could be filtered by parameter.
Call Syntax:
- op=get (required)
- op2=module_properties_by_name (required)
- id=agent_name (required)
- id2=agentmodule_name (required)
- return_type=<return kind> (required). That could be 'csv' or 'csv_head'.
- 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')
1.3.2.40.1 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 http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
1.3.2.41 get module_properties_by_alias
>= 7.0NG
It returns a list of module properties. The list could be filtered by parameter.
Call Syntax:
- op=get (required)
- op2=module_properties_by_alias (required)
- id=agent_alias (required)
- id2=agentmodule_name (required)
- return_type=<return kind> (required). That could be 'csv' or 'csv_head'.
- 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').
1.3.2.41.1 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
1.3.2.42 get module_graph
It returns a Module graph encoded with base64..
Call Syntax:
- op=get (required)
- op2=module_graph (required)
- id=<module id> (required)
- 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 |
or its [Escape character https://en.wikipedia.org/wiki/Escape_character] %7C
.
- 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).
1.3.2.42.1 Examples
Prior to version NG 752:
http://localhost/pandora_console/include/api.php?op=get&op2=module_graph&id=5&other=3600%7C1&other_mode=url_encode_separator_%7C&apipass=1234&api=1&user=admin&pass=pandora
Version NG 752 or higher:
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
1.3.2.43 get all_planned_downtimes
>= 5.1
It returns all matches of planned downtime.
op=get op2=all_planned_downtimes return_type=csv other=<name> <group> <type_downtime> <type_execution> <type_periodicity> (for filtering)
1.3.2.43.1 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 http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.44 get planned_downtimes_items
>= 5.1
It returns all matches of planned downtime items.
op=get op2=planned_downtimes_items return_type=csv other=<name> <group> <type_downtime> <type_execution> <type_periodicity> (for filter)
1.3.2.44.1 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 http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
1.3.2.45 get id_group_agent_by_name
>= 5.1
It returns the group id of an agent.
Call Syntax:
- op=get
- op2=id_group_agent_by_name
- other=<string or serialized parameters>. Agent name and filtering parameters (optional).
- <agent_name>
1.3.2.45.1 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
1.3.2.46 get id_group_agent_by_alias
>= 7.0NG
It returns the group id of an agent.
Call Syntax:
- op=get
- op2=id_group_agent_by_alias
- other=<string or serialized parameters>. Agent alias and filtering parameters (optional)
- <agent_alias>
1.3.2.46.1 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
1.3.2.47 get group_agent_by_name
>= 5.1
It returns the group name for a agent.
Call Syntax:
- op=get
- op2=group_agent_by_name
- other=<string or serialized parameters> Agent name and filtering parameters (optional).
- <agent_name>
1.3.2.47.1 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
1.3.2.48 get group_agent_by_alias
>= 7.0NG
It returns the group name for an agent.
Call Syntax:
- op=get
- op2=group_agent_by_alias
- other=<string or serialized parameters>. Agent alias and filtering parameters (optional).
- <agent_alias>
1.3.2.48.1 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
1.3.2.49 get group_id_by_name
>= 7.0NG
It returns the group id from the name.
Call syntax:
- op=get
- op2=group_id_by_name
- other=<unique parameter> (required):
- <group_name>
1.3.2.49.1 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
1.3.2.50 get_timezone
>= 7.0NG
It returns the timezone with which pandora is configured.
Call syntax:
- op=get
- op2=timezone
1.3.2.50.1 Example
http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone
1.3.2.51 get cluster_status
>= 7.0
It returns the cluster status by id
- op=get
- op2=cluster_status
- 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
1.3.2.52 get cluster_id_by_name
>= 7.0
It returns the id of the cluster by name
- op=get
- op2=cluster_id_by_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
1.3.2.53 get agents_id_name_by_cluster_id
>= 7.0
It returns the id => cluster agents names by cluster id
- op=get
- op2=agents_id_name_by_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
1.3.2.54 get agents_id_name_by_cluster_name
>= 7.0 It returns the id => cluster agents names by cluster name
- op=get
- op2=agents_id_name_by_cluster_name
- 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
1.3.2.55 get modules_id_name_by_cluster_id
>= 7.0
It returns the id => all the module names of the cluster agents by cluster id
- op=get
- op2=modules_id_name_by_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
1.3.2.56 get modules_id_name_by_cluster_name
>= 7.0
It returns the id => all the module names of the cluster agents by cluster name
- op=get
- op2=modules_id_name_by_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
1.3.2.57 get cluster_items
>= 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
pwarn: % for the warning state if its AA or null if its AP
- op=get
- op2=cluster_items
- 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
1.3.2.58 get policy
>= 7.0NG. 725
It returns all data from a policy. If no policy id is specified, it will return all data from all policies.
Call syntax:
- op=get
- op2=policy
- id=id_policy (optional)
- return_type=(json, csv, string)
1.3.2.58.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.59 get collections_policy
>= 7.0NG. 725
It returns all policy colections. If no policy id is specified, it returns all policy colections.
Call syntax:
- op=get
- op2=collections_policy
- id=id_policy (optional)
- return_type=(json, csv, string)
1.3.2.59.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.60 get plugins_policy
>= 7.0NG. 725
It returns all policy plugins. If no policy id is specified, it returns all policy plugins.
Call syntax:
- op=get
- op2=plugins_policy
- id=id_policy (optional)
- return_type=(json, csv, string).
1.3.2.60.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.61 get inventory_policy
>= 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.
Call syntax:
- op=get
- op2=inventory_policy
- id=id_policy (optional)
- return_type=(json, csv, string)
1.3.2.61.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2
1.3.2.62 get unlinking_policy
>= 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.
Call syntax:
- op=get
- op2=unlinking_policy
- id=id_policy(optional)
- return_type=(json, csv, string)
1.3.2.62.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.63 get alerts_policy
>= 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 the type of alert is specified: (three options).
- 0: it shows all by default.
- 1: Shows only the normal alerts.
- 2: Shows only the external alerts.
Call syntax:
- op=get
- op2=alerts_policy
- id=id_policy(optional)
- id2= 0:all(by default), 1:normal, 2:external.
- return_type=(json, csv, string)
1.3.2.63.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2.
1.3.2.64 get alerts_actions_policy
>= 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 an alert id is specified, it returns the action of that alert.
Call syntax:
- op = get
- op2 = alerts_actions_policy
- id = id_policy(optional)
- id2 = id_policy_alert(optional)
- return_type=(json, csv, string)
1.3.2.64.1 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
1.3.2.65 get agents_policy
>= 7.0NG. 725
It returns all policy agents. If no policy id is specified, it returns all agents of all policies.
Call syntax:
- op = get
- op2 = agents_policy
- id = id_policy(optional)
- return_type = (json, csv, string)
1.3.2.65.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json.
1.3.2.66 get groups_policy
>= 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:
- op = get
- op2 = groups_policy
- id = id_policy(optional)
- return_type = (json, csv, string)
1.3.2.66.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2
1.3.2.67 get queue_policy
>= 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:
- op = get
- op2 = queue_policy
- id = id_policy(optional)
- return_type = (json, csv, string)
1.3.2.67.1 Example
http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json
1.3.2.68 get traps
>= 7.0NG. 728
It returns the specified source traps, they can also be filtered by timestamp and other data.
Call syntax:
- op = get
- op2 = traps
- other=<optional parameters>:
- <timestamp>
- <limit>
- <offset>
- <status>
- <oid_custom>
1.3.2.68.1 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
1.3.2.69 get event_responses
It returns the response list of events the user has access to in Pandora FMS.
Call syntax:
- op=get (required)
- op2=event_reponses (required)
- return_type=csv|json (required)
1.3.2.69.1 Example
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
1.3.2.70 get users
It returns the list of Pandora FMS users.
Call syntax:
- op=get (required)
- op2=users (required)
- return_type=csv|json (required)
1.3.2.70.1 Example
This example will return all users in csv format.
http://localhost/pandora_console/include/api.php?op=get&op2=users&return_type=csv&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_&
1.3.2.71 get list all user
This