* TCP and UDP (Generic)

check_listen_tcp_udp.sh

Description:

This Nagios Plugin checks if there is any program listening on specified TCP/UDP port.

Current Version

Last Release Date

June 24, 2009

Compatible With


Project Files
Project Notes
This plugin is used to check if there is a listening socket on specified port with specified protocol (can be "tcp", "udp", "any"). Currently, the plugin uses following bash and Unix commands: - netstat - sed (with extended regular expression -- -r option) - grep (with extended regular expression -- -E option) I think that the plugin may be easily improved and optimized, but it works fine for me. example of use: To ensure that a DNS server is listening on localhost, with a TCP socket: $ check_listen_tcp_udp.sh -p 53 -P tcp -l 127.0.0.1
Reviews (2) Add a Review
Wrong shebang
by ninuzzo, May 31, 2013

It does not require to send a message and an expected response like check_udp, but PLEASE change the #!/bin/sh shebang line into #!/bin/bash Almost everybody has bash and the script is using some bash-specific features, so does not run in sh in Linux.



No service listening
by gds, April 30, 2011

Thanks but it works only for the localhost



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.8 (4)
Favorites
1
Views
110,838