Simple bash-script that uses nmap to check the state of a specific network-port (tcp or udp) on a given host.
**Usage:
**
check_network_port.sh -H -p
A Nagios Plugin that checks if the specified host is listening on specified
TCP/UDP port.Â
Options:
 -h --help               print this help message
 -V --version            print program version
 -H        The host, the specified port is to be tested on
 -p                The port number the host should listen to.
Example:
To check, if host myserver is listening on the port 80:
 $ ./check_network_port.sh -H myserver -p 80
**Sample-Outputs:
**
OK - Port 80 (tcp) is open
UNKNOWN - Port 80 (tcp) is filtered
CRITICAL - Port 80 (tcp) is closed