View | Details | Raw Unified | Return to bug 44875
Collapse All | Expand All

(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/check_notifier_replication.py (-2 / +67 lines)
Line 0    Link Here 
0
- 
1
#!/usr/bin/python2.7
2
# coding: utf-8
3
#
4
# Univention Management Console module:
5
#  System Diagnosis UMC module
6
#
7
# Copyright 2016-2017 Univention GmbH
8
#
9
# http://www.univention.de/
10
#
11
# All rights reserved.
12
#
13
# The source code of this program is made available
14
# under the terms of the GNU Affero General Public License version 3
15
# (GNU AGPL V3) as published by the Free Software Foundation.
16
#
17
# Binary versions of this program provided by Univention to you as
18
# well as other copyrighted, protected or trademarked materials like
19
# Logos, graphics, fonts, specific documentations and configurations,
20
# cryptographic keys etc. are subject to a license agreement between
21
# you and Univention and not subject to the GNU AGPL V3.
22
#
23
# In the case you use this program under the terms of the GNU AGPL V3,
24
# the program is provided in the hope that it will be useful,
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
# GNU Affero General Public License for more details.
28
#
29
# You should have received a copy of the GNU Affero General Public
30
# License with the Debian GNU/Linux or Univention distribution in file
31
# /usr/share/common-licenses/AGPL-3; if not, see
32
# <http://www.gnu.org/licenses/>.
33
34
from subprocess import Popen, PIPE, STDOUT
35
from univention.management.console.modules.diagnostic import Critical
36
37
from univention.lib.i18n import Translation
38
_ = Translation('univention-management-console-module-diagnostic').translate
39
40
title = _('Check for problems with ldap replication')
41
description = _('No problems found with ldap replication')
42
43
44
def run():
45
	process = Popen(["/usr/share/univention-directory-listener/get_notifier_id.py"], stdout=PIPE, stderr=STDOUT)
46
	if process.returncode:
47
		description = _("Calling /usr/share/univention-directory-listener/get_notifier_id.py faield")
48
		raise Critical("\n".join([
49
			description,
50
			"Returncode of process: %s" % (process.returncode)
51
		]))
52
	stdout, stderr = process.communicate()
53
	f = open("/var/lib/univention-directory-listener/notifier_id", "r")
54
	s = f.read()
55
	if stdout.rstrip() == s:
56
		return
57
	else:
58
		description = _("Notifier ids are different.")
59
		raise Critical("\n".join([
60
			description,
61
			"Id from Master: %s" % (stdout.rstrip()),
62
			"Id from local system: %s" % (s)
63
		]))
64
65
if __name__ == '__main__':
66
	from univention.management.console.modules.diagnostic import main
67
	main()
1
`check_notifier_replication.py`
68
`check_notifier_replication.py`
2
--
3
.../plugins/check_notifier_replication.py          | 64 ++++++++++++++--------
69
.../plugins/check_notifier_replication.py          | 64 ++++++++++++++--------
4
1 file changed, 42 insertions(+), 22 deletions(-)
70
1 file changed, 42 insertions(+), 22 deletions(-)
5
mode change 100644 => 100755 management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/check_notifier_replication.py
71
mode change 100644 => 100755 management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/check_notifier_replication.py
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/check_notifier_replication.py (-24 / +42 lines)
 Lines 31-66    Link Here 
31
# /usr/share/common-licenses/AGPL-3; if not, see
31
# /usr/share/common-licenses/AGPL-3; if not, see
32
# <http://www.gnu.org/licenses/>.
32
# <http://www.gnu.org/licenses/>.
33
33
34
from subprocess import Popen, PIPE, STDOUT
34
import socket
35
from univention.management.console.modules.diagnostic import Critical
35
36
import univention.config_registry
37
from univention.management.console.modules.diagnostic import Warning
36
38
37
from univention.lib.i18n import Translation
39
from univention.lib.i18n import Translation
38
_ = Translation('univention-management-console-module-diagnostic').translate
40
_ = Translation('univention-management-console-module-diagnostic').translate
39
41
40
title = _('Check for problems with ldap replication')
42
title = _('Check for problems with UDN replication')
41
description = _('No problems found with ldap replication')
43
description = _('No problems found with UDN replication.')
44
45
links = [{
46
	'name': 'sdb',
47
	'href': _('http://sdb.univention.de/content/14/295/en/troubleshooting-listener__notifier.html'),
48
	'label': _('Univention Support Database - Troubleshooting: Listener-/Notifier')
49
}]
50
51
52
def get_id(master, cmd='GET_ID'):
53
	sock = socket.create_connection((master, 6669))
54
55
	sock.send('Version: 2\nCapabilities: \n\n')
56
	sock.recv(100)
57
58
	sock.send('MSGID: 1\n{cmd}\n\n'.format(cmd=cmd))
59
	notifier_result = sock.recv(100).strip()
60
61
	(msg_id, notifier_id) = notifier_result.split('\n', 1)
62
	return notifier_id
42
63
43
64
44
def run():
65
def run():
45
	process = Popen(["/usr/share/univention-directory-listener/get_notifier_id.py"], stdout=PIPE, stderr=STDOUT)
66
	configRegistry = univention.config_registry.ConfigRegistry()
46
	if process.returncode:
67
	configRegistry.load()
47
		description = _("Calling /usr/share/univention-directory-listener/get_notifier_id.py faield")
68
48
		raise Critical("\n".join([
69
	try:
49
			description,
70
		notifier_id = get_id(configRegistry.get('ldap/master'))
50
			"Returncode of process: %s" % (process.returncode)
71
	except socket.error:
51
		]))
72
		raise Warning(_('Error retrieving notifier ID from the UDN.'))
52
	stdout, stderr = process.communicate()
53
	f = open("/var/lib/univention-directory-listener/notifier_id", "r")
54
	s = f.read()
55
	if stdout.rstrip() == s:
56
		return
57
	else:
73
	else:
58
		description = _("Notifier ids are different.")
74
		with open('/var/lib/univention-directory-listener/notifier_id') as fob:
59
		raise Critical("\n".join([
75
			id_from_file = fob.read().strip()
60
			description,
76
61
			"Id from Master: %s" % (stdout.rstrip()),
77
		if notifier_id != id_from_file:
62
			"Id from local system: %s" % (s)
78
			ed = [
63
		]))
79
				_('Univention Directory Notifier ID and the locally stored version differ.'),
80
				_('This might indicate an error or still processing transactions.')
81
			]
82
			raise Warning('\n'.join(ed))
83
64
84
65
if __name__ == '__main__':
85
if __name__ == '__main__':
66
	from univention.management.console.modules.diagnostic import main
86
	from univention.management.console.modules.diagnostic import main
67
- 
68
`check_notifier_replication.py` (po)
87
`check_notifier_replication.py` (po)
69
--
70
.../umc/python/diagnostic/de.po                    | 37 ++++++++++++++++++++--
88
.../umc/python/diagnostic/de.po                    | 37 ++++++++++++++++++++--
71
1 file changed, 35 insertions(+), 2 deletions(-)
89
1 file changed, 35 insertions(+), 2 deletions(-)
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po (-3 / +35 lines)
 Lines 2-9    Link Here 
2
msgid ""
2
msgid ""
3
msgstr ""
3
msgstr ""
4
"Project-Id-Version: univention-management-console-module-diagnostic\n"
4
"Project-Id-Version: univention-management-console-module-diagnostic\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
5
"Report-Msgid-Bugs-To: \n"
6
"POT-Creation-Date: 2016-01-14 12:19+0100\n"
6
"POT-Creation-Date: 2017-06-27 17:06+0200\n"
7
"PO-Revision-Date: \n"
7
"PO-Revision-Date: \n"
8
"Last-Translator: Univention GmbH <packages@univention.de>\n"
8
"Last-Translator: Univention GmbH <packages@univention.de>\n"
9
"Language-Team: Univention GmbH <packages@univention.de>\n"
9
"Language-Team: Univention GmbH <packages@univention.de>\n"
 Lines 27-32   msgstr "" Link Here 
27
msgid "Adjust to suggested limits"
27
msgid "Adjust to suggested limits"
28
msgstr "An vorgeschlagene Limits anpassen"
28
msgstr "An vorgeschlagene Limits anpassen"
29
29
30
#: umc/python/diagnostic/plugins/check_notifier_replication.py:42
31
msgid "Check for problems with UDN replication"
32
msgstr "Überprüfe Probleme mit der UDN Replikation"
33
34
#: umc/python/diagnostic/plugins/check_notifier_replication.py:72
35
msgid "Error retrieving notifier ID from the UDN."
36
msgstr "Fehler beim Abrufen der letzten Transaktions ID vom UDN."
37
30
#: umc/python/diagnostic/plugins/gateway.py:11
38
#: umc/python/diagnostic/plugins/gateway.py:11
31
msgid "Gateway is not reachable"
39
msgid "Gateway is not reachable"
32
msgstr "Gateway ist nicht erreichbar"
40
msgstr "Gateway ist nicht erreichbar"
 Lines 97-102   msgstr "" Link Here 
97
msgid "Nameserver(s) are not responsive"
105
msgid "Nameserver(s) are not responsive"
98
msgstr "Nameserver sind nicht ansprechbar"
106
msgstr "Nameserver sind nicht ansprechbar"
99
107
108
#: umc/python/diagnostic/plugins/check_notifier_replication.py:43
109
msgid "No problems found with UDN replication."
110
msgstr "Keine Prolbleme mit der UDN Replikation gefunden."
111
100
#: umc/python/diagnostic/plugins/package_status.py:11
112
#: umc/python/diagnostic/plugins/package_status.py:11
101
msgid "Package status corrupt"
113
msgid "Package status corrupt"
102
msgstr "Paketstatus korrupt"
114
msgstr "Paketstatus korrupt"
 Lines 249-254   msgstr "" Link Here 
249
"an Samba-Servern unmöglich, Dateioperationen (Kopieren, Verschieben) auf "
261
"an Samba-Servern unmöglich, Dateioperationen (Kopieren, Verschieben) auf "
250
"Freigaben kann fehlschlagen, uvm.)"
262
"Freigaben kann fehlschlagen, uvm.)"
251
263
264
#: umc/python/diagnostic/plugins/check_notifier_replication.py:80
265
msgid "This might indicate an error or still processing transactions."
266
msgstr ""
267
"Dies mag auf einen Fehler oder noch ausstehende Transaktionen hinweisen."
268
252
#: umc/python/diagnostic/plugins/proxy.py:83
269
#: umc/python/diagnostic/plugins/proxy.py:83
253
#, python-format
270
#, python-format
254
msgid ""
271
msgid ""
 Lines 260-265   msgstr "" Link Here 
260
"dass Authentifikations-Zugangsdaten (falls existierend) korrekt sind und die "
277
"dass Authentifikations-Zugangsdaten (falls existierend) korrekt sind und die "
261
"ACL's des Proxy-Servers nicht verbieten, Anfragen an %s zu stellen."
278
"ACL's des Proxy-Servers nicht verbieten, Anfragen an %s zu stellen."
262
279
280
#: umc/python/diagnostic/plugins/check_notifier_replication.py:79
281
msgid "Univention Directory Notifier ID and the locally stored version differ."
282
msgstr ""
283
"Univention Directory Notifier ID und die lokal gespeicherte Version "
284
"unterscheiden sich."
285
286
#: umc/python/diagnostic/plugins/check_notifier_replication.py:48
287
msgid "Univention Support Database - Troubleshooting: Listener-/Notifier"
288
msgstr ""
289
290
#: umc/python/diagnostic/plugins/check_notifier_replication.py:47
291
msgid ""
292
"http://sdb.univention.de/content/14/295/en/troubleshooting-"
293
"listener__notifier.html"
294
msgstr ""
295
263
#: umc/python/diagnostic/plugins/package_status.py:28
296
#: umc/python/diagnostic/plugins/package_status.py:28
264
msgid "some"
297
msgid "some"
265
msgstr "einigen"
298
msgstr "einigen"
266
- 

Return to bug 44875