Difference between revisions of "Pandora: Documentation en: Annex ExternalAPI"

From Pandora FMS Wiki
Jump to: navigation, search
(get agent_alias)
 
(609 intermediate revisions by 11 users not shown)
Line 3: Line 3:
 
= Pandora FMS External API =
 
= Pandora FMS External API =
  
The Pandora FMS External API is used doing remote calls (through HTTP) on the file '''/include/api.php'''.
+
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 parts with Pandora FMS. It basically consist on a call with the parameters formated to receive a value or a list of values that after its application it will use to do operations.
+
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 10:
 
  <nowiki>http://</nowiki>&lt;Pandora Console install&gt;/include/api.php&lt;parameters&gt;
 
  <nowiki>http://</nowiki>&lt;Pandora Console install&gt;/include/api.php&lt;parameters&gt;
  
The API only can receive the following parameters:
+
The API can only receive the following parameters:
  
*op (compulsory): is the first parameter that specify the nature of the operation, which could be "get" or "set" or "help":
+
*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: send a value or values.
+
:*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 (compulsory): the call with an explanatory name of the one that works.
+
*op2 (required): The call with an explanatory name of the one that it works on.
*id (optional): first parameter of the call.
+
*id (optional): The first call parameter.
*id2 (optional): second parameter of the call.
+
*id2 (optional): The second call parameter.
*other (optional): third parameter of the call, sometimes it could be a list of serial values..
+
*other (optional): The third call parameter, sometimes it could be a list of serial values.
*other_mode (optional): format of the serial. list of posible values:
+
*other_mode (optional): Serial format. list of posible values:
:*url_encode: el valor de other es un alfanumérico formateado como [http://en.wikipedia.org/wiki/Percent-encoding UrlEncode].
+
:*url_encode: the othervalue is an alphanumeric formtted as [http://en.wikipedia.org/wiki/Percent-encoding UrlEncode].
:*url_encode_separator_<separador>:the value will be a serial value list with the divider character, for example:
+
:*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:return the values as a CSV separated by default with the ";" character (fields) and with CR (files)
+
:*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, the security is based on an IPs list that will have access to the tool. And it will be configured as we could see at the image, in the Pandora Console configuration options.
+
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 introduce the character '''*''' in the box text, the ACL check will be omitted relegating the security to the protocol and to the environment. In the same way, the character '''*''' can be used as wildcard. In example. 183.234.33.*
+
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 39:
 
</center>
 
</center>
  
You can also set a password for the actions of the API.
+
You can also set a password for API actions.
  
In order to setup the password it is necessary to follow these steps:
+
In order to setup the password, follow these steps:
  
*''apipass'': Api password configured in the console. You can do it in the following configuration view (Administration>Setup>):  
+
*''apipass'': Api password configured in the console. Do it in the following configuration view (Administration>Setup>):  
 
 
Nota: Before the 4.0.2 version, this parameter was ''pass''
 
  
 
<center>
 
<center>
Line 51: Line 49:
 
</center>
 
</center>
  
To access to the actions of the API, is necessary give a valid user and pass of Pandora FMS, too.
+
Nota: Before version 4.0.2, this parameter was ''pass''
  
*''user'': Valid user of Pandora FMS  
+
To access API actions, it is necessary to give a Pandora FMS valid user and password.
  
*''pass'': The password of the given user
+
*''user'': Valid Pandora FMS user  
  
'''Note: In the API calls the passwords are uncodified. So please be careful and use SSL connections to avoid sniffers. The API allows POST petitions to codify it when use SSL/HTTPS.'''
+
*''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.'''
  
 
=== Return ===
 
=== Return ===
  
When the API denies the access, a simple string "auth error" is returned.
+
When the API denies the access, the simple string "auth error" is returned.
  
 
=== Examples ===
 
=== Examples ===
  
In this case, is provided the API password ''1234'' and the access credentials are user: ''admin'' and password: ''pandora''.
+
In this case, the API password ''1234'' is used. The user is ''admin'' and the password is ''pandora''.
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
Access conditions:  
 
Access conditions:  
* The origin IP is in the ACLs IP list
+
* The source IP is in the ACLs IP list
* The API password is not setted or is ''1234''
+
* The API password is not set or is ''1234''
* The user ''admin'' exists and their password is ''pandora''
+
* The user ''admin'' exists and its password is ''pandora''
  
 
=== Security Workflow ===
 
=== Security Workflow ===
Line 78: Line 78:
 
'''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 & Password in the console, need to be valid and have permissions to perform the operation requested.
+
* User & password valid in the console. Permissions will be used each time there is a requested operation.
  
This is explained in this workflow:
+
It is explained in this workflow:
  
 
<center>
 
<center>
Line 88: Line 88:
 
</center>
 
</center>
  
== New Calls Extension in the API ==
+
== New calls extension in the API ==
  
To develop new calls for the API you have to consider that:
+
To develop new calls for the API, keep in mind that:
  
* The call has to be inscribed as a function in the file &lt;instalación Pandora Console&gt;/include/functions_api.php .
+
* The call has to be inscribed as a function in the file &lt;installation Pandora FMS Console&gt;/include/functions_api.php .
  
* The function must have the next structure: The prefix "api", the kind of operation "get", "set" or "help" (depend if 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 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 have it, the parameters received will be the following in the same order:
+
*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 an string.
+
*id: first operator or parameter, it contains a string.
*id2: second operator or parameter, contains an string.
+
*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']: that could be string or array.
+
:*$other['type']: That might be be a string or an array.
:*$other['data']: that will be an string with the parameter or an array of numeric index with the past parameters.
+
:*$other['data']: That will be a string with the parameter or an array of numeric index with the past parameters.
*returnType: string that specify the kind of return that the call will have. It is usually transparent for you, but you could use or modify it if necessary.
+
*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 the Pandora FMS extensions ===
+
=== New Calls in the API from Pandora FMS extensions ===
  
Is possible to create new API calls without use /include/functions_api.php. The way is 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".
+
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 we must create a file called module_groups.api.php into this directory.  
+
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.  
  
  
Into this file will be the desired functions, for example a function to get the number of modules in a group. This function must have a name like: "apiextension_get_groupmodules".
+
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 imaginary functions.
+
In this function, made up functions have been used.
  
 
<code><pre>
 
<code><pre>
Line 132: Line 132:
 
==== Call example ====
 
==== Call example ====
  
This call example gets the number of modules of the group "Servers"
+
This call example gets the number of modules of the "Servers" group.
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=extension&ext_name=module_groups&ext_function=groupmodules&id=Servers&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=extension&ext_name=module_groups&ext_function=groupmodules&id=Servers&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
===API Functions===
 
===API Functions===
  
The following functions could be used in the function code of your call:
+
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: by now 'id_not_found' or null.
+
:*typeError: By now 'id_not_found' or null.
:*returnType: by now 'string' or error message.  
+
:*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: that could be 'string', 'csv', 'csv_head'
+
:*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' (compulsory): that could be 'string' and 'array'.
+
::*'type' (required): It could be 'string' and 'array'.
::*'list_index' (optional): contains a numeric index array containing the alphanumeric index that are wanted to take out through exit.
+
::*'list_index' (optional): It contains a numeric index array containing the alphanumeric index to be taken out through exit.
::*'data' (compulsory): contains and string with the data or an array of alphanumeric index or numeric index with the data.
+
::*'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 185:
 
==API Calls==
 
==API Calls==
  
They are divided in two groups, depending on if they get back or write data in Pandora FMS.
+
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 191:
 
===INFO RETRIEVING===
 
===INFO RETRIEVING===
  
Returns the version of Pandora Console in a similar way of the call ''get test'' but without check the API connection.
+
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 the authentication.
+
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 doesn't be considered a security vulnerability.  
+
The returned info can be retrieved from the login screen, so it is not considered a security vulnerability.  
  
  http://127.0.0.1/pandora_console/include/api.php?info=version
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?info=version</nowiki>
  
 
A return sample could be: ''Pandora FMS v5.0 - PC131015''
 
A return sample could be: ''Pandora FMS v5.0 - PC131015''
Line 203: Line 203:
 
===GET===
 
===GET===
  
It gets back the required data.
+
It returns the required data.
  
 
====get test====
 
====get test====
Checks the connection to API and returns the version of Pandora Console.
+
It checks the connection to the API and returns the version of Pandora FMS Console.
 +
 
  
 
{{metaconsole}}
 
{{metaconsole}}
Line 217: Line 218:
 
This example will return OK,[version],[build]
 
This example will return OK,[version],[build]
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=test&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
A return sample could be: ''OK,v4.0.2,PC120614''
 
A return sample could be: ''OK,v4.0.2,PC120614''
  
 
====get all_agents====
 
====get all_agents====
Returns a list of agents filters by the filter in other parameter.
+
It returns a list of agent filters according to the filter in some other parameter.
  
 
Call syntax:
 
Call syntax:
*op=get (compulsory)
+
*op=get (required)
*op2=all_agents (compulsory)
+
*op2=all_agents (required)
*return_type= csv or json (compulsory)
+
*return_type= csv or json (required)
*other=&lt;parámetros serializados&gt; (optional) serialized parameters to filter the agent search:
+
*other=&lt;serialized parameters&gt; (optional). Serialized parameters to filter the agent search:
 
:*&lt;filter_so&gt;
 
:*&lt;filter_so&gt;
 
:*&lt;filter_group&gt;
 
:*&lt;filter_group&gt;
Line 235: Line 236:
 
:*&lt;filter_policy&gt;
 
:*&lt;filter_policy&gt;
 
:*&lt;csv_separator&gt;
 
:*&lt;csv_separator&gt;
 +
:*Recursion (<b>1</b> or <b>0</b>)
  
 
=====Examples=====
 
=====Examples=====
  
This example will return all agents which id_os is equal to 1, id_group equal to 2, state equal to warning, their alias will contain 'j',  and the policy associated equal to 2.
+
This example will return all agents whose id_os is equal to 1, id_group equals 2, state equal to warning, their alias contains 'j',  and the policy associated equals 2.
  
  CSV example: http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=csv&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
+
  CSV example: <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=csv&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  JSON example: http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=json&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
+
  JSON example: <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_agents&return_type=json&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_last_value====
 
====get module_last_value====
Returns the last value of module. This module is filtered by the ID of module pass as parameter id. With the other parameter you can add a error code that your application knows and it is out range of module values.
+
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 (compulsory)
+
*op=get (required)
*op2=module_last_value (compulsory)
+
*op2=module_last_value (required)
*id=&lt;índex&gt; (compulsory) should be an index of an agent module.
+
*id=&lt;índex&gt; (required). It should be an agent module index.
*other=&lt;error return&gt; (optional) that you want to it gives back if there is an error(usually not located in the database.
+
*other=&lt;error return&gt; (optional). What you wish to receive if there is an error(usually not located in the database).
:*Error return code are:
+
:*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'&lt;separator&gt;&lt;code or value&gt gives back this code or error value. But it is necessary to enclose it with 'other_mode',like other_mode=url_encode_separator_&lt;separador&gt to put the divider on other.
+
::*'error_value'&lt;separator&gt;&lt;code or value&gt. It returns this code or error value. But it is necessary to enclose it with 'other_mode', like other_mode=url_encode_separator_&lt;separador&gt to place the divider on another one.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=63&other=error_value|0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=63&other=error_value|0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_last_value&id=62&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get agent_module_name_last_value====
 
====get agent_module_name_last_value====
Returns the last value of module. This module is filtered by the agent name pass as parameter id and module name pass as parameter id2. With the other parameter you can add a error code that your application knows and it is out range of module values.
+
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:
 
Call Syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=agent_module_name_last_value (compulsory)
+
*op2=agent_module_name_last_value (required)
*id=&lt;alphanumeric&gt;(compulsory) contains the agent name.
+
*id=&lt;alphanumeric&gt;(required). It contains the agent name.
*id2=&lt;alphanumeric&gt; (compulsory) contains the module name.
+
*id2=&lt;alphanumeric&gt; (required). It contains the module name.
*other=&lt;error return&gt; (optional) that you want to return if there is an error ( that usually has not been found in the DB).
+
*other=&lt;error return&gt; (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'&lt;separator&gt;&lt;code or value&gt gives back this code or error value,but it is necessary that it comes with 'other_mode' such as other_mode=url_encode_separator_&lt;separator&gt to use the divider in other.
+
::*'error_value'&lt;separator&gt;&lt;code or value&gt. It returns this code or error value, but it must come with 'other_mode' such as other_mode=url_encode_separator_&lt;separator&gt to use the divider on another one.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value&id=miguel-portatil&id2=cpu_user&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get agent_module_name_last_value_alias====
 
====get agent_module_name_last_value_alias====
 
=> 7.0NG
 
=> 7.0NG
  
Returns the last value of module. This module is filtered by the agent alias pass as parameter id and module name pass as parameter id2. With the other parameter you can add a error code that your application knows and it is out range of module values.
+
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:
  
*op=get (compulsory)
+
*op=get (required)
*op2=module_last_value_alias (compulsory)
+
*op2=module_last_value_alias (required)
*id=&lt;alphanumeric&gt;(compulsory) contains the agent alias.
+
*id=&lt;alphanumeric&gt;(required). It contains the agent alias.
*id2=&lt;alphanumeric&gt; (compulsory) contains the module name.
+
*id2=&lt;alphanumeric&gt; (required). It contains the module name.
*other=&lt;error return&gt; (optional) that you want to return if there is an error ( that usually has not been found in the DB).
+
*other=&lt;error return&gt; (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'&lt;separator&gt;&lt;code or value&gt gives back this code or error value,but it is necessary that it comes with 'other_mode' such as other_mode=url_encode_separator_&lt;separator&gt to use the divider in other.
+
::*'error_value'&lt;separator&gt;&lt;code or value&gt. It returns this code or error value, but it must come with 'other_mode' such as other_mode=url_encode_separator_&lt;separator&gt to use the divider on another one.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value_alias&id=pandorafms&id2=Memory_Used&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_module_name_last_value_alias&id=pandorafms&id2=Memory_Used&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_value_all_agents====
 
====get module_value_all_agents====
  
Returns a list of agents and module value, these modules are in all of agents of list and they are filtered by the name of module pass as the parameter id.
+
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:
  
*op=get (compulsory)
+
*op=get (required)
*op2=module_value_all_agents (compulsory)
+
*op2=module_value_all_agents (required)
*id=&lt;name of the module&gt; (compulsory) This is the module name.
+
*id=&lt;name of the module&gt; (required). This is the module name.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_value_all_agents&id=example_module_name&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_value_all_agents&id=example_module_name&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get agent_modules====
 
====get agent_modules====
Returns the list of modules of agent, this agent is filtered by the id agent pass as id parameter.
+
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:
  
*op=get (compulsory)
+
*op=get (required)
*op2=agent_modules (compulsory)
+
*op2=agent_modules (required)
*return_type=&lt;csv&gt; (compulsory) Output format.
+
*return_type=&lt;csv&gt; (required) Output format.
*other=&lt;serialized values&gt; (compulsory) Serialized values in order to filter by agent:
+
*other=&lt;serialized values&gt; (required) Serialized values in order to filter by agent:
 
:*&lt;id_agent&gt;
 
:*&lt;id_agent&gt;
It's necessary to complete 'other_mode' parameter in this way other_mode=url_encode_separator_&lt;separador&gt; in order to configure separator in other field.
+
The 'other_mode' parameter must be completed like this other_mode=url_encode_separator_&lt;separador&gt; in order to configure the separator in other field.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agent_modules&return_type=csv&other=14&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_id====
 
====get module_id====
Returns the id of a module of an agent.
+
It returns the id of an agent module.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=module_id (compulsory)
+
*op2=module_id (required)
*id=id agent (compulsory)
+
*id=id agent (required)
*other=module name (compulsory)
+
*other=module name (required)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_id&id=5&other=Host%20Alive&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_id&id=5&other=Host%20Alive&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get locate_agent====
 
====get locate_agent====
Get id server whare agent is located, and print all the result like a csv.
+
It gets the id server where the agent is located, and prints all the results like a csv.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=locate_agent (compulsory)
+
*op2=locate_agent (required)
*return_type=&lt;csv&gt; (compulsory) Output format.
+
*return_type=&lt;csv&gt; (required). Output format.
*id=id_agent (compulsory)
+
*id=id_agent (required)
*other_mode= other_mode=url_encode_separator_&lt;separator&gt (compulsory)  
+
*other_mode= other_mode=url_encode_separator_&lt;separator&gt (required)  
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=locate_agent&return_type=csv&apipass=1234&user=admin&pass=pandora&id=Pepito&other_mode=url_encode_separator_%7C
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=locate_agent&return_type=csv&apipass=1234&user=admin&pass=pandora&id=Pepito&other_mode=url_encode_separator_%7C</nowiki>
  
 
====get policies====
 
====get policies====
Returns the list of polities of agent, this agent is filtered by id into the other parameter.
+
It returns the list of agent policies, whose id which has gone through the other parameter.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=policies (compulsory)
+
*op2=policies (required)
*return_type=&lt;csv&gt; (compulsory)  
+
*return_type=&lt;csv&gt; (required)  
*other=&lt;serialized values&gt; (optional) Serialized values for filter policy by policy agent:
+
*other=&lt;serialized values&gt; (optional). Serialized values for filtering policies by policy agent:
 
:*&lt;id_agent&gt;
 
:*&lt;id_agent&gt;
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=policies&return_type=csv&other=&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====Get tree_agents====
+
====get tree_agents====
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.
+
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 (compulsory)
+
*op=get (required)
*op2=tree_agents (compulsory)
+
*op2=tree_agents (required)
*return_type=&lt;return kind&gt; (compulsory) that could be 'csv' or 'csv_head'.
+
*return_type=&lt;return kind&gt; (required). That could be 'csv' or 'csv_head'.
*other=&lt;string or serialized parameters&gt; (optional) in this case could be the divider or a parameter list in order and separated by the divider character. We are going to examine the two cases:  
+
*other=&lt;string or serialized parameters&gt; (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:  
  
 
::*&lt;separator&gt; The divider "yes" of the 'csv'.
 
::*&lt;separator&gt; The divider "yes" of the 'csv'.
::*&lt;separator csv&gt;|&lt;character that replaces the CR|&lt;fields 1&gt;,&lt;fields 2&gt;,&lt;fields N&gt;it will compose the following parameters in order( the divider character '|' could be specified in "other_mode"):
+
::*&lt;separator csv&gt;|&lt;character that replaces the CR|&lt;fields 1&gt;,&lt;fields 2&gt;,&lt;fields N&gt;. It will place the following parameters in order (the divider character '|' could be specified in "other_mode"):
:::*&lt;separator csv&gt;: divider of the fields in the CSV.
+
:::*&lt;separator csv&gt;. Field divider in the CSV.
:::*&lt;character that replaces the CR&gt; 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 pass an string in other, the substitute character is the blank space.
+
:::*&lt;character that replaces the CR&gt;. 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.
  
 
:::*&lt;fields 1&gt;,&lt;fields2&gt;,&lt;fields N&gt :the fields to show in the CSV are:  
 
:::*&lt;fields 1&gt;,&lt;fields2&gt;,&lt;fields N&gt :the fields to show in the CSV are:  
Line 522: Line 524:
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;|%20|type_row,group_id,agent_name&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=tree_agents&return_type=csv&other=;|%20|type_row,group_id,agent_name&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_data====
 
====get module_data====
Line 530: Line 532:
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory)
+
*op=set (required)
*op2=module_data (compulsory)
+
*op2=module_data (required)
*id=&lt;id_modulo&gt; (compulsory)
+
*id=&lt;id_modulo&gt; (required)
*other_mode=url_encode_separator_<separator> (compulsory)
+
*other_mode=url_encode_separator_<separator> (required)
 
*other=&lt;serialized parameters&gt; (optional)
 
*other=&lt;serialized parameters&gt; (optional)
 
::*The CSV divider character (point by default)
 
::*The CSV divider character (point by default)
Line 541: Line 543:
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_data&id=17&other=;|604800|20121201T13:40|20171215T13:40&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_data&id=17&other=;|604800|20121201T13:40|20171215T13:40&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get graph_module_data====
 
====get graph_module_data====
Returns the chart of a module as a image file, this chart is generated with the same method of static graphs of Pandora. It is necesary pass the width, height, period, label and start date of chart (knowing in Pandora the date indicated in graphs always is the end of data) all of they into the other parameter.
+
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:
 
Call syntax:
  
*op=set (compulsory)
+
*op=set (required)
*op2=module_data (compulsory)
+
*op2=module_data (required)
*id=&lt;id_modulo&gt; (compulsory)
+
*id=&lt;id_modulo&gt; (required)
*other=&lt;serialized parameters&gt; (compulsory). Are the following in this order:
+
*other=&lt;serialized parameters&gt; (required). They are the following in this order:
 
:*&lt;period&gt;
 
:*&lt;period&gt;
 
:*&lt;width&gt;
 
:*&lt;width&gt;
Line 561: Line 563:
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=graph_module_data&id=17&other=604800|555|245|pepito|2009-12-07&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=graph_module_data&id=17&other=604800|555|245|pepito|2009-12-07&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get events====
 
====get events====
Returns a list of events filtered by the other parameter.
+
It returns a list of events filtered by the other parameter.
 +
 
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=events (compulsory)
+
*op2=events (required)
*return_type=csv (compulsory)
+
*return_type=csv (required)
 
*other_mode=url_encode_separator_| (optional)
 
*other_mode=url_encode_separator_| (optional)
*other=&lt;serialized parameters&gt; (optional).Are the following in this order:
+
*other=&lt;serialized parameters&gt; (optional). They are the following in this order:
 
:*&lt;separator&gt;
 
:*&lt;separator&gt;
:*&lt;criticity&gt; From 0 to 4, or -1 for to avoid this param
+
:*&lt;criticity&gt; Values from 0 to 4, or -1 to avoid this param
 
:*&lt;agent alias&gt;
 
:*&lt;agent alias&gt;
 
:*&lt;module name&gt;  
 
:*&lt;module name&gt;  
Line 585: Line 588:
 
:*&lt;register limit&gt;
 
:*&lt;register limit&gt;
 
:*&lt;offset register&gt;
 
:*&lt;offset register&gt;
:*&lt;optional style [total|more_criticity]&gt; (total - returns the number of the records,  more_criticity - returns the biggest value of criticity)
+
:*&lt;optional style [total|more_criticity]&gt; (total - it returns the number of the records,  more_criticity - it returns the highest criticity value)
:*&lt;event type&gt; unknown, alert_fired, alert_recovered,.. or its substring. you can also use 'not_normal'.
+
:*&lt;id_grupo&gt;
 +
:*&lt;tags&gt;
 +
:*&lt;event type&gt; unknown, alert_fired, alert_recovered,.. or its substring. You may also use 'not_normal'.
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=events&other_mode=url_encode_separator_|&return_type=csv&other=;|2|SERVER|CPU|template_alert00||1274715715|127471781&apipass=1234&user=admin&pass=pandora</nowiki>
 
 
===== Full usage example =====
 
 
 
Sample event #1 report this information:
 
 
 
<pre>
 
951140;3998;0;14;0;2012-06-23 22:51:28;Module CheckPandora (0.00) is going to
 
CRITICAL;1340484688;going_up_critical;8176;0;4;;;RemoteAgent;Aerin;transmit;Going down to critical
 
state;http://firefly.artica.es/pandora_demo//images/b_red.png;Critical;http://firefly.artica.es/pandora_demo//
 
images/status_sets/default/severity_critical.png
 
</pre>
 
 
 
Most of the fields, match the fields in the dababase, try to do this query using the SQL manager at pandora:
 
 
 
select * from tevento order by id_evento DESC limit 100;
 
 
 
You will see the fields are like this:
 
 
 
* Field 1 - ID event number (incremental)
 
* Field 2 - ID agent
 
* Field 3 - ID user which validate the event
 
* Field 4 - ID Group (numerical)
 
* Field 5 - Status (0 - new, 1 validated... see more in docs about status codes)
 
* Field 6 - Timestamp (human string timestamp)
 
* Field 7 - Event description (pure text)
 
* Field 8 - utimestamp (Unix timestamp, numerical seconds since 1970)
 
* Field 9 - event type, tokens representing event type with fixed strings
 
* Field 10 - ID agent_module the numerical ID of the module with raise this event. It depends on the event type a new_agent event type do not come with any value here (0). Later the API will get the name, you dont need to call again the api to "resolve" the name by asking with the ID.
 
* Field 11- Id alert. THe same with F10
 
* Field 12 - Criticity (values), check out the docs to see the codes.
 
* Field 13 - User comments (if provided by the user)
 
* Field 14 - Tags
 
 
 
Now comes the API aditional fields, not in DB:
 
 
 
* Field 15 - Agent name
 
* Field 16 - Group name
 
* Field 17 - Group image name.
 
* Field 18 - Long description of the event type
 
* Field 19 - URL to image representing the event status (red ball)
 
* Field 20 - Description of the event criticity (Field 12)
 
* Field 21 - URL to image representing the criticity.
 
  
 
====get all_alert_templates====
 
====get all_alert_templates====
  
Returns the list of alert templates defined into the Pandora.
+
It returns the list of alert templates defined in Pandora FMS.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=all_alert_templates (compulsory)
+
*op2=all_alert_templates (required)
 
*other=cvs_separator (optional)
 
*other=cvs_separator (optional)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_alert_templates&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
  
 
====get module_groups====
 
====get module_groups====
Returns the list of module groups.
+
It returns the list of module groups.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=module_groups (compulsory)
+
*op2=module_groups (required)
 
*other=cvs_separator (optional)
 
*other=cvs_separator (optional)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_groups&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get plugins====
 
====get plugins====
Returns the list of server plugins of Pandora.
+
It returns the list of Pandora FMS server plugins.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=plugins (compulsory)
+
*op2=plugins (required)
 
*other=cvs_separator (optional)
 
*other=cvs_separator (optional)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=plugins&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get tags====
 
====get tags====
Returns the list of tags defined into Pandora.
+
It returns the list of tags defined in Pandora FMS.
  
 
Call syntax:
 
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=tags (compulsory)
+
*op2=tags (required)
*return_type=csv (compulsory)
+
*return_type=csv (required)
  
 
=====Examples=====
 
=====Examples=====
Line 688: Line 652:
 
This example will return all tags in the system.
 
This example will return all tags in the system.
  
  http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=tags&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_from_conf====
 
====get module_from_conf====
 
>= 5.0 (Only Enterprise)
 
>= 5.0 (Only Enterprise)
  
Returns the configuration of a local module.
+
It returns the configuration of a local module.
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=update_module_in_conf (mandatory)
+
*op2=update_module_in_conf (required)
*id=&lt;id agente&gt; (mandatory)
+
*id=&lt;agent id&gt; (required)
*id2=&lt;nombre módulo&gt; (mandatory)
+
*id2=&lt;module name&gt; (required)
  
 
=====Examples=====
 
=====Examples=====
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_from_conf&apipass=1234&user=admin&pass=pandora&id=9043&id2=example_name
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_from_conf&apipass=1234&user=admin&pass=pandora&id=9043&id2=example_name</nowiki>
  
It returns null string if no modules are found.
+
It returns an empty string if no modules are found.
  
 
====get total_modules====
 
====get total_modules====
Line 712: Line 676:
 
Call syntax:
 
Call syntax:
  
*op=get (mandatory)
+
*op=get (required)
*op2=total_modules (mandatory)
+
*op2=total_modules (required)
*id=<id group> (mandatory)  
+
*id=<id group> (required)  
  
 
=====Examples=====
 
=====Examples=====
  http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=total_modules&id=2&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
If the group id is 0, it returns the total amount of modules.
  
 
====get total_agents====
 
====get total_agents====
Line 725: Line 691:
 
Call syntax:
 
Call syntax:
  
*op=get (mandatory)
+
*op=get (required)
*op2=total_agents (mandatory)
+
*op2=total_agents (required)
*id=<id group> (mandatory)  
+
*id=<id group> (required)  
  
 
=====Examples=====
 
=====Examples=====
  http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=total_agents&id=2&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get agent_name====
 
====get agent_name====
Line 736: Line 702:
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=agent_name (mandatory)
+
*op2=agent_name (required)
*id=&lt;id agent&gt; (mandatory)
+
*id=&lt;agent id&gt; (required)
  
 
=====Examples=====
 
=====Examples=====
  http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get agent_alias====
 
====get agent_alias====
Line 749: Line 715:
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=agent_alias (mandatory)
+
*op2=agent_alias (required)
*id=&lt;id agent&gt; (mandatory)
+
*id=&lt;agent id&gt; (required)
*id2=<id node> (obligatory in the meta console, unnecessary in the node)
+
*id2=<node id> (required in the meta console, unnecessary in the node)
  
 
=====Examples=====
 
=====Examples=====
  
Node:
+
* Node:
  
  http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
Metaconsole:
+
* Metaconsole:
  
  http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_name====
 
====get module_name====
Line 768: Line 734:
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=module_name (mandatory)
+
*op2=module_name (required)
*id=&lt;id module&gt; (mandatory)
+
*id=&lt;module id&gt; (required)
  
 
=====Examples=====
 
=====Examples=====
  http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=module_name&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get alert_action_by_group====
 
====get alert_action_by_group====
Line 779: Line 745:
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=alert_action_by_group (mandatory)
+
*op2=alert_action_by_group (required)
*id=&lt;id group&gt; (mandatory)
+
*id=&lt;group id&gt; (required)
*id2=&lt;id action&gt; (mandatory)
+
*id2=&lt;action id&gt; (required)
 +
 
 +
=====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>
 +
 
 +
====get alert_actions====
 +
 
 +
List of alert actions
 +
 
 +
Call syntax:
 +
*op=get (required)
 +
*op2=alert_actions (required)
 +
*return_type=&lt;return type&gt; (required). It can be 'csv' or 'json'.
 +
*other=&lt;serialized parameters&gt; (optional):
 +
:*&lt;action_name&gt; (optional)
 +
:*&lt;separator&gt; (optional)
  
 
=====Examples=====
 
=====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
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alert_actions&apipass=1234&user=admin&pass=pandora&other=Create|&other_mode=url_encode_separator_|&return_type=json</nowiki>
 +
 
 +
====get alert_actions_meta====
 +
 
 +
{{metaconsole}}
 +
List of node alert actions from Metaconsole.
 +
 
 +
Call syntax:
 +
*op=get (required)
 +
*op2=alert_actions_meta (required)
 +
*return_type=&lt;return type&gt; (required). It can be 'csv' o 'json'.
 +
*other=&lt;serialized parameters&gt; (optional):
 +
:*&lt;server_name&gt; (optional)
 +
:*&lt;action_name&gt; (optional)
 +
:*&lt;separator&gt; (optional)
 +
 
 +
=====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>
 +
 
 +
 
 +
====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====
Return all of event data. This event is selected by id in the id parameter.
+
It returns all event data by typing in the event id.
 +
 
  
 
{{metaconsole}}
 
{{metaconsole}}
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=event_info (mandatory)
+
*op2=event_info (required)
*id=&lt;id_event&gt; (mandatory)
+
*id=&lt;id_event&gt; (required)
  
 
=====Examples=====
 
=====Examples=====
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=event_info&id=80&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get tactical_view====
 
====get tactical_view====
  
Returns the next values list (this values you can see in the tactical page in Pandora Console)
+
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 833: Line 845:
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=tactical_view (mandatory)
+
*op2=tactical_view (required)
  
 
=====Example=====
 
=====Example=====
  http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get pandora_servers====
 
====get pandora_servers====
 
>= 5.0
 
>= 5.0
  
Returns the list of pandora servers.
+
It returns the list of Pandora FMS servers.
  
call syntax:
+
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=pandora_servers (mandatory)
+
*op2=pandora_servers (required)
 
*other=cvs_separator (optional)
 
*other=cvs_separator (optional)
*return_type=csv (mandatory)
+
*return_type=csv (required)
  
 
=====Example=====
 
=====Example=====
  http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=pandora_servers&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
It returns the fields in this order:
 
It returns the fields in this order:
Line 869: Line 881:
 
>= 5.0
 
>= 5.0
  
Translate the name of custom field to the id in the data base.
+
It translates the name of custom field into the id in the data base.
  
 
Call syntax:
 
Call syntax:
*op=get (mandatory)
+
*op=get (required)
*op2=custom_field_id (mandatory)
+
*op2=custom_field_id (required)
*other=&lt;serialized parameters&gt; (mandatory) in this case custom field name
+
*other=&lt;serialized parameters&gt; (required). In this case, custom field name.
:*&lt;name&gt; (mandatory)
+
:*&lt;name&gt; (required)
  
 
=====Example=====
 
=====Example=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=custom_field_id&other=mycustomfield&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=custom_field_id&other=mycustomfield&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get gis_agent====
 
====get gis_agent====
 
>= 5.0
 
>= 5.0
  
Return the last gis agent data.
+
It returns the last GIS agent data.
  
Sintax call:
+
Call syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=gis_agent (compulsory)
+
*op2=gis_agent (required)
*id=<index> (compulsory) agent index.
+
*id=<index> (required). It must be an agent index.
  
=====Ejemplo=====
+
=====Example=====
  
http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1
+
<nowiki>http://localhost/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=gis_agent&id=1</nowiki>
  
 
====get special_days====
 
====get special_days====
 
>= 5.1
 
>= 5.1
  
Return special day's list.
+
It returns special day's list.
  
Sintax call:
+
Call syntax:
  
*op=get (compulsory)
+
*op=get (required)
*op2=special_days (compulsory)
+
*op2=special_days (required)
*other=<csv separator> (optional) CSV separator
+
*other=<csv separator> (optional). CSV separator
  
 
=====Example=====
 
=====Example=====
  
  http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=get&op2=special_days
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=special_days</nowiki>
  
 
====get module_properties====
 
====get module_properties====
 
>= 5.1SP2
 
>= 5.1SP2
  
Returns a list of module properties. The list could be filtered by the parameter.
+
It returns a list of module properties. The list could be filtered by parameter.
  
 
Call Syntax:
 
Call Syntax:
*op=get (compulsory)
+
*op=get (required)
*op2=module_properties (compulsory)
+
*op2=module_properties (required)
*id=module-id (compulsory)
+
*id=module-id (required)
*return_type=&lt;return kind&gt; (compulsory) that could be 'csv' or 'csv_head'.
+
*return_type=&lt;return kind&gt; (required). That could be 'csv' or 'csv_head'.
*other=&lt;string or serialized parameters&gt; (optional) in this case could be the divider or a parameter list in order and separated by the divider character. We are going to examine the two cases:  
+
*other=&lt;string or serialized parameters&gt; (optional). In this case, it could be the divider or a parameter list ordered and separated by the divider character. Both cases are exposed:  
  
::*&lt;separator&gt; The divider "yes" of the 'csv'.
+
::*&lt;separator&gt;. The divider "yes" of the 'csv'.
::*&lt;separator csv&gt;|&lt;character that replaces the CR|&lt;fields 1&gt;,&lt;fields 2&gt;,&lt;fields N&gt;it will compose the following parameters in order( the divider character '|' could be specified in "other_mode"):
+
::*&lt;separator csv&gt;|&lt;. Character that replaces the CR|&lt;fields 1&gt;,&lt;fields 2&gt;,&lt;fields N&gt;. It will make up the following parameters in order (the divider character '|' could be specified in "other_mode"):
:::*&lt;separator csv&gt;: divider of the fields in the CSV.
+
:::*&lt;separator csv&gt;. Field divider in the CSV.
:::*&lt;character that replaces the CR&gt; 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 pass an string in other, the substitute character is the blank space.
+
:::*&lt;character that replaces the CR&gt;. 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.
:::*&lt;fields 1&gt;,&lt;fields2&gt;,&lt;fields N&gt; :the fields to output in CSV are:  
+
:::*&lt;fields 1&gt;,&lt;fields2&gt;,&lt;fields N&gt;. The fields to output in CSV are:  
::::*module_id_agent_modulo
+
::::*module_id_agent_module
 
::::*module_id_agent
 
::::*module_id_agent
 
::::*module_id_module_type
 
::::*module_id_module_type
Line 979: Line 991:
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=6233&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=6233&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=1103&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties&id=1103&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_properties_by_name====
 
====get module_properties_by_name====
 
>= 5.1SP2
 
>= 5.1SP2
  
Returns a list of module properties. The list could be filtered by the parameter.
+
It returns a list of module properties. The list could be filtered by parameter.
  
 
Call Syntax:
 
Call Syntax:
*op=get (compulsory)
+
*op=get (required)
*op2=module_properties_by_name (compulsory)
+
*op2=module_properties_by_name (required)
*id=agent_name (compulsory)
+
*id=agent_name (required)
*id2=agentmodule_name (compulsory)
+
*id2=agentmodule_name (required)
*return_type=&lt;return kind&gt; (compulsory) that could be 'csv' or 'csv_head'.
+
*return_type=&lt;return kind&gt; (required). That could be 'csv' or 'csv_head'.
*other=&lt;string or serialized parameters&gt; (optional) in this case 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')
+
*other=&lt;string or serialized parameters&gt; (optional). In this case, it could be the divider or a parameter list in order and separated by the divider character. (the same as 'get module_properties'. For details, see 'get module_properties')
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_name&id=my_agent&id2=my_module&return_type=csv&other=;|%20|module_id_agent_module,module_id_module_type,module_type,module_name,module_last_try,module_state&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_properties_by_alias====
 
====get module_properties_by_alias====
 
>= 7.0NG
 
>= 7.0NG
  
Returns a list of module properties. The list could be filtered by the parameter.
+
It returns a list of module properties. The list could be filtered by parameter.
  
 
Call Syntax:
 
Call Syntax:
*op=get (compulsory)
+
*op=get (required)
*op2=module_properties_by_alias (compulsory)
+
*op2=module_properties_by_alias (required)
*id=agent_alias (compulsory)
+
*id=agent_alias (required)
*id2=agentmodule_name (compulsory)
+
*id2=agentmodule_name (required)
*return_type=&lt;return kind&gt; (compulsory) that could be 'csv' or 'csv_head'.
+
*return_type=&lt;return kind&gt; (required). That could be 'csv' or 'csv_head'.
*other=&lt;string or serialized parameters&gt; (optional) in this case 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')
+
*other=&lt;string or serialized parameters&gt; (optional). In this case, it could be the divider or a parameter list ordered and separated by the divider character (the same as 'get module_properties'. For details, see 'get module_properties').
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_alias&id=pandorafms&id2=Memory_Used&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=module_properties_by_alias&id=pandorafms&id2=Memory_Used&return_type=csv&other=;&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get module_graph====
 
====get module_graph====
 
>= 6.0
 
>= 6.0
  
Returns a module graph encoded with base64.
+
It returns a module graph encoded with base64.
  
 
Call Syntax:
 
Call Syntax:
*op=get (compulsory)
+
*op=get (required)
*op2=module_graph (compulsory)
+
*op2=module_graph (required)
*id=<module id> (compulsory)
+
*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.
  
 
=====Examples=====
 
=====Examples=====
  
  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>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>
  
 
====get all_planned_downtimes====
 
====get all_planned_downtimes====
 
>= 5.1
 
>= 5.1
  
Return all matches of planned downtime.
+
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 filter)
+
other=<name> <group> <type_downtime> <type_execution> <type_periodicity> (for filtering)
  
  
Line 1,046: Line 1,058:
 
=====Example=====
 
=====Example=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get planned_downtimes_items====
 
====get planned_downtimes_items====
 
>= 5.1
 
>= 5.1
  
Return all matches of planned downtime items.
+
It returns all matches of planned downtime items.
  
 
op=get
 
op=get
Line 1,061: Line 1,073:
 
=====Example=====
 
=====Example=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki>
  http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=planned_downtimes_items&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  
 
====get id_group_agent_by_name====
 
====get id_group_agent_by_name====
 
>= 5.1
 
>= 5.1
  
Return the group id of an agent.
+
It returns the group id of an agent.
  
 
Call Syntax:
 
Call Syntax:
Line 1,073: Line 1,085:
 
* op=get
 
* op=get
 
* op2=id_group_agent_by_name
 
* op2=id_group_agent_by_name
* other=<string or serialized parameters> Agent name and filtering parameters (optional)
+
* other=<string or serialized parameters>. Agent name and filtering parameters (optional).
 
:* <agent_name>
 
:* <agent_name>
  
 
=====Example=====
 
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40</nowiki>
  
 
====get id_group_agent_by_alias====
 
====get id_group_agent_by_alias====
 
>= 7.0NG
 
>= 7.0NG
  
Return the group id of an agent.
+
It returns the group id of an agent.
  
 
Call Syntax:
 
Call Syntax:
Line 1,088: Line 1,100:
 
* op=get
 
* op=get
 
* op2=id_group_agent_by_alias
 
* op2=id_group_agent_by_alias
* other=<string or serialized parameters> Agent alias and filtering parameters (optional)
+
* other=<string or serialized parameters>. Agent alias and filtering parameters (optional)
 
:* <agent_alias>
 
:* <agent_alias>
  
 
=====Example=====
 
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=id_group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms</nowiki>
  
 
====get group_agent_by_name====
 
====get group_agent_by_name====
 
>= 5.1
 
>= 5.1
  
Return the group name for a agent.
+
It returns the group name for a agent.
  
 
Call Syntax:
 
Call Syntax:
Line 1,107: Line 1,119:
  
 
=====Example=====
 
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_name&other_mode=url_encode_separator_|&other=192.168.50.40</nowiki>
  
 
====get group_agent_by_alias====
 
====get group_agent_by_alias====
 
>= 7.0NG
 
>= 7.0NG
  
Return the group name for a agent.
+
It returns the group name for an agent.
  
 
Call Syntax:
 
Call Syntax:
Line 1,118: Line 1,130:
 
* op=get
 
* op=get
 
* op2=group_agent_by_alias
 
* op2=group_agent_by_alias
* other=<string or serialized parameters> Agent alias and filtering parameters (optional).
+
* other=<string or serialized parameters>. Agent alias and filtering parameters (optional).
 
:* <agent_alias>
 
:* <agent_alias>
  
 
=====Example=====
 
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_agent_by_alias&other_mode=url_encode_separator_%7C&other=pandorafms</nowiki>
 
 
  
 
====get group_id_by_name====
 
====get group_id_by_name====
 
>= 7.0NG
 
>= 7.0NG
  
Retorna el id de grupo a partir del nombre.
+
It returns the group id from the name.
  
Sintaxis de la llamada:
+
Call syntax:
  
 
* op=get
 
* op=get
 
* op2=group_id_by_name
 
* op2=group_id_by_name
* other=<parámetros único> (obligatorio):
+
* other=<unique parameter> (required):
 
:* <group_name>
 
:* <group_name>
  
=====Ejemplo=====
+
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_id_by_name&other=Servers
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=group_id_by_name&other=Servers</nowiki>
  
====get get_timezone====
+
====get_timezone====
 
>= 7.0NG
 
>= 7.0NG
  
Retorna el timezone con el que está configurado pandora.
+
It returns the timezone with which pandora is configured.
 
 
Sintaxis de la llamada:
 
  
 +
Call syntax:
 
* op=get
 
* op=get
 
* op2=timezone
 
* op2=timezone
  
=====Ejemplo=====
+
=====Example=====
  http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=timezone</nowiki>
  
====get traps====
+
====get cluster_status====
>= 7.0NG. 728
+
>= 7.0
  
Devuelve los traps de origen especificado, también puedes filtrar por timestamp y otros datos.
+
It returns the cluster status by id
  
Sintaxis de la llamada:
+
*op=get
 +
*op2=cluster_status
 +
*id=cluster id
  
* op = get
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_status&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
* op2 = traps
 
* other=<parámetros opcionales>:
 
:* <timestamp>
 
:* <limit>
 
:* <offset>
 
:* <status>
 
:* <oid_custom>
 
  
=====Ejemplo=====
+
====get cluster_id_by_name====
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
+
>= 7.0
  
===SET===
+
It returns the id of the cluster by name
  
Send data
+
*op=get
 +
*op2=cluster_id_by_name
 +
*id=cluster name
  
====Set new_agent====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_id_by_name&id=paco&apipass=1234&user=admin&pass=pandora</nowiki>
Create a new agent with the data passed as parameters.
 
  
Call syntax:
+
====get agents_id_name_by_cluster_id====
 +
>= 7.0
  
*op=set (compulsory)
+
It returns the id => cluster agents names by cluster id
*op2=new_agent (compulsory)
 
*other=&lt;serialized parameters&gt; (compulsory).They are the agent configuration and data, serial in the following order:
 
  
:*&lt;agent_alias&gt;
+
*op=get
:*&lt;ip&gt;
+
*op2=agents_id_name_by_cluster_id
:*&lt;id_parent&gt;
+
*id=cluster id
:*&lt;id_group&gt;
 
:*&lt;cascade_protection&gt;
 
:*&lt;cascade_protection_module&gt;
 
:*&lt;interval_sec&gt;
 
:*&lt;id_os&gt;
 
:*&lt;name_server&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;learning_mode&gt;
 
:*&lt;disabled&gt;
 
:*&lt;description&gt;
 
:*&lt;alias_as_name&gt;
 
  
=====Examples=====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agents_id_name_by_cluster_id&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_agent&other=agente_alias%7C1.1.1.1%7C0%7C4%7C0%7C0%7C300%7C10%7Cpandorafms%7C8%7C10%7C%7Cla%20descripcion%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
+
====get agents_id_name_by_cluster_name====
 +
>= 7.0
 +
It returns the id => cluster agents names by cluster name
  
*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.
+
*op=get
 +
*op2=agents_id_name_by_cluster_name
 +
*id=cluster id
  
====Set update_agent====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=agents_id_name_by_cluster_name&id=paco&apipass=1234&user=admin&pass=pandora</nowiki>
Update a new agent with the data passed as parameters.
 
  
Call syntax:
+
====get modules_id_name_by_cluster_id====
 +
>= 7.0
  
*op=set (compulsory)
+
It returns the id => all the module names of the cluster agents by cluster id
*op2=update_agent (compulsory)
 
*id=&lt;id_agent&gt; (compulsory)
 
*other=&lt;serialized parameters&gt; (compulsory).They are the agent configuration and data, serial in the following order:
 
  
:*&lt;agent_alias&gt;
+
*op=get
:*&lt;ip&gt;
+
*op2=modules_id_name_by_cluster_id
:*&lt;id_parent&gt;
+
*id=cluster id
:*&lt;id_group&gt;
 
:*&lt;cascade_protection&gt;
 
:*&lt;interval_sec&gt;
 
:*&lt;id_os&gt;
 
:*&lt;name_server&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;learning_mode&gt;
 
:*&lt;disabled&gt;
 
:*&lt;description&gt;
 
  
=====Examples=====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=modules_id_name_by_cluster_id&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?id=5&op=set&op2=update_agent&other=agente_nombre%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20descripcion&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
+
====get modules_id_name_by_cluster_name====
 +
>= 7.0
  
====Set delete_agent====
+
It returns the id => all the module names of the cluster agents by cluster name
Delete a agent that passed the name as parameter.
 
  
Call syntax:
+
*op=get
*op=set (compulsory)
+
*op2=modules_id_name_by_cluster_name
*op2=delete_agent (compulsory)
+
*id=cluster name
*id=&lt;name_agent&gt; (compulsory) should be an agent name.
 
  
=====Examples=====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=modules_id_name_by_cluster_name&id=paco&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_agent&id=agente_erroneo&apipass=1234&user=admin&pass=pandora
+
====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
  
====set create_module_template====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=cluster_items&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====get policy====
 +
>= 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)
 +
 
 +
=====Example=====
 +
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki>
 +
 
 +
====get collections_policy====
 +
>= 7.0NG. 725
 +
 
 +
It returns all policy colections. If no policy id is specified, it returns all policy colections.
  
Create a alert from a template pass as id parameter, in the module pass as id into other and agent pass as id into the other.
 
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
 
*op2=create_module_template (compulsory)
 
*id=&lt;id_template&gt; (compulsory) should be a template id.
 
*other=&lt;id_module&gt;|&lt;id_agent&gt;
 
  
=====Examples=====
+
* op=get
 +
* op2=collections_policy
 +
* id=id_policy (optional)
 +
* return_type=(json, csv, string)
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_module_template&id=1&other=1|10&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
=====Example=====
 +
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=collections_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki>
  
====set apply_module_template====
+
====get plugins_policy====
 +
>= 7.0NG. 725
  
Apply module template to agent
+
It returns all policy plugins. If no policy id is specified, it returns all policy plugins.
  
Module template are an agrupation which contain network check modules. This templates can be applied directly to agents, avoiding add modules one by one.
+
Call syntax:
  
Call sintax:
+
* op=get
*op=set (compulsory)
+
* op2=plugins_policy
*op2=apply_module_template (compulsory)
+
* id=id_policy (optional)
*id&lt;id_template&gt; (compulsory) id of the template that will be applied on the module.
+
* return_type=(json, csv, string).
*id2&lt;id_agente&gt; (compulsory) id of the agent in which the modules will be created.
 
  
=====Examples=====
+
=====Example=====
 +
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=plugins_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_module_template&id=2&id2=2&apipass=1234&user=admin&pass=pandora
+
====get inventory_policy====
 +
>= 7.0NG. 725
  
====set create_network_module====
+
It returns all inventory modules of a policy. If no policy id is specified, it returns all inventory modules of all policies.
  
Create a network module from the data pass as parameters.
 
  
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory)
+
* op=get
*op2=create_network_module (compulsory)
+
* op2=inventory_policy
*id=&lt;agent_name&gt; (compulsory) should be an agent name.
+
* id=id_policy (optional)
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
* return_type=(json, csv, string)
:*&lt;name_module&gt;
+
 
:*&lt;disabled&gt;
+
=====Example=====
:*&lt;id_module_type&gt;
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2</nowiki>
:*&lt;id_module_group&gt;
+
 
:*&lt;min_warning&gt;
+
====get unlinking_policy====
:*&lt;max_warning&gt;
+
>= 7.0NG. 725
:*&lt;str_warning&gt;
+
 
:*&lt;min_critical&gt;
+
It returns all unlinked modules of a policy. If no policy id is specified, it returns all unlinked modules of all policies.
:*&lt;max_critical&gt;
+
 
:*&lt;str_critical&gt;
+
 
:*&lt;ff_threshold&gt;
+
Call syntax:
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;tcp_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min&gt;
 
:*&lt;max&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 
  
=====Examples=====
+
* op=get
 +
* op2=unlinking_policy
 +
* id=id_policy(optional)
 +
* return_type=(json, csv, string)
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|127.0.0.1|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
=====Example=====
 +
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=unlinking_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki>
  
====set create_plugin_module====
+
====get alerts_policy====
Create a module plugin with the data passed as parameters.
+
>= 7.0NG. 725
  
Call sintax:
+
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)
  
*op=set (compulsory)
 
*op2=create_plugin_module (compulsory)
 
*id=&lt;agent_name&gt; (compulsory) should be an agent name.
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
 
:*&lt;name_module&gt;
 
:*&lt;disabled&gt;
 
:*&lt;id_module_type&gt;
 
:*&lt;id_module_group&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;tcp_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;id_plugin&gt;
 
:*&lt;plugin_user&gt;
 
:*&lt;plugin_pass&gt;
 
:*&lt;plugin_parameter&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document. The content should be an object formed by objects with the following properties:
 
** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
 
**''"desc"'': Descriptive name of the macro.
 
**''"help"'': Description of the macro.
 
**''"value"'': Value of the macro.
 
**''"hide"'': Set to "1" to hide the value of the macro (useful for storing passwords).
 
 
=====Example=====
 
=====Example=====
  {
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alerts_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id2=2.</nowiki>
  "1": {
+
 
    "macro": "_field1_",
+
====get alerts_actions_policy====
    "desc": "Target&#x20;IP",
+
>= 7.0NG. 725
    "help": "",
+
 
    "value": "192.168.0.1",
+
It returns all actions of the alerts of a policy, taking into account:
    "hide": ""
+
 
  },
+
* 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.
  "2": {
+
* If an alert id is specified, it returns the action of that alert.
    "macro": "_field2_",
+
 
    "desc": "Port",
+
Call syntax:
    "help": "",
+
 
    "value": "80",
+
* op = get
    "hide": "" 
+
* op2 = alerts_actions_policy
}
+
* id = id_policy(optional)
}
+
* id2 = id_policy_alert(optional)
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
+
* return_type=(json, csv, string)
:*&lt;each_ff&gt; (only in version 5.1 or later)
+
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
+
=====Example=====
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=alerts_actions_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=1&id2=3</nowiki>
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
+
 
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
+
====get agents_policy====
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
+
>= 7.0NG. 725
 +
 
 +
It returns all policy agents. If no policy id is specified, it returns all agents of all policies.
 +
 +
 
 +
Call syntax:
  
=====Examples=====
+
* op = get
 +
* op2 = agents_policy
 +
* id = id_policy(optional)
 +
* return_type = (json, csv, string)
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_plugin_module&id=pepito&other=prueba|0|1|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
=====Example=====
 +
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=agents_policy&apipass=1234&user=admin&pass=pandora&return_type=json.</nowiki>
  
====set create_data_module====
+
====get groups_policy====
 +
>= 7.0NG. 725
  
Create a module from parameters passed.
+
It returns all groups of a policy. If no policy id is specified, it returns all groups of all policies.
  
{{warning|With this call you can add database module data but you cannot modify configuration file of the agents associated to the module}}
+
Call syntax:
  
Call sintax:
+
* op = get
 +
* op2 = groups_policy
 +
* id = id_policy(optional)
 +
* return_type = (json, csv, string)
  
*op=set (compulsory)
+
=====Example=====
*op2=create_data_module (compulsory)
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=groups_policy&apipass=1234&user=admin&pass=pandora&return_type=json&id=2</nowiki>
*id=&lt;agent_name&gt; (compulsory) should be an agent name.
+
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
====get queue_policy====
:*&lt;name_module&gt;
+
>= 7.0NG. 725
:*&lt;disabled&gt;
+
 
:*&lt;id_module_type&gt;
+
It returns the queue of a policy. If no id policy is specified, its returns all queues of all policies.
:*&lt;description&gt;
+
 
:*&lt;id_module_group&gt;
+
Call syntax:
:*&lt;min_value&gt;
+
 
:*&lt;max_value&gt;
+
* op = get
:*&lt;post_process&gt;
+
* op2 = queue_policy
:*&lt;module_interval&gt;
+
* id = id_policy(optional)
:*&lt;min_warning&gt;
+
* return_type = (json, csv, string)
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;history_data&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 
  
=====Examples=====
+
=====Example=====
 +
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=queue_policy&apipass=1234&user=admin&pass=pandora&return_type=json</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_data_module&id=pepito&other=prueba|0|1|data%20module%20from%20api|1|10|20|10.50|180|10|15||16|20||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
====get traps====
 +
>= 7.0NG. 728
  
====set create_SNMP_module====
+
It returns the specified source traps, they can also be filtered by timestamp and other data.
  
Create a SNMP module.
+
Call syntax:
  
Call sintax:
+
* op = get
*op=set (compulsory)
+
* op2 = traps
*op2=create_snmp_module (compulsory)
+
* other=<optional parameters>:
*id=&lt;agent_name&gt; (compulsory) should be an agent name.
+
:* <timestamp>
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
:* <limit>
:*&lt;name_module&gt;
+
:* <offset>
:*&lt;disabled&gt;
+
:* <status>
:*&lt;id_module_type&gt;
+
:* <oid_custom>
:*&lt;id_module_group&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_version&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;snmp3_priv_method [AES|DES]&gt;
 
:*&lt;snmp3_priv_pass&gt;
 
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 
:*&lt;snmp3_auth_user&gt;
 
:*&lt;snmp3_auth_pass&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
  
=====Examples=====
+
=====Example=====
 +
<nowiki>https://localhost/pandora_console/include/api.php?op=get&op2=traps&other=1537128000%7C9000%7C0%7C1%7C.1.2.3.6.4&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
Example 1 (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw)
+
====get event_responses====
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito&other=prueba|0|15|1|10|15||16|18||15|0|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP%20module%20from%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
It returns the response list of events the user has access to in Pandora FMS.
  
Example 2 (snmp v: 1)
+
Call syntax:
 +
*op=get (required)
 +
*op2=event_reponses (required)
 +
*return_type=csv|json (required)
 +
 
 +
=====Example=====
 +
 
 +
This example will return all system event responses in csv format.
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito1&other=prueba2|0|15|1|10|15||16|18||15|0|127.0.0.1|60|1|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP module from API&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=event_responses&return_type=csv&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set update_network_module====
+
====get users====
  
Update the network module.
+
It returns the list of Pandora FMS users.
  
 
Call syntax:
 
Call syntax:
 +
*op=get (required)
 +
*op2=users (required)
 +
*return_type=csv|json (required)
  
*op=set (compulsory)
+
=====Example=====
*op2=update_network_module (compulsory)
 
*id=&lt;module_id&gt; (compulsory) should be a module id.
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
 
:*&lt;id_agent&gt;
 
:*&lt;disabled&gt;
 
:*&lt;id_module_group&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min&gt;
 
:*&lt;max&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 
  
=====Examples=====
+
This example will return all users in csv format.
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_network_module&id=3431&other=44|0|2|10|15||16|18||7|0|127.0.0.1|0||0|300|30.00|0|0|0|latency%20ping%20modified%20by%20the%20Api&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=users&return_type=csv&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_&</nowiki>
  
====set update_plugin_module====
+
====get list all user====
 +
{{metaconsole}}
  
Update the plugin module.
+
It lists all Pandora FMS users.
  
Call sintax:
+
Call syntax:
 +
*op=get (required)
 +
*op2=list_all_user(required)
 +
*return_type=csv|json (required)
  
*op=set (compulsory)
 
*op2=update_plugin_module (compulsory)
 
*id=&lt;module_id&gt; (compulsory) should be a module id.
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
 
:*&lt;id_agent&gt;
 
:*&lt;disabled&gt;
 
:*&lt;id_module_group&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;id_plugin&gt;
 
:*&lt;plugin_user&gt;
 
:*&lt;plugin_pass&gt;
 
:*&lt;plugin_parameter&gt;
 
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 
:*&lt;macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document. The content should be an object formed by objects with the following properties:
 
** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
 
**''"desc"'': Descriptive name of the macro.
 
**''"help"'': Description of the macro.
 
**''"value"'':Value of the macro.
 
 
=====Example=====
 
=====Example=====
{
+
It can return Json or CSV, this return is remarked through the URL.
  "1": {
+
Only the type of return is remarked, it does not use any specific variable
    "macro": "_field1_",
+
    "desc": "Target&#x20;IP",
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_all_user&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki>
    "help": "",
+
 
    "value": "192.168.0.1"
+
====get info user name====
  },
+
{{metaconsole}}
  "2": {
+
 
    "macro": "_field2_",
+
It lists user data.
    "desc": "Port",
+
 
    "help": "",
+
Call syntax:
    "value": "80"
+
*op=get (required)
  }
+
*op2=list_all_user(required)
}
+
*return_type=csv|json (required)
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
+
*other= usernarme (requiered)
:*&lt;each_ff&gt; (only in version 5.1 or later)
+
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
+
=====Example=====
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
+
It obtains all the information about a specific user.  
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
+
It can return Json or CSV. This return is specified through the URL.
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
+
Only the username is used to obtain said information:
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
+
 +
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=info_user_name&return_type=json&other=admin&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====get user_profiles_info====
 +
 
 +
It returns the list of Pandora FMS user profiles.
  
=====Examples=====
+
Call syntax:
 +
*op=get (required)
 +
*op2=user_profiles_info (required)
 +
*return_type=csv|json (required)
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_plugin_module&id=2343&other=44|0|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
=====Example=====
  
====set update_data_module====
+
This example will return all user profiles in json format.
  
{{warning|With this call you can add database module data but you cannot modify configuration file of the agents associated to the module}}
+
<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>
  
Update the local module.
+
====get migrate_agent====
 +
>= 7.21 ONLY METACONSOLE
  
Call sintax:
+
It looks up whether an especific agent exists in migration queue, returning the data of migration_queue.
  
*op=set (compulsory)
+
*op=get
*op2=update_data_module (compulsory)
+
*op2=migrate_agent
*id=&lt;module_id&gt; (compulsory) should be a module id.
+
*id=id_agente a migrar
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
*return_type = string, json, etc
:*&lt;id_agent&gt;
+
 
:*&lt;disabled&gt;
+
=====Example=====
:*&lt;id_module_group&gt;
+
 
:*&lt;min_warning&gt;
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=migrate_agent&apipass=1234&user=admin&pass=pandora&id=2&return_type=json</nowiki>
:*&lt;max_warning&gt;
+
 
:*&lt;str_warning&gt;
+
====get language====
:*&lt;min_critical&gt;
+
>= 7.0NG 730
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 
  
=====Examples=====
+
It returns the language with which Pandora FMS is configured.
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module&id=23234&other=44|0|data%20module%20modified%20from%20API|6|0|0|50.00|300|10|15||16|18||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
Call syntax:
 +
* op=get
 +
* op2=language
  
====set update_data_module_policy====
+
=====Example=====
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=language</nowiki>
  
Update data module in policy and return id from new module.
+
====get session_timeout====
  
Call sintax:
+
>= 7.0NG 730
*op=set (compulsory)
+
 
*op2=update_data_module (compulsory)
+
It returns the session time with which Pandora FMS is configured.
*id=&lt;id_agent_module&gt; (compulsory) Id of the target policy module.
+
 
*other=&lt;parámetros serializados&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
Call syntax:
:*&lt;id_policy_module&gt;
+
 
:*&lt;description&gt;
+
* op=get
:*&lt;id_module_group&gt;
+
* op2=session_timeout
:*&lt;min&gt;
+
 
:*&lt;max&gt;
+
=====Example=====
:*&lt;post_process&gt;
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=admin&pass=pandora&op=get&op2=session_timeout</nowiki>
:*&lt;module_interval&gt;
+
 
:*&lt;min_warning&gt;
+
====get groups====
:*&lt;max_warning&gt;
+
>= 7.0NG 732
:*&lt;min_critical&gt;
+
 
:*&lt;max_critical&gt;
+
It returns the existing groups.
:*&lt;str_critical&gt;
+
 
:*&lt;history_data&gt;
+
Call syntax:
:*&lt;configuration_data&gt;
 
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) hould be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
  
=====Examples=====
+
* op=get
 +
* op2=groups
 +
* other=<optional parameters>:
 +
:* <csv_separator>: ';' by default.
 +
:* <return_all_group>. It returns the group 'All'.
 +
:* <return_all_columns>. It returns all columns.
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module_policy&id=1&other=10~data%20module%20updated%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_
+
=====Example=====
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=get&op2=groups&other=;%7C1%7C0&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set update_SNMP_module====
+
====get filter user group====
 +
{{metaconsole}}
  
Update a SNMP module.
+
It obtains user groups through filtering.
  
Call sintax:
+
Call syntax:
*op=set (compulsory)
 
*op2=update_snmp_module (compulsory)
 
*id=&lt;module_id&gt; (compulsory) should be a module id.
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
 
:*&lt;id_agent&gt;
 
:*&lt;disabled&gt;
 
:*&lt;id_module_group&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;str_warning&gt;
 
:*&lt;min_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;ip_target&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_version&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;snmp3_priv_method [AES|DES]&gt;
 
:*&lt;snmp3_priv_pass&gt;
 
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 
:*&lt;snmp3_auth_user&gt;
 
:*&lt;snmp3_auth_pass&gt;
 
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
  
=====Examples=====
+
* op=get (requiered)
 +
* op2=filter_user_group (requiered)
 +
* return_type=csv|json(requiered)
 +
*other= id group(requiered)|Enabled or not(Disabled)(requiered)
  
Example (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw)
+
=====Example=====
 +
It can return Json or CSV. This return is remarked through the URL.
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_snmp_module&id=33432&other=44|0|6|20|25||26|30||15|1|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
{{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.}}
  
====set apply_policy====
+
 +
<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>
  
Apply the policy pass as policy id into the id parameter.
+
====get inventory_modules====
 +
It returns the list of Pandora inventory modules.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=get (required)
*op2=apply_policy (compulsory)
+
*op2=inventory_modules (required)
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
*return_type=csv|json (required)
  
 
=====Examples=====
 
=====Examples=====
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_policy&id=1&apipass=1234&user=admin&pass=pandora
+
This example will return information from all of the system's inventories in json format.
  
====set apply_all_policies====
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=inventory_modules&return_type=json&apipass=1234&user=admin&pass=pandora</nowiki>
  
Apply all policies that are in Pandora.
+
====get inventory_modules_by_name====
 +
Obtains the inventory modules from an agent using the agent name.  
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=get (required)
*op2=apply_all_policies (compulsory)
+
*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
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_all_policies&apipass=1234&user=admin&pass=pandora
+
====get inventory_modules_by_alias====
 +
Obtains the inventory modules from an agent using the agent alias.
  
====set add_network_module_policy====
+
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
  
Add a network module in the policy pass as id in the parameter.
+
====get inventory_module_data====
 +
Obtains the data from an inventory module using agent name and module.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=get (required)
*op2=add_network_module_policy (compulsory)
+
*op2=inventory_module_data (required)
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
*id=<agent name> (required)
*other=&lt;parámetros serializados&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
*id2=<inventory module name> (optional)
:*&lt;id_module_type&gt;
+
*other=<serialized parameters> (optional), the following ones in this order:
:*&lt;description&gt;
+
**<separator>
:*&lt;id_module_group&gt;
+
**<date_from>: <year><month><day>T<hour>:<minute>
:*&lt;min_value&gt;
+
**<date_to>: <year><month><day>T<hour>:<minute>
:*&lt;max_value&gt;
+
**<use_agent_alias> (optional) values 0 and 1.
:*&lt;post_process&gt;
+
 
:*&lt;module_interval&gt;
+
=====Examples=====
:*&lt;min_warning&gt;
+
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
:*&lt;max_warning&gt;
+
 
:*&lt;str_warning&gt;
+
====get list_collections====
:*&lt;min_critical&gt;
+
It returns the list of all the collections in Pandora FMS.
:*&lt;max_critical&gt;
+
 
:*&lt;str_critical&gt;
+
Call syntax:
:*&lt;history_data&gt;
+
*op=get (required)
:*&lt;ff_threshold&gt;
+
*op2=list_collections (required)
:*&lt;disabled&gt;
 
:*&lt;module_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
  
 
=====Examples=====
 
=====Examples=====
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_network_module_policy&id=1&other=network_module_policy_example_name|6|network%20module%20created%20by%20Api|2|0|0|50.00|180|10|20||21|35||1|15|0|66|||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
This example will return information from all collections in json format.
  
====set add_plugin_module_policy====
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collections&apipass=1234&user=admin&pass=pandora</nowiki>
  
Add a plugin module in the policy pass as id in the parameter.
+
====get list_collection_files====
 +
It returns the list of all files in a collection. If it does not receive a collection id, it will return all files from all collections.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=get (required)
*op2=add_plugin_module_policy (compulsory)
+
*op2=list_collections_files (required)
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
*id=id_collection
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
 
:*&lt;name_module&gt;
+
=====Examples=====
:*&lt;disabled&gt;
+
 
:*&lt;id_module_type&gt;
+
This example will return the names of all files in a collection in json format.
:*&lt;id_module_group&gt;
+
 
:*&lt;min_warning&gt;
+
<nowiki>http://localhost/pandora_console/include/api.php?op=get&op2=list_collection_files&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
:*&lt;max_warning&gt;
+
 
:*&lt;str_warning&gt;
+
====get event_mcid====
:*&lt;min_critical&gt;
+
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.
:*&lt;max_critical&gt;
+
 
:*&lt;str_critical&gt;
+
{{metaconsole}}
:*&lt;ff_threshold&gt;
+
 
:*&lt;history_data&gt;
+
Call syntax:
:*&lt;module_port&gt;
+
 
:*&lt;snmp_community&gt;
+
*op=get (required)
:*&lt;snmp_oid&gt;
+
*op2=event_mcid (required)
:*&lt;module_interval&gt;
+
*id=<server_id> (required) the ID of one of the nodes.
:*&lt;post_process&gt;
+
*id2 = <id_source_event> (required) The ID of the event from the node.
:*&lt;min_value&gt;
+
 
:*&lt;max_value&gt;
+
=====Example=====
 +
 
 +
<nowiki>http://172.16.0.3/pandora_console/include/api.php?op=get&op2=event_mcid&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
===SET===
 +
 
 +
It sends data.
 +
 
 +
====set new_agent====
 +
It creates a new agent with the data sent as parameters.
 +
 
 +
Call syntax:
 +
 
 +
*op=set (required)
 +
*op2=new_agent (required)
 +
*other=&lt;serialized parameters&gt; (required). They are the agent configuration and data, serialized in the following order:
 +
 
 +
:*&lt;agent_alias&gt;
 +
:*&lt;ip&gt;
 +
:*&lt;id_parent&gt;
 +
:*&lt;id_group&gt;
 +
:*&lt;cascade_protection&gt;
 +
:*&lt;cascade_protection_module&gt;
 +
:*&lt;interval_sec&gt;
 +
:*&lt;id_os&gt;
 +
:*&lt;name_server&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;custom_id&gt;
 +
:*&lt;learning_mode&gt;
 +
:*&lt;disabled&gt;
 
:*&lt;description&gt;
 
:*&lt;description&gt;
:*&lt;id_plugin&gt;
+
:*&lt;alias_as_name&gt;
:*&lt;plugin_user&gt;
+
 
:*&lt;plugin_pass&gt;
 
:*&lt;plugin_parameter&gt;
 
:*&lt;enable_unknown_events&gt; (only in version 5)
 
:*&lt;macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document. The content should be an object formed by objects with the following properties:
 
** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
 
**''"desc"'': Descriptive name of the macro.
 
**''"help"'': Description of the macro.
 
**''"value"'':Value of the macro.
 
 
=====Example=====
 
=====Example=====
{
 
  "1": {
 
    "macro": "_field1_",
 
    "desc": "Target&#x20;IP",
 
    "help": "",
 
    "value": "192.168.0.1"
 
  },
 
  "2": {
 
    "macro": "_field2_",
 
    "desc": "Port",
 
    "help": "",
 
    "value": "80"
 
  }
 
}
 
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
  
=====Examples=====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_agent&other=agente_alias%7C1.1.1.1%7C0%7C4%7C0%7C0%7C300%7C10%7Cpandorafms%7C8%7C10%7C%7Cla%20descripcion%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
*Note: If ''alias_as_name'' is 1, the agent name will be the same as the alias. If it is 0, the agent name will be automatically generated.
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_plugin_module_policy&id=1&other=example%20plugin%20module%20name|0|1|2|0|0||0|0||15|0|66|||300|50.00|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
====set update_agent====
 +
It updates a new agent with data as parameters.
  
====set add_data_module_policy====
+
Call syntax:
  
Add a local module in the policy pass as id in the parameter.
+
*op=set (required)
 +
*op2=update_agent (required)
 +
*id=&lt;id_agent&gt; (required)
 +
*other=&lt;serialized parameters&gt; (required). They are agent configuration and data, serialized in the following order:
  
Call syntax:
+
:*&lt;agent_alias&gt;
*op=set (compulsory)
+
:*&lt;ip&gt;
*op2=add_data_module_policy (compulsory)
+
:*&lt;id_parent&gt;
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
:*&lt;id_group&gt;
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
:*&lt;cascade_protection&gt;
:*&lt;name_module&gt;
+
:*&lt;interval_sec&gt;
:*&lt;id_module_type&gt;
+
:*&lt;id_os&gt;
:*&lt;description&gt;
+
:*&lt;name_server&gt;
:*&lt;id_module_group&gt;
+
:*&lt;custom_id&gt;
:*&lt;min_value&gt;
+
:*&lt;learning_mode&gt;
:*&lt;max_value&gt;
+
:*&lt;disabled&gt;
:*&lt;post_process&gt;
+
:*&lt;description&gt;
:*&lt;module_interval&gt;
+
 
:*&lt;min_warning&gt;
+
=====Examples=====
:*&lt;max_warning&gt;
+
 
:*&lt;str_warning&gt;
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?id=5&op=set&op2=update_agent&other=agente_nombre%7C1.1.1.1%7C0%7C4%7C0%7C0%7C30%7C8%7Clocalhost.localdomain%7C%7C0%7C0%7Cla%20descripcion&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
:*&lt;min_critical&gt;
+
 
:*&lt;max_critical&gt;
+
====Set delete_agent====
:*&lt;str_critical&gt;
+
It deletes an agent that has the name as parameter.
:*&lt;history_data&gt;
+
 
:*&lt;configuration_data&gt; This is the definition block of the agent that will be inserted in the config file of the policy agent.
+
Call syntax:
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
+
*op=set (required)
:*&lt;module_macros&gt; (only in version 5 or later) Should be a base 64 encoded JSON document formed by an object with one property for each macro. The format of the JSON properties should be "<macro name>": "<macro value>".
+
*op2=delete_agent (required)
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
+
*id=&lt;name_agent&gt; (required). It should be an agent name.
:*&lt;each_ff&gt; (only in version 5.1 or later)
+
*other (optional)=&lt;use_agent_alias&gt; (Values 0 and 1 supported)
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_data_module_policy&id=1&other=data_module_policy_example_name~2~data%20module%20created%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_~&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_agent&id=agente_erroneo&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set add_SNMP_module_policy====
+
====set create_module_template====
  
Add a SNMP module in the policy pass as id in the parameter.
+
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 (compulsory)
+
*op=set (required)
*op2=add_snmp_module_policy (compulsory)
+
*op2=create_module_template (required)
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
*id=&lt;id_template&gt; (required). It should be a template id.
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
+
*other=&lt;id_module&gt;|&lt;id_agent&gt;
 +
 
 +
=====Examples=====
 +
 
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_module_template&id=1&other=1|10&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====set apply_module_template====
 +
 
 +
It applies module template to agent.
 +
 
 +
Module template is an group which contains network check modules. These templates can be applied directly to agents, avoiding adding modules one by one.
 +
 
 +
Call Syntax:
 +
*op=set (required)
 +
*op2=apply_module_template (required)
 +
*id&lt;id_template&gt; (required). Id of the template that will be applied on the module.
 +
*id2&lt;id_agente&gt; (required). Id of the agent in which the modules will be created.
 +
 
 +
=====Examples=====
 +
 
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_module_template&id=2&id2=2&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====set create_network_module====
 +
 
 +
It creates a network module from data as parameters.
 +
 
 +
Call syntax:
 +
 
 +
*op=set (required)
 +
*op2=create_network_module (required)
 +
*id=&lt;agent_name&gt; (required). It should be an agent name.
 +
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 
:*&lt;name_module&gt;
 
:*&lt;name_module&gt;
 
:*&lt;disabled&gt;
 
:*&lt;disabled&gt;
Line 1,916: Line 1,806:
 
:*&lt;ff_threshold&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;history_data&gt;
 
:*&lt;history_data&gt;
:*&lt;module_port&gt;
+
:*&lt;ip_target&gt;
:*&lt;snmp_version&gt;
+
:*&lt;tcp_port&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;post_process&gt;
:*&lt;min_value&gt;
+
:*&lt;min&gt;
:*&lt;max_value&gt;
+
:*&lt;max&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;description&gt;
:*&lt;snmp3_priv_method [AES|DES]&gt;
 
:*&lt;snmp3_priv_pass&gt;
 
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 
:*&lt;snmp3_auth_user&gt;
 
:*&lt;snmp3_auth_pass&gt;
 
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 +
:*&lt;module_macros&gt; (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>".
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_snmp_module_policy&id=1&other=example%20SNMP%20module%20name|0|15|2|0|0||0|0||15|1|66|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|127.0.0.1|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set add_agent_policy====
+
====set create_plugin_module====
 +
It creates a module plugin with data as parameters.
  
Add a agent into a policy.
+
Call Syntax:
  
Call syntax:
+
*op=set (required)
*op=set (compulsory)
+
*op2=create_plugin_module (required)
*op2=add_agent_policy (compulsory)
+
*id=&lt;agent_name&gt; (required). It should be an agent name.
*id=&lt;id_policy&gt; (compulsory) should be a policy Id.
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
*other=&lt;serialized parameters&gt; (compulsory) are the agent configuration and data, serialized in the following order:
+
:*&lt;name_module&gt;
:*&lt;id_agent&gt;
+
:*&lt;disabled&gt;
 
+
:*&lt;id_module_type&gt;
=====Examples=====
 
 
 
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy&id=1&other=167&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 
 
 
====set new_network_component====
 
 
 
Create a new network component.
 
 
 
Call syntax:
 
*op=set (compulsory)
 
*op2=new_network_component (compulsory)
 
*id=&lt;network_component_name&gt; (compulsory) should be the network component name.
 
*other=&lt;serialized parameters&gt; (compulsory) are the agent configuration and data of the network component, serialized in the following order:
 
:*&lt;network_component_type&gt;
 
:*&lt;description&gt;
 
:*&lt;module_interval&gt;
 
:*&lt;max_value&gt;
 
:*&lt;min_value&gt;
 
:*&lt;snmp_community&gt;
 
 
:*&lt;id_module_group&gt;
 
:*&lt;id_module_group&gt;
:*&lt;max_timeout&gt;
 
:*&lt;history_data&gt;
 
 
:*&lt;min_warning&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;max_warning&gt;
Line 1,982: Line 1,851:
 
:*&lt;str_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;ip_target&gt;
 +
:*&lt;tcp_port&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 
:*&lt;post_process&gt;
 
:*&lt;post_process&gt;
:*&lt;network_component_group&gt;
+
:*&lt;min_value&gt;
:*&lt;enable_unknown_events&gt; (only in version 5)
+
:*&lt;max_value&gt;
:*&lt;each_ff&gt; (only in version 5.1 or later)
+
:*&lt;custom_id&gt;
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
+
:*&lt;description&gt;
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
+
:*&lt;id_plugin&gt;
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
+
:*&lt;plugin_user&gt;
 +
:*&lt;plugin_pass&gt;
 +
:*&lt;plugin_parameter&gt;
 +
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 +
:*&lt;macros&gt; (only in version 5 or later). It should be a base64 encoded JSON document. The content should be an object made up by objects with the following properties:
 +
:**''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
 +
:**''"desc"'': Descriptive macro name.
 +
:**''"help"'': Macro description.
 +
:**''"value"'': Macro value.
 +
:**''"hide"'': Set to "1" to hide the macro value (useful for storing passwords).
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
 +
 
 +
=====Example=====
 +
{
 +
  "1": {
 +
    "macro": "_field1_",
 +
    "desc": "Target&#x20;IP",
 +
    "help": "",
 +
    "value": "192.168.0.1",
 +
    "hide": ""
 +
  },
 +
  "2": {
 +
    "macro": "_field2_",
 +
    "desc": "Port",
 +
    "help": "",
 +
    "value": "80",
 +
    "hide": "" 
 +
}
 +
}
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_network_component&id=example_network_component_name&other=7|network%20component%20created%20by%20Api|300|30|10|public|3||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_plugin_module&id=pepito&other=prueba|0|1|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set new_plugin_component====
+
====set create_data_module====
 +
 
 +
It creates a module with the given parameters.
 +
 
 +
{{warning|With this call, you may add database module data but the configuration file of the agents associated to the module cannot be modified.}}
  
Create a new plugin component.
+
Call Syntax:
  
Call syntax:
+
*op=set (required)
*op=set (compulsory)
+
*op2=create_data_module (required)
*op2=new_plugin_component (compulsory)
+
*id=&lt;agent_name&gt; (required). It should be an agent name.
*id=&lt;plugin_component_name&gt; (compulsory) should be the plugin component name.
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
*other=&lt;serialized parameters&gt; (compulsory) are the agent configuration and data of the plugin component, serialized in the following order:
+
:*&lt;name_module&gt;
:*&lt;plugin_component_type&gt;
+
:*&lt;disabled&gt;
 +
:*&lt;id_module_type&gt;
 
:*&lt;description&gt;
 
:*&lt;description&gt;
:*&lt;module_interval&gt;
+
:*&lt;id_module_group&gt;
 +
:*&lt;min_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;max_value&gt;
:*&lt;min_value&gt;
+
:*&lt;post_process&gt;
:*&lt;module_port&gt;
+
:*&lt;module_interval&gt;
:*&lt;id_module_group&gt;
 
:*&lt;id_plugin&gt;
 
:*&lt;max_timeout&gt;
 
:*&lt;history_data&gt;
 
 
:*&lt;min_warning&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;max_warning&gt;
Line 2,019: Line 1,932:
 
:*&lt;max_critical&gt;
 
:*&lt;max_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;str_critical&gt;
:*&lt;ff_threshold&gt;
+
:*&lt;history_data&gt;
:*&lt;post_process&gt;
 
:*&lt;plugin_component_group&gt;
 
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_plugin_component&id=example_plugin_component_name&other=2|plugin%20component%20created%20by%20Api|300|30|10|66|3|2|example_user|example_pass|-p%20max||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_data_module&id=pepito&other=prueba|0|1|data%20module%20from%20api|1|10|20|10.50|180|10|15||16|20||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set new_snmp_component====
+
====set create_SNMP_module====
  
Create a new SNMP component.
+
It creates an SNMP module.
  
Call syntax:
+
Call Syntax:
 
+
*op=set (required)
*op=set (compulsory)
+
*op2=create_snmp_module (required)
*op2=new_snmp_component (compulsory)
+
*id=&lt;agent_name&gt; (required). It should be an agent name.
*id=&lt;snmp_component_name&gt; (compulsory) should be the snmp component name.
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
*other=&lt;serialized parameters&gt; (compulsory) are the configuration and data of the snmp component, serialized in the following order:
+
:*&lt;name_module&gt;
:*&lt;snmp_component_type&gt;
+
:*&lt;disabled&gt;
:*&lt;description&gt;
+
:*&lt;id_module_type&gt;
:*&lt;module_interval&gt;
 
:*&lt;max_value&gt;
 
:*&lt;min_value&gt;
 
 
:*&lt;id_module_group&gt;
 
:*&lt;id_module_group&gt;
:*&lt;max_timeout&gt;
 
:*&lt;history_data&gt;
 
 
:*&lt;min_warning&gt;
 
:*&lt;min_warning&gt;
 
:*&lt;max_warning&gt;
 
:*&lt;max_warning&gt;
Line 2,057: Line 1,970:
 
:*&lt;str_critical&gt;
 
:*&lt;str_critical&gt;
 
:*&lt;ff_threshold&gt;
 
:*&lt;ff_threshold&gt;
:*&lt;post_process&gt;
+
:*&lt;history_data&gt;
 +
:*&lt;ip_target&gt;
 +
:*&lt;module_port&gt;
 
:*&lt;snmp_version&gt;
 
:*&lt;snmp_version&gt;
 +
:*&lt;snmp_community&gt;
 
:*&lt;snmp_oid&gt;
 
:*&lt;snmp_oid&gt;
:*&lt;snmp_community&gt;
+
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;snmp3_priv_method [AES|DES]&gt;
 +
:*&lt;snmp3_priv_pass&gt;
 +
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 +
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 
:*&lt;snmp3_auth_user&gt;
 
:*&lt;snmp3_auth_user&gt;
 
:*&lt;snmp3_auth_pass&gt;
 
:*&lt;snmp3_auth_pass&gt;
:*&lt;module_port&gt;
 
:*&lt;snmp3_auth_pass&gt;
 
:*&lt;snmp3_privacy_method&gt;
 
:*&lt;snmp3_privacy_pass&gt;
 
:*&lt;snmp3_auth_method&gt;
 
:*&lt;snmp3_security_level&gt;
 
:*&lt;snmp_component_group&gt;
 
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
Line 2,075: Line 1,993:
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
 
=====Examples=====
 
=====Examples=====
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_snmp_component&id=example_snmp_component_name&other=16|SNMP%20component%20created%20by%20Api|300|30|10|3||1|10|20|str|21|30|str1|15|50.00|3|.1.3.6.1.2.1.2.2.1.8.2|public|example_auth_user|example_auth_pass|66|AES|example_priv_pass|MD5|authNoPriv|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
Example 1 (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw)
 
 
====set new_local_component====
 
  
Create a new local component.
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito&other=prueba|0|15|1|10|15||16|18||15|0|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP%20module%20from%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
Call syntax:
+
Example 2 (snmp v: 1)
*op=set (compulsory)
 
*op2=new_local_component (compulsory)
 
*id=&lt;local_component_name&gt; (compulsory) should be a local component name.
 
*other=&lt;serialized parameters&gt; (compulsory) are the configuration and data of the local component, serialized in the following order:
 
:*&lt;description&gt;
 
:*&lt;id_os&gt;
 
:*&lt;local_component_group&gt;
 
:*&lt;configuration_data&gt; This is the configuration block of the module.
 
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
 
:*&lt;each_ff&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 
  
=====Examples=====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_snmp_module&id=pepito1&other=prueba2|0|15|1|10|15||16|18||15|0|127.0.0.1|60|1|public|.1.3.6.1.2.1.1.1.0|180|0|0|0|0|SNMP module from API&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_local_component&id=example_local_component_name&other=local%20component%20created%20by%20Api~5~12~module_begin%0dmodule_name%20example_local_component_name%0dmodule_type%20generic_data%0dmodule_exec%20ps%20|%20grep%20pid%20|%20wc%20-l%0dmodule_interval%202%0dmodule_end&other_mode=url_encode_separator_~&apipass=1234&user=admin&pass=pandora
+
====set update_network_module====
  
====set create_alert_template====
+
It updates the network module.
  
Create a template of alert.
+
Call syntax:
  
Call sintax:
+
*op=set (required)
 +
*op2=update_network_module (required)
 +
*id=&lt;module_id&gt; (required). It should be a module id.
 +
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 +
:*&lt;id_agent&gt;
 +
:*&lt;disabled&gt;
 +
:*&lt;id_module_group&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;ip_target&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min&gt;
 +
:*&lt;max&gt;
 +
:*&lt;custom_id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
*op=set (compulsory)
+
=====Examples=====
*op2=create_alert_template (compulsory)
+
 
*id=&lt;template_name&gt; (compulsory) will be the template name.
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_network_module&id=3431&other=44|0|2|10|15||16|18||7|0|127.0.0.1|0||0|300|30.00|0|0|0|latency%20ping%20modified%20by%20the%20Api&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
*other=&lt;serialized parameters&gt; (compulsory) are the template configuration and data, serialized in the following order:
 
:*&lt;type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]&gt;
 
:*&lt;description&gt;
 
:*&lt;id_alert_action&gt;
 
:*&lt;field1&gt;
 
:*&lt;field2&gt;
 
:*&lt;field3&gt;
 
:*&lt;value&gt;
 
:*&lt;matches_value&gt;
 
:*&lt;max_value&gt;
 
:*&lt;min_value&gt;
 
:*&lt;time_threshold&gt;
 
:*&lt;max_alerts&gt;
 
:*&lt;min_alerts&gt;
 
:*&lt;time_from&gt;
 
:*&lt;time_to&gt;
 
:*&lt;monday&gt;
 
:*&lt;tuesday&gt;
 
:*&lt;wednesday&gt;
 
:*&lt;thursday&gt;
 
:*&lt;friday&gt;
 
:*&lt;saturday&gt;
 
:*&lt;sunday&gt;
 
:*&lt;recovery_notify&gt;
 
:*&lt;field2_recovery&gt;
 
:*&lt;field3_recovery&gt;
 
:*&lt;priority&gt;
 
:*&lt;id_group&gt;
 
  
=====Examples=====
+
====set update_plugin_module====
  
Example 1 (condition: regexp =~ /pp/, action: Mail to XXX, max_alert: 10, min_alert: 0, priority: WARNING, group: databases):
+
It updates the plugin module.
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_alert_template&id=pepito&other=regex|template%20based%20in%20regexp|1||||pp|1||||10|0|||||||||||||3&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
Call Syntax:
  
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):
+
*op=set (required)
 
+
*op2=update_plugin_module (required)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_alert_template&id=template_min_max&other=max_min|template%20based%20in%20range|NULL||||||10|5||||00:00:00|15:00:00|||||||||||4|2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
*id=&lt;module_id&gt; (required). It should be a module id.
 
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
====set update_alert_template====
+
:*&lt;id_agent&gt;
 
+
:*&lt;disabled&gt;
Update the template alert.
+
:*&lt;id_module_group&gt;
 
+
:*&lt;min_warning&gt;
Call sintax:
+
:*&lt;max_warning&gt;
 
+
:*&lt;str_warning&gt;
*op=set (compulsory)
+
:*&lt;min_critical&gt;
*op2=update_alert_template (compulsory)
+
:*&lt;max_critical&gt;
*id=&lt;id_template&gt; (compulsory) should be a template id.
+
:*&lt;str_critical&gt;
*other=&lt;serialized parameters&gt; (compulsory) are the template configuration and data, serialized in the following order:
+
:*&lt;ff_threshold&gt;
:*&lt;template_name&gt;
+
:*&lt;history_data&gt;
:*&lt;type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]&gt;
+
:*&lt;ip_target&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;description&gt;
:*&lt;id_alert_action&gt;
+
:*&lt;id_plugin&gt;
:*&lt;field1&gt;
+
:*&lt;plugin_user&gt;
:*&lt;field2&gt;
+
:*&lt;plugin_pass&gt;
:*&lt;field3&gt;
+
:*&lt;plugin_parameter&gt;
:*&lt;value&gt;
+
:*&lt;disabled_types_event&gt; (only in version 5 or later)
:*&lt;matches_value&gt;
+
:*&lt;macros&gt; (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:
:*&lt;max_value&gt;
+
** ''"macro"'': Macro name. Should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
:*&lt;min_value&gt;
+
**''"desc"'': Descriptive name of the macro.
:*&lt;time_threshold&gt;
+
**''"help"'': Macro description.
:*&lt;max_alerts&gt;
+
**''"value"'':Macro value.
:*&lt;min_alerts&gt;
+
=====Example=====
:*&lt;time_from&gt;
+
{
:*&lt;time_to&gt;
+
  "1": {
:*&lt;monday&gt;
+
    "macro": "_field1_",
:*&lt;tuesday&gt;
+
    "desc": "Target&#x20;IP",
:*&lt;wednesday&gt;
+
    "help": "",
:*&lt;thursday&gt;
+
    "value": "192.168.0.1"
:*&lt;friday&gt;
+
  },
:*&lt;saturday&gt;
+
  "2": {
:*&lt;sunday&gt;
+
    "macro": "_field2_",
:*&lt;recovery_notify&gt;
+
    "desc": "Port",
:*&lt;field2_recovery&gt;
+
    "help": "",
:*&lt;field3_recovery&gt;
+
    "value": "80"
:*&lt;priority&gt;
+
  }
:*&lt;id_group&gt;
+
}
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_alert_template&id=38&other=example_template_with_changed_name|onchange|changing%20from%20min_max%20to%20onchange||||||1||||5|1|||1|1|0|1|1|0|0|1|field%20recovery%20example%201|field%20recovery%20example%202|1|8&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_plugin_module&id=2343&other=44|0|2|0|0||0|0||0|0|127.0.0.1|0||0|300|0|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set delete_alert_template====
+
====set update_data_module====
  
Delete a alert template and delete the alerts that are using this template.
+
{{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.}}
  
Call sintax:
+
It updates the local module.
  
*op=set (compulsory)
+
Call Syntax:
*op2=delete_alert_template (compulsory)
 
*id=&lt;id_template&gt; (compulsory) should be a template id.
 
  
=====Examples=====
+
*op=set (required)
 
+
*op2=update_data_module (required)
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38&apipass=1234&user=admin&pass=pandora
+
*id=&lt;module_id&gt; (required). It should be the module id to be updated.
 
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
====set delete_module_template====
+
:*&lt;id_agent&gt;
 
+
:*&lt;disabled&gt;
Delete a module template.
+
:*&lt;id_module_group&gt;
 
+
:*&lt;min_warning&gt;
Call sintax:
+
:*&lt;max_warning&gt;
 
+
:*&lt;str_warning&gt;
*op=set (compulsory)
+
:*&lt;min_critical&gt;
*op2=delete_module_template (compulsory)
+
:*&lt;max_critical&gt;
*id=&lt;id_alert_template_module&gt; (compulsory) should be a alert_template_module id.
+
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;ip_target&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;ff_threshold&gt; (only in version 5.1 or later)
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;ff_timeout&gt; (only in version 5.1 or later)
 +
:*&lt;critical_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;warning_inverse&gt; (only in version 6.0SP1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module&id=23234&other=44|0|data%20module%20modified%20from%20API|6|0|0|50.00|300|10|15||16|18||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set delete_module_template_by_names====
+
====set update_data_module_policy====
  
Delete a module template.
+
It updates a data module in a policy and returns an id from the new module.
  
Call sintax:
+
Call Syntax:
 
+
*op=set (required)
*op=set (compulsory)
+
*op2=update_data_module (required)
*op2=delete_module_template_by_names (compulsory)
+
*id=&lt;id_agent_module&gt; (required). Id of the target policy module.
*id=&lt;agent name&gt; (compulsory)
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
*id2=&lt;alert template name&gt; (compulsory)
+
:*&lt;id_policy_module&gt;
*other=&lt;serialized parameter&gt; (compulsory), are the following in this order:
+
:*&lt;description&gt;
:*&lt;module name&gt; (compulsory)
+
:*&lt;id_module_group&gt;
 
+
:*&lt;min&gt;
=====Examples=====
+
:*&lt;max&gt;
 
+
:*&lt;post_process&gt;
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
+
:*&lt;module_interval&gt;
 
+
:*&lt;min_warning&gt;
====set stop_downtime====
+
:*&lt;max_warning&gt;
 
+
:*&lt;min_critical&gt;
Stop a downtime.
+
:*&lt;max_critical&gt;
 
+
:*&lt;str_critical&gt;
Call sintax:
+
:*&lt;history_data&gt;
 
+
:*&lt;configuration_data&gt;
*op=set (compulsory)
+
:*&lt;disabled_types_event&gt; (only in version 5 or later)
*op2=stop_downtime (compulsory)
+
:*&lt;module_macros&gt; (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>".
*id=&lt;id_downtime&gt; (compulsory) should be a id downtime.
 
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_data_module_policy&id=1&other=10~data%20module%20updated%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_</nowiki>
  
====set new_user====
+
====set update_SNMP_module====
  
Create a new user into Pandora.
+
It updates an SNMP module.
  
 
Call Syntax:
 
Call Syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=new_user (compulsory)
+
*op2=update_snmp_module (required)
*id=&lt;user_name&gt; (compulsory) will be an user name.
+
*id=&lt;module_id&gt; (required). It should be a module id.
*other=&lt;serialized parameters&gt; (compulsory) are the user configuration and data, serialized in the following order:
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
:*&lt;fullname&gt;
+
:*&lt;id_agent&gt;
:*&lt;firstname&gt;
+
:*&lt;disabled&gt;
:*&lt;lastname&gt;
+
:*&lt;id_module_group&gt;
:*&lt;middlename&gt;
+
:*&lt;min_warning&gt;
:*&lt;password&gt;
+
:*&lt;max_warning&gt;
:*&lt;email&gt;
+
:*&lt;str_warning&gt;
:*&lt;phone&gt;
+
:*&lt;min_critical&gt;
:*&lt;languages&gt;
+
:*&lt;max_critical&gt;
:*&lt;comments&gt;
+
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;ip_target&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_version&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;snmp3_priv_method [AES|DES]&gt;
 +
:*&lt;snmp3_priv_pass&gt;
 +
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 +
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 +
:*&lt;snmp3_auth_user&gt;
 +
:*&lt;snmp3_auth_pass&gt;
 +
:*&lt;disabled_types_event&gt; (only in version 5 or later)
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel|de%20dios|matias|kkk|pandora|[email protected].com|666|es|descripcion%20y%20esas%20cosas&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
Example (snmp v: 3, snmp3_priv_method: AES, snmp3_priv_pass: example_priv_passw, snmp3_sec_level: authNoPriv, snmp3_auth_method:MD5, snmp3_auth_user: pepito_user, snmp3_auth_pass: example_priv_passw)
 +
 
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_snmp_module&id=33432&other=44|0|6|20|25||26|30||15|1|127.0.0.1|60|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====Set update_user====
+
====set apply_policy====
 +
It applies the policy, once it has gone through id, in one or several agents.
 +
 
 +
Call syntax:
 +
*op=set (required)
 +
*op2=apply_policy (required)
 +
*id=&lt;id_policy&gt; (required)
 +
*id2=&lt;id_agent&gt; (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=&lt;serialized parameters&gt;
 +
:*&lt;name_agent (Integer)&gt;. It indicates whether the agent will be sent by Id (0), by name (1) or by alias (2).
 +
:*&lt;server_id&gt; (required when using Metaconsole). Id of the server in which the policy will be applied.
 +
 
 +
=====Examples=====
  
Update a user selected by the id into the id parameter.
+
<nowiki>http://192.168.70.102/pandora_console/include/api.php?op=set&op2=apply_policy&id=22&id2=3e&other=0|1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
Call Syntax:
+
====set apply_all_policies====
*op=set (compulsory)
 
*op2=update_user (compulsory)
 
*id=&lt;user_name&gt; (compulsory) should be an user name.
 
*other=&lt;serialized parameters&gt; (compulsory) are the module configuration and data, serialized in the following order:
 
:*&lt;fullname&gt;
 
:*&lt;firstname&gt;
 
:*&lt;lastname&gt;
 
:*&lt;middlename&gt;
 
:*&lt;password&gt;
 
:*&lt;email&gt;
 
:*&lt;phone&gt;
 
:*&lt;languages&gt;
 
:*&lt;comments&gt;
 
:*&lt;is_admin&gt;
 
:*&lt;block_size&gt;
 
:*&lt;flash_chart&gt;
 
  
=====Examples=====
+
It applies all policies within Pandora FMS.
 
 
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_user&id=example_user_name&other=example_fullname||example_lastname||example_new_passwd|example_email||example_language|example%20comment|1|30|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 
 
 
====Set delete_user====
 
 
 
Delete a selected user.
 
  
 
Call syntax:
 
Call syntax:
 
+
*op=set (required)
*op=set (compulsory)
+
*op2=apply_all_policies (required)
*op2=delete_user (compulsory)
 
*id=&lt;nombre_usuario&gt; (compulsory) should be an user name.
 
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=apply_all_policies&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set enable_disable_user====
+
====set add_network_module_policy====
  
Enable a disabled user.
+
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 (compulsory)
+
*op2=add_network_module_policy (required)
*op2=enable_disable_user (compulsory)
+
*id=&lt;id_policy&gt; (required). It should be a policy Id.
*id=&lt;user_name&gt; (compulsory) should be an user name.
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 
+
:*&lt;id_module_type&gt;
=====Examples=====
+
:*&lt;description&gt;
 
+
:*&lt;id_module_group&gt;
Example 1 (Disable user 'example_name')  
+
:*&lt;min_value&gt;
 
+
:*&lt;max_value&gt;
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
:*&lt;post_process&gt;
 
+
:*&lt;module_interval&gt;
Example 2 (Enable user 'example_name')
+
:*&lt;min_warning&gt;
 
+
:*&lt;max_warning&gt;
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
:*&lt;str_warning&gt;
 
+
:*&lt;min_critical&gt;
====set create_group====
+
:*&lt;max_critical&gt;
 
+
:*&lt;str_critical&gt;
Create a group.
+
:*&lt;history_data&gt;
 
+
:*&lt;ff_threshold&gt;
Call syntax:
+
:*&lt;disabled&gt;
 
+
:*&lt;module_port&gt;
*op=set (compulsory)
+
:*&lt;snmp_community&gt;
*op2=create_group (compulsory)
+
:*&lt;snmp_oid&gt;
*id=&lt;group_name&gt; (compulsory) should be a group name.
+
:*&lt;custom_id&gt;
*other=&lt;serialized_parameters&gt; (compulsory). Are the following in this order:
+
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
:*&lt;icon name&gt;  
+
:*&lt;module_macros&gt; (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>".
:*&lt;parent group id&gt; (optional)
+
:*&lt;each_ff&gt; (only in version 5.1 or later)
:*&lt;description&gt; (optional)
+
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
:*&lt;propagate acl&gt; (optional)
+
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
:*&lt;disable alerts&gt; (optional)
+
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
:*&lt;custom id&gt; (optional)
+
:*&lt;ff_type&gt; (only in version 733 or later)
:*&lt;contact info&gt; (optional)
 
:*&lt;other info&gt; (optional)
 
  
 
=====Examples=====
 
=====Examples=====
  
Example 1 (with parent group: Servers)
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_network_module_policy&id=1&other=network_module_policy_example_name|6|network%20module%20created%20by%20Api|2|0|0|50.00|180|10|20||21|35||1|15|0|66|||0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
   
 
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name&other=applications|2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 
 
Example 2 (without parent group)
 
 
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name2&other=computer|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
 
  
====set update_group====
+
====set add_plugin_module_policy====
  
Update a group.
+
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 (compulsory)
+
*op2=add_plugin_module_policy (required)
*op2=update_group (compulsory)
+
*id=&lt;id_policy&gt; (required). It should be a policy Id.
*id=&lt;group_id&gt; (compulsory) should be a group id
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
*other=&lt;serialized_parameters&gt; (compulsory). Are the following in this order:
+
:*&lt;name_module&gt;
:*&lt;group name&gt;  
+
:*&lt;disabled&gt;
:*&lt;icon name&gt;  
+
:*&lt;id_module_type&gt;
:*&lt;parent group id&gt;
+
:*&lt;id_module_group&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 
:*&lt;description&gt;
 
:*&lt;description&gt;
:*&lt;propagate acl&gt;
+
:*&lt;id_plugin&gt;
:*&lt;disable alerts&gt;
+
:*&lt;plugin_user&gt;
:*&lt;custom id&gt;
+
:*&lt;plugin_pass&gt;
:*&lt;contact info&gt;  
+
:*&lt;plugin_parameter&gt;
:*&lt;other info&gt;
+
:*&lt;enable_unknown_events&gt; (only in version 5)
 
+
:*&lt;macros&gt; (only in version 5 or later). It should be a base64 encoded JSON document. The content should be an object made up by objects with the following properties:
 +
** ''"macro"'': Macro name. It should be ''_field1_'', ''_field2_'', ..., ''_fieldN_''.
 +
**''"desc"'': Descriptive macro name.
 +
**''"help"'': Macro description.
 +
**''"value"'':Macro value.
 
=====Example=====
 
=====Example=====
 +
{
 +
  "1": {
 +
    "macro": "_field1_",
 +
    "desc": "Target&#x20;IP",
 +
    "help": "",
 +
    "value": "192.168.0.1"
 +
  },
 +
  "2": {
 +
    "macro": "_field2_",
 +
    "desc": "Port",
 +
    "help": "",
 +
    "value": "80"
 +
  }
 +
}
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;each_ff&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1 or later)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1 or later)
 +
:*&lt;ff_type&gt; (only in version 733 or later)
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_group&id=example_group_id&other=New%20Name|application|2|new%20description|1|0|custom%20id||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
=====Examples=====
 
 
====set delete_group====
 
>= 6
 
 
 
Delete a group.
 
  
Call syntax:
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_plugin_module_policy&id=1&other=example%20plugin%20module%20name|0|1|2|0|0||0|0||15|0|66|||300|50.00|0|0|0|plugin%20module%20from%20api|2|admin|pass|-p%20max&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
*op=set (compulsory)
 
*op2=delete_group (compulsory)
 
*id=&lt;group_id&gt; (compulsory) should be a group id
 
  
=====Example=====
+
====set add_data_module_policy====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora
+
It adds a local module in the policy which has gone through id in the parameter.
  
====Set add_user_profile====
+
Call syntax:
 +
*op=set (required)
 +
*op2=add_data_module_policy (required)
 +
*id=&lt;id_policy&gt; (required). It should be a policy Id.
 +
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 +
:*&lt;name_module&gt;
 +
:*&lt;id_module_type&gt;
 +
:*&lt;description&gt;
 +
:*&lt;id_module_group&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;configuration_data&gt;. This is the definition block of the agent that will be entered in the config file of the policy agent.
 +
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 +
:*&lt;module_macros&gt; (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>".
 +
:*&lt;ff_threshold&gt; (only in version 5.1 )
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_timeout&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
Add a profile into user.
+
=====Examples=====
  
Call syntax:
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_data_module_policy&id=1&other=data_module_policy_example_name~2~data%20module%20created%20by%20Api~2~0~0~50.00~10~20~180~~21~35~~1~module_begin%0dmodule_name%20pandora_process%0dmodule_type%20generic_data%0dmodule_exec%20ps%20aux%20|%20grep%20pandora%20|%20wc%20-l%0dmodule_end&other_mode=url_encode_separator_~&apipass=1234&user=admin&pass=pandora</nowiki>
  
*op=set (compulsory)
+
====set add_SNMP_module_policy====
*op2=add_user_profile (compulsory)
+
 
*id=&lt;user_name&gt; (compulsory) should be an user name.
+
It adds a SNMP module in the policy which has gone through id in the parameter.
*other=&lt;serialized parameters&gt; (compulsory) are the group configuration and data and the profile, serialized in the following order:  
+
 
:*&lt;group&gt;
+
Call syntax:
:*&lt;profile&gt;
+
*op=set (required)
 +
*op2=add_snmp_module_policy (required)
 +
*id=&lt;id_policy&gt; (required). It should be a policy Id.
 +
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 +
:*&lt;name_module&gt;
 +
:*&lt;disabled&gt;
 +
:*&lt;id_module_type&gt;
 +
:*&lt;id_module_group&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp_version&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;custom_id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;snmp3_priv_method [AES|DES]&gt;
 +
:*&lt;snmp3_priv_pass&gt;
 +
:*&lt;snmp3_sec_level [authNoPriv|authPriv|noAuthNoPriv]&gt;
 +
:*&lt;snmp3_auth_method [MD5|SHA]&gt;
 +
:*&lt;snmp3_auth_user&gt;
 +
:*&lt;snmp3_auth_pass&gt;
 +
:*&lt;enable_unknown_events&gt; (only in version 5 or later)
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_snmp_module_policy&id=1&other=example%20SNMP%20module%20name|0|15|2|0|0||0|0||15|1|66|3|public|.1.3.6.1.2.1.1.1.0|180|50.00|10|60|0|SNMP%20module%20modified%20by%20API|AES|example_priv_passw|authNoPriv|MD5|pepito_user|example_auth_passw&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set delete_user_profile====
+
====set add_agent_policy_by_id====
  
Deattach a profile of user.
+
It adds an agent to a policy using the agent ID
  
 
Call syntax:
 
Call syntax:
 +
*op=set (required)
 +
*op2=add_agent_policy_by_id (mandatory)
 +
*id=&lt;id_policy&gt; (required). It must be a policy Id.
 +
*other=&lt;serialized parameters&gt; (required). These are agent configuration and data, serialized in the following order:
 +
:*&lt;id_agent&gt;
 +
:*&lt;id_node&gt; (required when using the Metaconsole). ID of the node the agent you wish to add to the policy belongs to.
  
*op=set (compulsory)
+
=====Examples=====
*op2=delete_user_profile (compulsory)
 
*id=&lt;user_name&gt; (compulsory) should be an user name.
 
*other=&lt;serialized parameters&gt; (compulsory) are the group configuration, data and profile, serialized in the following order:
 
:*&lt;group&gt;
 
:*&lt;profile&gt;
 
  
=====Examples=====
+
* Node:
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_id&id=2&other=1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
* Metaconsole:
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_id&id=2&other=1%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set new_incident====
+
====set add_agent_policy_by_name====
  
Create a new incident.
+
It adds an agent to a policy using the agent name.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=new_incident (compulsory)
+
*op2=add_agent_policy_by_name (required)
*other=&lt;serialized parameters&gt; (compulsory) are the incident configuration and data, serialized in the following order:
+
*id=&lt;id_policy&gt; (required). It must be a policy Id.
:*&lt;title&gt;
+
*other=&lt;serialized parameters&gt; (required). These are agent configuration and data, serialized in the following order:
:*&lt;description&gt;
+
:*&lt;agent_name&gt;
:*&lt;origin&gt;
 
:*&lt;priority&gt;
 
:*&lt;status&gt;
 
:*&lt;group&gt;
 
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_incident&other=titulo|descripcion%20texto|Logfiles|2|10|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_agent_policy_by_name&id=4&other=e76774025b24057cc71df514f27027c43484c3af766ed40f259a86a4fd568f9d&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
====Set new_note_incident====
+
====set remove_agent_from_policy_by_id====
  
Add a note into a incident.
+
It deletes an agent from a policy using the agent ID.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=new_note_incident (compulsory)
+
*op2=remove_agent_from_policy_by_id (required)
*id=&lt;id_incident&gt; (compulsory )the incident id.
+
*id=&lt;id_política&gt; (required). It must be a policy Id.
*id2=&lt;user_name&gt; (compulsory) the user name.
+
*other=&lt;serialized parameters&gt; (required). These are the agent’s configuration and data, serialized in the following order:
*other=&lt;note&gt; (compulsory) is the note codified in url encode.
+
:*&lt;id_agent&gt;
 +
:*&lt;id_node&gt; (required when using the Metaconsole). ID of the node the agent you wish to remove from the policy belongs to.  
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_note_incident&id=5&id2=miguel&other=una%20nota%20para%20la%20incidencia&apipass=1234&user=admin&pass=pandora
+
* Node:
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_id&id=2&other=2&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set validate_all_alerts====
+
* Metaconsole:
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_id&id=4&other=1%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====set remove_agent_from_policy_by_name====
  
Validate all alerts.
+
It deletes an agent from a policy using the agent name.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=validate_all_alerts (compulsory)
+
*op2=remove_agent_from_policy_by_name (required)
 +
*id=&lt;id_policy&gt; (required). It must be a policy Id.
 +
*other=&lt;serialized parameters&gt; (required). These are the agent’s configuration and data, serialized in the following order:
 +
:*&lt;agent_name&gt;
  
 
=====Examples=====
 
=====Examples=====
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts&apipass=1234&user=admin&pass=pandora
 
  
====set validate_all_policy_alerts====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_agent_from_policy_by_name&id=4&other=e76774025b24057cc71df514f27027c43484c3af766ed40f259a86a4fd568f9d&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====set new_network_component====
  
Validate the alerts created from a policy.
+
It creates a new network component.
  
 
Call syntax:
 
Call syntax:
*op=set (compulsory)
+
*op=set (required)
*op2=validate_all_policy_alerts (compulsory)
+
*op2=new_network_component (required)
 +
*id=&lt;network_component_name&gt; (required). It should be the network component name.
 +
*other=&lt;serialized parameters&gt; (required). They are agent configuration and data of the network component, serialized in the following order:
 +
:*&lt;network_component_type&gt;
 +
:*&lt;description&gt;
 +
:*&lt;module_interval&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;id_module_group&gt;
 +
:*&lt;max_timeout&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;network_component_group&gt;
 +
:*&lt;enable_unknown_events&gt; (only in version 5)
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
 
=====Examples=====
 
=====Examples=====
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts&apipass=1234&user=admin&pass=pandora
 
  
====set event_validate_filter====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_network_component&id=example_network_component_name&other=7|network%20component%20created%20by%20Api|300|30|10|public|3||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
Validate all events that pass the filter pass as parameters.
+
====set new_plugin_component====
  
{{metaconsole}}
+
It creates a new plugin component.
  
 
Call syntax:
 
Call syntax:
 
+
*op=set (required)
*op=set (compulsory)
+
*op2=new_plugin_component (required)
*op2=event_validate_filter (compulsory)
+
*id=&lt;plugin_component_name&gt; (required). It should be the plugin component name.
*other_mode=url_encode_separator_|(optional)
+
*other=&lt;serialized parameters&gt; (required). They are agent configuration and data of the plugin component, serialized in the following order:
*other=&lt;serialized_parameters&gt; (optional). Are the following in this order:
+
:*&lt;plugin_component_type&gt;
:*&lt;separator&gt;
+
:*&lt;description&gt;
:*&lt;criticity&gt; De 0 a 4
+
:*&lt;module_interval&gt;
:*&lt;agent name&gt;
+
:*&lt;max_value&gt;
:*&lt;module name&gt;
+
:*&lt;min_value&gt;
:*&lt;alert template name&gt;
+
:*&lt;module_port&gt;
:*&lt;user&gt;
+
:*&lt;id_module_group&gt;
:*&lt; numeric interval minimum level&gt; en unix timestamp
+
:*&lt;id_plugin&gt;
:*&lt; numeric interval maximum level&gt; en unix timestamp
+
:*&lt;max_timeout&gt;
 +
:*&lt;history_data&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;plugin_component_group&gt;
 +
:*&lt;enable_unknown_events&gt; (only in version 5)
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_plugin_component&id=example_plugin_component_name&other=2|plugin%20component%20created%20by%20Api|300|30|10|66|3|2|example_user|example_pass|-p%20max||1|10|20|str|21|30|str1|10|50.00|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set event_validate_filter_pro====
+
====set new_snmp_component====
  
It is the similar to previous call.
+
It creates a new SNMP component.
 
 
{{metaconsole}}
 
  
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory))
+
*op=set (required)
*op2=event_validate_filter_pro (compulsory)
+
*op2=new_snmp_component (required)
*other_mode=url_encode_separator_| (optional)
+
*id=&lt;snmp_component_name&gt; (required). It should be the SNMP component name.
*other=&lt;serialized parameters&gt; (optional), are the following in this order:
+
*other=&lt;serialized parameters&gt; (required). These are the configuration and data of the snmp component, serialized in the following order:
:*&lt;separator&gt;
+
:*&lt;snmp_component_type&gt;
:*&lt;criticity&gt; From 0 to 4
+
:*&lt;description&gt;
:*&lt;id agent&gt;
+
:*&lt;module_interval&gt;
:*&lt;id module&gt;
+
:*&lt;max_value&gt;
:*&lt;id agent module alert&gt;
+
:*&lt;min_value&gt;
:*&lt;user&gt;
+
:*&lt;id_module_group&gt;
:*&lt;numeric interval minimum level&gt; in unix timestamp
+
:*&lt;max_timeout&gt;
:*&lt;numeric interval maximum level&gt; in unix timestamp
+
:*&lt;history_data&gt;
 +
:*&lt;min_warning&gt;
 +
:*&lt;max_warning&gt;
 +
:*&lt;str_warning&gt;
 +
:*&lt;min_critical&gt;
 +
:*&lt;max_critical&gt;
 +
:*&lt;str_critical&gt;
 +
:*&lt;ff_threshold&gt;
 +
:*&lt;post_process&gt;
 +
:*&lt;snmp_version&gt;
 +
:*&lt;snmp_oid&gt;
 +
:*&lt;snmp_community&gt;
 +
:*&lt;snmp3_auth_user&gt;
 +
:*&lt;snmp3_auth_pass&gt;
 +
:*&lt;module_port&gt;
 +
:*&lt;snmp3_privacy_method&gt;
 +
:*&lt;snmp3_privacy_pass&gt;
 +
:*&lt;snmp3_auth_method&gt;
 +
:*&lt;snmp3_security_level&gt;
 +
:*&lt;snmp_component_group&gt;
 +
:*&lt;enable_unknown_events&gt; (only in version 5)
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter_pro&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_snmp_component&id=example_snmp_component_name&other=16|SNMP%20component%20created%20by%20Api|300|30|10|3||1|10|20|str|21|30|str1|15|50.00|3|.1.3.6.1.2.1.2.2.1.8.2|public|example_auth_user|example_auth_pass|66|AES|example_priv_pass|MD5|authNoPriv|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set new_alert_template====
+
====set new_local_component====
  
Apply a new alert from a template and module pass as id agent and name of module.
+
It creates a new local component.
  
 
Call syntax:
 
Call syntax:
 
+
*op=set (required)
*op=set (ob)
+
*op2=new_local_component (required)
*op2=new_alert_template (compulsory)
+
*id=&lt;local_component_name&gt; (required). It should be a local component name.
*id=&lt;agent name&gt; (compulsory)
+
*other=&lt;serialized parameters&gt; (required). They are configuration and data of the local component, serialized in the following order:
*id2=&lt;alert template name&gt; (compulsory)
+
:*&lt;description&gt;
*other_mode=url_encode_separator_| (optional)
+
:*&lt;id_os&gt;
*other=&lt;serialized parameter&gt; (compulsory), are the following in this order:
+
:*&lt;local_component_group&gt;
:*&lt;module name&gt; (compulsory)
+
:*&lt;configuration_data&gt;. This is the module configuration block.
 +
:*&lt;enable_unknown_events&gt; (only in version 5)
 +
:*&lt;ff_threshold&gt; (only in version 5.1)
 +
:*&lt;each_ff&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_normal&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_warning&gt; (only in version 5.1)
 +
:*&lt;ff_threshold_critical&gt; (only in version 5.1)
 +
:*&lt;ff_timeout&gt; (only in version 5.1)
 +
:*&lt;ff_type&gt; (only in version 734)
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_alert_template&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_local_component&id=example_local_component_name&other=local%20component%20created%20by%20Api~5~12~module_begin%0dmodule_name%20example_local_component_name%0dmodule_type%20generic_data%0dmodule_exec%20ps%20|%20grep%20pid%20|%20wc%20-l%0dmodule_interval%202%0dmodule_end&other_mode=url_encode_separator_~&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set alert_actions====
+
====set create_alert_template====
  
Add actions into a alert.
+
It creates an alert template.
 
 
Call syntax:
 
*op=set (compulsory)
 
*op2=alert_actions (compulsory)
 
*id=&lt;agent name&gt; (compulsory)
 
*id2=&lt;alert template name&gt; (compulsory)
 
*other_mode=url_encode_separator_| (optional)
 
*other=&lt;serialized parameters&gt; (compulsory), are the following in this order:
 
:*&lt;module name&gt; (compulsory)
 
:*&lt;action name&gt; (compulsory)
 
:*&lt;fires min &gt; (optional)
 
:*&lt;fires max &gt; (optional)
 
 
 
=====Examples=====
 
 
 
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test&apipass=1234&user=admin&pass=pandora
 
 
 
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test|1|3&apipass=1234&user=admin&pass=pandora
 
 
 
====set new_module====
 
Create a new module.
 
  
 
Call Syntax:
 
Call Syntax:
  
*op=set (compulsory)
+
*op=set (required)
*op2=new_module (compulsory)
+
*op2=create_alert_template (required)
*id=&lt;agent_name&gt; (compulsory)
+
*id=&lt;template_name&gt; (required). It is the template name.
*id2=&lt;new module name&gt; (compulsory)
+
*other=&lt;serialized parameters&gt; (required). They are template configuration and data, serialized in the following order:
*other_mode=url_encode_separator_| (optional)
+
:*&lt;type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]&gt;
*other=&lt;serialized parameters&gt; (compulsory), are the following in this order:
+
:*&lt;description&gt;
:*&lt;network module kind &gt; (compulsory)
+
:*&lt;id_alert_action&gt;
:*&lt;action name&gt; (compulsory)
+
:*&lt;field1&gt;
:*&lt;ip o url &gt; (compulsory)
+
:*&lt;field2&gt;
:*&lt;port &gt; (optional)
+
:*&lt;field3&gt;
:*&lt;description &gt; (optional)
+
:*&lt;value&gt;
:*&lt;min &gt; (optional)
+
:*&lt;matches_value&gt;
:*&lt;max &gt; (optional)
+
:*&lt;max_value&gt;
:*&lt;post process &gt; (optional)
+
:*&lt;min_value&gt;
:*&lt;module interval &gt; (optional)
+
:*&lt;time_threshold&gt;
:*&lt;min warning &gt; (optional)
+
:*&lt;max_alerts&gt;
:*&lt;max warning &gt; (optional)
+
:*&lt;min_alerts&gt;
:*&lt;min critical &gt; (optional)
+
:*&lt;time_from&gt;
:*&lt;max critical &gt; (optional)
+
:*&lt;time_to&gt;
:*&lt;history data &gt; (optional)
+
:*&lt;monday&gt;
:*&lt;enable_unknown_events&gt; (only in version 5)
+
:*&lt;tuesday&gt;
 +
:*&lt;wednesday&gt;
 +
:*&lt;thursday&gt;
 +
:*&lt;friday&gt;
 +
:*&lt;saturday&gt;
 +
:*&lt;sunday&gt;
 +
:*&lt;recovery_notify&gt;
 +
:*&lt;field2_recovery&gt;
 +
:*&lt;field3_recovery&gt;
 +
:*&lt;priority&gt;
 +
:*&lt;id_group&gt;
  
 
=====Examples=====
 
=====Examples=====
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_module&id=miguel-portatil&id2=juanito&other_mode=url_encode_separator_|&other=remote_tcp_string|localhost|33|descripcion%20larga&apipass=1234&user=admin&pass=pandora
+
Example 1 (condition: regexp =~ /pp/, action: Mail to XXX, max_alert: 10, min_alert: 0, priority: WARNING, group: databases):
  
====set delete_module====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_alert_template&id=pepito&other=regex|template%20based%20in%20regexp|1||||pp|1||||10|0|||||||||||||3&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
Delete a module.
 
  
Call syntax:
+
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):
  
*op=set (compulsory)
+
<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|NULL||||||10|5||||00:00:00|15:00:00|||||||||||4|2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
*op2=delete_module (compulsory)
 
*id=&lt;agent name&gt; (compulsory)
 
*id2=&lt;module name&gt; (compulsory)
 
*other=simulate (optional)
 
  
=====Examples=====
+
====set update_alert_template====
  
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
+
It updates the template alert.
  
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
+
Call Syntax:
  
====set enable_alert====
+
*op=set (required)
Enable a alert of a agent.
+
*op2=update_alert_template (required)
 
+
*id=&lt;id_template&gt; (required). It should be a template id.
Call syntax
+
*other=&lt;serialized parameters&gt; (required). They are template configuration and data, serialized in the following order:
 
+
:*&lt;template_name&gt;
*op=set (mandatory)
+
:*&lt;type [regex|max_min|max|min|equal|not_equal|warning|critical|onchange|unknown|always]&gt;
*op2=enable_alert
+
:*&lt;description&gt;
*id=&lt;Agent name&gt; (mandatory)
+
:*&lt;id_alert_action&gt;
*id2=&lt;Module name&gt; (mandatory)
+
:*&lt;field1&gt;
*other: Alert template name (p.e: Warning event) (mandatory)
+
:*&lt;field2&gt;
 +
:*&lt;field3&gt;
 +
:*&lt;value&gt;
 +
:*&lt;matches_value&gt;
 +
:*&lt;max_value&gt;
 +
:*&lt;min_value&gt;
 +
:*&lt;time_threshold&gt;
 +
:*&lt;max_alerts&gt;
 +
:*&lt;min_alerts&gt;
 +
:*&lt;time_from&gt;
 +
:*&lt;time_to&gt;
 +
:*&lt;monday&gt;
 +
:*&lt;tuesday&gt;
 +
:*&lt;wednesday&gt;
 +
:*&lt;thursday&gt;
 +
:*&lt;friday&gt;
 +
:*&lt;saturday&gt;
 +
:*&lt;sunday&gt;
 +
:*&lt;recovery_notify&gt;
 +
:*&lt;field2_recovery&gt;
 +
:*&lt;field3_recovery&gt;
 +
:*&lt;priority&gt;
 +
:*&lt;id_group&gt;
  
 +
=====Examples=====
  
===== Examples =====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_alert_template&id=38&other=example_template_with_changed_name|onchange|changing%20from%20min_max%20to%20onchange||||||1||||5|1|||1|1|0|1|1|0|0|1|field%20recovery%20example%201|field%20recovery%20example%202|1|8&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora
+
====set delete_alert_template====
  
====set enable_alert_alias====
+
It deletes a alert template and deletes all the alerts it defines.
  
Enable alert of a agent by alias.
+
Call Syntax:
  
Call syntax:
+
*op=set (required)
 +
*op2=delete_alert_template (required)
 +
*id=&lt;id_template&gt; (required). It should be a template id.
  
 +
=====Examples=====
  
*op=set (mandatory)
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_alert_template&id=38&apipass=1234&user=admin&pass=pandora</nowiki>
*op2=enable_alert_alias
 
*id=&lt;Agent alias&gt; (mandatory)
 
*id2=&lt;Module name&gt; (mandatory)
 
*other: Alert template name (p.e: Warning event) (mandatory)
 
  
 +
====set delete_module_template====
  
===== Examples =====
+
It deletes a module template.
  
http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert_alias&id=nova&id2=CPU%20Load&other=critical%20condition&apipass=1234&user=admin&pass=pandora
+
Call Syntax:
  
====set disable_alert====
+
*op=set (required)
 +
*op2=delete_module_template (required)
 +
*id=&lt;id_alert_template_module&gt; (required). It should be an alert_template_module id.
  
Disable a alert of a agent.
+
=====Examples=====
  
Call syntax:
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module_template&id=38&apipass=1234&user=admin&pass=pandora</nowiki>
  
 +
====set delete_module_template_by_names====
  
*op=set (mandatory)
+
It deletes a module template.
*op2=disable_alert
 
*id=&lt;Agent name&gt; (mandatory)
 
*id2=&lt;Module name&gt; (mandatory)
 
*other: Alert template name (p.e: Warning event) (mandatory)
 
  
 +
Call Syntax:
  
===== Examples =====
+
*op=set (required)
 +
*op2=delete_module_template_by_names (required)
 +
*id=&lt;agent name&gt; (required)
 +
*id2=&lt;alert template name&gt; (required)
 +
*other=&lt;serialized parameter&gt; (required). They are the following in this order:
 +
:*&lt;module name&gt; (required)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora
+
=====Examples=====
  
====set disable_alert_alias====
+
<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>
  
Disable a alert of a agent.
+
====set stop_downtime====
  
Call syntax:
+
It stops a downtime.
  
 +
Call Syntax:
  
*op=set (mandatory)
+
*op=set (required)
*op2=disable_alert_alias
+
*op2=stop_downtime (required)
*id=&lt;Agent alias&gt; (mandatory)
+
*id=&lt;id_downtime&gt; (required). It should be an id downtime.
*id2=&lt;Module name&gt; (mandatory)
 
*other: Alert template name (p.e: Warning event) (mandatory)
 
  
 +
=====Examples=====
  
===== Examples =====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=stop_downtime&id=1&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert_alias&id=nova&id2=CPU%20Load&other=critical%20condition&apipass=1234&user=admin&pass=pandora
+
====set new_user====
  
====set enable_module_alerts====
+
It creates a new user in Pandora FMS.
  
Equal to the enable_alert api call.
+
Call Syntax:
 +
*op=set (required)
 +
*op2=new_user (required)
 +
*id=&lt;user_name&gt; (required). It is an user name.
 +
*other=&lt;serialized parameters&gt; (required). They are user configuration and data, serialized in the following order:
 +
:*&lt;fullname&gt;
 +
:*&lt;firstname&gt;
 +
:*&lt;lastname&gt;
 +
:*&lt;middlename&gt;
 +
:*&lt;password&gt;
 +
:*&lt;email&gt;
 +
:*&lt;phone&gt;
 +
:*&lt;languages&gt;
 +
:*&lt;comments&gt;
 +
:*&lt;time_autorefresh&gt;
 +
:*&lt;default_event_filter&gt;
 +
:*&lt;section&gt;
 +
:*&lt;session_time&gt; (-1 to establish the session as permanent)
  
Call syntax:
+
=====Examples=====
  
*op=set (obligatorio)
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_user&id=md&other=miguel|de%20dios|matias|kkk|pandora|[email protected]|666|es|descripcion%20y%20esas%20cosas&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
*op2=enable_module_alerts
 
*id=&lt;Nombre del agente&gt; (obligatorio)
 
*id2=&lt;Nombre del modulo&gt; (obligatorio)
 
  
 +
====Set update_user====
  
===== Examples =====
+
It updates a user selected by the id in the id parameter.
  
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora
+
Call Syntax:
 
+
*op=set (required)
====set disable_module_alerts====
+
*op2=update_user (required)
 
+
*id=&lt;user_name&gt; (required). It should be a user name.
Equal to the call api disable_alert.
+
*other=&lt;serialized parameters&gt; (required). They are module configuration and data, serialized in the following order:
 
+
:*&lt;fullname&gt;
Call syntax:
+
:*&lt;firstname&gt;
 +
:*&lt;lastname&gt;
 +
:*&lt;middlename&gt;
 +
:*&lt;password&gt;
 +
:*&lt;email&gt;
 +
:*&lt;phone&gt;
 +
:*&lt;languages&gt;
 +
:*&lt;comments&gt;
 +
:*&lt;is_admin&gt;
 +
:*&lt;block_size&gt;
 +
:*&lt;flash_chart&gt;
  
*op=set (obligatorio)
+
=====Examples=====
*op2=disable_module_alerts
 
*id=&lt;Nombre del agente&gt; (obligatorio)
 
*id2=&lt;Nombre del modulo&gt; (obligatorio)
 
  
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_user&id=example_user_name&other=example_fullname||example_lastname||example_new_passwd|example_email||example_language|example%20comment|1|30|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
===== Examples =====
+
====Set delete_user====
  
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module_alerts&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora
+
It deletes a selected user.
  
====set enable_module====
+
Call syntax:
  
Enable the module.
+
*op=set (required)
 +
*op2=delete_user (required)
 +
*id=&lt;nombre_usuario&gt; (required). It should be a username.
  
Call syntax
+
=====Examples=====
  
*op=set (mandatory)
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user&id=md&apipass=1234&user=admin&pass=pandora</nowiki>
*op2=enable_module
 
*id=&lt;Agent name&gt; (mandatory)
 
*id2=&lt;Module name&gt; (mandatory)
 
  
===== Examples =====
+
====Set delete_user_permissions====
 +
{{metaconsole}}
 +
It deletes user permissions.
  
http://localhost/pandora_console/include/api.php?op=set&op2=enable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora
+
Call syntax:
  
====set disable_module====
+
*Op = set(requiered)
 +
*Op2 =delete_user_permission(requiered)
 +
*Return_type = csv|json(requiered)
 +
*Other = id profile(requiered)
  
Disable the module.
 
  
Call syntax
+
=====Example=====
 +
It deletes user permissions.
 +
It can return Json or CSV, this return is remarked through the URL.
 +
 +
<nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=delete_user_permission&return_type=json&other=2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
*op=set (mandatory)
+
====Set add_permission_user_group====
*op2=disable_module
+
{{metaconsole}}
*id=&lt;Agent name&gt; (mandatory)
 
*id2=&lt;Module name&gt; (mandatory)
 
  
===== Examples =====
+
It adds permissions to a user group.
 
 
http://localhost/pandora_console/include/api.php?op=set&op2=disable_module&id=garfio&id2=Status&apipass=1234&user=admin&pass=pandora
 
 
 
====set create_network_module_from_component====
 
 
 
Create a new network module from a component.
 
  
 
Call syntax:
 
Call syntax:
 +
* Op = set(requiered)
 +
* Op2 =add_permission_user_to_group(requiered)
 +
* Return_type = csv|json(requiered)
 +
* Other = user id(requiered)|group_id(requiered)|profile id(requiered)|No hierarchy(Optional)| profile id(Optional)
  
*op=set (mandatory)
 
*op2=create_network_module_from_component (mandatory)
 
*id=&lt;Nombre del agente&gt; (mandatory)
 
*id2=&lt;Nombre del componente&gt; (mandatory)
 
  
  
===== Examples =====
+
=====Examples=====
 +
It can return Json or CSV, this return is remarked through the URL.
 +
{{Warning|Be careful, no_hierarchy may be empty. If that is the case, it takes value 0.}}
  
  http://localhost/pandora_console/include/api.php?op=set&op2=create_network_module_from_component&id=garfio&id2=OS%20Total%20process&apipass=1234&user=admin&pass=pandora
+
{{Warning|Be careful, permission id (id_up) in the table can be used if an existing permission must be modified.}}
 +
 +
  <nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=add_permission_user_to_group&return_type=json&other=admin|0|1|1|20&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set module_data====
+
====set enable_disable_user====
  
Add module value.
+
It enables a disabled user.
  
 
Call syntax:
 
Call syntax:
  
*op=set (mandatory)
+
*op=set (required)
*op2=module_data (mandatory)
+
*op2=enable_disable_user (required)
*id=&lt;id agente módulo&gt; (mandatory)
+
*id=&lt;user_name&gt; (required). It should be a username.
*other: module data and timestamp serialized.
 
**dato: data which must belong to any Pandora data type.
 
**tiempo: could be a specified timestamp of the string "now".
 
  
=====Example=====
+
=====Examples=====
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
 
  
====set add_module_in_conf====
+
Example 1 (Disable user 'example_name')  
>= 5.0 (Only Enterprise)
 
  
Add the configuration into a local module.
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=0&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
Call syntax:
+
Example 2 (Enable user 'example_name')
*op=set (mandatory)
+
 
*op2=add_module_in_conf (mandatory)
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=enable_disable_user&id=example_name&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
*id=&lt;id agente&gt; (mandatory)
 
*id2=&lt;nombre módulo&gt; (mandatory)
 
*other: The module data that will be placed in the conf file encoded in base64 (mandatory) (mandatory)
 
  
=====Examples=====
+
====set meta_synch_user====
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
 
  
Will be returned '0' when success, '-1' when error, '-2' if already exists
+
{{metaconsole}}
  
====set delete_module_in_conf====
+
It syncronizes metaconsole users to the node
>= 5.0 (Only Enterprise)
 
 
 
Delete a configuration of local module.
 
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
+
*op=set (required)
*op2=add_module_in_conf (mandatory)
+
*op2=meta_synch_user (required)
*id=&lt;id agente&gt; (mandatory)
+
*other=&lt;serialized parameters&gt; (opcional):
*id2=&lt;module name&gt; (mandatory)
+
:*&lt;user_name_1,user_name_2,user_name_3..&gt; (Usernames separated by comma and without spaces at the beginning or the end, required)
 +
:*&lt;server_name&gt; (required)
 +
:*&lt;profile_mode(1-0)&gt; (optional)
 +
:*&lt;group_name&gt; (optional)
 +
:*&lt;profile_1,profile_2,profile_3&gt; (Profiles separated by comma and without spaces at the beginning or at the end, optional)
 +
:*&lt;create_groups(1-0)&gt; (optional)
  
=====Examples=====
+
=====Example=====
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
 
  
Will be returned '0' when success or '-1' when error
+
<nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=meta_synch_user&apipass=1234&user=admin&pass=pandora&other=name1,name2|nodo1|0|||&other_mode=url_encode_separator_|</nowiki>
  
====set update_module_in_conf====
+
====set create_group====
>= 5.0 (Only Enterprise)
 
  
Update a configuration of local module.
+
It creates a group.
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
 
*op2=update_module_in_conf (mandatory)
 
*id=&lt;agent id&gt; (mandatory)
 
*id2=&lt;module name&gt; (mandatory)
 
*other: The new module data that will be placed in the conf file encoded in base64 (mandatory)
 
  
=====Ejemplos=====
+
*op=set (required)
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
+
*op2=create_group (required)
 +
*id=&lt;group_name&gt; (required). It should be a group name.
 +
*other=&lt;serialized_parameters&gt; (required). They are the following in this order:
 +
:*&lt;icon name&gt;
 +
:*&lt;parent group id&gt; (optional)
 +
:*&lt;description&gt; (optional)
 +
:*&lt;propagate acl&gt; (optional)
 +
:*&lt;disable alerts&gt; (optional)
 +
:*&lt;custom id&gt; (optional)
 +
:*&lt;contact info&gt; (optional)
 +
:*&lt;other info&gt; (optional)
  
Will be returned '1' when no changes, '0' when success, '-1' when error, '-2' if doesn't exist
+
=====Examples=====
  
====set create_event====
+
Example 1 (with parent group: Servers)
 +
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name&other=applications|2&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 +
Example 2 (without parent group)
 +
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_group&id=example_group_name2&other=computer|&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
Create a new event into Pandora.
+
====set update_group====
  
{{metaconsole}}
+
It updates a group with past data as parameters.
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
 
*op2=create_event (mandatory)
 
*other=&lt;serialized_parameters&gt; (mandatory) event's configuration data as follows:
 
:*&lt;event_text&gt; (obligatorio)(string)
 
:*&lt;id_group&gt; (obligatorio)(string)
 
:*&lt;id_agent&gt; (obligatorio)(numeric)
 
:*&lt;status&gt;(0 New, 1 Validated, 2 In process)
 
:*&lt;id_user&gt;(numeric)
 
:*&lt;event_type&gt;(unknown, alert_fired, alert_recovered, alert_ceased, alert_manual_validation, system, error, new_agent, configuration_change, going_unknown, going_down_critical, going_down_warning, going_up_normal)
 
:*&lt;severity&gt; (0 Maintenance,1 Informative,2 Normal,3 Warning,4 Crit,5 Minor, 6 Major)
 
:*&lt;id_agent_module&gt;(numeric)
 
:*&lt;id_alert_am&gt;(numeric)
 
:*&lt;critical_instructions&gt;(string)
 
:*&lt;warning_instructions&gt;(string)
 
:*&lt;unknown_instructions&gt;(string)
 
:*&lt;comment&gt;(string)
 
:*&lt;source&gt;(string)
 
:*&lt;tags&gt;(string)
 
:*&lt;custom_data&gt; Custom data should be a base 64 encoded JSON document.
 
:*&lt;server_id&gt; The id of the child node (only for metaconsole).
 
:*&lt;id_extra&gt; (alphanumeric)
 
  
 +
*op=set (required)
 +
*op2=update_group (required)
 +
*id=&lt;group_id&gt; (required). It should be a group id
 +
*other=&lt;serialized_parameters&gt; (required). They are the following in this order:
 +
:*&lt;group name&gt;
 +
:*&lt;icon name&gt;
 +
:*&lt;parent group id&gt;
 +
:*&lt;description&gt;
 +
:*&lt;propagate acl&gt;
 +
:*&lt;disable alerts&gt;
 +
:*&lt;custom id&gt;
 +
:*&lt;contact info&gt;
 +
:*&lt;other info&gt;
 +
 +
=====Example=====
 +
 +
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=update_group&id=example_group_id&other=New%20Name|application|2|new%20description|1|0|custom%20id||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 +
====set delete_group====
  
=====Examples=====
+
It deletes a group.
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora&other=Event_name|0|1|0|admin|alert_fired|4|1|||||comment|admin||tags|eyJBbnN3ZXIgdG8gdGhlIFVsdGltYXRlIFF1ZXN0aW9uIG9mIExpZmUsIHRoZSBVbml2ZXJzZSwgYW5kIEV2ZXJ5dGhpbmciOiA0Mn0=||12
+
Call syntax:
 +
*op=set (required)
 +
*op2=delete_group (required)
 +
*id=&lt;group_id&gt; (required) it should be a group id
  
====set add_event_comment====
+
=====Example=====
  
>= 5.1  
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_group&id=303&apipass=1234&user=admin&pass=pandora</nowiki>
  
Add an event comment.
+
====Set add_user_profile====
  
{{metaconsole}}
+
It adds a profile into user.
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
+
 
*op2=add_event_comment (mandatory)
+
*op=set (required)
*other=&lt;serialized_parameters&gt; (mandatory) event's configuration data as follows:
+
*op2=add_user_profile (required)
:*&lt;comment&gt; (mandatory)
+
*id=&lt;user_name&gt; (required). It should be a user name.
 +
*other=&lt;serialized parameters&gt; (required). They are group and profile configuration and data, serialized in the following order:  
 +
:*&lt;group&gt;
 +
:*&lt;profile&gt;
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_event_comment&id=event_id&other=string&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=add_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set create_netflow_filter====
+
====set delete_user_profile====
(>=5.0)
 
  
Create a new filter of netflow.
+
It deletes a profile from a user.
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
+
 
*op2=create_netflow_filter (mandatory)
+
*op=set (required)
*other=&lt;serialized parameters&gt; (mandatory) filter data in this order:
+
*op2=delete_user_profile (required)
:*&lt;filter_name&gt; (mandatory)
+
*id=&lt;user_name&gt; (required). It should be a user name.
:*&lt;group_id&gt; (mandatory)
+
*other=&lt;serialized parameters&gt; (required). They are the group configuration, data and profile, serialized in the following order:
:*&lt;filter&gt; (mandatory)
+
:*&lt;group&gt;
:*&lt;aggregate_by&gt; (Possible values: dstip,dstport,none,proto,srcip,srcport)  (mandatory)
+
:*&lt;profile&gt;
:*&lt;output_format&gt; (Possible values: kilobytes,kilobytespersecond,megabytes,megabytespersecond) (mandatory)
 
  
 
=====Examples=====
 
=====Examples=====
  
  http://127.0.0.1/pandora/include/api.php?op=set&op2=create_netflow_filter&apipass=1234&user=admin&pass=pandora&other=Filter%20name|9|host%20192.168.50.3%20OR%20host%20192.168.50.4%20or%20HOST%20192.168.50.6|dstport|kilobytes&other_mode=url_encode_separator_|
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_user_profile&id=md&other=12|4&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set create_custom_field====
+
====set new_incident====
>= 5.0
 
  
Create a new custom field.
+
It creates a new incident.
  
 
Call syntax:
 
Call syntax:
*op=set (mandatory)
+
*op=set (required)
*op2=create_custom_field (mandatory)
+
*op2=new_incident (required)
*other=&lt;serialized parameters&gt; (mandatory) parameters to configure the custom field
+
*other=&lt;serialized parameters&gt; (required). They are incident configuration and data, serialized in the following order:
:*&lt;name&gt; (mandatory)
+
:*&lt;title&gt;
:*&lt;flag_display_front&gt; (mandatory; 0 the field will not be displayed on operation view, 1 the field will be displayed)
+
:*&lt;description&gt;
 +
:*&lt;origin&gt;
 +
:*&lt;priority&gt;
 +
:*&lt;status&gt;
 +
:*&lt;group&gt;
  
=====Example=====
+
=====Examples=====
  
  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=new_incident&other=titulo|descripcion%20texto|Logfiles|2|10|12&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set create_tag====
+
====Set new_note_incident====
>= 5.0
 
  
Create a new tag.
+
It adds a note within an incident.
  
Sintaxis de la llamada:
+
Call syntax:
*op=set (mandatory)
+
*op=set (required)
*op2=create_tag (mandatory)
+
*op2=new_note_incident (required)
*other=&lt;serialized parameters&gt; (mandatory) parameters to configure the tag
+
*id=&lt;id_incident&gt; (required). It is the incident id.
:*&lt;name&gt; Tag's name (mandatory)
+
*id2=&lt;user_name&gt; (required). Username.
:*&lt;description&gt; Tag's description
+
*other=&lt;note&gt; (required). It is the note codified in url encode.
:*&lt;eurl&gt; Tag's URL
 
:*&lt;email&gt; Tag's email
 
  
=====Ejemplo=====
+
=====Examples=====
  
  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=new_note_incident&id=5&id2=miguel&other=una%20nota%20para%20la%20incidencia&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set enable_disable_agent====
+
====set validate_all_alerts====
  
Enable / disabled agent.
+
It validates all alerts.
  
 
Call syntax:
 
Call syntax:
 
+
*op=set (required)
*op=set (compulsory)
+
*op2=validate_all_alerts (required)
*op2=enable_disable_agent (compulsory)
 
*id=&lt;agent_id&gt; (compulsory) should be an agent id.
 
  
 
=====Examples=====
 
=====Examples=====
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_alerts&apipass=1234&user=admin&pass=pandora</nowiki>
  
Example 1 (Disable agent 'example_id')
+
====set validate_all_policy_alerts====
  
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
+
It validates the alerts created from a policy.
  
Example 2 (Enable agent 'example_id')
+
Call syntax:
 
+
*op=set (required)
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
+
*op2=validate_all_policy_alerts (required)
  
====set gis_agent_only_position====
+
=====Examples=====
>= 5.0
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=validate_all_policy_alerts&apipass=1234&user=admin&pass=pandora</nowiki>
  
Add new position GIS in any agent.
+
====set event_validate_filter====
  
Call syntax:
+
It validates all events that pass the past filter as parameters.
*op=set (compulsory)
 
*op2=gis_agent_only_position (compulsory)
 
*id=<índice> (compulsory) agent index
 
*other=&lt;parámetros serializados&gt; (compulsory) params to set position
 
:*&lt;latitude&gt; Latitude
 
:*&lt;longitude&gt; Longitude
 
:*&lt;altitude&gt; Altitude
 
  
=====Ejemplo=====
 
  
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
+
{{metaconsole}}
  
====set gis_agent====
+
Call syntax:
>= 5.0
 
  
Add the gis data agent.
+
*op=set (required)
 
+
*op2=event_validate_filter (required)
Call syntax:
+
*other_mode=url_encode_separator_|(optional)
*op=set (compulsory)
+
*other=&lt;serialized_parameters&gt; (optional). They are the following in this order:
*op2=gis_agent_only_position (compulsory)
+
:*&lt;separator&gt;
*id=<índice> (compolsory) agent index.
+
:*&lt;criticity&gt; From 0 to 4
*other=&lt;parámetros serializados&gt; (compulsory) gis data
+
:*&lt;agent name&gt;
:*&lt;latitude&gt;
+
:*&lt;module name&gt;
:*&lt;longitude&gt;
+
:*&lt;alert template name&gt;
:*&lt;altitude&gt;
+
:*&lt;user&gt;
:*&lt;ignore_new_gis_data&gt;
+
:*&lt; numeric interval minimum level&gt; en unix timestamp
:*&lt;manual_placement&gt;
+
:*&lt; numeric interval maximum level&gt; en unix timestamp
:*&lt;start_timestamp&gt;
+
:*&lt;use_agent_name&gt; (Values 0 and 1 supported)
:*&lt;end_timestamp&gt;
 
:*&lt;number_of_packages&gt;
 
:*&lt;description_save_history&gt;
 
:*&lt;description_update_gis&gt;
 
:*&lt;description_first_insert&gt;
 
  
====set create_special_day====
+
=====Examples=====
>= 5.1
 
  
Add new special day.
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_validate_filter&other_mode=url_encode_separator_|&other=;|2&apipass=1234&user=admin&pass=pandora</nowiki>
  
Call syntax:
+
====set event_validate_filter_pro====
 
 
*op=set (compulsory)
 
*op2=create_special_day (compulsory)
 
*other=&lt;serialized parameters&gt; (compulsory)
 
:*&lt;special day&gt; Special day
 
:*&lt;same day&gt; Same day
 
:*&lt;description&gt; Description
 
:*&lt;id_group&gt; Group ID
 
  
=====Example=====
+
It is similar to previous call.
  
http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=create_special_day&other_mode=url_encode_separator_|&other=2014-05-03|Sunday|desc|0
 
  
====set update_special_day====
+
{{metaconsole}}
>= 5.1
 
 
 
Update a configuration of special day already defined.
 
  
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory)
+
*op=set (required))
*op2=update_special_day (compulsory)
+
*op2=event_validate_filter_pro (required)
*id=&lt;special day's id&gt; (compulsory)
+
*other_mode=url_encode_separator_| (optional)
*other=&lt;serialized parameters&gt; (compulsory)
+
*other=&lt;serialized parameters&gt; (optional). They are the following in this order:
:*&lt;special day&gt; Special day
+
:*&lt;separator&gt;
:*&lt;same day&gt; Same day
+
:*&lt;criticity&gt; From 0 to 4
:*&lt;description&gt; Description
+
:*&lt;id agent&gt;
:*&lt;id_group&gt; Group ID
+
:*&lt;id module&gt;
 +
:*&lt;id agent module alert&gt;
 +
:*&lt;user&gt;
 +
:*&lt;numeric interval minimum level&gt; in unix timestamp
 +
:*&lt;numeric interval maximum level&gt; in unix timestamp
  
=====Example=====
+
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=update_special_day&id=1&other_mode=url_encode_separator_|&other=2014-05-03|Sunday|desc|0
+
  <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 delete_special_day====
+
====set validate_event_by_id====
>= 5.1
 
  
Delete a special day.
+
Validates an event given its id.
  
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory)
+
op=set (required)
*op2=delete_special_day (compulsory)
+
op2=validate_event_by_id (required)
*id=&lt;special day's id&gt; (compulsory)
+
id=<event_id> (required) event id.
  
=====Example=====
+
=====Examples=====
  
  http://127.0.0.1/pandora_console/include/api.php?apipass=caca&user=admin&pass=pandora&op=set&op2=delete_special_day&id=1
+
  <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 pagerduty_webhook====
+
====set new_alert_template====
>= 5.1
 
  
Connect PagerDuty notification with Pandora FMS alerts. This call will be set in webhooks option in PagerDuty's service to validate the alerts of Pandora FMS previously linked to Pager Duty when were validated from PagerDuty.
+
It applies a new alert from a template and module which has gone through id agent and module name.
  
 
Call syntax:
 
Call syntax:
  
*op=set (compulsory)
+
*op=set (ob)
*op2=pagerduty_webhook (compulsory)
+
*op2=new_alert_template (required)
*id=alert (compulsory)
+
*id=&lt;agent name&gt; (required)
 +
*id2=&lt;alert template name&gt; (required)
 +
*other_mode=url_encode_separator_| (optional)
 +
*other=&lt;serialized parameter&gt; (required). They are the following in this order:
 +
:*&lt;module name&gt; (required)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
=====Example=====
+
=====Examples=====
  
  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=new_alert_template&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set tag_user_profile====
+
====set alert_actions====
>= 6
 
  
Add a tag into a profile for a user.
+
It adds actions within an alert.
  
 
Call syntax:
 
Call syntax:
 +
*op=set (required)
 +
*op2=alert_actions (required)
 +
*id=&lt;agent name&gt; (required)
 +
*id2=&lt;alert template name&gt; (required)
 +
*other_mode=url_encode_separator_| (optional)
 +
*other=&lt;serialized parameters&gt; (required). They are the following in this order:
 +
:*&lt;module name&gt; (required)
 +
:*&lt;action name&gt; (required)
 +
:*&lt;fires min &gt; (optional)
 +
:*&lt;fires max &gt; (optional)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
* op = set (compulsory)
+
=====Examples=====
* op2 = tag_user_profile (compulsory)
 
* id = id_user (compulsory)
 
* id2 = id_tag (compulsory)
 
* other_mode = url_encode_separator_| (compulsory)
 
* other = <id_group>|<id_profile> (compulsory)
 
  
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test&apipass=1234&user=admin&pass=pandora</nowiki>
  
=====Example=====
+
  <nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=alert_actions&id=miguel-portatil&id2=test&other_mode=url_encode_separator_|&other=memfree|test|1|3&apipass=1234&user=admin&pass=pandora</nowiki>
 
 
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=tag_user_profile&apipass=1234&user=admin&pass=pandora&id=1&id2=2&other_mode=url_encode_separator_|&other=122|3
 
 
 
====set tag====
 
>= 6
 
  
Add a tag into your pandora.
+
====set alert_commands====
 +
It adds commands within an alert.
  
 
Call syntax:
 
Call syntax:
 +
*op=set (required)
 +
*op2=alert_commands (required)
 +
*id=&lt;name of the command&gt; (required)
 +
*other_mode=url_encode_separator_| (optional)
 +
*other=&lt;serialized parameters&gt; (required). They are the following in this order:
 +
:*&lt;command&gt; (required)
 +
:*&lt;id_group&gt; (required)
 +
:*&lt;description &gt; (required)
 +
:*&lt;internal &gt; (optional)
 +
:*&lt;field_description_1&gt;&lt;field_value_1&gt;&lt;field_description_2&gt;&lt;field_value_2&gt;...&lt;field_description_n&gt;&lt;field_value_n&gt;
  
* op = set (compulsory)
+
=====Examples=====
* op2 = tag (compulsory)
+
<nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=alert_commands&id=PRUEBA1&other=command|0|Desc|1|des1|val1|des2|val2|des3|val3||val4|des5&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora</nowiki>
* id = name (compulsory)
 
* other_mode = url_encode_separator_| (compulsory)
 
* other = <description>|<url>|<email>|<phone>
 
  
 +
====set new_module====
 +
It creates a new module.
  
=====Example=====
+
Call Syntax:
  
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
+
*op=set (required)
 
+
*op2=new_module (required)
====set add_tag_module====
+
*id=&lt;agent_name&gt; (required)
>= 6
+
*id2=&lt;new module name&gt; (required)
 +
*other_mode=url_encode_separator_| (optional)
 +
*other=&lt;serialized parameters&gt; (required). They are the following in this order:
 +
:*&lt;network module kind &gt; (required)
 +
:*&lt;action name&gt; (required)
 +
:*&lt;ip o url &gt; (required)
 +
:*&lt;port &gt; (optional)
 +
:*&lt;description &gt; (optional)
 +
:*&lt;min &gt; (optional)
 +
:*&lt;max &gt; (optional)
 +
:*&lt;post process &gt; (optional)
 +
:*&lt;module interval &gt; (optional)
 +
:*&lt;min warning &gt; (optional)
 +
:*&lt;max warning &gt; (optional)
 +
:*&lt;min critical &gt; (optional)
 +
:*&lt;max critical &gt; (optional)
 +
:*&lt;history data &gt; (optional)
 +
:*&lt;enable_unknown_events&gt; (only in version 5)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
Add a tag into a module.
+
=====Examples=====
 +
 
 +
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=new_module&id=miguel-portatil&id2=juanito&other_mode=url_encode_separator_|&other=remote_tcp_string|localhost|33|descripcion%20larga&apipass=1234&user=admin&pass=pandora</nowiki>
 +
 
 +
====set delete_module====
 +
It deletes a module.
  
 
Call syntax:
 
Call syntax:
  
* op = set (compulsory)
+
*op=set (required)
* op2 = add_tag_module (compulsory)
+
*op2=delete_module (required)
* id = id_module (compulsory)
+
*id=&lt;agent name&gt; (required)
* id2 = id_tag (compulsory)
+
*id2=&lt;module name&gt; (required)
 +
*other=simulate (optional)
 +
:*&lt;use_agent_alias&gt; (Values 0 and 1 supported)
  
 +
=====Examples=====
  
=====Example=====
+
<nowiki>http://127.0.0.1/pandora_console/include/api.php?op=set&op2=delete_module&id=miguel-portatil&id2=juanito&other=simulate&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|</nowiki>
  
  http://127.0.0.1/pandora_console/include/api.php?op=set&op2=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=delete_module&id=miguel-portatil&id2=juanito&apipass=1234&user=admin&pass=pandora&other_mode=url_encode_separator_|</nowiki>
  
====set remove_tag_module====
+
====set enable_alert====
>= 6
+
It enables an agent alert.
  
Remove a tag into a module.
+
Call syntax
  
Call syntax:
+
*op=set (required)
 +
*op2=enable_alert
 +
*id=&lt;Agent name&gt; (required)
 +
*id2=&lt;Module name&gt; (required)
 +
*other: Alert template name (p.e: Warning event) (required)
  
* op = set (compulsory)
 
* op2 = add_tag_module (compulsory)
 
* id = id_module (compulsory)
 
* id2 = id_tag (compulsory)
 
  
 +
===== Examples =====
  
=====Example=====
+
<nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=enable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora</nowiki>
  
http://127.0.0.1/pandora_console/include/api.php?op=set&op2=remove_tag_module&apipass=1234&user=admin&pass=pandora&id=1&id2=2
+
====set enable_alert_alias====
  
====set planned_downtimes_created====
+
It enables agent alert by alias.
>= 5.1
 
  
Add new planned downtime.
+
Call syntax:
 +
*op=set (required)
 +
*op2=enable_alert_alias
 +
*id=&lt;Agent alias&gt; (required)
 +
*id2=&lt;Module name&gt; (required)
 +
*other: Alert template name (p.e: Warning event) (required)
  
*op=set
 
*op2=planned_downtimes_created
 
*other=<description>;<date_from>;<date_to>;<id_group>;<monday>;
 
*  <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>;
 
  
=====Example=====
+
===== Examples =====
  
  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=enable_alert_alias&id=nova&id2=CPU%20Load&other=critical%20condition&apipass=1234&user=admin&pass=pandora</nowiki>
  
====set planned_downtimes_additem====
+
====set disable_alert====
>= 5.1
 
Add new items of a planned downtime.
 
*op=set
 
*op2=planned_downtimes_additem
 
*id=planned_downtime_id
 
*other= <id_agent1;id_agent2;id_agent3;....id_agentn;>;<name_module1;name_module2;name_module3;......name_modulen;>
 
  
=====Example=====
+
It disables an agent alert.
  
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_|
+
Call syntax:
  
====set planned_downtimes_deleted====
 
>=5.1
 
  
Delete a planned downtime
+
*op=set (required)
*op=set
+
*op2=disable_alert
*op2=planned_downtimes_deleted
+
*id=&lt;Agent name&gt; (required)
*id=planned_downtime_id
+
*id2=&lt;Module name&gt; (required)
 +
*other: Alert template name (p.e: Warning event) (required)
  
=====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
+
===== Examples =====
  
====set create_synthetic_module====
+
<nowiki>http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition&apipass=1234&user=admin&pass=pandora</nowiki>
>=5.1SP4
 
  
Add new synthetic module:
+<