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 name ('tcp') is truncated when --scheme is used #77

Open deepakdeore2004 opened 6 years ago

deepakdeore2004 commented 6 years ago

without --scheme usage:

[ec2-user@ip-10-127-251-45 ~]$ /opt/sensu/embedded/bin/metrics-netstat-tcp.rb -d ip-10-127-251-45.us-west-2.compute.internal.tcp.UNKNOWN 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.ESTABLISHED 2 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.SYN_SENT 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.SYN_RECV 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.FIN_WAIT1 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.FIN_WAIT2 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.TIME_WAIT 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.CLOSE 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.CLOSE_WAIT 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.LAST_ACK 0 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.LISTEN 2 1522370627 ip-10-127-251-45.us-west-2.compute.internal.tcp.CLOSING 0 1522370627

tcp is truncated when --scheme is used: [ec2-user@ip-10-127-251-45 ~]$ /opt/sensu/embedded/bin/metrics-netstat-tcp.rb -d --scheme web-server web-server.UNKNOWN 0 1522370637 web-server.ESTABLISHED 2 1522370637 web-server.SYN_SENT 0 1522370637 web-server.SYN_RECV 0 1522370637 web-server.FIN_WAIT1 0 1522370637 web-server.FIN_WAIT2 0 1522370637 web-server.TIME_WAIT 0 1522370637 web-server.CLOSE 0 1522370637 web-server.CLOSE_WAIT 0 1522370637 web-server.LAST_ACK 0 1522370637 web-server.LISTEN 2 1522370637 web-server.CLOSING 0 1522370637

I added '.tcp.' int scheme option to tackle this problem, so not a big issue but thought to notify.

Evesy commented 6 years ago

Hey,

I believe this is intended behaviour in line with all other metrics plugins; allowing users to completely redefine the metrics path.

Are there examples of other plugins where this behaviour is different that you've come across?