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

Check both TCP and UDP ports #28

Closed jcastillocano closed 8 years ago

jcastillocano commented 8 years ago

I added a new param (Protocol) to be able to check both TCP and UDP ports using TCPSocket and UDPSocket classes.

I also added some spec tests for check-ports.rb.

Please review it!

jcastillocano commented 8 years ago

Using ruby 2.X syntax on test file.

jcastillocano commented 8 years ago

The behaviour of UDP ports is more like 'having a socket open on it by a process' than 'I can reach that port because I have a valid response', but I guess it's worthy to have it integrated in check-ports.rb.