Add log analyzor for CentOS7

Change-Id: Id31df5b1d2c7be887ff738f7fad998cc5174fadf
This commit is contained in:
Lei Lei 2015-03-04 15:08:33 -08:00
parent 89201e8f12
commit 80b9d87c29
2 changed files with 151 additions and 3 deletions

View File

@ -65,10 +65,21 @@ def _load_calculator_configurations():
OS_ADAPTER_CONFIGURATIONS = [
OSMatcher(
os_installer_name='cobbler',
os_pattern='CentOS.*',
os_pattern='CentOS-6.*',
item_matcher=(
(os_installer_configurations[
'cobbler']['CentOS'])
'cobbler']['CentOS6'])
),
file_reader_factory=FileReaderFactory(
setting.INSTALLATION_LOGDIR['CobblerInstaller']
)
),
OSMatcher(
os_installer_name='cobbler',
os_pattern='CentOS-7.*',
item_matcher=(
(os_installer_configurations[
'cobbler']['CentOS7'])
),
file_reader_factory=FileReaderFactory(
setting.INSTALLATION_LOGDIR['CobblerInstaller']

View File

@ -184,7 +184,7 @@ OS_INSTALLER_CONFIGURATIONS = {
),
]
),
'CentOS': AdapterItemMatcher(
'CentOS6': AdapterItemMatcher(
file_matchers=[
FileMatcher(
filename='sys.log',
@ -374,6 +374,143 @@ OS_INSTALLER_CONFIGURATIONS = {
),
]
),
'CentOS7': AdapterItemMatcher(
file_matchers=[
FileMatcher(
filename='syslog',
min_progress=0.0,
max_progress=0.1,
line_matchers={
'start': LineMatcher(
pattern=r'NOTICE (?P<message>.*)',
progress=IncrementalProgress(.1, .9, .1),
message_template='%(message)s',
unmatch_nextline_next_matcher_name='start',
match_nextline_next_matcher_name='exit'
),
}
),
FileMatcher(
filename='anaconda.log',
min_progress=0.1,
max_progress=1.0,
line_matchers={
'start': LineMatcher(
pattern=r'Running.*kickstart.*pre.*script',
progress=.15,
unmatch_nextline_next_matcher_name=(
'start'),
match_nextline_next_matcher_name=(
'kickstart_pre_done')
),
'kickstart_pre_done': LineMatcher(
pattern=(
r'All.*kickstart.*pre'
'.*script.*have.*been.*run'
),
progress=.2,
unmatch_nextline_next_matcher_name=(
'kickstart_pre_done'),
match_nextline_next_matcher_name=(
'geolocation_lookup')
),
'geolocation_lookup': LineMatcher(
pattern=r'Starting.*geolocation.*lookup',
progress=0.3,
message_template=(
'Setting up Customized Repositories'
),
unmatch_nextline_next_matcher_name=(
'geolocation_lookup'),
match_nextline_next_matcher_name=(
'geolocation_done')
),
'geolocation_done': LineMatcher(
pattern=r'Geolocation.*lookup.*finished',
progress=0.4,
message_template=(
'Geolocation lookup are done'
),
unmatch_nextline_next_matcher_name=(
'geolocation_done'),
match_nextline_next_matcher_name='setup_environment'
),
'setup_environment': LineMatcher(
pattern=r'Setting.*installation.*environment',
progress=0.5,
message_template='Setting up installation environment',
unmatch_nextline_next_matcher_name='setup_environment',
match_nextline_next_matcher_name='installing_packages'
),
'installing_packages': LineMatcher(
pattern=(
r'Creating.*biosboot.*on'
),
progress=.5,
message_template=(
'Installing packages'
),
unmatch_nextline_next_matcher_name=(
'installing_packages'),
match_nextline_next_matcher_name=(
'packages_installed')
),
'packages_installed': LineMatcher(
pattern=(
r'bootloader.*args'
),
progress=.8,
message_template='Packages are installed',
unmatch_nextline_next_matcher_name=(
'packages_installed'),
match_nextline_next_matcher_name=(
'installing_bootloader')
),
'installing_bootloader': LineMatcher(
pattern=r'setting.*installation.*environment',
progress=0.9,
message_template='Setup installation environment',
unmatch_nextline_next_matcher_name=(
'installing_bootloader'),
match_nextline_next_matcher_name=(
'post_installation'),
),
'post_installation': LineMatcher(
pattern=r'Running.*post-installation.*scripts',
progress=1.0,
message_template='Ran post-nstallation scripts',
unmatch_nextline_next_matcher_name=(
'post_installation'),
match_nextline_next_matcher_name='exit'
),
}
),
FileMatcher(
filename='packaging.log',
min_progress=0.56,
max_progress=0.80,
line_matchers={
'start': LineMatcher(
pattern=r'Installing (?P<package>.*)',
progress=IncrementalProgress(0.0, 0.99, 0.005),
message_template='Installing %(package)s',
unmatch_sameline_next_matcher_name=(
'package_complete'
),
unmatch_nextline_next_matcher_name='start',
match_nextline_next_matcher_name='start'
),
'package_complete': LineMatcher(
pattern='end.*rpm.*scriptlet',
progress=1.0,
message_template='installing packages finished',
unmatch_nextline_next_matcher_name='start',
match_nextline_next_matcher_name='exit'
),
}
),
]
),
}
}