zabbix_export: version: '6.0' date: '2021-11-21T22:01:08Z' groups: - uuid: 7df96b18c230490a9a0a9e2307226338 name: Templates templates: - uuid: 409a992aac894097b87478730df0732e template: 'AWS CloudWatch via Docker Wrapper' name: 'AWS CloudWatch via Docker Wrapper' description: | ## Description Monitorizacion de AWS via CloudWatch utilizando un Wrapper desarrollado en NodeJS. ## Overview Repository for access to Cloudwatch via API REST using AWS-SDK + NodeJS Wrapper. The templatre only use HTTP Agent to recolect all metrics from AWS Cloudwatch. [Git Repo](https://github.com/mobarrio/cloudwatch_wrapper "Git Repo") ## Author Mariano J. Obarrio Miles groups: - name: Templates discovery_rules: - uuid: 51c6ffa9e0274da49951ddfd2fe8194f name: 'Get Credentials' type: HTTP_AGENT key: get.bearer.token delay: 1h description: 'Recupera el Bearer token con el cual podremos acceder a la API' item_prototypes: - uuid: 22fae0b8df12452eb71b2c4cff50b163 name: 'EC2 CPUUtilization' type: HTTP_AGENT key: 'get.ec2.CPUUtilization[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: '%' description: | The percentage of CPU utilization. Units: Percent preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [{ "Name": "InstanceType", "Value": "m5.2xlarge" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 5708d97ee63e442eab5636fc764b7087 name: 'ElastiCache CacheHitRate' type: HTTP_AGENT key: 'get.ElastiCache.CacheHitRate[{#ACCOUNT}]' delay: 5m description: 'The number of unsuccessful read-only key lookups in the main dictionary. This is derived fromkeyspace_misses statistic at Redis INFO.' preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/ElastiCache", "MetricName": "CacheHitRate", "Dimensions": [{ "Name": "CacheClusterId", "Value": "{$REDISDBNAME}" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 22d5995a4031496ebd4b1dd796345b91 name: 'ElastiCache CPUUtilization' type: HTTP_AGENT key: 'get.ElastiCache.CPUUtilization[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: '%' description: 'The percentage of CPU utilization for the entire host. Because Redis is single-threaded, we recommend you monitor EngineCPUUtilization metric for nodes with 4 or more vCPUs.' preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/ElastiCache", "MetricName": "CPUUtilization", "Dimensions": [{ "Name": "CacheClusterId", "Value": "{$REDISDBNAME}" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 7c7f2ba3032149b4b8d7569f28d422bd name: 'ElastiCache CurrConnections' type: HTTP_AGENT key: 'get.ElastiCache.CurrConnections[{#ACCOUNT}]' delay: 5m value_type: FLOAT description: 'The number of client connections, excluding connections from read replicas. ElastiCache uses two to four of the connections to monitor the cluster in each case. This is derived from the connected_clients statistic at Redis INFO.' preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/ElastiCache", "MetricName": "CurrConnections", "Dimensions": [{ "Name": "CacheClusterId", "Value": "{$REDISDBNAME}" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 50913ba14a8c4a179214d49c158fe130 name: 'ElastiCache SwapUsage' type: HTTP_AGENT key: 'get.ElastiCache.SwapUsage[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: b description: 'The amount of swap used on the host.' preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/ElastiCache", "MetricName": "SwapUsage", "Dimensions": [{ "Name": "CacheClusterId", "Value": "{$REDISDBNAME}" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 580c4d493d3e4372ae4b80fbe7624aa9 name: 'RDS CPUUtilization' type: HTTP_AGENT key: 'get.rds.CPUUtilization[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: '%' description: | The percentage of CPU utilization. Units: Percent preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "MetricName": "CPUUtilization", "Dimensions": [{ "Name": "EngineName", "Value": "postgres" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 04f5ee78ade94126a42f8b720553a440 name: 'RDS DatabaseConnections' type: HTTP_AGENT key: 'get.rds.DatabaseConnections[{#ACCOUNT}]' delay: 5m description: | The number of database connections in use. The metric value might not include broken database connections that haven't been cleaned up by your database yet. So, the number of database connections recorded by your database might be higher than the metric value. Units: Count preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "MetricName": "DatabaseConnections", "Dimensions": [{ "Name": "EngineName", "Value": "postgres" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: bdb2cd014a95489081a840771f162ac0 name: 'RDS FreeableMemory' type: HTTP_AGENT key: 'get.rds.FreeableMemory[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: b description: | "The amount of available random access memory. For MariaDB, MySQL, Oracle, and PostgreSQL DB instances, this metric reports the value of the MemAvailable field of /proc/meminfo. Units: Bytes" preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "MetricName": "FreeableMemory", "Dimensions": [{ "Name": "EngineName", "Value": "postgres" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: e8f417c4508d4341b395f2a34467083a name: 'RDS FreeStorageSpace' type: HTTP_AGENT key: 'get.rds.FreeStorageSpace[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: b description: | "The amount of available storage space. Units: Bytes" preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "MetricName": "FreeStorageSpace", "Dimensions": [{ "Name": "EngineName", "Value": "postgres" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST - uuid: 9175131ebef04a169803ccb96e3f4e42 name: 'RDS List Metrics' type: HTTP_AGENT key: 'get.rds.metrics[{#ACCOUNT}]' delay: 1d trends: '0' value_type: TEXT url: '{$API_SERVER}/api/v1/aws/listmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "Dimensions": [] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json - uuid: 0372d388993440f0a2a2e5900dd06d8f name: 'RDS SwapUsage' type: HTTP_AGENT key: 'get.rds.SwapUsage[{#ACCOUNT}]' delay: 5m value_type: FLOAT units: b description: | "The amount of swap space used on the DB instance. This metric is not available for SQL Server. Units: Bytes" preprocessing: - type: JSONPATH parameters: - $.Average url: '{$API_SERVER}/api/v1/aws/getmetrics' posts: | { "Config": { "Account": "{#ACCOUNT}", "Region": "{$REGION}" }, "Metric": { "Namespace": "AWS/RDS", "MetricName": "SwapUsage", "Dimensions": [{ "Name": "EngineName", "Value": "postgres" }] } } post_type: JSON headers: - name: Authorization value: 'Bearer {#TOKEN}' - name: Content-Type value: application/json request_method: POST timeout: 10s url: '{$API_SERVER}/auth/get/credentials' headers: - name: Authorization value: 'Basic YWRtaW46emFiYml4' - name: Content-Type value: application/json - name: Cache-Control value: No-Store request_method: POST lld_macro_paths: - lld_macro: '{#TOKEN}' path: $.token - lld_macro: '{#ACCOUNT}' path: $.account - lld_macro: '{#TTL}' path: $.ttl macros: - macro: '{$API_SERVER}' value: 'http://10.1.2.100:3000' description: 'IP y Puerto en que escucha la API' - macro: '{$BASICTOKEN}' value: YWRtaW46emFiYml4 description: 'Usr: admin Psw: zabbix' - macro: '{$REGION}' value: eu-west-1 description: 'Region de AWS'