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

fetch config json file mixed up #9

Open
jschaeff opened this issue Aug 24, 2016 · 0 comments
Open

fetch config json file mixed up #9

jschaeff opened this issue Aug 24, 2016 · 0 comments

Comments

@jschaeff
Copy link

When munin contains several hosts with common metrics (for instance uptime or cpu), there is only one "tag" section with one host.

"tags": {
    "cpu": {
      "domain": "testnodes",
      "host": "pmtest3",
      "plugin": "cpu"
    },
}

This makes future fetch operation write all values from different hosts with the tag host="pmtest3" instead of the right one.

in fetch.py, the tags are computed out of the config file:

    return [{
            "measurement": measurement,
            "tags": config['tags'][measurement],
            "time": fields['time'],
            "fields": {key: value for key, value in fields.iteritems() if key != 'time'}
        } for measurement, fields in data.iteritems()]

As a dirty workaround, I forced domain and tags config before the return statement:

    for measurement, fields in data.iteritems():
        config['tags'][measurement]['host'] = host
        config['tags'][measurement]['domain'] = domain
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