Update server 1.6 to 2.0

After updating server check_mk 1.6 to 2.0, I have a bug with cplugs:
MKGeneralException(_(“Invalid regular expression ‘%s’: %s”) % (pattern, e)) cmk.utils.exceptions.MKGeneralException: Invalid regular expression ‘*$’: nothing to repeat at position 0

all the mistake:
‘’’’
cmk -vvR --debug
Invalid characters in ‘apcupsd.bcharge’ for RuleSetName: ‘.’
Traceback (most recent call last):
File “/omd/sites/itil/lib/python3/cmk/base/config.py”, line 2048, in _extract_check_plugins
create_check_plugin_from_legacy(
File “/omd/sites/itil/lib/python3/cmk/base/api/agent_based/register/check_plugins_legacy.py”, line 350, in create_check_plugin_from_legacy
return create_check_plugin(
File “/omd/sites/itil/lib/python3/cmk/base/api/agent_based/register/check_plugins.py”, line 262, in create_check_plugin
check_ruleset_name=RuleSetName(check_ruleset_name) if check_ruleset_name else None,
File “/omd/sites/itil/lib/python3/cmk/utils/type_defs/pluginname.py”, line 35, in init
self._value = self._parse_valid(plugin_name)
File “/omd/sites/itil/lib/python3/cmk/utils/type_defs/pluginname.py”, line 50, in parse_valid
raise ValueError(f"Invalid characters in {plugin_name!r} for {class
}: {invalid!r}")
ValueError: Invalid characters in ‘apcupsd.bcharge’ for RuleSetName: ‘.’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/omd/sites/itil/bin/cmk”, line 79, in
errors = config.load_all_agent_based_plugins(check_api.get_check_api_context)
File “/omd/sites/itil/lib/python3/cmk/base/config.py”, line 1427, in load_all_agent_based_plugins
errors.extend(load_checks(get_check_api_context, filelist))
File “/omd/sites/itil/lib/python3/cmk/base/config.py”, line 1576, in load_checks
_extract_check_plugins(validate_creation_kwargs=did_compile))
File “/omd/sites/itil/lib/python3/cmk/base/config.py”, line 2060, in _extract_check_plugins
raise MKGeneralException(exc) from exc
cmk.utils.exceptions.MKGeneralException: Invalid characters in ‘apcupsd.bcharge’ for RuleSetName: ‘.’
‘’’’

Server: Centos 7.4
Old version server check-mk: 1.6.0p28.cre
New version server check-mk: 2.0.0p22.cre

Was this upgrade done with clean install of existing site?

This was an installation of a working site using omd update

Oke then i think what it’s saying. Is that you have a regular expression like “*$” somehwere.
To find it you can search for it in GUI, or these command can be useful

omd diff       SITE ([RELBASE])        Shows differences compared to the original version files
cmk  -X, --config-check                 Check configuration for invalid vars

command: cmk -X --config-check

Failed to auto-migrate legacy plugin to check plugin: apcupsd.bcharge
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.bvoltage
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.involtage
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.load
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.outvoltage
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.status
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.temp
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: apcupsd.timeleft
Please refer to Werk 10601 for more information.

in gui * $ shows me all the hosts

Oke the legacy plugin should be a problem.
But dont look it up in the GUI, but under your rules.

Have you used the following command?

omd diff       SITE ([RELBASE])        Shows differences compared to the original version files

removing the apcupsd plugin has no positive result. Omd diff returns nothing
I have all the time: Invalid regular expression: nothing to repeat at position 0

sorry man, its diffecult to find the problem

Only thing that i can think of is the is related to apc. But that is a guess

I have a problem with every host, when I go to the GUI, Monitor → all hosts and I go to the host, I have:
image

Hi,

the problems based on the subchekcs like apcupsd.bcharge wit the “.” in name. From my point of view, checkMK is not able to convert this kind of checks. Best way is to rewrite the chekcs with 2.0 API.

Regards, Christian

As addition to @ChristianM the problem here is not the old check itself but the rules defined for this check.
Please do a search inside the ~/etc/check_mk/conf.d/ for all the rules with name beginning with “apcupsd.”.
These rules must be removed.

1 Like

In ~ / etc / check_mk / conf.d / I have nothing to do with “apcupsd.”. because I removed this plug. After typing cmk -vvR --debug I have, for example:

psseduoracle2 : cmk.base.plugins.agent_based.cpu cmk.base.plugins.agent_based.datapower_tcp cmk.base.plugins.agent_based.df_section cmk.base.plugins.agent_based.diskstat cmk.base.plugins.a gent_based.diskstat_statgrab_section cmk.base.plugins.agent_based.docker_container_diskstat cmk.base.plugins.agent_based.docker_container_diskstat_cgroupv2 cmk.base.plugins.agent_based.kerne l cmk.base.plugins.agent_based.lnx_if cmk.base.plugins.agent_based.mem cmk.base.plugins.agent_based.oracle_rman cmk.base.plugins.agent_based.oracle_tablespaces cmk.base.plugins.agent_based.s nmp_uptime cmk.base.plugins.agent_based.tcp_conn_stats cmk.base.plugins.agent_based.uptime cmk.base.plugins.agent_based.winperf_tcp_conn cpu.loads cpu.threads df kernel mem.linux mounts mult ipath oracle_instance postfix_mailq postfix_mailq_status systemd_units systemd_units.services_summaryTrying to acquire lock on /omd/sites/itil/var/check_mk/core/helper_config/13/host_checks/ psseduoracle2.py
Got lock on /omd/sites/itil/var/check_mk/core/helper_config/13/host_checks/psseduoracle2.py
Releasing lock on /omd/sites/itil/var/check_mk/core/helper_config/13/host_checks/psseduoracle2.py
Released lock on /omd/sites/itil/var/check_mk/core/helper_config/13/host_checks/psseduoracle2.py
==> /omd/sites/itil/var/check_mk/core/helper_config/13/host_checks/psseduoracle2.

in my version the host information looks like this:

p = sre_parse.parse(p, flags) File “/omd/sites/itil/lib/python3.8/sre_parse.py”, line 948, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) File “/omd/sites/itil/lib/python3.8/sre_parse.py”, line 443, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, File “/omd/sites/itil/lib/python3.8/sre_parse.py”, line 668, in _parse raise source.error(“nothing to repeat”, re.error: nothing to repeat at position 0 During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/omd/sites/itil/lib/python3/cmk/gui/plugins/views/icons/init.py”, line 107, in _process_icon result = icon.render(what, row, tags, custom_vars) File “/omd/sites/itil/lib/python3/cmk/gui/plugins/views/icons/builtin.py”, line 983, in render if bi.is_part_of_aggregation(row[“host_name”], row.get(“service_description”)): File “/omd/sites/itil/lib/python3/cmk/gui/bi.py”, line 69, in is_part_of_aggregation return get_cached_bi_compiler().is_part_of_aggregation(host, service) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_compiler.py”, line 247, in is_part_of_aggregation self._check_redis_lookup_integrity() File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_compiler.py”, line 265, in _check_redis_lookup_integrity self.load_compiled_aggregations() File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_compiler.py”, line 77, in load_compiled_aggregations self._check_compilation_status() File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_compiler.py”, line 112, in _check_compilation_status self._compiled_aggregations[aggregation.id] = aggregation.compile(self.bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_aggregation.py”, line 82, in compile branches = self.node.compile({}, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_node_generator.py”, line 54, in compile return sorted(self.action.execute_search_results(search_results, macros, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_lib.py”, line 495, in execute_search_results yield from self.execute(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_actions.py”, line 80, in execute return bi_rule_id_registry[self.rule_id].compile(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_rule.py”, line 120, in compile action_results.extend(bi_node.compile(mapped_rule_arguments, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_node_generator.py”, line 54, in compile return sorted(self.action.execute_search_results(search_results, macros, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_lib.py”, line 495, in execute_search_results yield from self.execute(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_actions.py”, line 80, in execute return bi_rule_id_registry[self.rule_id].compile(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_rule.py”, line 120, in compile action_results.extend(bi_node.compile(mapped_rule_arguments, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_node_generator.py”, line 54, in compile return sorted(self.action.execute_search_results(search_results, macros, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_lib.py”, line 495, in execute_search_results yield from self.execute(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_actions.py”, line 80, in execute return bi_rule_id_registry[self.rule_id].compile(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_rule.py”, line 120, in compile action_results.extend(bi_node.compile(mapped_rule_arguments, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_node_generator.py”, line 54, in compile return sorted(self.action.execute_search_results(search_results, macros, bi_searcher)) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_lib.py”, line 495, in execute_search_results yield from self.execute(argument, bi_searcher) File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_actions.py”, line 134, in execute host_matches, match_groups = bi_searcher.get_host_name_matches( File “/omd/sites/itil/lib/python3/cmk/utils/bi/bi_searcher.py”, line 96, in get_host_name_matches regex_pattern = regex(pattern_with_anchor) File “/omd/sites/itil/lib/python3/cmk/utils/regex.py”, line 49, in regex raise MKGeneralException((“Invalid regular expression ‘%s’: %s”) % (pattern, e)) cmk.utils.exceptions.MKGeneralException: \Invalid regular expression ‘*$’: nothing to repeat at position 0

1 Like

First, if you select all host. It will show you all host.
You filter out the result with a incorrect regex. Correct regex would be .*$
afbeelding

Maybe if you saved the regex this way, and the GUI didn’t give an error, you will get an error when upgrading

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.