Parameters and configuration options
Parámetros
| --creds | Base 64 |
LasBefore credencialesbeing antesconverted de pasarlas ato base 6464, tienencredentials elhave siguientethe formatofollowing :format:
{
"access_key_id": "KEY",
"secret_access_key": "PASSWORD"
}
| --query_conf |
EnIn elthe ficheroquery defile, queries,you secan puedenspecify especificarone unaor o mas consultas demore Metrics Insights. Estasqueries. siguenThese lafollow estructurathe questructure estadocumented documentadain enthe elfollowing siguiente enlace:link: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.htmlLaThe estructurastructure parafor poderexecuting ejecutarone unaor o mas consultas demore Metrics insights esqueries lais siguienteas :follows:
{
"time_frame": "<Ventana detime tiempowindow enin lawhich queto recogercollect losdata, datos,possible opciones posiblesoptions : 5m, 10m, 15m, 30m, 1h>",
"region_name": "< region enin lawhich queto ejecutarexecute lathe consultaquery > ",
"MetricDataQueries": [
< Operaciones de metricsMetrics insights operations >
]
}
EstasThese consultasqueries debenmust irbe definidasdefined dentrowithin de una lista y separadas por comas, por lo que la estructura, de dos consultas, sería lalist siguiente:and separated by commas, so the structure of two queries would be as follows:
[
{
"time_frame": "<Ventana deTime tiempowindow enfor lacollecting quedata, recogerpossible los datos, opciones posiblesoptions : 5m, 10m, 15m, 30m, 1h>",
"region_name": "< region enin lawhich queto ejecutarexecute lathe consultaquery > ",
"MetricDataQueries": [
< Operaciones de metrics insights >
]
}
,
{
"time_frame": "<Ventana deime tiempowindow enfor lacollecting quedata, recogerpossible los datos, opciones posiblesoptions : 5m, 10m, 15m, 30m, 1h>",
"region_name": "< region enin lawhich queto ejecutarexecute lathe consultaquery > ",
"MetricDataQueries": [
< Operaciones de metrics insights >
]
}
]
UnAn ejemploexample deof una configuración de consultas, sería elquery siguienteconfiguration :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
}
]
}
]
El campoThe ID yand label defields lasfor operacionesthe queoperations estánwithin dentroeach dequery cadaare consultaimportant sonfor importanteslinking parathese relacionarqueries estasto consultasthe con la configuración dedesired Pandora deseadaconfiguration parafor elthe datodata obtenidoobtained defrom estathis operación.operation. MásFurther abajodown enin elthe apartado“module "configuraciónconfiguration” desection, módulos"you vienewill detalladofind comodetails seon puedenhow relacionarthese estosfields campos.can be linked.
| --conf |
ArchivoConfiguration de configuraciónfile (--conf)
[CONF]
agents_group = < GrupoGroup parafor losagents agentescreated creadosby por elthe plugin >
agent_name = < NombreDefault delagent agente por defectoname >
threads = < NúmeroNumber deof hilosthreads utilizadosused porby elthe plugin >
interval = < IntervaloInterval enin segundosseconds parafor los agentesagents >
transfer_mode = < ModoTransfer de transferencia,mode, tentacle oor local >
tentacle_ip = < IP deof lathe máquinadestination destinomachine parafor losthe agentesagents creadoscreated >
tentacle_port = < PuertoTentacle deport, tentacle, por defecto :default: 41121 >
tentacle_opts = < Opciones adicionales deAdditional tentacle client options >
use_proxy = < ActivarEnable parato poder utilizar modouse proxy mode >
proxy_url = < urlURL deof la direccionthe proxy aaddress utilizarto use >
ssl_check = < ActivarEnable parato activar chequeoactivate SSL check >
EjemploExample
[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
ConfiguraciónModule de módulosconfiguration
LaThe configuraciónmodule deconfiguration módulosmust debebe irdefined definidain en elthe conf anteriormentefile visto,seen debajoabove, deunder lasthe variables.
LaThe estructurastructure parafor poderconfiguring configurarmodules módulosfor parathe losdata datosobtained obtenidosfrom deeach cadaoperation operaciónof deeach cadaquery consultais esas la siguiente:follows:
[< ID - Aquí debe ir elThe ID quedefined sein haya definido en la operacion dethe metrics insights queoperation sethat esperais recibirexpected elto datoreceive the data should go here >]
name = < NombreName queof tendráthe elmodule módulothat quewill generarágenerate elthe dato.data. Se puede usar laThe macro __label__ ,can sibe seused.
usaIf estathis macro,macro elis nombreused, delthe móduloname seráof elthe obtenidomodule porwill labe etiquetaobtained from the label entag lain operaciónthe queoperation contienecontaining elthe ID definidodefined arriba.above. EstoThis esis utiluseful parafor consultasqueries quethat devuelvenreturn másmore dethan
unone dato,piece porof ejemplodata, unafor consultaexample, quea saquequery lasthat returns the 10 instanciasinstances conwith masthe usohighest deCPU cpu,usage. siIf enin lathe
operaciónoperation definesyou define label comoas "cpu",“cpu,” lathe devolucionreturn obtenidaobtained serawill be "cpu <nombreinstance instancianame 1>,
cpu cpu <nombreinstance instancianame 2> , cpu <nombreinstance instancianame 3 > ... yand asiso sucesivamenteon, yand
estosthese seranwill losbe nombresthe denames losof módulosthe generadosmodules generated >
type = < TipoModule del módulotype>
description = < DescripciónModule del módulodescription >
value = < ValorValue ato recogerbe delcollected datofrom obtenidothe endata laobtained operacion,in opcionesthe posiblesoperation,
:possible options: last, average, sum, max, min >
agent = < AgenteAgent enin elwhich quethe semodule incluirawill elbe módulo,included; deif noit existirdoes senot creará,exist, deit nowill definirse,be loscreated; módulosif senot meterandefined, enthe elmodules
agentewill porbe defectoplaced >in the default agent
EjemploExample deof configuraciónmodule deconfiguration, módulos,according acordeto athe lasmetrics métricasdefined definidas arriba: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