Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_listen_tcp_udp.sh

Rating
4 votes
Favoured:
1
Hits
107117
Files:
FileDescription
check_listen_tcp_udp.shcheck_listen_tcp_udp.sh version 0.1
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This Nagios Plugin checks if there is any program listening on specified TCP/UDP port.
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)
byninuzzo, May 22, 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.
bygds, April 13, 2011
Thanks but it works only for the localhost