I’m working on moving from graphite to influxdb, and I set this up: https://github.com/jhrv/sensu-influxdb-extension and it seems to be working. My issue is that previously we were using the client hostname in the metric output, ex. (host1.cpu.usage), but it seems with Influx, I would actually want the hostname passed as a tag opposed to being in the measurement name. Does anyone know if there’s a way to use some sort of hostname variable in the sensu config so it can resolve that client’s hostname when the check is run?
Thanks.
You could use check token substitution and add a tags attribute with the name of the client. In your check definition you would add:
…
“tags”: {
“hostname”: “:::name:::”
}
Alternatively whatever you use to configure the client could add a tags section in the client config containing the hostname and that tag would be included with every metrics result.
···
On Mon, Mar 20, 2017 at 6:09 PM, Jack Watroba jwatroba@improvementdirect.com wrote:
I’m working on moving from graphite to influxdb, and I set this up: https://github.com/jhrv/sensu-influxdb-extension and it seems to be working. My issue is that previously we were using the client hostname in the metric output, ex. (host1.cpu.usage), but it seems with Influx, I would actually want the hostname passed as a tag opposed to being in the measurement name. Does anyone know if there’s a way to use some sort of hostname variable in the sensu config so it can resolve that client’s hostname when the check is run?
Thanks.
Awesome, that worked great. Thanks!
···
On Monday, March 20, 2017 at 10:13:14 PM UTC-7, Eric Heydrick wrote:
You could use check token substitution and add a tags attribute with the name of the client. In your check definition you would add:
…
“tags”: {
“hostname”: “:::name:::”
}
Alternatively whatever you use to configure the client could add a tags section in the client config containing the hostname and that tag would be included with every metrics result.
On Mon, Mar 20, 2017 at 6:09 PM, Jack Watroba jwat...@improvementdirect.com wrote:
I’m working on moving from graphite to influxdb, and I set this up: https://github.com/jhrv/sensu-influxdb-extension and it seems to be working. My issue is that previously we were using the client hostname in the metric output, ex. (host1.cpu.usage), but it seems with Influx, I would actually want the hostname passed as a tag opposed to being in the measurement name. Does anyone know if there’s a way to use some sort of hostname variable in the sensu config so it can resolve that client’s hostname when the check is run?
Thanks.