# Agents and modules generated by the plugin

The agents and modules generated by the plugin depend entirely on the configuration settings. For example, the following general and metric settings:  
  
**Metrics insights configuration**

```
[
{   
    "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": "cpu_usage",
        "Period":300,
        "ReturnData": true
      }
    ]
}
]
```

**General and module settings**

```
[CONF]
agents_group                     = 1
agent_name                       = AWS General
interval                         = 300
threads                          = 3
transfer_mode                    = tentacle
tentacle_ip                      = 172.42.42.101
tentacle_port                    = 41121

[q1]
name = __label__
type = generic_data
description = Monitors CPU utilization
unit =percent
value = average
agent = AWS EC2
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 = Cpu usage
agent = AWS EC2
value = last
```

**It would create the following:**

- An agent called AWS EC2 (as defined explicitly in the two modules that execute ec2 queries above).

This agent would contain the following modules:

<table border="1" id="bkmrk-un-modulo-por-cada-u" style="border-collapse: collapse; width: 100%; height: 105.7px;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr style="height: 46.4333px;"><td style="height: 46.4333px;">One module for each of the 10 instances of the operation with id ec2\_cpu, with the following name: cpu\_usage &lt;name of each instance&gt;</td></tr><tr style="height: 29.6333px;"><td style="height: 29.6333px;">**A module for operation q1**, with the following name: avg\_cpu i-01e5fbcd406596f84</td></tr><tr style="height: 29.6333px;"><td style="height: 29.6333px;">**A module for operation q2**, with the following name: free cpu i-01e5fbcd406596f84</td></tr></tbody></table>

- An agent called AWS general (the default agent)

This agent would contain the following modules:

<table border="1" id="bkmrk-un-modulo-para-la-op" style="border-collapse: collapse; width: 100%; height: 29.6333px;"><colgroup><col style="width: 99.8765%;"></col></colgroup><tbody><tr style="height: 29.6333px;"><td style="height: 29.6333px;">A module for the ebs\_write\_time operation, with the following name: Average EBS Volume Total Write Time</td></tr></tbody></table>