# Parameters and configuration options

**Parámetros**

<table border="1" id="bkmrk---creds-base-64-de-l" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>**--creds**</td><td>Base 64 of the credentials </td></tr></tbody></table>

Before being converted to base 64, credentials have the following format:

```
{
  "access_key_id": "KEY",
  "secret_access_key": "PASSWORD"
}
```

<table border="1" id="bkmrk---conf-ruta-al-archi" style="width: 1274px;"><tbody><tr><td style="width: 353px;">**<span class="line" id="bkmrk---query_conf" lang="python"><span class="s">--query\_conf</span></span>**</td><td style="width: 454px;">Path to the AWS custom query configuration file</td></tr></tbody></table>

In the query file, you can specify one or more Metrics Insights queries. These follow the structure documented in the following link: [https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API\_GetMetricData.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html)  
  
The structure for executing one or more Metrics insights queries is as follows:

```
{   
    "time_frame": "< time window in which to collect data, possible options : 5m, 10m, 15m, 30m, 1h>",
    "region_name": "< region in which to execute the query > ",
    "MetricDataQueries": [
        < Metrics insights operations >
    ]
}
```

These queries must be defined within a list and separated by commas, so the structure of two queries would be as follows:

```
[
{   
    "time_frame": "< Time window for collecting data, possible options : 5m, 10m, 15m, 30m, 1h>",
    "region_name": "< region in which to execute the query > ",
    "MetricDataQueries": [
        < Operaciones de metrics insights >
    ]
}
,
{   
    "time_frame": "< ime window for collecting data, possible options : 5m, 10m, 15m, 30m, 1h>",
    "region_name": "< region in which to execute the query > ",
    "MetricDataQueries": [
        < Operaciones de metrics insights >
    ]
}
]
```

An example of a query configuration would be the following:

```
[
{   
    "time_frame": "5m",
    "region_name": "us-east-1",
    "MetricDataQueries": [
        {
            "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) WHERE InstanceId = 'i-01e5fbcd406596f84' GROUP BY InstanceId",
            "Id": "q1",
            "Period": 300,
            "Label": "avg_cpu"
        },
        {
            "Id": "q2",
            "Expression": "(100 - q1)",
            "Label": "free space"
        }
    ]
},
{
    "time_frame": "5m",
    "region_name": "us-east-1",
    "MetricDataQueries": [
      {
        "Id": "ebs_write_time",
        "Expression": "SELECT AVG(VolumeTotalWriteTime) FROM SCHEMA("AWS/EBS", VolumeId)",
        "Label": "Average EBS Volume Total Write Time",
        "Period":300,
        "ReturnData": true
      }
    ]
},
{
    "time_frame": "5m",
    "region_name": "us-east-1",
    "MetricDataQueries": [
      {
        "Id": "ec2_cpu",
        "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId ORDER BY MAX() DESC LIMIT 10",
        "Label": "top_10",
        "Period":300,
        "ReturnData": true
      }
    ]
}
]
```

<p class="callout info">The ID and label fields for the operations within each query are important for linking these queries to the desired Pandora configuration for the data obtained from this operation. Further down in the “module configuration” section, you will find details on how these fields can be linked.</p>

<table border="1" id="bkmrk---conf-ruta-al-archi-1" style="width: 1278px;"><tbody><tr><td style="width: 320px;">**--conf**</td><td style="width: 489px;">Path to the configuration file</td></tr></tbody></table>

**Configuration file (--conf)**

```
[CONF]
agents_group       = < Group for agents created by the plugin >
agent_name         = < Default agent name >
threads            = < Number of threads used by the plugin >
interval           = < Interval in seconds for agents  >
transfer_mode      = < Transfer mode, tentacle or local > 
tentacle_ip        = < IP of the destination machine for the agents created >
tentacle_port      = < Tentacle port, default: 41121 >
tentacle_opts      = < Additional tentacle client options >
use_proxy          = < Enable to use proxy mode >
proxy_url          = < URL of the proxy address to use >
ssl_check          = < Enable to activate SSL check >
```

<span style="text-decoration: underline;">Example</span>

```
[CONF]
agents_group       = Applications
agent_name         = AWS 
threads            = 4
interval           = 300
transfer_mode      = tentacle
tentacle_ip        = 127.0.0.1
tentacle_port      = 41121
tentacle_opts      = 
use_proxy          = 0
proxy_url          = 
ssl_check          = 1
```

**Module configuration**

The module configuration must be defined in the conf file seen above, under the variables.

The structure for configuring modules for the data obtained from each operation of each query is as follows:

```
[< ID - The ID defined in the metrics insights operation that is expected to receive the data should go here >]

name = < Name of the module that will generate the data. The macro __label__ can be used.
If this macro is used, the name of the module will be obtained from the label tag in the operation containing the ID defined above. This is useful for queries that return more than
one piece of data, for example, a query that returns the 10 instances with the highest CPU usage. If in the
operation you define label as “cpu,” the return obtained will be "cpu <instance name 1>,
cpu cpu <instance name 2>, cpu <instance name 3> ... and so on, and 
these will be the names of the modules generated >

type = < Module type> 

description = < Module description >

value = < Value to be collected from the data obtained in the operation, 
possible options: last, average, sum, max, min >

agent = < Agent in which the module will be included; if it does not exist, it will be created; if not defined, the modules
will be placed in the default agent
```

Example of module configuration, according to the metrics defined above:

```
[q1]
name = __label__
type = generic_data
description = Monitors CPU utilization
unit =percent
value = average
min_warning = 75
min_critical = 85

[q2]
name = __label__
type = generic_data
description = Monitors CPU free space
unit = percent
value = last
min_warning = 11
max_warning = 20
min_critical = 0
max_critical = 10

[ebs_write_time]
name = __label__
type = generic_data
description = Average EBS Volume Total Write Time
value = last
agent = AWS 2 Cloudwatch

[ec2_cpu]
name = __label__
type = generic_data
description = EC2
value = last
```