Eventscripts - generalise TCP port checking plus new nmap-based checker
authorMartin Schwenke <martin@meltin.net>
Wed, 17 Aug 2011 02:12:20 +0000 (12:12 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 17 Aug 2011 02:12:20 +0000 (12:12 +1000)
commitd9651175b40b9454e7d4e98291955fcf1445085e
tree828e79674e2c96e1815dfc1ce3bac71ede727bbd
parent44c14aeeb11080980fe07c7396d06843a4870747
Eventscripts - generalise TCP port checking plus new nmap-based checker

Split the netstat-specific parts of ctdb_check_tcp_ports() into new
function ctdb_check_tcp_ports_netstat().

Implement new ctdb_check_tcp_ports_nmap() function that uses
"nmap -PS" to check if the desired ports are listening.

ctdb_check_ctdb_ports() now uses new configuration variable
CTDB_TCP_PORT_CHECKERS to decide which port checkers to try.  Default
value is currently "nmap netstat".  If nmap is not found then this
will fall back to netstat - if logging is at debug level this will
also fill the logs with message saying the nmap checker failed.  This
indicates that either nmap should be installed or the default value of
CTDB_TCP_PORT_CHECKERS should be changed (in a configuration file) to
avoid trying to use nmap.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/functions