Hi folks,
I am currently migrating my extensions from v1.6 API to v2.0 API due to the fact, that the host_extra_conf() function is not supported anymore.
According to How to make a plugin V2 compatible (-> host_name) - #2 by r.sander the use of own WATO rule during discovery now should be defined using discover_ruleset_name and discovery_ruleset_type parameters during registration command.
So I have adapted my plugin as described according to PRO TIP PRO TIP: Migrate plugin vnx_quotas · tribe29/checkmk@b428616 · GitHub
My discovery rule returns a WATO-like object like ListOf(Tuple(TextAscii(),TextAscii())) so it returns a list.
So i went with the following register command parameters:
register.check_plugin(
name="sadmin_versions",
sections=['sadmin'],
service_name="SW version of %s",
discovery_function=discovery_sadmin_versions,
discovery_default_parameters=[],
discovery_ruleset_name="inventory_sadmin_versions_rules",
discovery_ruleset_type=register.RuleSetType.ALL,
...
)
But when I activate those changes, I get the following exception during discovery:
My WATO rule deliveres a list of tuples, so the default value (which is mandatory by the API) must be an empty list.
When i change the discovery_default_parameters value to an empty dict => {} i get the following error during a reload:
How must I specify my discovery rule correctly, so it can be used by the discovery function?
Thank you
Best Regards
Markus