Univention Bugzilla – Bug 39509
get_notifier_id.py fails on IPv6 systems.
Last modified: 2016-07-21 15:16:10 CEST
nagios/plugins/check_univention_replication cannot generate a notifier id on systems where the master hostname is resolved as an IPv6 address. nagios/plugins/check_univention_replication uses management/univention-directory-listener/python/get_notifier_id.py to get the notifier id. This script uses a tcp socket to communicate with the master, which is initialized as socket.AF_INET and therefore not able to connect over IPv6: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((master, 6669)) sock.send('Version: 2\nCapabilities: \n\n') sock.recv(100) sock.send('MSGID: 1\nGET_ID\n\n') notifier_result = sock.recv(100) if notifier_result: print "%s" % notifier_result.splitlines()[1] except socket.error, ex: print >> sys.stderr, 'Error: %s' % (ex,) sys.exit(1) This results in most tests in ucs-test to fail like this, with nid set to "Error: [Errno -2]". [2015-10-05 12:59:04.198281]CRITICAL: no change of listener transaction id for last 0 checks (nid=Error: [Errno -2] Name or service not known lid=314) [2015-10-05 12:59:05.254182]CRITICAL: no change of listener transaction id for last 0 checks (nid=Error: [Errno -2] Name or service not known lid=314) [...] [2015-10-05 13:04:20.786333]CRITICAL: no change of listener transaction id for last 0 checks (nid=Error: [Errno -2] Name or service not known lid=314) [2015-10-05 13:04:21.835229]CRITICAL: no change of listener transaction id for last 0 checks (nid=Error: [Errno -2] Name or service not known lid=314) [2015-10-05 13:04:22.838307]Error: replication incomplete.
Created attachment 7250 [details] proposed patch
I propose the attached patch, which uses socket.create_connection(), which is higher level than socket.socket().connect(), and is able to detect the correct protocol version. Tested (by hand) on an ipv4 and an ipv6 setup.
This bug breaks all ucs-test scripts in IPv6 environments using wait_for_replication.
r69890 | Bug #39509 UDL: Add IPv6 support for get_notifier_id.py Package: univention-directory-listener Version: 10.0.0-11.315.201606071717 Branch: ucs_4.1-0 Scope: errata4.1-2 r69910 | Bug #22383,Bug #30227,Bug #30263,Bug #34324,Bug #34507,Bug #34738,Bug #3490,Bug #38696,Bug #39509,Bug #40600,Bug #41261: UDL YAML univention-directory-listener.yaml
r69891 | Bug #39509 UDL: autopep8
See Bug 28232 Comment 3.
(In reply to Arvid Requate from comment #6) > See Bug 28232 Comment 3. r71061 | Bug #39509 UDL: Make tab-lovers happy again
Code: review: Ok Advisory: Ok
<http://errata.software-univention.de/ucs/4.1/215.html>