|
2 |
import re |
2 |
import re |
3 |
|
3 |
|
4 |
|
4 |
|
5 |
class Errors(object): |
5 |
class LogMessage(object): |
6 |
wanted = map(lambda p: re.compile(p, re.IGNORECASE), |
6 |
def __init__(self, wanted=None, ignore=None): |
7 |
[".*(error).*", |
7 |
self.wanted = self.recomp(self.wanted_list + (wanted or [])).match |
8 |
".*(failed).*", |
8 |
self.ignore = self.recomp(self.ignore_list + (ignore or [])).match |
9 |
".*(usage).*", |
|
|
10 |
"^E:"]) |
11 |
|
9 |
|
12 |
# possible (ignored) errors: |
10 |
@staticmethod |
13 |
ignore_list = [ |
11 |
def recomp(patterns, ignore_case=True): |
14 |
'.*failedmirror=.*', |
12 |
pattern = '|'.join('(?:%s)' % _ for _ in patterns) |
15 |
'All done, no errors.', |
13 |
return re.compile(pattern, re.IGNORECASE if ignore_case else 0) |
16 |
'I: .* libgpg-error0', |
|
|
17 |
'Installation finished. No error.* reported', |
18 |
'Not updating .*', |
19 |
'Error: There are no (services|hosts|host groups|contacts|contact groups) defined!', |
20 |
'Total Errors:\s+\d+', |
21 |
'Cannot find nagios object .*', |
22 |
'invoke-rc.d: initscript udev, action "reload" failed.', # Bug 19227 |
23 |
'yes: write error', |
24 |
'.*Update aborted by pre-update script of release.*', |
25 |
'.*update failed. Please check /var/log/univention/.*', |
26 |
'.*failed to convert the username listfilter to the uid.*', |
27 |
'.*Can not write log, .* failed.*', |
28 |
'.*Starting Univention Directory Policy:.*', |
29 |
'.*LISTENER .* : failed to connect to any notifier.*', |
30 |
'.*liberror-perl.*', |
31 |
'.*CONSISTENCY CHECK FAILED: cyls is too large .* setting to possible max .*', |
32 |
'.*error adding .*.pem', |
33 |
'.*failed .*VM used: java-6-cacao.*', |
34 |
'.*/etc/ca-certificates/update.d/.* exited with code 1'] |
35 |
|
14 |
|
36 |
ignore = map(re.compile, ignore_list) |
|
|
37 |
|
15 |
|
|
|
16 |
class Errors(LogMessage): |
17 |
wanted_list = [ |
18 |
".*error.*", |
19 |
".*failed.*", |
20 |
".*usage.*", |
21 |
"^E:", |
22 |
] |
38 |
|
23 |
|
39 |
class Tracebacks(object): |
24 |
# possible (ignored) errors: |
40 |
wanted = map(lambda p: re.compile(p, re.IGNORECASE), |
25 |
ignore_list = [ |
41 |
[".*(traceback).*"]) |
26 |
'.*failedmirror=.*', |
|
|
27 |
'All done, no errors.', |
28 |
'I: .* libgpg-error0', |
29 |
'Installation finished. No error.* reported', |
30 |
'Not updating .*', |
31 |
'Error: There are no (?:services|hosts|host groups|contacts|contact groups) defined!', |
32 |
'Total Errors:\s+\d+', |
33 |
'Cannot find nagios object .*', |
34 |
'invoke-rc.d: initscript udev, action "reload" failed.', # Bug 19227 |
35 |
'yes: write error', |
36 |
'.*Update aborted by pre-update script of release.*', |
37 |
'.*update failed. Please check /var/log/univention/.*', |
38 |
'.*failed to convert the username listfilter to the uid.*', |
39 |
'.*Can not write log, .* failed.*', |
40 |
'.*Starting Univention Directory Policy:.*', |
41 |
'.*LISTENER .* : failed to connect to any notifier.*', |
42 |
'.*liberror-perl.*', |
43 |
'.*CONSISTENCY CHECK FAILED: cyls is too large .* setting to possible max .*', |
44 |
'.*error adding .*.pem', |
45 |
'.*failed .*VM used: java-6-cacao.*', |
46 |
'.*/etc/ca-certificates/update.d/.* exited with code 1', |
47 |
] |
42 |
|
48 |
|
43 |
|
49 |
|
44 |
class Warnings(object): |
50 |
class Tracebacks(LogMessage): |
45 |
wanted = map(lambda p: re.compile(p, re.IGNORECASE), |
51 |
wanted_list = [ |
46 |
[".*(warning).*"]) |
52 |
".*traceback.*", |
|
|
53 |
] |
47 |
|
54 |
|
48 |
# possible (ignored) warnings: |
55 |
ignore_list = [] |
49 |
ignore_list = [ |
|
|
50 |
'WARNING: The following packages cannot be authenticated!', |
51 |
'Authentication warning overridden.', |
52 |
'^Create .*/warning', |
53 |
'WARNING: You are logged in using SSH -- this may interrupt the update and result in an inconsistent system!', |
54 |
'dpkg - warning: ignoring request to remove .* which isn.t installed.', |
55 |
'dpkg: warning - unable to delete old directory .*: Directory not empty', |
56 |
'dpkg - warning, overriding problem because --force enabled', |
57 |
'dpkg: serious warning: files list file for package .* missing, assuming package has no files currently installed.', |
58 |
'.*dpkg: warning: unable to delete old directory .* Directory not empty.*', |
59 |
'WARNING: cannot append .* to .*, value exists', |
60 |
'Warning: The config registry variable .*? does not exist', |
61 |
'Total Warnings:\s+\d+', |
62 |
'sys:1: DeprecationWarning: Non-ASCII character.*but no encoding declared; see http://www.python.org/peps/pep-0263.html for details', |
63 |
'warning: commands will be executed using /bin/.*', |
64 |
'Not updating .*', |
65 |
'Warning: The home dir .* you specified already exists.', |
66 |
'WARNING!', |
67 |
'.*WARNING: All config files need \.conf: /etc/modprobe\.d/.+, it will be ignored in a future release\.', |
68 |
'update-rc\.d: warning: .* (start|stop) runlevel arguments \([^)]+\) do not match LSB Default-(Start|Stop) values ([^)]+)', |
69 |
'.*warning: rule .* already exists.*', |
70 |
'.*Not starting .*: no services enabled.*', |
71 |
'.*Running /etc/init.d/.* is deprecated.*', |
72 |
'.*The resulting partition is not properly aligned for best performance.*', |
73 |
'.*Updating certificates in /etc/ssl/certs.* WARNING: Skipping duplicate certificate ca-certificates.crt.*', |
74 |
'.*Permanently added .* to the list of known hosts.*', |
75 |
'.*usr/sbin/grub-probe: warning: disk does not exist, so falling back to partition device.*', |
76 |
'.*WARNING: cannot read /sys/block/vda.* (No such file or directory|Datei oder Verzeichnis nicht gefunden).*'] |
77 |
|
56 |
|
78 |
ignore = map(re.compile, ignore_list) |
57 |
|
|
|
58 |
class Warnings(LogMessage): |
59 |
wanted_list = [ |
60 |
".*warning.*", |
61 |
] |
62 |
|
63 |
# possible (ignored) warnings: |
64 |
ignore_list = [ |
65 |
'WARNING: The following packages cannot be authenticated!', |
66 |
'Authentication warning overridden.', |
67 |
'^Create .*/warning', |
68 |
'WARNING: You are logged in using SSH -- this may interrupt the update and result in an inconsistent system!', |
69 |
'dpkg - warning: ignoring request to remove .* which isn.t installed.', |
70 |
'dpkg: warning - unable to delete old directory .*: Directory not empty', |
71 |
'dpkg - warning, overriding problem because --force enabled', |
72 |
'dpkg: serious warning: files list file for package .* missing, assuming package has no files currently installed.', |
73 |
'.*dpkg: warning: unable to delete old directory .* Directory not empty.*', |
74 |
'WARNING: cannot append .* to .*, value exists', |
75 |
'Warning: The config registry variable .*? does not exist', |
76 |
'Total Warnings:\s+\d+', |
77 |
'sys:1: DeprecationWarning: Non-ASCII character.*but no encoding declared; see http://www.python.org/peps/pep-0263.html for details', |
78 |
'warning: commands will be executed using /bin/.*', |
79 |
'Not updating .*', |
80 |
'Warning: The home dir .* you specified already exists.', |
81 |
'WARNING!', |
82 |
'.*WARNING: All config files need \.conf: /etc/modprobe\.d/.+, it will be ignored in a future release\.', |
83 |
'update-rc\.d: warning: .* (?:start|stop) runlevel arguments \([^)]+\) do not match LSB Default-(?:Start|Stop) values [^)]+', |
84 |
'.*warning: rule .* already exists.*', |
85 |
'.*Not starting .*: no services enabled.*', |
86 |
'.*Running /etc/init.d/.* is deprecated.*', |
87 |
'.*The resulting partition is not properly aligned for best performance.*', |
88 |
'.*Updating certificates in /etc/ssl/certs.* WARNING: Skipping duplicate certificate ca-certificates.crt.*', |
89 |
'.*Permanently added .* to the list of known hosts.*', |
90 |
'.*usr/sbin/grub-probe: warning: disk does not exist, so falling back to partition device.*', |
91 |
'.*WARNING: cannot read /sys/block/vda.* (?:No such file or directory|Datei oder Verzeichnis nicht gefunden).*'] |