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

(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/__init__.py (-1 / +2 lines)
 Lines 100-106   class Instance(Base, ProgressMixin): Link Here 
100
	def run(self, plugin, args=None):
100
	def run(self, plugin, args=None):
101
		plugin = self.get(plugin)
101
		plugin = self.get(plugin)
102
		MODULE.process('Running %s' % (plugin,))
102
		MODULE.process('Running %s' % (plugin,))
103
		MODULE.process(''.join(plugin.run_descr,))
103
		for line in plugin.run_descr:
104
			MODULE.process(line)
104
		args = args or {}
105
		args = args or {}
105
		def thread(self, request):
106
		def thread(self, request):
106
			return plugin.execute(self, **args)
107
			return plugin.execute(self, **args)
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po (-4 / +4 lines)
 Lines 345-355   msgstr "" Link Here 
345
345
346
#: umc/python/diagnostic/plugins/53_package_status.py:14
346
#: umc/python/diagnostic/plugins/53_package_status.py:14
347
msgid ""
347
msgid ""
348
"Login to the system as root via ssh and run the command \"dpkg --configure -a"
348
"You may log in to the system as root via ssh and run the command \"dpkg "
349
"\" in order to correct the packages status."
349
"--configure -a\" as an attempt to correct the packages status."
350
msgstr ""
350
msgstr ""
351
"Um den Paketstatus zu korrigieren loggen Sie sich am System per ssh als root "
351
"Um den Paketstatus zu korrigieren, können Sie sich am System per ssh als "
352
"ein und führen Sie das Kommando \"dpkg --configure -a\" aus."
352
"root einloggen und das Kommando \"dpkg --configure -a\" ausführen."
353
353
354
#: umc/python/diagnostic/plugins/01_ssh_connection.py:66
354
#: umc/python/diagnostic/plugins/01_ssh_connection.py:66
355
msgid "Machine authentication failed"
355
msgid "Machine authentication failed"
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/00_check_server_password.py (-1 / +1 lines)
 Lines 48-54   from univention.management.console.modules.diagnostic import Critical, ProblemFi Link Here 
48
48
49
from univention.lib.i18n import Translation
49
from univention.lib.i18n import Translation
50
_ = Translation('univention-management-console-module-diagnostic').translate
50
_ = Translation('univention-management-console-module-diagnostic').translate
51
run_descr = ["Trying to authenticatate with machine password against LDAP  Similar to running: univention-ldapsearch -LLLs base dn"]
51
run_descr = ['Trying to authenticate with machine password against LDAP', 'Similar to running: univention-ldapsearch -LLLs base dn']
52
title = _('Check machine password')
52
title = _('Check machine password')
53
description = _('Authentication with machine password against LDAP successful.')
53
description = _('Authentication with machine password against LDAP successful.')
54
links = [{
54
links = [{
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/01_ssh_connection.py (-2 / +2 lines)
 Lines 16-22   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
16
16
17
title = _('SSH connection to UCS server failed!')
17
title = _('SSH connection to UCS server failed!')
18
18
19
run_descr =['This can be checked by running:  univention-ssh /etc/machine.secret "%s$"@%s echo OK'  %  (ucr["hostname"], 'fqdn')]
19
ucr.load()
20
run_descr = ['This can be checked by running:  univention-ssh /etc/machine.secret "%s$"@%s echo OK'  %  (ucr["hostname"], 'fqdn')]
20
class IgnorePolicy(paramiko.MissingHostKeyPolicy):
21
class IgnorePolicy(paramiko.MissingHostKeyPolicy):
21
22
22
	def missing_host_key(self, client, hostname, key):
23
	def missing_host_key(self, client, hostname, key):
 Lines 24-30   class IgnorePolicy(paramiko.MissingHostKeyPolicy): Link Here 
24
25
25
26
26
def run(_umc_instance):
27
def run(_umc_instance):
27
	ucr.load()
28
	# Now a workaround for paramico logging to connector-s4.log
28
	# Now a workaround for paramico logging to connector-s4.log
29
	# because one of the diagnostic plugins instanciates s4connector.s4.s4()
29
	# because one of the diagnostic plugins instanciates s4connector.s4.s4()
30
	# which initializes univention.debug2, which initializes logging.basicConfig
30
	# which initializes univention.debug2, which initializes logging.basicConfig
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/02_certificate_check.py (-1 / +1 lines)
 Lines 47-53   from univention.management.console.modules.diagnostic import Critical, Warning, Link Here 
47
47
48
from univention.lib.i18n import Translation
48
from univention.lib.i18n import Translation
49
_ = Translation('univention-management-console-module-diagnostic').translate
49
_ = Translation('univention-management-console-module-diagnostic').translate
50
run_descr=['This can be checked by running ucr get server/roles and ucr get ldap/master']
50
run_descr=['This can be checked by running: ucr get server/roles and ucr get ldap/master']
51
title = _('Check validity of SSL certificates')
51
title = _('Check validity of SSL certificates')
52
description = _('All SSL certificates valid.')
52
description = _('All SSL certificates valid.')
53
links = [{
53
links = [{
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/03_check_notifier_replication.py (-1 / +1 lines)
 Lines 37-43   import univention.config_registry Link Here 
37
from univention.management.console.modules.diagnostic import Warning, MODULE
37
from univention.management.console.modules.diagnostic import Warning, MODULE
38
from univention.lib.i18n import Translation
38
from univention.lib.i18n import Translation
39
_ = Translation('univention-management-console-module-diagnostic').translate
39
_ = Translation('univention-management-console-module-diagnostic').translate
40
run_descr=['get id of ucr get ldap/master and check if var/lib/univention-directory-listener/notifier_id) is the same ']
40
run_descr=['get last_id from ldap/master and check that /var/lib/univention-directory-listener/notifier_id is the same']
41
title = _('Check for problems with UDN replication')
41
title = _('Check for problems with UDN replication')
42
description = _('No problems found with UDN replication.')
42
description = _('No problems found with UDN replication.')
43
43
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/10_gateway.py (-1 / +1 lines)
 Lines 20-26   umc_modules = [{ Link Here 
20
	'flavor': 'network'
20
	'flavor': 'network'
21
}]
21
}]
22
22
23
run_descr =['This can be checked by using ucr get gateway']
23
run_descr =['This can be checked by running: ping "$(ucr get gateway)"']
24
24
25
def run(_umc_instance):
25
def run(_umc_instance):
26
	ucr.load()
26
	ucr.load()
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/11_nameserver.py (-2 / +3 lines)
 Lines 28-44   def run(_umc_instance): Link Here 
28
	ucr.load()
28
	ucr.load()
29
	failed = []
29
	failed = []
30
30
31
	fqdn = ".".join((ucr['hostname'], ucr['domainname']))
31
	hostnames = {
32
	hostnames = {
32
		'www.univention.de': ('dns/forwarder1', 'dns/forwarder2', 'dns/forwarder3'),
33
		'www.univention.de': ('dns/forwarder1', 'dns/forwarder2', 'dns/forwarder3'),
33
		ucr.get('hostname', ''): ('nameserver1', 'nameserver2', 'nameserver3')
34
		fqdn: ('nameserver1', 'nameserver2', 'nameserver3')
34
	}
35
	}
35
	for hostname, nameservers in hostnames.iteritems():
36
	for hostname, nameservers in hostnames.iteritems():
36
		for nameserver in nameservers:
37
		for nameserver in nameservers:
37
			if not ucr.get(nameserver):
38
			if not ucr.get(nameserver):
38
				continue
39
				continue
39
			
40
			
40
			MODULE.process("Similar to running: dig +short %s @%s" %(hostname,ucr[nameserver]))
41
			MODULE.process("Trying %s to resolve %s" %(ucr[nameserver],hostname))
41
			MODULE.process("Trying %s to resolve %s" %(ucr[nameserver],hostname))
42
			MODULE.process("Similar to running: dig +short %s @%s" %(hostname,ucr[nameserver]))
42
			try:
43
			try:
43
				query_dns_server(ucr[nameserver], hostname)
44
				query_dns_server(ucr[nameserver], hostname)
44
			except DNSException as exc:
45
			except DNSException as exc:
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/20_check_nameservers.py (-2 / +2 lines)
 Lines 170-177   class UDM(object): Link Here 
170
	def find(self, nameserver):
170
	def find(self, nameserver):
171
171
172
		filter_expression = nameserver.build_filter()
172
		filter_expression = nameserver.build_filter()
173
		MODULE.process("Trying to find nameserver %s in UDM/LDAP" %(nameserver))
173
		MODULE.process("Trying to find nameserver %s in UDM/LDAP" %(nameserver.fqdn()))
174
		MODULE.process("Similar to running: univention-ldapsearch %s" %(filter_expression))
174
		MODULE.process("Similar to running: univention-ldapsearch '%s'" %(filter_expression))
175
		for (dn, attr) in self.ldap_connection.search(filter_expression):
175
		for (dn, attr) in self.ldap_connection.search(filter_expression):
176
			if dn:
176
			if dn:
177
				for module in udm_modules.identify(dn, attr):
177
				for module in udm_modules.identify(dn, attr):
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/22_kdc_service.py (-3 / +3 lines)
 Lines 56-62   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
56
56
57
title = _('KDC service check')
57
title = _('KDC service check')
58
description = ['The check for the KDC reachability was succesful.']
58
description = ['The check for the KDC reachability was succesful.']
59
run_descr = ['Makes a KDC reachability check']
59
run_descr = ['Performs a KDC reachability check']
60
60
61
61
62
# This checks for the reachability of KDCs by sending a AS-REQ per TCP and UDP.
62
# This checks for the reachability of KDCs by sending a AS-REQ per TCP and UDP.
 Lines 248-255   def send_and_receive(kdc, port, protocol, as_req): Link Here 
248
248
249
def probe_kdc(kdc, port, protocol, target_realm, user_name):
249
def probe_kdc(kdc, port, protocol, target_realm, user_name):
250
	request = build_kerberos_request(target_realm, user_name)
250
	request = build_kerberos_request(target_realm, user_name)
251
	MODULE.process("Trying to cantact KDC %s on port %d" %(kdc,port))
251
	MODULE.process("Trying to contact KDC %s on port %d" %(kdc,port))
252
	MODULE.process("Similar to running: nmap%s -p %d" %(kdc,port))
252
	MODULE.process("Similar to running: nmap %s -p %d" %(kdc,port))
253
	try:
253
	try:
254
		received = send_and_receive(kdc, port, protocol, request)
254
		received = send_and_receive(kdc, port, protocol, request)
255
	except KerberosException:
255
	except KerberosException:
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/32_security_limits.py (-1 / +1 lines)
 Lines 32-38   buttons = [{ Link Here 
32
	'action': 'adjust'
32
	'action': 'adjust'
33
}]
33
}]
34
actions = {}  # filled at bottom
34
actions = {}  # filled at bottom
35
run_descr = ['checks samba logfile /var/log/samba/log.smbd for "too many open files" messages \n checks if ucr get samba/max_open_files is set to the suggested value of 32808']
35
run_descr = ['checks samba logfile /var/log/samba/log.smbd for "too many open files" messages', 'and checks if ucr get samba/max_open_files is set to the suggested value of 32808']
36
36
37
37
38
def run(_umc_instance):
38
def run(_umc_instance):
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/40_samba_tool_dbcheck.py (-1 / +1 lines)
 Lines 38-44   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
38
38
39
title = _('Check local AD database for errors')
39
title = _('Check local AD database for errors')
40
description = _('No errors found.'),
40
description = _('No errors found.'),
41
run_descr = ['This can be checked by running samba-tool dbcheck']
41
run_descr = ['This can be checked by running: samba-tool dbcheck']
42
42
43
43
44
def run_samba_tool_dbcheck_fix(umc_instance):
44
def run_samba_tool_dbcheck_fix(umc_instance):
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/42_samba_tool_sysvolcheck.py (-1 / +1 lines)
 Lines 39-45   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
39
39
40
title = _('Check Samba sysvol ACLs for errors')
40
title = _('Check Samba sysvol ACLs for errors')
41
description = _('No errors found.'),
41
description = _('No errors found.'),
42
run_descr = ['This can be checked by running samba-tool ntacl sysvolcheck']
42
run_descr = ['This can be checked by running: samba-tool ntacl sysvolcheck']
43
43
44
def run_samba_tool_ntacl_sysvolreset(umc_instance):
44
def run_samba_tool_ntacl_sysvolreset(umc_instance):
45
	if not util.is_service_active('Samba 4'):
45
	if not util.is_service_active('Samba 4'):
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/46_kerberos_ddns_update.py (-3 / +4 lines)
 Lines 81-87   class NSUpdateError(UpdateError): Link Here 
81
def kinit(principal, keytab=None, password_file=None):
81
def kinit(principal, keytab=None, password_file=None):
82
	auth = '--keytab={tab}' if keytab else '--password-file={file}'
82
	auth = '--keytab={tab}' if keytab else '--password-file={file}'
83
	cmd = ('kinit', auth.format(tab=keytab, file=password_file), principal)
83
	cmd = ('kinit', auth.format(tab=keytab, file=password_file), principal)
84
	MODULE.process('Running: %s' %(''.join(cmd)))
84
	MODULE.process('Running: %s' %(' '.join(cmd)))
85
85
86
	try:
86
	try:
87
		subprocess.check_call(cmd)
87
		subprocess.check_call(cmd)
 Lines 95-104   def kinit(principal, keytab=None, password_file=None): Link Here 
95
def nsupdate(server, domainname):
95
def nsupdate(server, domainname):
96
	process = subprocess.Popen(('nsupdate', '-g', '-t', '15'), stdin=subprocess.PIPE,
96
	process = subprocess.Popen(('nsupdate', '-g', '-t', '15'), stdin=subprocess.PIPE,
97
		stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
97
		stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
98
	cmd = 'server {server}\nprereq yxdomain {domain}\nsend\nquit\n'
98
	cmd_template = 'server {server}\nprereq yxdomain {domain}\nsend\nquit\n'
99
	cmd = cmd_template.format(server=server, domain=domainname)
99
	MODULE.process("Running: 'echo %s | nsupdate -g -t 15" %(cmd,))
100
	MODULE.process("Running: 'echo %s | nsupdate -g -t 15" %(cmd,))
100
101
101
	_ = process.communicate(cmd.format(server=server, domain=domainname))
102
	_ = process.communicate(cmd)
102
	if process.poll() != 0:
103
	if process.poll() != 0:
103
		raise NSUpdateError(server, domainname)
104
		raise NSUpdateError(server, domainname)
104
105
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/53_package_status.py (-2 / +2 lines)
 Lines 11-21   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
11
title = _('Package status corrupt')
11
title = _('Package status corrupt')
12
description = '\n'.join([
12
description = '\n'.join([
13
	_('The package status of %s packages is corrupt.'),
13
	_('The package status of %s packages is corrupt.'),
14
	_('Login to the system as root via ssh and run the command "dpkg --configure -a" in order to correct the packages status.'),
14
	_('You may log in to the system as root via ssh and run the command "dpkg --configure -a" as an attempt to correct the packages status.'),
15
	_('More information about the cause can be gained by executing "dpkg --audit".')
15
	_('More information about the cause can be gained by executing "dpkg --audit".')
16
])
16
])
17
17
18
run_descr = ['This can be checked by running: dpkg --audit Login to the system as root via ssh and run the command "dpkg --configure -a" in order to correct the packages status.']
18
run_descr = ['This can be checked by running: dpkg --audit']
19
19
20
def run(_umc_instance):
20
def run(_umc_instance):
21
	proccess = Popen(['dpkg', '--audit'], stdout=PIPE, env={'LANG': 'C'})
21
	proccess = Popen(['dpkg', '--audit'], stdout=PIPE, env={'LANG': 'C'})
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/54_sources_list_check.py (-1 / +1 lines)
 Lines 42-48   _ = Translation('univention-management-console-module-diagnostic').translate Link Here 
42
42
43
title = _('Check errors in sources.list files')
43
title = _('Check errors in sources.list files')
44
description = _('All files ok.')
44
description = _('All files ok.')
45
run_descr = [' Check by opening /etc/apt/sources.list.d/* and look for exceptions']
45
run_descr = ['Looking for Python exceptions in /etc/apt/sources.list.d/*']
46
46
47
47
48
TRACEBACK_REGEX = re.compile((
48
TRACEBACK_REGEX = re.compile((

Return to bug 47649