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:
| One module for each of the 10 instances of the operation with id ec2_cpu, with the following name: cpu_usage <name of each instance> |
| A module for operation q1, with the following name: avg_cpu i-01e5fbcd406596f84 |
| A module for operation q2, with the following name: free cpu i-01e5fbcd406596f84 |
- An agent called AWS general (the default agent)
This agent would contain the following modules:
| A module for the ebs_write_time operation, with the following name: Average EBS Volume Total Write Time |