sensu-plugins / sensu-plugins-network-checks

This plugin provides native network instrumentation for monitoring and metrics collection, including: hardware, TCP response, RBLs, whois, port status, and more.
http://sensu-plugins.io
MIT License
30 stars 76 forks source link

metrics-sockstat.rb does not output hostname as first field #102

Open noahbailey opened 5 years ago

noahbailey commented 5 years ago

When using this metrics plugin for Grafana via InfluxDB, it does not get added to the correct measurement.

Expected behaviour: The first field should contain the hostname of the server it runs on. Observed behaviour: The first field is 'network' which puts all the metrics under the same measurement in InfluxDB making it rather useless for visualizations in grafana.

What it looks like: network.sockets.total_used 298 1558632775

What it should look like: my-server-name-here.network.sockets.total_used 298 1558632775

Appreciate all the work you guys do, thanks so much!

rwky commented 5 years ago

This is due to this line https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/metrics-sockstat.rb#L38

You can adjust it using the --scheme flag but I agree it should match the format used here https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/metrics-netstat-tcp.rb#L73