Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t3. ec2 instance metrics discovery #8

Open
vti-uplata opened this issue Jun 24, 2019 · 0 comments
Open

t3. ec2 instance metrics discovery #8

vti-uplata opened this issue Jun 24, 2019 · 0 comments

Comments

@vti-uplata
Copy link

vti-uplata commented Jun 24, 2019

When i've tried to discover metrics for my t3.* instance, i've got this responce:

{"data":[{"{#METRIC.NAME}":"NetworkPacketsIn","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSReadBytes","{#METRIC.UNIT}":"Bytes","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"NetworkPacketsOut","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSReadOps","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"CPUCreditUsage","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSIOBalance%!"(MISSING),"{#METRIC.UNIT}":"Percent","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"CPUSurplusCreditBalance","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"CPUCreditBalance","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"CPUUtilization","{#METRIC.UNIT}":"Percent","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSWriteOps","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"NetworkOut","{#METRIC.UNIT}":"Bytes","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"StatusCheckFailed_Instance","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"NetworkIn","{#METRIC.UNIT}":"Bytes","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSWriteBytes","{#METRIC.UNIT}":"Bytes","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"EBSByteBalance%!"(MISSING),"{#METRIC.UNIT}":"Percent","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"CPUSurplusCreditsCharged","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"StatusCheckFailed_System","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"},{"{#METRIC.NAME}":"StatusCheckFailed","{#METRIC.UNIT}":"Count","{#METRIC.NAMESPACE}":"AWS/EC2"}]}

And that's not a valid JSON object (already confirmed that at https://jsonlint.com/), because there are two metrics with "broken" names:

"{#METRIC.NAME}": "EBSIOBalance%!"(MISSING),
and
"{#METRIC.NAME}": "EBSByteBalance%!"(MISSING),

It appears, that "(MISSING)" string breaks json format.

As i am not a programmer, but a jack-of-no-trades OPS, i have no knowledge how to fix that in source code. And suddenly an idea came into my mind - i can solve this with bash and sed like this:

  1. 've renamed zaws to zaws-bin
  2. 've created shell-script zaws with such content:

`#!/bin/bash

/usr/lib/zabbix/externalscripts/zaws-bin $@ | sed -e "s|(MISSING)||g"`

So, if anyone can fix this issue in source code and build new binary - it would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant