diff --git a/doc/source/contrib/language_ref/property_ref/main_properties.rst b/doc/source/contrib/language_ref/property_ref/main_properties.rst index f83f837ae..f728566af 100644 --- a/doc/source/contrib/language_ref/property_ref/main_properties.rst +++ b/doc/source/contrib/language_ref/property_ref/main_properties.rst @@ -18,6 +18,7 @@ Or they can reference a Python property. This is done by prefixing the import st vars: foo: '@path.to.myproperty' + bar: '@property.alias' A :ref:`factory ` reference can also be defined using the following form: @@ -46,6 +47,81 @@ Variables are accessible from any property within the file in which they are def NOTE: global properties are not yet supported. +Aliases +======= + +Aliasing provides easier access to a class or property. The class or property needs to +be aliased in order to use this feature. + +.. code-block:: python + + class MyHelperClass: + + @property + def my_awesome_property(self): + return True + + +Normally, if the user wants to retrieve the value of the my_awesome_property in a YAML scenario +they have to write the whole import path to the class, as follows: + +.. code-block:: yaml + + vars: + foo: '@hotsos.module.path.MyHelperClass.my_awesome_property' + checks: + foo_is_true: + requires: + varops: [[$foo], [eq, true]] + +But, with the help of aliasing, we can make it easier to type and remember for the user: + +.. code-block:: python + + from hotsos.core.alias import alias + + @alias("helper") + class MyHelperClass: + + @property + def my_awesome_property(self): + return True + +... so the previous example can be written as follows: + +.. code-block:: yaml + + vars: + foo: '@helper.my_awesome_property' + checks: + foo_is_true: + requires: + varops: [[$foo], [eq, true]] + +Individual properties can be aliased too: + +.. code-block:: python + + from hotsos.core.alias import alias + + class MyHelperClass: + + @alias('awesomeness') + @property + def my_awesome_property(self): + return True + +.. code-block:: yaml + + vars: + awesome: '@awesomeness' + + +Aliasing works for the following constructs: + +- Python property names +- Class names (e.g. Config handler class type name) + Checks ====== diff --git a/doc/source/contrib/language_ref/property_ref/requirement_types.rst b/doc/source/contrib/language_ref/property_ref/requirement_types.rst index 0139cb251..a2656c94b 100644 --- a/doc/source/contrib/language_ref/property_ref/requirement_types.rst +++ b/doc/source/contrib/language_ref/property_ref/requirement_types.rst @@ -30,14 +30,14 @@ Usage: .. code-block:: yaml - property: + property: or .. code-block:: yaml property: - path: + path: ops: OPS_LIST Cache keys: @@ -269,7 +269,7 @@ Usage: .. code-block:: yaml config: - handler: + handler: path: assertions: - allow-unset: @@ -295,7 +295,7 @@ Example: checks: checkcfg: config: - handler: hotsos.core.plugins.openstack.OpenstackConfig + handler: openstack.config path: etc/nova/nova.conf assertions: - key: debug diff --git a/doc/source/contrib/scenarios.rst b/doc/source/contrib/scenarios.rst index d06dd596a..4bab9f9da 100644 --- a/doc/source/contrib/scenarios.rst +++ b/doc/source/contrib/scenarios.rst @@ -67,7 +67,7 @@ matches and the second is a fallback: .. code-block:: yaml vars: - mem_current: '@hotsos.core.host_helpers.systemd.ServiceFactory.memory_current:neverfail' + mem_current: '@systemd.service.memory_current:neverfail' checks: is_enabled: systemd: diff --git a/doc/source/contrib/writing_checks_overview.rst b/doc/source/contrib/writing_checks_overview.rst index b4d6ac397..fac9041a4 100644 --- a/doc/source/contrib/writing_checks_overview.rst +++ b/doc/source/contrib/writing_checks_overview.rst @@ -50,5 +50,6 @@ the rest of the directory will only be run if it resolves to *True*: requires: or: - property: hotsos.core.plugins.myplugin.mustbetrue + - property: alias.mustbetrue - path: file/that/must/exist diff --git a/hotsos/core/alias.py b/hotsos/core/alias.py new file mode 100644 index 000000000..53b007c01 --- /dev/null +++ b/hotsos/core/alias.py @@ -0,0 +1,91 @@ +"""Aliasing utilities.""" + +from hotsos.core.log import log + + +class AliasAlreadyInUseError(Exception): + """Raised when an alias is already in use.""" + + def __init__(self, name): + self.message = f"Alias '{name}` already in use!" + + def __str__(self): + return self.message + + +class AliasRegistry: + """ + A class that provides a registry for aliasing Python things. + """ + + # A class-level dictionary to store registered aliases. + registry = {} + + @staticmethod + def register(name, decoratee): + """ + Register a function, method, or property under an alias. + + This method handles different types of Python objects and creates + appropriate wrappers or registrations based on the object type. + + Args: + name (str): The alias under which to register the decoratee. + decoratee (callable or property): The Python object to be + registered. + + Raises: + AliasAlreadyInUseError: If the alias name is already registered. + """ + isprop = isinstance(decoratee, property) + target = decoratee.fget if isprop else decoratee + + if name in AliasRegistry.registry: + log.debug("alias registration failed -- already in use(`%s`)", + name) + raise AliasAlreadyInUseError(name) + + import_path = f"{target.__module__}.{target.__qualname__}" + log.debug("registering alias `%s` --> {%s}", name, import_path) + # Register full import path. + AliasRegistry.registry[name] = import_path + + @staticmethod + def resolve(the_alias, default=None): + """ + Retrieve a registered alias. + + Args: + the_alias (str): The alias to retrieve. + + Returns: + callable: The function or wrapper associated with the alias. + + Raises: + NoSuchAliasError: No such alias in the registry. + """ + + if the_alias not in AliasRegistry.registry: + log.debug( + "alias `%s` not found in the registry, " + "returning the default value", + the_alias, + ) + return default + + value = AliasRegistry.registry[the_alias] + log.debug("alias %s resolved to %s", the_alias, value) + return value + + +def alias(argument): + """Create an alias for a property, function or a thing.""" + + def real_decorator(func): + """We're not wrapping the func as we don't want + to do anything at runtime. We just want to alias + `func` to some user-defined name and call it on-demand.""" + AliasRegistry.register(argument, func) + return func + + return real_decorator diff --git a/hotsos/core/host_helpers/__init__.py b/hotsos/core/host_helpers/__init__.py index 20f5c4a36..cf580a223 100644 --- a/hotsos/core/host_helpers/__init__.py +++ b/hotsos/core/host_helpers/__init__.py @@ -37,3 +37,7 @@ AAProfileFactory, ApparmorHelper, ) +from .filestat import ( # noqa: F403,F401 + FileFactory, + FileObj +) diff --git a/hotsos/core/host_helpers/apparmor.py b/hotsos/core/host_helpers/apparmor.py index 601dcb7d7..89a03b2a3 100644 --- a/hotsos/core/host_helpers/apparmor.py +++ b/hotsos/core/host_helpers/apparmor.py @@ -9,6 +9,7 @@ ) from hotsos.core.factory import FactoryBase from hotsos.core.host_helpers.cli import CLIHelperFile +from hotsos.core.alias import alias class AAProfile(): @@ -77,6 +78,7 @@ def profiles_unconfined(self): return self.profiles.get('unconfined', {}).get('profiles', []) +@alias('apparmor.profile') class AAProfileFactory(FactoryBase): """ Dynamically create AAProfile objects using profile name. diff --git a/hotsos/core/host_helpers/filestat.py b/hotsos/core/host_helpers/filestat.py index 386bdfc55..0072e25dc 100644 --- a/hotsos/core/host_helpers/filestat.py +++ b/hotsos/core/host_helpers/filestat.py @@ -3,6 +3,7 @@ from hotsos.core.config import HotSOSConfig from hotsos.core.factory import FactoryBase from hotsos.core.log import log +from hotsos.core.alias import alias class FileObj(): @@ -38,6 +39,7 @@ def size(self): return size +@alias('file') class FileFactory(FactoryBase): """ Factory to dynamically create FileObj objects using file path as input. diff --git a/hotsos/core/host_helpers/packaging.py b/hotsos/core/host_helpers/packaging.py index b3d3e12d6..764be8999 100644 --- a/hotsos/core/host_helpers/packaging.py +++ b/hotsos/core/host_helpers/packaging.py @@ -6,6 +6,7 @@ from hotsos.core.host_helpers.cli import CLIHelper from hotsos.core.log import log from hotsos.core.utils import sorted_dict +from hotsos.core.alias import alias class DPKGBadVersionSyntax(Exception): @@ -483,6 +484,7 @@ def __init__(self, name, version): self.version = version +@alias('apt.package') class AptFactory(FactoryBase): """ Factory to dynamically get package versions. diff --git a/hotsos/core/host_helpers/ssl.py b/hotsos/core/host_helpers/ssl.py index d961d83c6..149344921 100644 --- a/hotsos/core/host_helpers/ssl.py +++ b/hotsos/core/host_helpers/ssl.py @@ -7,6 +7,7 @@ from hotsos.core.factory import FactoryBase from hotsos.core.host_helpers.cli import CLIHelper from hotsos.core.log import log +from hotsos.core.alias import alias class SSLCertificate(): @@ -65,6 +66,7 @@ def certificate_expires_soon(self): return self.certificate.days_to_expire <= self.expire_days +@alias('sslcert') class SSLCertificatesFactory(FactoryBase): """ Factory to dynamically create SSLCertificate objects for given paths. diff --git a/hotsos/core/host_helpers/systemd.py b/hotsos/core/host_helpers/systemd.py index f7575c57f..164804d6c 100644 --- a/hotsos/core/host_helpers/systemd.py +++ b/hotsos/core/host_helpers/systemd.py @@ -19,6 +19,7 @@ from hotsos.core.host_helpers import CLIHelper, CLIHelperFile from hotsos.core.host_helpers.common import ServiceManagerBase from hotsos.core.log import log +from hotsos.core.alias import alias class SystemdService(): @@ -354,6 +355,7 @@ def _service_filtered_ps(self): return ps_filtered +@alias("systemd.service") class ServiceFactory(FactoryBase): """ Factory to dynamically create SystemdService objects for given services. diff --git a/hotsos/core/plugins/juju/common.py b/hotsos/core/plugins/juju/common.py index b4ecf67ab..4123e9a76 100644 --- a/hotsos/core/plugins/juju/common.py +++ b/hotsos/core/plugins/juju/common.py @@ -3,6 +3,7 @@ from hotsos.core.host_helpers import PebbleHelper, SystemdHelper from hotsos.core.plugins.juju.resources import JujuBase from hotsos.core import plugintools +from hotsos.core.alias import alias SVC_VALID_SUFFIX = r'[0-9a-zA-Z-_]*' JUJU_SVC_EXPRS = [rf'mongod{SVC_VALID_SUFFIX}', @@ -12,6 +13,7 @@ rf'(?:^|[^\s])juju-db{SVC_VALID_SUFFIX}'] +@alias('juju') class JujuChecks(plugintools.PluginPartBase, JujuBase): """ Juju checks. """ plugin_name = 'juju' diff --git a/hotsos/core/plugins/juju/resources.py b/hotsos/core/plugins/juju/resources.py index 13426235e..53332dc1d 100644 --- a/hotsos/core/plugins/juju/resources.py +++ b/hotsos/core/plugins/juju/resources.py @@ -10,6 +10,7 @@ from hotsos.core.config import HotSOSConfig from hotsos.core.log import log from hotsos.core import utils +from hotsos.core.alias import alias class JujuMachine(): @@ -174,6 +175,7 @@ def __init__(self, name, version): self.version = int(version) +@alias('juju.base') class JujuBase(): """ Juju checks base class. """ CHARM_MANIFEST_GLOB = "agents/unit-*/state/deployer/manifests" @@ -257,6 +259,7 @@ def charm_names(self): return list(self.charms.keys()) +@alias('juju.bin') class JujuBinaryInterface(JujuBase): """ Interface to juju binary. """ @property diff --git a/hotsos/core/plugins/kernel/common.py b/hotsos/core/plugins/kernel/common.py index 8558893e6..f7a361fd6 100644 --- a/hotsos/core/plugins/kernel/common.py +++ b/hotsos/core/plugins/kernel/common.py @@ -5,8 +5,10 @@ from hotsos.core import host_helpers, plugintools from hotsos.core.config import HotSOSConfig from hotsos.core.plugins.kernel.config import KernelConfig +from hotsos.core.alias import alias +@alias('kernel') class KernelBase(): """ Base class for kernel plugin helpers. """ @cached_property diff --git a/hotsos/core/plugins/kernel/config.py b/hotsos/core/plugins/kernel/config.py index aca258350..4e9f66900 100644 --- a/hotsos/core/plugins/kernel/config.py +++ b/hotsos/core/plugins/kernel/config.py @@ -3,6 +3,7 @@ from hotsos.core.config import HotSOSConfig from hotsos.core import host_helpers +from hotsos.core.alias import alias class KernelConfig(host_helpers.ConfigBase): @@ -38,6 +39,7 @@ def _load(self): break +@alias('kernel.systemdconfig') class SystemdConfig(host_helpers.IniConfigBase): """Systemd configuration.""" def __init__(self, *args, **kwargs): diff --git a/hotsos/core/plugins/kernel/kernlog/calltrace.py b/hotsos/core/plugins/kernel/kernlog/calltrace.py index 7a2f6d7f4..5d7fe83a6 100644 --- a/hotsos/core/plugins/kernel/kernlog/calltrace.py +++ b/hotsos/core/plugins/kernel/kernlog/calltrace.py @@ -12,6 +12,7 @@ TraceTypeBase, KernLogBase, ) +from hotsos.core.alias import alias KERNLOG_TS = r'\[\s*\d+\.\d+\]' KERNLOG_PREFIX = rf'(?:\S+\s+\d+\s+[\d:]+\s+\S+\s+\S+:\s+)?{KERNLOG_TS}' @@ -469,6 +470,7 @@ def __iter__(self): yield from self.hungtasks +@alias("kernel.calltrace") class CallTraceManager(KernLogBase): """ Manager for all call trace analysis types. From here all analysis is run diff --git a/hotsos/core/plugins/kernel/kernlog/events.py b/hotsos/core/plugins/kernel/kernlog/events.py index 62991d93d..7d0b527b2 100644 --- a/hotsos/core/plugins/kernel/kernlog/events.py +++ b/hotsos/core/plugins/kernel/kernlog/events.py @@ -1,8 +1,10 @@ from hotsos.core.log import log from hotsos.core.plugins.kernel.kernlog.common import KernLogBase from hotsos.core.search import SearchDef +from hotsos.core.alias import alias +@alias('kernel.kernlog.events') class KernLogEvents(KernLogBase): """ Kern log events info. """ def __init__(self, *args, **kwargs): diff --git a/hotsos/core/plugins/kernel/memory.py b/hotsos/core/plugins/kernel/memory.py index b934c51af..c3a0218ab 100644 --- a/hotsos/core/plugins/kernel/memory.py +++ b/hotsos/core/plugins/kernel/memory.py @@ -3,6 +3,7 @@ from hotsos.core.config import HotSOSConfig from hotsos.core.utils import sorted_dict +from hotsos.core.alias import alias class _BaseProcKeyValue(): @@ -54,6 +55,7 @@ def __getattr__(self, key): f'{self.__class__.__name__}.') +@alias('kernel.vmstat') class VMStat(_BaseProcKeyValue): """ Interface to /proc/vmstat """ VALID_KEYS = ['compact_fail', 'compact_success'] @@ -63,6 +65,7 @@ def path(self): return os.path.join(HotSOSConfig.data_root, 'proc/vmstat') @property + @alias("kernel.vmstat.compaction_failures_pct") def compaction_failures_percent(self): if not os.path.exists(self.path): return 0 @@ -75,6 +78,7 @@ def compaction_failures_percent(self): return int(fail_count / (success_count / 100)) +@alias("kernel.meminfo") class MemInfo(_BaseProcKeyValue): """ Interface to /proc/meminfo """ VALID_KEYS = ['MemTotal', 'MemAvailable', 'Hugetlb', 'HugePages_Total', @@ -117,6 +121,7 @@ def hugep_used_to_hugep_total_percentage(self): return round(100 - (self.HugePages_Free * 100) / self.HugePages_Total) +@alias("kernel.slab") class SlabInfo(): """ Interface to /proc/slabinfo """ def __init__(self, filter_names=None): @@ -290,6 +295,7 @@ def high_order_seq(self): return count +@alias('kernel.memchecks') class MemoryChecks(): """ Memory checks implementation. """ @property diff --git a/hotsos/core/plugins/kernel/net.py b/hotsos/core/plugins/kernel/net.py index 857413b7b..e12f46f53 100644 --- a/hotsos/core/plugins/kernel/net.py +++ b/hotsos/core/plugins/kernel/net.py @@ -6,6 +6,7 @@ from hotsos.core.host_helpers import SYSCtlFactory, CLIHelperFile from hotsos.core.log import log from hotsos.core.search import FileSearcher, SearchDef, ResultFieldInfo +from hotsos.core.alias import alias class ProcNetBase(abc.ABC): @@ -108,6 +109,7 @@ def __init__(self): 'proc/net/snmp')) +@alias('kernel.net.snmp.tcp') class SNMPTcp(SNMPBase): """ /proc/net/snmp interface implementation to extract TCP information. """ def _percent_in_segs(self, field): @@ -153,6 +155,7 @@ def __getattr__(self, fld): return super().__getattr__(fld) +@alias('kernel.net.snmp.udp') class SNMPUdp(SNMPBase): """ /proc/net/snmp interface implementation to extract UDP information. """ @property @@ -207,6 +210,7 @@ def __init__(self): self.net_snmp_tcp = SNMPTcp() +@alias('kernel.net.netstat.tcp') class NetStatTCP(NetStatBase): """ /proc/net/netstat interface implementation to extract TCP information. @@ -287,6 +291,7 @@ def __getattr__(self, fld): return super().__getattr__(fld) +@alias('kernel.net.sockstat') class SockStat(ProcNetBase): """ Provides a common way to extract fields from /proc/net/sockstat. @@ -530,6 +535,7 @@ def all_with_inode(self, inode): return list(filter(lambda x: (x.NODE == inode), self.data)) +@alias('kernel.net.netlink') class NetLink(STOVParserBase): """ Provides a way to extract fields from /proc/net/netlink. diff --git a/hotsos/core/plugins/kernel/sysfs.py b/hotsos/core/plugins/kernel/sysfs.py index 81320c1f2..d166b5632 100644 --- a/hotsos/core/plugins/kernel/sysfs.py +++ b/hotsos/core/plugins/kernel/sysfs.py @@ -4,6 +4,7 @@ from hotsos.core.config import HotSOSConfig from hotsos.core import host_helpers from hotsos.core.plugins.system.system import SystemBase +from hotsos.core.alias import alias class SYSFSBase(): @@ -23,6 +24,7 @@ def get(relpath): return fd.read().strip() +@alias('kernel.sysfs.cpu') class CPU(SYSFSBase): """ Helper to get CPU information. """ @property diff --git a/hotsos/core/plugins/kubernetes.py b/hotsos/core/plugins/kubernetes.py index c265d4eef..09e2002ef 100644 --- a/hotsos/core/plugins/kubernetes.py +++ b/hotsos/core/plugins/kubernetes.py @@ -10,6 +10,7 @@ SystemdHelper, ) from hotsos.core import plugintools +from hotsos.core.alias import alias SERVICES = [r"etcd\S*", r"calico\S*", @@ -87,6 +88,7 @@ def containers(self): return sorted(containers) +@alias('kubernetes.checks') class KubernetesChecks(KubernetesBase, plugintools.PluginPartBase): """ Kubernetes checks. """ plugin_name = 'kubernetes' diff --git a/hotsos/core/plugins/lxd/common.py b/hotsos/core/plugins/lxd/common.py index 88882b9e2..20a276c7c 100644 --- a/hotsos/core/plugins/lxd/common.py +++ b/hotsos/core/plugins/lxd/common.py @@ -11,13 +11,14 @@ FileSearcher, SearchDef, SequenceSearchDef ) - +from hotsos.core.alias import alias CORE_APT = ['lxd', 'lxc'] CORE_SNAPS = [rf"(?:snap\.)?{p}" for p in CORE_APT] SERVICE_EXPRS = [rf"{s}\S*" for s in CORE_SNAPS] +@alias('lxd') class LXD(): """ LXD interface. """ @cached_property diff --git a/hotsos/core/plugins/mysql.py b/hotsos/core/plugins/mysql.py index b00e5166e..83ec33fa9 100644 --- a/hotsos/core/plugins/mysql.py +++ b/hotsos/core/plugins/mysql.py @@ -11,12 +11,14 @@ host_helpers, plugintools, ) +from hotsos.core.alias import alias SVC_VALID_SUFFIX = r'[0-9a-zA-Z-_]*' MYSQL_SVC_EXPRS = [rf'mysql{SVC_VALID_SUFFIX}'] CORE_APT = ['mysql'] +@alias('mysql') class MySQLChecks(plugintools.PluginPartBase): """ MySQL checks. """ plugin_name = 'mysql' @@ -33,6 +35,7 @@ def plugin_runnable(self): return self.apt.core is not None +@alias('mysql.config') class MySQLConfig(host_helpers.IniConfigBase): """ MySQL config interface. """ def __init__(self, *args, **kwargs): @@ -41,6 +44,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, path=path, **kwargs) +@alias('mysql.config.router') class MySQLRouterConfig(host_helpers.IniConfigBase): """ MySQL Router config interface. """ def __init__(self, *args, **kwargs): diff --git a/hotsos/core/plugins/openstack/common.py b/hotsos/core/plugins/openstack/common.py index b92788dd6..588bbf55c 100644 --- a/hotsos/core/plugins/openstack/common.py +++ b/hotsos/core/plugins/openstack/common.py @@ -26,8 +26,10 @@ from hotsos.core.plugins.openstack.octavia import OctaviaBase from hotsos.core import plugintools from hotsos.core.ycheck.events import EventHandlerBase, EventCallbackBase +from hotsos.core.alias import alias +@alias('openstack') class OpenstackBase(): """ Base class for Openstack checks. @@ -243,6 +245,7 @@ def apache2_allow_encoded_slashes_on(self): return False +@alias('openstack.checks') class OpenStackChecks(OpenstackBase, plugintools.PluginPartBase): """ OpenStack checks. """ plugin_name = "openstack" diff --git a/hotsos/core/plugins/openstack/neutron.py b/hotsos/core/plugins/openstack/neutron.py index 1312f773b..afe5ac215 100644 --- a/hotsos/core/plugins/openstack/neutron.py +++ b/hotsos/core/plugins/openstack/neutron.py @@ -9,6 +9,7 @@ OpenstackConfig, OSTServiceBase, ) +from hotsos.core.alias import alias # See https://github.com/openstack/neutron-lib/blob/master/neutron_lib/constants.py#L346 # noqa, pylint: disable=C0301 IP_HEADER_BYTES = 20 @@ -44,6 +45,7 @@ def bind_interfaces(self): return interfaces +@alias('neutron.service_checks') class ServiceChecks(): """ Neutron service specific checks. """ @cached_property @@ -128,6 +130,7 @@ def find_router_with_vr_id(self, vr_id): return None +@alias('neutron.config') class Config(FactoryBase): """ Neutron config. """ def __getattr__(self, path): diff --git a/hotsos/core/plugins/openstack/nova.py b/hotsos/core/plugins/openstack/nova.py index 9f381b936..c30a01431 100644 --- a/hotsos/core/plugins/openstack/nova.py +++ b/hotsos/core/plugins/openstack/nova.py @@ -23,6 +23,7 @@ NUMAInfo, SystemBase, ) +from hotsos.core.alias import alias @dataclass @@ -253,6 +254,7 @@ def vcpu_info(self): return vcpu_info +@alias('openstack.nova.cpupinning') class CPUPinning(NovaBase): """ Interface to Nova CPU pinning. """ def __init__(self): diff --git a/hotsos/core/plugins/openstack/octavia.py b/hotsos/core/plugins/openstack/octavia.py index 97ad9b035..e6c957675 100644 --- a/hotsos/core/plugins/openstack/octavia.py +++ b/hotsos/core/plugins/openstack/octavia.py @@ -1,12 +1,15 @@ from functools import cached_property from hotsos.core.plugins.openstack.openstack import OSTServiceBase - -OCTAVIA_HM_PORT_NAME = 'o-hm0' +from hotsos.core.alias import alias +@alias('openstack.octavia') class OctaviaBase(OSTServiceBase): """ Base class for Octavia checks. """ + + OCTAVIA_HM_PORT_NAME = 'o-hm0' + def __init__(self, *args, **kwargs): super().__init__('octavia', *args, **kwargs) @@ -17,15 +20,16 @@ def bind_interfaces(self): keyed by config key used to identify interface. """ interfaces = {} - port = self.nethelp.get_interface_with_name(OCTAVIA_HM_PORT_NAME) + port = self.nethelp.get_interface_with_name( + OctaviaBase.OCTAVIA_HM_PORT_NAME) if port: - interfaces.update({OCTAVIA_HM_PORT_NAME: port}) + interfaces.update({OctaviaBase.OCTAVIA_HM_PORT_NAME: port}) return interfaces @property def hm_port_has_address(self): - port = self.bind_interfaces.get(OCTAVIA_HM_PORT_NAME) + port = self.bind_interfaces.get(OctaviaBase.OCTAVIA_HM_PORT_NAME) if port is None or not port.addresses: return False @@ -33,7 +37,7 @@ def hm_port_has_address(self): @cached_property def hm_port_healthy(self): - port = self.bind_interfaces.get(OCTAVIA_HM_PORT_NAME) + port = self.bind_interfaces.get(OctaviaBase.OCTAVIA_HM_PORT_NAME) if port is None: return True diff --git a/hotsos/core/plugins/openstack/openstack.py b/hotsos/core/plugins/openstack/openstack.py index 2fde27f65..c9ee242a2 100644 --- a/hotsos/core/plugins/openstack/openstack.py +++ b/hotsos/core/plugins/openstack/openstack.py @@ -51,6 +51,7 @@ from hotsos.core.plugins.openstack.exceptions_octavia import ( OCTAVIA_EXCEPTIONS, ) +from hotsos.core.alias import alias # NOTE(tpsilva): when updating this, refer to the Charmed Openstack supported @@ -295,6 +296,7 @@ } +@alias('openstack.config') class OpenstackConfig(host_helpers.IniConfigBase): """ Openstack config interface. """ def __getattr__(self, key): diff --git a/hotsos/core/plugins/openvswitch/common.py b/hotsos/core/plugins/openvswitch/common.py index adbdceee1..f50e3291c 100644 --- a/hotsos/core/plugins/openvswitch/common.py +++ b/hotsos/core/plugins/openvswitch/common.py @@ -9,6 +9,7 @@ from hotsos.core.ycheck.events import EventCallbackBase, EventHandlerBase from hotsos.core.ycheck.common import GlobalSearcherAutoRegisterBase from hotsos.core.utils import sorted_dict +from hotsos.core.alias import alias OVS_SERVICES_EXPRS = [r'ovsdb[a-zA-Z-]*', r'ovs-vswitch[a-zA-Z-]*', @@ -37,6 +38,7 @@ def paths(cls): """ Returns a list of one or more paths to search. """ +@alias('openvswitch.checks') class OpenvSwitchChecks(plugintools.PluginPartBase): """ OpenvSwitch checks. """ plugin_name = "openvswitch" diff --git a/hotsos/core/plugins/openvswitch/ovs.py b/hotsos/core/plugins/openvswitch/ovs.py index 133b97ebc..c219e9b69 100644 --- a/hotsos/core/plugins/openvswitch/ovs.py +++ b/hotsos/core/plugins/openvswitch/ovs.py @@ -18,6 +18,7 @@ create_constraint, ) from hotsos.core.plugins.openvswitch.common import OpenvSwitchGlobalSearchBase +from hotsos.core.alias import alias class OVSDBTable(): @@ -84,6 +85,7 @@ def __getattr__(self, column): return self.get(record='.', column=column) +@alias('openvswitch.db') class OVSDB(FactoryBase): """ This class is used like a factory in that attributes are table names that @@ -93,6 +95,7 @@ def __getattr__(self, table): return OVSDBTable(table) +@alias('openvswitch.dplookups') class OVSDPLookups(): """ Interface to OVS datapath lookups. """ def __init__(self): @@ -250,6 +253,7 @@ def paths(cls): 'var/log/openvswitch/ovs-vswitchd.log')] +@alias("openvswitch.bfd") class OVSBFD(OpenvSwitchBase): """ OVS BFD representation. """ @property @@ -303,6 +307,7 @@ def max_transitions_last_24h_within_hour(self): for port in self._transitions.values())) +@alias('openvswitch.dpdk') class OVSDPDK(OpenvSwitchBase): """ Interface to OVS DPDK. """ @cached_property diff --git a/hotsos/core/plugins/pacemaker.py b/hotsos/core/plugins/pacemaker.py index dfb46a343..3944e3d7b 100644 --- a/hotsos/core/plugins/pacemaker.py +++ b/hotsos/core/plugins/pacemaker.py @@ -7,12 +7,14 @@ SystemdHelper, ) from hotsos.core.plugintools import PluginPartBase +from hotsos.core.alias import alias PACEMAKER_PKGS_CORE = ['pacemaker', r'pacemaker-\S+', 'crmsh', 'corosync'] PACEMAKER_SVC_EXPR = ['pacemaker[a-zA-Z-]*', 'corosync'] +@alias('pacemaker') class PacemakerBase(): """ Base class for pacemaker checks. """ @cached_property @@ -40,6 +42,7 @@ def online_nodes(self): return [] +@alias('pacemaker.checks') class PacemakerChecks(PacemakerBase, PluginPartBase): """ Pacemaker checks. """ plugin_name = 'pacemaker' diff --git a/hotsos/core/plugins/rabbitmq/common.py b/hotsos/core/plugins/rabbitmq/common.py index 3601081ff..8fd83c2ff 100644 --- a/hotsos/core/plugins/rabbitmq/common.py +++ b/hotsos/core/plugins/rabbitmq/common.py @@ -5,6 +5,7 @@ SystemdHelper, ) from hotsos.core.plugins.rabbitmq.report import RabbitMQReport +from hotsos.core.alias import alias RMQ_SERVICES_EXPRS = [ r"beam.smp", @@ -16,6 +17,7 @@ ] +@alias('rabbitmq.checks') class RabbitMQChecks(plugintools.PluginPartBase): """ Rabbitmq checks. """ plugin_name = 'rabbitmq' diff --git a/hotsos/core/plugins/rabbitmq/report.py b/hotsos/core/plugins/rabbitmq/report.py index dbb7f6a93..422fcb2ee 100644 --- a/hotsos/core/plugins/rabbitmq/report.py +++ b/hotsos/core/plugins/rabbitmq/report.py @@ -8,8 +8,10 @@ FileSearcher, ) from hotsos.core.host_helpers import CLIHelperFile +from hotsos.core.alias import alias +@alias('rabbitmq') class RabbitMQReport(): """ Class providing easy access to the contents of a rabbitmqctl report. diff --git a/hotsos/core/plugins/sosreport.py b/hotsos/core/plugins/sosreport.py index 2cd2a540e..eb4b592fb 100644 --- a/hotsos/core/plugins/sosreport.py +++ b/hotsos/core/plugins/sosreport.py @@ -8,10 +8,12 @@ SearchDef, FileSearcher, ) +from hotsos.core.alias import alias CORE_APT = ['sosreport'] +@alias('sosreport') class SOSReportChecks(PluginPartBase): """ Sosreport checks. """ plugin_name = 'sosreport' diff --git a/hotsos/core/plugins/storage/bcache.py b/hotsos/core/plugins/storage/bcache.py index 657fd7f8f..ff737afca 100644 --- a/hotsos/core/plugins/storage/bcache.py +++ b/hotsos/core/plugins/storage/bcache.py @@ -13,6 +13,7 @@ SearchDef ) from hotsos.core.utils import sort_suffixed_integers +from hotsos.core.alias import alias class BcacheConfig(ConfigBase): @@ -92,6 +93,7 @@ def __getattr__(self, key): raise AttributeError(f"{key} not found in cacheset config") +@alias('bcache') class BcacheBase(StorageBase): """ Base class for bcache checks. """ def __init__(self, *args, **kwargs): @@ -191,6 +193,7 @@ def is_bcache_device(self, dev): return False +@alias('bcache.bdevsinfo') class BDevsInfo(BcacheBase): """ Representation of al bdevs in a host. """ def _get_parameter(self, key): @@ -234,6 +237,7 @@ def writeback_percent(self): return sorted(list(map(int, ret))) +@alias('bcache.cachesetsinfo') class CachesetsInfo(BcacheBase): """ Representation of all bcache cachsets in a host. """ def _get_parameter(self, key): @@ -270,6 +274,7 @@ def cache_available_percent(self): return sorted(list(map(int, ret))) +@alias('bcache.checks') class BcacheChecks(BcacheBase): """ Bcache checks. """ diff --git a/hotsos/core/plugins/storage/ceph/cluster.py b/hotsos/core/plugins/storage/ceph/cluster.py index 6c5f4f6d4..caf8762f8 100644 --- a/hotsos/core/plugins/storage/ceph/cluster.py +++ b/hotsos/core/plugins/storage/ceph/cluster.py @@ -15,10 +15,12 @@ CephOSD, ) from hotsos.core.utils import sorted_dict +from hotsos.core.alias import alias CEPH_POOL_TYPE = {1: 'replicated', 3: 'erasure-coded'} +@alias('ceph.crushmap') class CephCrushMap(): """ Representation of a Ceph cluster CRUSH map. @@ -224,6 +226,7 @@ def is_rgw_using_civetweb(self): return False +@alias('ceph.cluster') class CephCluster(): # pylint: disable=too-many-public-methods """ Provides an interface to a Ceph cluster. diff --git a/hotsos/core/plugins/storage/ceph/common.py b/hotsos/core/plugins/storage/ceph/common.py index 350cc03f7..83b6ae7d9 100644 --- a/hotsos/core/plugins/storage/ceph/common.py +++ b/hotsos/core/plugins/storage/ceph/common.py @@ -30,6 +30,7 @@ SearchDef ) from hotsos.core.ycheck.events import EventCallbackBase +from hotsos.core.alias import alias CEPH_SERVICES_EXPRS = [r"ceph-[a-z0-9-]+", r"rados[a-z0-9-:]+", @@ -87,6 +88,7 @@ def csv_to_set_inner(*args, **kwargs): return csv_to_set_inner +@alias('ceph.config') class CephConfig(IniConfigBase): """ Ceph config. @@ -135,6 +137,7 @@ def public_network_set(self): return self.get('public network') +@alias('ceph') class CephChecks(StorageBase): """ Ceph Checks. """ def __init__(self, *args, **kwargs): @@ -423,6 +426,7 @@ def __getattr__(self, name=None): return list(vals) +@alias('ceph.daemon.all-osds') class CephDaemonAllOSDsFactory(FactoryBase): """ A factory interface to allow dynamic access to ceph daemon commands and diff --git a/hotsos/core/plugins/system/common.py b/hotsos/core/plugins/system/common.py index 5e4db34f5..3d13460eb 100644 --- a/hotsos/core/plugins/system/common.py +++ b/hotsos/core/plugins/system/common.py @@ -1,7 +1,9 @@ from hotsos.core.plugins.system.system import SystemBase from hotsos.core import plugintools +from hotsos.core.alias import alias +@alias('system.checks') class SystemChecks(SystemBase, plugintools.PluginPartBase): """ System checks. """ plugin_name = 'system' diff --git a/hotsos/core/plugins/system/system.py b/hotsos/core/plugins/system/system.py index 9aa8f556f..a66132684 100644 --- a/hotsos/core/plugins/system/system.py +++ b/hotsos/core/plugins/system/system.py @@ -13,6 +13,7 @@ FileSearcher, SearchDef, SequenceSearchDef ) +from hotsos.core.alias import alias class NUMAInfo(): @@ -76,6 +77,7 @@ def cores(self, node=None): return self.nodes.get(node) +@alias('system') class SystemBase(): """ Base class for system checks. """ @cached_property @@ -233,6 +235,7 @@ def sysctl_all(self): return SYSCtlFactory().sysctl_all +@alias('sssd') class SSSD(): """ SSSD interface. """ def __init__(self): diff --git a/hotsos/core/plugintools.py b/hotsos/core/plugintools.py index bae95e640..37fcb7867 100644 --- a/hotsos/core/plugintools.py +++ b/hotsos/core/plugintools.py @@ -48,6 +48,12 @@ def __init__(cls, _name, _mro, members): index_key = 'summary_part_index' if hasattr(subcls, index_key): index = subcls.summary_part_index + + if not hasattr(cls, 'plugin_name') or cls.plugin_name is None: + raise NameNotSetError( + f"{cls.__name__}.plugin_name must be set to a value" + " that represents the name of the plugin") + existing = [e[index_key] for e in PLUGINS[cls.plugin_name]] if index in existing: raise SummaryOffsetConflict(f"plugin {name} has index " diff --git a/hotsos/core/ycheck/engine/properties/common.py b/hotsos/core/ycheck/engine/properties/common.py index cd6041e21..3fa37aa9b 100644 --- a/hotsos/core/ycheck/engine/properties/common.py +++ b/hotsos/core/ycheck/engine/properties/common.py @@ -15,6 +15,7 @@ MissingRequiredParameterError, UnexpectedParameterError ) +from hotsos.core.alias import AliasRegistry class ImportPathIsNotAClass(Exception): @@ -395,8 +396,12 @@ def get_cls(self, import_str): log.debug("instantiating class %s (from_cache=True)", import_str) return ret + # Try to resolve class alias + import_str = AliasRegistry.resolve(import_str, import_str) + log.debug("instantiating class %s (from_cache=False)", import_str) mod, cls_name = self._get_mod_class_from_path(import_str) + try: _mod = importlib.import_module(mod) ret = getattr(_mod, cls_name) @@ -414,6 +419,7 @@ def get_cls(self, import_str): self._add_to_import_cache(import_str, ret) return ret + # pylint: disable-next=too-many-statements def get_property(self, import_str): """ Import and fetch value of a Python property or factory. @@ -428,6 +434,11 @@ def get_property(self, import_str): @param import_str: a path to a Python property or Factory. """ + + # Try to resolve aliases first. + import_path, _, __ = import_str.partition(":") + import_str = AliasRegistry.resolve(import_path, import_str) + ret = self._load_from_import_cache(import_str) if ret: log.debug("calling property %s (from_cache=True)", import_str) diff --git a/hotsos/defs/scenarios/juju/bugs/lp1910958.yaml b/hotsos/defs/scenarios/juju/bugs/lp1910958.yaml index 844a7839e..928856b75 100644 --- a/hotsos/defs/scenarios/juju/bugs/lp1910958.yaml +++ b/hotsos/defs/scenarios/juju/bugs/lp1910958.yaml @@ -17,4 +17,4 @@ conclusions: format-dict: units: '@checks.has_lp1910958.search.results_group_1:unique_comma_join' rels: '@checks.has_lp1910958.search.results_group_2:unique_comma_join' - juju_version: 'hotsos.core.plugins.juju.resources.JujuBase.version' + juju_version: 'juju.base.version' diff --git a/hotsos/defs/scenarios/juju/juju.yaml b/hotsos/defs/scenarios/juju/juju.yaml index b5f64a48d..959afd422 100644 --- a/hotsos/defs/scenarios/juju/juju.yaml +++ b/hotsos/defs/scenarios/juju/juju.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.juju.JujuChecks.plugin_runnable + property: juju.plugin_runnable diff --git a/hotsos/defs/scenarios/juju/juju_binary_cve.yaml b/hotsos/defs/scenarios/juju/juju_binary_cve.yaml index 378bacfac..f62a5995d 100644 --- a/hotsos/defs/scenarios/juju/juju_binary_cve.yaml +++ b/hotsos/defs/scenarios/juju/juju_binary_cve.yaml @@ -1,7 +1,7 @@ checks: has_affected_juju_binary: binary: - handler: hotsos.core.plugins.juju.JujuBinaryInterface + handler: juju.bin juju: - min: '2.9.0' max: '2.9.48' diff --git a/hotsos/defs/scenarios/juju/jujud_machine_checks.yaml b/hotsos/defs/scenarios/juju/jujud_machine_checks.yaml index 55972f407..8c22ba5ad 100644 --- a/hotsos/defs/scenarios/juju/jujud_machine_checks.yaml +++ b/hotsos/defs/scenarios/juju/jujud_machine_checks.yaml @@ -1,7 +1,7 @@ checks: jujud_not_found: property: - path: hotsos.core.plugins.juju.JujuChecks.systemd_processes + path: juju.systemd_processes ops: [[contains, jujud], [not_]] conclusions: jujud-not-found: diff --git a/hotsos/defs/scenarios/kernel/amd_iommu_pt.yaml b/hotsos/defs/scenarios/kernel/amd_iommu_pt.yaml index 3861eedac..1ab270c3d 100644 --- a/hotsos/defs/scenarios/kernel/amd_iommu_pt.yaml +++ b/hotsos/defs/scenarios/kernel/amd_iommu_pt.yaml @@ -1,7 +1,7 @@ vars: - virt_type: '@hotsos.core.plugins.system.SystemBase.virtualisation_type' - cpu_vendor: '@hotsos.core.plugins.kernel.sysfs.CPU.vendor' - kernel_cmd_line: '@hotsos.core.plugins.kernel.KernelBase.boot_parameters' + virt_type: '@system.virtualisation_type' + cpu_vendor: '@kernel.sysfs.cpu.vendor' + kernel_cmd_line: '@kernel.boot_parameters' checks: is_phy_host: varops: [[$virt_type], [not_]] @@ -22,4 +22,4 @@ conclusions: passthrough mode (e.g. set iommu=pt in boot parameters) which is recommended in order to get the best performance e.g. for networking. format-dict: - cpu_model: hotsos.core.plugins.kernel.sysfs.CPU.model + cpu_model: kernel.sysfs.cpu.model diff --git a/hotsos/defs/scenarios/kernel/kernlog_calltrace.yaml b/hotsos/defs/scenarios/kernel/kernlog_calltrace.yaml index df3c596ee..030ee71ca 100644 --- a/hotsos/defs/scenarios/kernel/kernlog_calltrace.yaml +++ b/hotsos/defs/scenarios/kernel/kernlog_calltrace.yaml @@ -1,23 +1,23 @@ checks: has_stacktraces: property: - path: hotsos.core.plugins.kernel.CallTraceManager.calltrace_anytype + path: kernel.calltrace.calltrace_anytype ops: [[length_hint]] has_oom_killer_invoked: property: - path: hotsos.core.plugins.kernel.CallTraceManager.oom_killer + path: kernel.calltrace.oom_killer ops: [[length_hint]] has_bcache_deadlock_invoked: property: - path: hotsos.core.plugins.kernel.CallTraceManager.calltrace-bcache + path: kernel.calltrace.calltrace-bcache ops: [[length_hint]] has_hungtasks: property: - path: hotsos.core.plugins.kernel.CallTraceManager.calltrace_hungtask + path: kernel.calltrace.calltrace_hungtask ops: [[length_hint]] has_fanotify_hang: property: - path: hotsos.core.plugins.kernel.CallTraceManager.calltrace-fanotify + path: kernel.calltrace.calltrace-fanotify ops: [[length_hint]] conclusions: stacktraces: @@ -51,7 +51,7 @@ conclusions: See https://www.spinics.net/lists/stable/msg566639.html for full detail. format-dict: - kver: hotsos.core.plugins.kernel.KernelBase.version + kver: kernel.version hungtasks: priority: 2 decision: has_hungtasks diff --git a/hotsos/defs/scenarios/kernel/memory.yaml b/hotsos/defs/scenarios/kernel/memory.yaml index 49ef9ac6b..0a68f5350 100644 --- a/hotsos/defs/scenarios/kernel/memory.yaml +++ b/hotsos/defs/scenarios/kernel/memory.yaml @@ -1,23 +1,19 @@ vars: - nodes_with_limited_high_order_memory: - '@hotsos.core.plugins.kernel.memory.MemoryChecks.nodes_with_limited_high_order_memory' - compact_success: '@hotsos.core.plugins.kernel.memory.VMStat.compact_success' - compaction_failures_percent: '@hotsos.core.plugins.kernel.memory.VMStat.compaction_failures_percent' - slab_major_consumers: '@hotsos.core.plugins.kernel.memory.SlabInfo.major_consumers' + nodes_with_limited_high_order_memory: '@kernel.memchecks.nodes_with_limited_high_order_memory' + compact_success: '@kernel.vmstat.compact_success' + compaction_failures_percent: '@kernel.vmstat.compaction_failures_pct' + slab_major_consumers: '@kernel.slab.major_consumers' # We use an arbitrary threshold of 10k to suggest that a lot of # compaction has occurred but noting that this is a rolling counter # and is not necessarily representative of current state. min_compaction_success: 10000 max_compaction_failures_pcent: 10 - hugetlb_to_mem_total_percentage: - '@hotsos.core.plugins.kernel.memory.MemInfo.hugetlb_to_mem_total_percentage' - mem_avail_to_mem_total_percentage: - '@hotsos.core.plugins.kernel.memory.MemInfo.mem_avail_to_mem_total_percentage' - hugep_used_to_hugep_total_percentage: - '@hotsos.core.plugins.kernel.memory.MemInfo.hugep_used_to_hugep_total_percentage' - mem_total_gb: '@hotsos.core.plugins.kernel.memory.MemInfo.mem_total_gb' - mem_available_gb: '@hotsos.core.plugins.kernel.memory.MemInfo.mem_available_gb' - hugetlb_gb: '@hotsos.core.plugins.kernel.memory.MemInfo.hugetlb_gb' + hugetlb_to_mem_total_percentage: '@kernel.meminfo.hugetlb_to_mem_total_percentage' + mem_avail_to_mem_total_percentage: '@kernel.meminfo.mem_avail_to_mem_total_percentage' + hugep_used_to_hugep_total_percentage: '@kernel.meminfo.hugep_used_to_hugep_total_percentage' + mem_total_gb: '@kernel.meminfo.mem_total_gb' + mem_available_gb: '@kernel.meminfo.mem_available_gb' + hugetlb_gb: '@kernel.meminfo.hugetlb_gb' # Arbitrary thresholds set for the memory allocated for the huge # pages to total memory and memory available to total memory. hugetlb_to_mem_total_threshold_percent: 80 @@ -29,7 +25,7 @@ checks: - varops: [[$compact_success], [gt, $min_compaction_success]] - varops: [[$compaction_failures_percent], [gt, $max_compaction_failures_pcent]] too_many_free_hugepages: - - property: hotsos.core.plugins.kernel.memory.MemInfo.huge_pages_enabled + - property: kernel.meminfo.huge_pages_enabled - varops: [[$hugetlb_to_mem_total_percentage], [gt, $hugetlb_to_mem_total_threshold_percent]] - varops: [[$mem_avail_to_mem_total_percentage], [lt, $mem_available_to_mem_total_thershold_percent]] conclusions: diff --git a/hotsos/defs/scenarios/kernel/network/misc.yaml b/hotsos/defs/scenarios/kernel/network/misc.yaml index 1243c624d..7be0d9d86 100644 --- a/hotsos/defs/scenarios/kernel/network/misc.yaml +++ b/hotsos/defs/scenarios/kernel/network/misc.yaml @@ -8,7 +8,7 @@ checks: # "Jun 08 10:48:13 compute4 kernel:" expr: '(\w{3,5}\s+\d{1,2}\s+[\d:]+)\S+.+ nf_conntrack: table full, dropping packet' has_over_mtu_dropped_packets: - property: hotsos.core.plugins.kernel.kernlog.KernLogEvents.over_mtu_dropped_packets + property: kernel.kernlog.events.over_mtu_dropped_packets conclusions: nf-conntrack-full: decision: has_nf_conntrack_full diff --git a/hotsos/defs/scenarios/kernel/network/netlink.yaml b/hotsos/defs/scenarios/kernel/network/netlink.yaml index e67907faa..5223b68c4 100644 --- a/hotsos/defs/scenarios/kernel/network/netlink.yaml +++ b/hotsos/defs/scenarios/kernel/network/netlink.yaml @@ -1,6 +1,6 @@ checks: has_socks_with_drops: - property: hotsos.core.plugins.kernel.net.NetLink.all_with_drops + property: kernel.net.netlink.all_with_drops conclusions: netlink-socks-with-drops: decision: has_socks_with_drops @@ -14,4 +14,4 @@ conclusions: This may be a symptom of problems in the associated process(es) and should be investigated further. format-dict: - socks_with_drops: hotsos.core.plugins.kernel.net.NetLink.all_with_drops_str + socks_with_drops: kernel.net.netlink.all_with_drops_str diff --git a/hotsos/defs/scenarios/kernel/network/tcp.yaml b/hotsos/defs/scenarios/kernel/network/tcp.yaml index c57c7c2d9..d0ceefce1 100644 --- a/hotsos/defs/scenarios/kernel/network/tcp.yaml +++ b/hotsos/defs/scenarios/kernel/network/tcp.yaml @@ -1,30 +1,30 @@ vars: - incsumerr: '@hotsos.core.plugins.kernel.net.SNMPTcp.InCsumErrors' - incsumrate_pcent: '@hotsos.core.plugins.kernel.net.SNMPTcp.InCsumErrorsPcentInSegs' - outsegs: '@hotsos.core.plugins.kernel.net.SNMPTcp.OutSegs' - retrans: '@hotsos.core.plugins.kernel.net.SNMPTcp.RetransSegs' - outretrans_pcent: '@hotsos.core.plugins.kernel.net.SNMPTcp.RetransSegsPcentOutSegs' - spurrtx: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPSpuriousRtxHostQueues' - spurrtx_pcent: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPSpuriousRtxHostQueuesPcentOutSegs' - prunec: '@hotsos.core.plugins.kernel.net.NetStatTCP.PruneCalled' - rcvcoll: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPRcvCollapsed' - rcvpr: '@hotsos.core.plugins.kernel.net.NetStatTCP.RcvPruned' - ofopr: '@hotsos.core.plugins.kernel.net.NetStatTCP.OfoPruned' - backlogd: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPBacklogDrop' - rpfilterd: '@hotsos.core.plugins.kernel.net.NetStatTCP.IPReversePathFilter' - ldrop: '@hotsos.core.plugins.kernel.net.NetStatTCP.ListenDrops' - pfmemd: '@hotsos.core.plugins.kernel.net.NetStatTCP.PFMemallocDrop' - minttld: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPMinTTLDrop' - listenovf: '@hotsos.core.plugins.kernel.net.NetStatTCP.ListenOverflows' - ofod: '@hotsos.core.plugins.kernel.net.NetStatTCP.OfoPruned' - zwind: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPZeroWindowDrop' - rcvqd: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPRcvQDrop' - rcvqd_pcent: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPRcvQDropPcentInSegs' - rqfulld: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPReqQFullDrop' - rqfullcook: '@hotsos.core.plugins.kernel.net.NetStatTCP.TCPReqQFullDoCookies' - memusage_pages_inuse: '@hotsos.core.plugins.kernel.net.SockStat.GlobTcpSocksTotalMemPages' - memusage_pages_max: '@hotsos.core.plugins.kernel.net.SockStat.SysctlTcpMemMax' - memusage_pct: '@hotsos.core.plugins.kernel.net.SockStat.TCPMemUsagePct' + incsumerr: '@kernel.net.snmp.tcp.InCsumErrors' + incsumrate_pcent: '@kernel.net.snmp.tcp.InCsumErrorsPcentInSegs' + outsegs: '@kernel.net.snmp.tcp.OutSegs' + retrans: '@kernel.net.snmp.tcp.RetransSegs' + outretrans_pcent: '@kernel.net.snmp.tcp.RetransSegsPcentOutSegs' + spurrtx: '@kernel.net.netstat.tcp.TCPSpuriousRtxHostQueues' + spurrtx_pcent: '@kernel.net.netstat.tcp.TCPSpuriousRtxHostQueuesPcentOutSegs' + prunec: '@kernel.net.netstat.tcp.PruneCalled' + rcvcoll: '@kernel.net.netstat.tcp.TCPRcvCollapsed' + rcvpr: '@kernel.net.netstat.tcp.RcvPruned' + ofopr: '@kernel.net.netstat.tcp.OfoPruned' + backlogd: '@kernel.net.netstat.tcp.TCPBacklogDrop' + rpfilterd: '@kernel.net.netstat.tcp.IPReversePathFilter' + ldrop: '@kernel.net.netstat.tcp.ListenDrops' + pfmemd: '@kernel.net.netstat.tcp.PFMemallocDrop' + minttld: '@kernel.net.netstat.tcp.TCPMinTTLDrop' + listenovf: '@kernel.net.netstat.tcp.ListenOverflows' + ofod: '@kernel.net.netstat.tcp.OfoPruned' + zwind: '@kernel.net.netstat.tcp.TCPZeroWindowDrop' + rcvqd: '@kernel.net.netstat.tcp.TCPRcvQDrop' + rcvqd_pcent: '@kernel.net.netstat.tcp.TCPRcvQDropPcentInSegs' + rqfulld: '@kernel.net.netstat.tcp.TCPReqQFullDrop' + rqfullcook: '@kernel.net.netstat.tcp.TCPReqQFullDoCookies' + memusage_pages_inuse: '@kernel.net.sockstat.GlobTcpSocksTotalMemPages' + memusage_pages_max: '@kernel.net.sockstat.SysctlTcpMemMax' + memusage_pct: '@kernel.net.sockstat.TCPMemUsagePct' checks: incsumerr_high: or: diff --git a/hotsos/defs/scenarios/kernel/network/udp.yaml b/hotsos/defs/scenarios/kernel/network/udp.yaml index d970562ba..9b1c86f01 100644 --- a/hotsos/defs/scenarios/kernel/network/udp.yaml +++ b/hotsos/defs/scenarios/kernel/network/udp.yaml @@ -1,15 +1,15 @@ vars: - inerrors: '@hotsos.core.plugins.kernel.net.SNMPUdp.InErrors' - inerrors_pcent: '@hotsos.core.plugins.kernel.net.SNMPUdp.InErrorsPcentInDatagrams' - rcvbuferrors: '@hotsos.core.plugins.kernel.net.SNMPUdp.RcvbufErrors' - rcvbuferrors_pcent: '@hotsos.core.plugins.kernel.net.SNMPUdp.RcvbufErrorsPcentInDatagrams' - sndbuferrors: '@hotsos.core.plugins.kernel.net.SNMPUdp.SndbufErrors' - sndbuferrors_pcent: '@hotsos.core.plugins.kernel.net.SNMPUdp.SndbufErrorsPcentOutDatagrams' - incsumerrors: '@hotsos.core.plugins.kernel.net.SNMPUdp.InCsumErrors' - incsumerrors_pcent: '@hotsos.core.plugins.kernel.net.SNMPUdp.InCsumErrorsPcentInDatagrams' - memusage_pages_inuse: '@hotsos.core.plugins.kernel.net.SockStat.GlobUdpSocksTotalMemPages' - memusage_pages_max: '@hotsos.core.plugins.kernel.net.SockStat.SysctlUdpMemMax' - memusage_pct: '@hotsos.core.plugins.kernel.net.SockStat.UDPMemUsagePct' + inerrors: '@kernel.net.snmp.udp.InErrors' + inerrors_pcent: '@kernel.net.snmp.udp.InErrorsPcentInDatagrams' + rcvbuferrors: '@kernel.net.snmp.udp.RcvbufErrors' + rcvbuferrors_pcent: '@kernel.net.snmp.udp.RcvbufErrorsPcentInDatagrams' + sndbuferrors: '@kernel.net.snmp.udp.SndbufErrors' + sndbuferrors_pcent: '@kernel.net.snmp.udp.SndbufErrorsPcentOutDatagrams' + incsumerrors: '@kernel.net.snmp.udp.InCsumErrors' + incsumerrors_pcent: '@kernel.net.snmp.udp.InCsumErrorsPcentInDatagrams' + memusage_pages_inuse: '@kernel.net.sockstat.GlobUdpSocksTotalMemPages' + memusage_pages_max: '@kernel.net.sockstat.SysctlUdpMemMax' + memusage_pct: '@kernel.net.sockstat.UDPMemUsagePct' checks: rcvbuferrors_high: or: diff --git a/hotsos/defs/scenarios/kubernetes/kubernetes.yaml b/hotsos/defs/scenarios/kubernetes/kubernetes.yaml index d2e14dad5..2759ef15c 100644 --- a/hotsos/defs/scenarios/kubernetes/kubernetes.yaml +++ b/hotsos/defs/scenarios/kubernetes/kubernetes.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.kubernetes.KubernetesChecks.plugin_runnable + property: kubernetes.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/kubernetes/system_cpufreq_mode.yaml b/hotsos/defs/scenarios/kubernetes/system_cpufreq_mode.yaml index 5959e2d1b..7997cf4cd 100644 --- a/hotsos/defs/scenarios/kubernetes/system_cpufreq_mode.yaml +++ b/hotsos/defs/scenarios/kubernetes/system_cpufreq_mode.yaml @@ -9,7 +9,7 @@ vars: message_ondemand: >- You will also need to stop and disable the ondemand systemd service in order for changes to persist. - scaling_governor: '@hotsos.core.plugins.kernel.sysfs.CPU.cpufreq_scaling_governor_all' + scaling_governor: '@kernel.sysfs.cpu.cpufreq_scaling_governor_all' checks: cpufreq_governor_not_performance: # can we actually see the setting @@ -20,7 +20,7 @@ checks: - snap: kubelet # ignore if not running on metal - property: - path: hotsos.core.plugins.system.system.SystemBase.virtualisation_type + path: system.virtualisation_type ops: [[eq, null]] ondemand_installed_and_enabled: systemd: diff --git a/hotsos/defs/scenarios/lxd/bugs/lp1807628.yaml b/hotsos/defs/scenarios/lxd/bugs/lp1807628.yaml index fe59b293c..258159451 100644 --- a/hotsos/defs/scenarios/lxd/bugs/lp1807628.yaml +++ b/hotsos/defs/scenarios/lxd/bugs/lp1807628.yaml @@ -15,11 +15,11 @@ checks: max: 3.0.3-0ubuntu1~18.04.2 is_not_a_lxc_container: property: - path: hotsos.core.plugins.system.SystemBase.virtualisation_type + path: system.virtualisation_type ops: [[ne, 'lxc']] has_lxc_containers: property: - path: hotsos.core.plugins.lxd.LXD.instances + path: lxd.instances ops: [[length_hint], [gt, 0]] conclusions: lxcfs_segfault: diff --git a/hotsos/defs/scenarios/lxd/lxcfs_deadlock.yaml b/hotsos/defs/scenarios/lxd/lxcfs_deadlock.yaml index fc4f7cfa6..49af17142 100644 --- a/hotsos/defs/scenarios/lxd/lxcfs_deadlock.yaml +++ b/hotsos/defs/scenarios/lxd/lxcfs_deadlock.yaml @@ -1,11 +1,11 @@ checks: is_not_a_lxc_container: property: - path: hotsos.core.plugins.system.SystemBase.virtualisation_type + path: system.virtualisation_type ops: [[ne, 'lxc']] has_lxc_containers: property: - path: hotsos.core.plugins.lxd.LXD.instances + path: lxd.instances ops: [[length_hint], [gt, 0]] has_lxd_version_5_9: snap: diff --git a/hotsos/defs/scenarios/mysql/bugs/lp1959861.yaml b/hotsos/defs/scenarios/mysql/bugs/lp1959861.yaml index 60b76e044..ddf8648df 100644 --- a/hotsos/defs/scenarios/mysql/bugs/lp1959861.yaml +++ b/hotsos/defs/scenarios/mysql/bugs/lp1959861.yaml @@ -3,13 +3,13 @@ checks: apt: mysql-router client_ssl_mode: config: - handler: hotsos.core.plugins.mysql.MySQLRouterConfig + handler: mysql.config.router assertions: key: client_ssl_mode ops: [[eq, PREFERRED]] client_ssl_cert: config: - handler: hotsos.core.plugins.mysql.MySQLRouterConfig + handler: mysql.config.router assertions: key: client_ssl_cert ops: [[ne, null]] diff --git a/hotsos/defs/scenarios/mysql/mysql.yaml b/hotsos/defs/scenarios/mysql/mysql.yaml index 8d394979a..327a7f652 100644 --- a/hotsos/defs/scenarios/mysql/mysql.yaml +++ b/hotsos/defs/scenarios/mysql/mysql.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.mysql.MySQLChecks.plugin_runnable + property: mysql.plugin_runnable diff --git a/hotsos/defs/scenarios/mysql/mysql_connections.yaml b/hotsos/defs/scenarios/mysql/mysql_connections.yaml index 7193df639..75c033508 100644 --- a/hotsos/defs/scenarios/mysql/mysql_connections.yaml +++ b/hotsos/defs/scenarios/mysql/mysql_connections.yaml @@ -3,7 +3,7 @@ checks: apt: percona-xtradb-cluster-server max_connections_gt_default_limit: config: - handler: hotsos.core.plugins.mysql.MySQLConfig + handler: mysql.config assertions: key: max_connections ops: [[gt, 4190]] diff --git a/hotsos/defs/scenarios/openstack/cinder/bugs/lp2004555.yaml b/hotsos/defs/scenarios/openstack/cinder/bugs/lp2004555.yaml index 17e511cc6..373bb0d23 100644 --- a/hotsos/defs/scenarios/openstack/cinder/bugs/lp2004555.yaml +++ b/hotsos/defs/scenarios/openstack/cinder/bugs/lp2004555.yaml @@ -19,7 +19,7 @@ checks: max: '2:23' service_tokens_enabled: config: - handler: 'hotsos.core.plugins.openstack.OpenstackConfig' + handler: 'openstack.config' path: 'etc/cinder/cinder.conf' assertions: - section: service_user diff --git a/hotsos/defs/scenarios/openstack/eol.yaml b/hotsos/defs/scenarios/openstack/eol.yaml index 04f85ecbb..f7afc5019 100644 --- a/hotsos/defs/scenarios/openstack/eol.yaml +++ b/hotsos/defs/scenarios/openstack/eol.yaml @@ -1,7 +1,7 @@ checks: is_eol: property: - path: hotsos.core.plugins.openstack.OpenStackChecks.days_to_eol + path: openstack.days_to_eol ops: [[le, 0]] conclusions: is-eol: @@ -14,4 +14,4 @@ conclusions: limited support and is likely not receiving updates anymore. Please consider upgrading to a newer release. format-dict: - release: hotsos.core.plugins.openstack.OpenStackChecks.release_name + release: openstack.release_name diff --git a/hotsos/defs/scenarios/openstack/neutron/bugs/lp1907686.yaml b/hotsos/defs/scenarios/openstack/neutron/bugs/lp1907686.yaml index 9cd31a75c..0eaaf26db 100644 --- a/hotsos/defs/scenarios/openstack/neutron/bugs/lp1907686.yaml +++ b/hotsos/defs/scenarios/openstack/neutron/bugs/lp1907686.yaml @@ -1,6 +1,6 @@ checks: isolcpus_enabled: - property: hotsos.core.plugins.kernel.KernelBase.isolcpus_enabled + property: kernel.isolcpus_enabled has_1907686: input: path: 'var/log/neutron/neutron-openvswitch-agent.log' diff --git a/hotsos/defs/scenarios/openstack/neutron/neutron_ovs_cleanup.yaml b/hotsos/defs/scenarios/openstack/neutron/neutron_ovs_cleanup.yaml index 474442ffc..fa795043f 100644 --- a/hotsos/defs/scenarios/openstack/neutron/neutron_ovs_cleanup.yaml +++ b/hotsos/defs/scenarios/openstack/neutron/neutron_ovs_cleanup.yaml @@ -3,7 +3,7 @@ checks: systemd: neutron-ovs-cleanup: enabled ovs_cleanup_run_manually: - property: hotsos.core.plugins.openstack.neutron.ServiceChecks.ovs_cleanup_run_manually + property: neutron.service_checks.ovs_cleanup_run_manually conclusions: ovs-cleanup-run-manually: decision: diff --git a/hotsos/defs/scenarios/openstack/nova/bugs/lp1761062.yaml b/hotsos/defs/scenarios/openstack/nova/bugs/lp1761062.yaml index d25e8679c..dc34640d7 100644 --- a/hotsos/defs/scenarios/openstack/nova/bugs/lp1761062.yaml +++ b/hotsos/defs/scenarios/openstack/nova/bugs/lp1761062.yaml @@ -6,7 +6,7 @@ checks: hint: 'DestinationDiskExists' libvirt_rbd_backend: config: - handler: hotsos.core.plugins.openstack.OpenstackConfig + handler: openstack.config path: etc/nova/nova.conf assertions: - key: images_type diff --git a/hotsos/defs/scenarios/openstack/nova/bugs/lp2004555.yaml b/hotsos/defs/scenarios/openstack/nova/bugs/lp2004555.yaml index 69e6b128f..867851a55 100644 --- a/hotsos/defs/scenarios/openstack/nova/bugs/lp2004555.yaml +++ b/hotsos/defs/scenarios/openstack/nova/bugs/lp2004555.yaml @@ -1,5 +1,5 @@ vars: - nova_version: '@hotsos.core.host_helpers.packaging.AptFactory.version:nova-common' + nova_version: '@apt.package.version:nova-common' checks: # only packages for >= yoga are fixed at the time of writing pkg_installed_and_ge_yoga: @@ -36,7 +36,7 @@ checks: max: '3:28' service_tokens_enabled: config: - handler: 'hotsos.core.plugins.openstack.OpenstackConfig' + handler: 'openstack.config' path: 'etc/nova/nova.conf' assertions: - section: service_user diff --git a/hotsos/defs/scenarios/openstack/nova/bugs/lp2012284.yaml b/hotsos/defs/scenarios/openstack/nova/bugs/lp2012284.yaml index 28ddce341..452c25776 100644 --- a/hotsos/defs/scenarios/openstack/nova/bugs/lp2012284.yaml +++ b/hotsos/defs/scenarios/openstack/nova/bugs/lp2012284.yaml @@ -1,5 +1,5 @@ vars: - nc_aa_mode: '@hotsos.core.host_helpers.apparmor.AAProfileFactory.mode:/usr/bin/nova-compute' + nc_aa_mode: '@apparmor.profile.mode:/usr/bin/nova-compute' checks: has_2012284: input: diff --git a/hotsos/defs/scenarios/openstack/nova/config_checks.yaml b/hotsos/defs/scenarios/openstack/nova/config_checks.yaml index 5d1377209..4914e7186 100644 --- a/hotsos/defs/scenarios/openstack/nova/config_checks.yaml +++ b/hotsos/defs/scenarios/openstack/nova/config_checks.yaml @@ -3,7 +3,7 @@ checks: apt: openvswitch-switch-dpdk nova_libvirt_queue_sizes_invalid_config: config: - handler: hotsos.core.plugins.openstack.OpenstackConfig + handler: openstack.config path: etc/nova/nova.conf assertions: not: diff --git a/hotsos/defs/scenarios/openstack/nova/cpu_pinning.yaml b/hotsos/defs/scenarios/openstack/nova/cpu_pinning.yaml index 9bc8ab8b4..ebd0d2581 100644 --- a/hotsos/defs/scenarios/openstack/nova/cpu_pinning.yaml +++ b/hotsos/defs/scenarios/openstack/nova/cpu_pinning.yaml @@ -1,24 +1,24 @@ # All conclusions in this scenario share the same priority so that one or more # of them can be reached. vars: - isolcpus_enabled: '@hotsos.core.plugins.kernel.KernelBase.isolcpus_enabled' - cpuaffinity_enabled: '@hotsos.core.plugins.kernel.SystemdConfig.cpuaffinity_enabled' - openstack_release: '@hotsos.core.plugins.openstack.OpenStackChecks.release_name' - vcpu_pinset: '@hotsos.core.plugins.openstack.nova.CPUPinning.vcpu_pin_set' - cpu_dedicated_set: '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set' - cpu_dedicated_set_name: '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set_name' - pinning_from_multi_numa_nodes: '@hotsos.core.plugins.openstack.nova.CPUPinning.nova_pinning_from_multi_numa_nodes' + isolcpus_enabled: '@kernel.isolcpus_enabled' + cpuaffinity_enabled: '@kernel.systemdconfig.cpuaffinity_enabled' + openstack_release: '@openstack.release_name' + vcpu_pinset: '@openstack.nova.cpupinning.vcpu_pin_set' + cpu_dedicated_set: '@openstack.nova.cpupinning.cpu_dedicated_set' + cpu_dedicated_set_name: '@openstack.nova.cpupinning.cpu_dedicated_set_name' + pinning_from_multi_numa_nodes: '@openstack.nova.cpupinning.nova_pinning_from_multi_numa_nodes' cpu_dedicated_set_intersection_isolcpus: - '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set_intersection_isolcpus' + '@openstack.nova.cpupinning.cpu_dedicated_set_intersection_isolcpus' cpu_dedicated_set_intersection_cpuaffinity: - '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set_intersection_cpuaffinity' + '@openstack.nova.cpupinning.cpu_dedicated_set_intersection_cpuaffinity' cpu_shared_set_intersection_isolcpus: - '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_shared_set_intersection_isolcpus' + '@openstack.nova.cpupinning.cpu_shared_set_intersection_isolcpus' cpu_shared_set_intersection_cpu_dedicated_set: - '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_shared_set_intersection_cpu_dedicated_set' - cpuaffinity_intersection_isolcpus: '@hotsos.core.plugins.openstack.nova.CPUPinning.cpuaffinity_intersection_isolcpus' - num_unpinned_cpus: '@hotsos.core.plugins.openstack.nova.CPUPinning.num_unpinned_cpus' - unpinned_cpus_pcent: '@hotsos.core.plugins.openstack.nova.CPUPinning.unpinned_cpus_pcent' + '@openstack.nova.cpupinning.cpu_shared_set_intersection_cpu_dedicated_set' + cpuaffinity_intersection_isolcpus: '@openstack.nova.cpupinning.cpuaffinity_intersection_isolcpus' + num_unpinned_cpus: '@openstack.nova.cpupinning.num_unpinned_cpus' + unpinned_cpus_pcent: '@openstack.nova.cpupinning.unpinned_cpus_pcent' checks: is_nova_compute_node: systemd: nova-compute @@ -106,7 +106,7 @@ conclusions: format-dict: pcent_unpinned: $unpinned_cpus_pcent nonisolated: $num_unpinned_cpus - total: hotsos.core.plugins.system.common.SystemBase.num_cpus + total: system.num_cpus nova-pinning-from-multi-numa-nodes: decision: - is_nova_compute_node diff --git a/hotsos/defs/scenarios/openstack/nova/service_mem_usage.yaml b/hotsos/defs/scenarios/openstack/nova/service_mem_usage.yaml index b3077307e..307392682 100644 --- a/hotsos/defs/scenarios/openstack/nova/service_mem_usage.yaml +++ b/hotsos/defs/scenarios/openstack/nova/service_mem_usage.yaml @@ -1,6 +1,6 @@ vars: limit: 5242880 # 5G in kb - libvirtd_usage: '@hotsos.core.host_helpers.systemd.ServiceFactory.memory_current_kb:libvirtd' + libvirtd_usage: '@systemd.service.memory_current_kb:libvirtd' checks: libvirtd_mem_use_above_limit: systemd: libvirtd diff --git a/hotsos/defs/scenarios/openstack/octavia/bugs/lp2029857.yaml b/hotsos/defs/scenarios/openstack/octavia/bugs/lp2029857.yaml index c78e8f8aa..c370d8ec8 100644 --- a/hotsos/defs/scenarios/openstack/octavia/bugs/lp2029857.yaml +++ b/hotsos/defs/scenarios/openstack/octavia/bugs/lp2029857.yaml @@ -6,7 +6,7 @@ checks: end: '(\[.+\]+) (octavia.common.exceptions.ProviderNotFound: Provider ''ovn'' was not found\.)' ovn_provider_enabled: config: - handler: 'hotsos.core.plugins.openstack.OpenstackConfig' + handler: 'openstack.config' path: 'etc/octavia/octavia.conf' assertions: - section: api_settings diff --git a/hotsos/defs/scenarios/openstack/octavia/hm_port_health.yaml b/hotsos/defs/scenarios/openstack/octavia/hm_port_health.yaml index a18dd35b0..88ff25af5 100644 --- a/hotsos/defs/scenarios/openstack/octavia/hm_port_health.yaml +++ b/hotsos/defs/scenarios/openstack/octavia/hm_port_health.yaml @@ -1,13 +1,13 @@ checks: octavia_worker_installed: - property: hotsos.core.plugins.openstack.octavia.OctaviaBase.installed + property: openstack.octavia.installed or: systemd: octavia-worker pebble: octavia-worker hm_port_has_no_packet_drops_or_errors: - property: hotsos.core.plugins.openstack.octavia.OctaviaBase.hm_port_healthy + property: openstack.octavia.hm_port_healthy hm_port_address_check: - property: hotsos.core.plugins.openstack.octavia.OctaviaBase.hm_port_has_address + property: openstack.octavia.hm_port_has_address conclusions: no-addr-or-noexist: priority: 1 @@ -22,7 +22,7 @@ conclusions: access to the lb-management network and therefore will not be able to communicate with Amphora VMs - please investigate. format-dict: - name: hotsos.core.plugins.openstack.octavia.OCTAVIA_HM_PORT_NAME + name: openstack.octavia.OCTAVIA_HM_PORT_NAME packet-drops-errors: priority: 2 decision: @@ -34,4 +34,4 @@ conclusions: Octavia health manager port {name} has some packets drops or errors - please investigate. format-dict: - name: hotsos.core.plugins.openstack.octavia.OCTAVIA_HM_PORT_NAME + name: openstack.octavia.OCTAVIA_HM_PORT_NAME diff --git a/hotsos/defs/scenarios/openstack/openstack.yaml b/hotsos/defs/scenarios/openstack/openstack.yaml index d9b18edba..a30f76424 100644 --- a/hotsos/defs/scenarios/openstack/openstack.yaml +++ b/hotsos/defs/scenarios/openstack/openstack.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.openstack.OpenStackChecks.plugin_runnable + property: openstack.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/openstack/openstack_apache2_certificates.yaml b/hotsos/defs/scenarios/openstack/openstack_apache2_certificates.yaml index 480b09b3a..0e75af471 100644 --- a/hotsos/defs/scenarios/openstack/openstack_apache2_certificates.yaml +++ b/hotsos/defs/scenarios/openstack/openstack_apache2_certificates.yaml @@ -1,9 +1,9 @@ checks: ssl_enabled: - property: hotsos.core.plugins.openstack.OpenstackBase.ssl_enabled + property: openstack.ssl_enabled apache2_certificate_expiring: property: - path: hotsos.core.plugins.openstack.OpenstackBase.apache2_certificates_expiring + path: openstack.apache2_certificates_expiring ops: [[ne, []]] conclusions: need-certificate-renewal: @@ -17,4 +17,4 @@ conclusions: {apache2-certificates-path} format-dict: apache2-certificates-path: '@checks.apache2_certificate_expiring.requires.value_actual:comma_join' - apache2-certificates-days-to-expire: 'hotsos.core.plugins.openstack.OpenstackBase.certificate_expire_days' + apache2-certificates-days-to-expire: 'openstack.certificate_expire_days' diff --git a/hotsos/defs/scenarios/openstack/openstack_charm_conflicts.yaml b/hotsos/defs/scenarios/openstack/openstack_charm_conflicts.yaml index 63c2d26b5..9518d9168 100644 --- a/hotsos/defs/scenarios/openstack/openstack_charm_conflicts.yaml +++ b/hotsos/defs/scenarios/openstack/openstack_charm_conflicts.yaml @@ -1,5 +1,5 @@ vars: - local_charms: '@hotsos.core.plugins.juju.JujuChecks.charms' + local_charms: '@juju.charms' checks: neutron_conflicts: - varops: [[$local_charms], [contains, neutron-api]] diff --git a/hotsos/defs/scenarios/openstack/pkgs_from_mixed_releases_found.yaml b/hotsos/defs/scenarios/openstack/pkgs_from_mixed_releases_found.yaml index e5cfe0869..867b674ef 100644 --- a/hotsos/defs/scenarios/openstack/pkgs_from_mixed_releases_found.yaml +++ b/hotsos/defs/scenarios/openstack/pkgs_from_mixed_releases_found.yaml @@ -1,7 +1,7 @@ checks: has_mixed_pkg_releases: property: - path: hotsos.core.plugins.openstack.OpenStackChecks.installed_pkg_release_names + path: openstack.installed_pkg_release_names ops: [[length_hint], [gt, 1]] conclusions: mixed-pkg-releases: diff --git a/hotsos/defs/scenarios/openstack/system_cpufreq_mode.yaml b/hotsos/defs/scenarios/openstack/system_cpufreq_mode.yaml index e83c12db6..31115e41b 100644 --- a/hotsos/defs/scenarios/openstack/system_cpufreq_mode.yaml +++ b/hotsos/defs/scenarios/openstack/system_cpufreq_mode.yaml @@ -12,7 +12,7 @@ vars: msg_ondemand: >- You will also need to stop and disable the ondemand systemd service in order for changes to persist. - scaling_governor: '@hotsos.core.plugins.kernel.sysfs.CPU.cpufreq_scaling_governor_all' + scaling_governor: '@kernel.sysfs.cpu.cpufreq_scaling_governor_all' checks: cpufreq_governor_not_performance: # can we actually see the setting diff --git a/hotsos/defs/scenarios/openstack/systemd_masked_services.yaml b/hotsos/defs/scenarios/openstack/systemd_masked_services.yaml index 2de38f8ab..5e55808a3 100644 --- a/hotsos/defs/scenarios/openstack/systemd_masked_services.yaml +++ b/hotsos/defs/scenarios/openstack/systemd_masked_services.yaml @@ -1,7 +1,7 @@ checks: has_unexpected_masked: property: - path: hotsos.core.plugins.openstack.OpenStackChecks.unexpected_masked_services + path: openstack.unexpected_masked_services ops: [[ne, []]] conclusions: has-unexpected-masked: diff --git a/hotsos/defs/scenarios/openvswitch/dpdk_config.yaml b/hotsos/defs/scenarios/openvswitch/dpdk_config.yaml index c95044c3a..a1e3fd3c6 100644 --- a/hotsos/defs/scenarios/openvswitch/dpdk_config.yaml +++ b/hotsos/defs/scenarios/openvswitch/dpdk_config.yaml @@ -1,15 +1,15 @@ vars: pmd_cpu_mask_key: 'pmd-cpu-mask' - pmd_cpu_mask: '@hotsos.core.plugins.openvswitch.OVSDPDK.pmd_cpu_mask' + pmd_cpu_mask: '@openvswitch.dpdk.pmd_cpu_mask' lcore_mask_key: 'dpdk-lcore-mask' - lcore_mask: '@hotsos.core.plugins.openvswitch.OVSDPDK.dpdk_lcore_mask' - other_config: '@hotsos.core.plugins.openvswitch.OVSDB.other_config:Open_vSwitch' - cpu_dedicated_set_hex: '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set_hex' - cpu_shared_set_hex: '@hotsos.core.plugins.openstack.nova.CPUPinning.cpu_shared_set_hex' + lcore_mask: '@openvswitch.dpdk.dpdk_lcore_mask' + other_config: '@openvswitch.db.other_config:Open_vSwitch' + cpu_dedicated_set_hex: '@openstack.nova.cpupinning.cpu_dedicated_set_hex' + cpu_shared_set_hex: '@openstack.nova.cpupinning.cpu_shared_set_hex' checks: ovs_dpdk_enabled: # see https://docs.openvswitch.org/en/latest/intro/install/dpdk/#setup-ovs - property: hotsos.core.plugins.openvswitch.OVSDPDK.enabled + property: openvswitch.dpdk.enabled dpdk_installed: apt: [openvswitch-switch-dpdk, dpdk] pmd_mask_is_set: @@ -79,5 +79,5 @@ conclusions: Poll Mode Driver threads and the Nova instances. format-dict: pmd_cpu_mask: '$pmd_cpu_mask_key' - cpu_dedicated_set: 'hotsos.core.plugins.openstack.nova.CPUPinning.cpu_dedicated_set:int_ranges' - cpu_shared_set: 'hotsos.core.plugins.openstack.nova.CPUPinning.cpu_shared_set:int_ranges' + cpu_dedicated_set: 'openstack.nova.cpupinning.cpu_dedicated_set:int_ranges' + cpu_shared_set: 'openstack.nova.cpupinning.cpu_shared_set:int_ranges' diff --git a/hotsos/defs/scenarios/openvswitch/dpif_lost_packets.yaml b/hotsos/defs/scenarios/openvswitch/dpif_lost_packets.yaml index 134f1a830..88e9250ac 100644 --- a/hotsos/defs/scenarios/openvswitch/dpif_lost_packets.yaml +++ b/hotsos/defs/scenarios/openvswitch/dpif_lost_packets.yaml @@ -2,7 +2,7 @@ input: path: var/log/openvswitch/ovs-vswitchd.log vars: - num_lost_packets: '@hotsos.core.plugins.openvswitch.OVSDPLookups.lost' + num_lost_packets: '@openvswitch.dplookups.lost' lost_packets_msg_part1: >- This host is running Openvswitch and its datapath is reporting a non-zero amount diff --git a/hotsos/defs/scenarios/openvswitch/openvswitch.yaml b/hotsos/defs/scenarios/openvswitch/openvswitch.yaml index f8633d7ed..05ac6a1eb 100644 --- a/hotsos/defs/scenarios/openvswitch/openvswitch.yaml +++ b/hotsos/defs/scenarios/openvswitch/openvswitch.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.openvswitch.OpenvSwitchChecks.plugin_runnable + property: openvswitch.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/openvswitch/ovn/bfd_flapping.yaml b/hotsos/defs/scenarios/openvswitch/ovn/bfd_flapping.yaml index 557df1b0a..c42fec22a 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/bfd_flapping.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/bfd_flapping.yaml @@ -1,5 +1,5 @@ vars: - bfd_transitions: '@hotsos.core.plugins.openvswitch.OVSBFD.max_transitions_last_24h_within_hour' + bfd_transitions: '@openvswitch.bfd.max_transitions_last_24h_within_hour' checks: vswitchd_to_ovn_controller_inactivity_timeouts: input: diff --git a/hotsos/defs/scenarios/openvswitch/ovn/ovn_central_certs_logs.yaml b/hotsos/defs/scenarios/openvswitch/ovn/ovn_central_certs_logs.yaml index 5c7af947e..99223d729 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/ovn_central_certs_logs.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/ovn_central_certs_logs.yaml @@ -1,9 +1,9 @@ vars: - host_cert_mtime: '@hotsos.core.host_helpers.filestat.FileFactory.mtime:etc/ovn/cert_host' - ovn_central_cert_mtime: '@hotsos.core.host_helpers.filestat.FileFactory.mtime:etc/ovn/ovn-central.crt' - northd_start_time: '@hotsos.core.host_helpers.systemd.ServiceFactory.start_time_secs:ovn-northd' - ovsdb_nb_start_time: '@hotsos.core.host_helpers.systemd.ServiceFactory.start_time_secs:ovn-ovsdb-server-nb' - ovsdb_sb_start_time: '@hotsos.core.host_helpers.systemd.ServiceFactory.start_time_secs:ovn-ovsdb-server-sb' + host_cert_mtime: '@file.mtime:etc/ovn/cert_host' + ovn_central_cert_mtime: '@file.mtime:etc/ovn/ovn-central.crt' + northd_start_time: '@systemd.service.start_time_secs:ovn-northd' + ovsdb_nb_start_time: '@systemd.service.start_time_secs:ovn-ovsdb-server-nb' + ovsdb_sb_start_time: '@systemd.service.start_time_secs:ovn-ovsdb-server-sb' cert_expired_expr: '([\d-]+)T([\d:]+)\.\d+Z\|\S+\|stream_ssl\|WARN\|SSL_accept: error:\S+:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired' cert_invalid_expr: '([\d-]+)T([\d:]+)\.\d+Z\|\S+\|stream_ssl\|WARN\|SSL_accept: error:\S+:SSL routines:tls_process_client_certificate:certificate verify failed' checks: diff --git a/hotsos/defs/scenarios/openvswitch/ovn/ovn_certs_valid.yaml b/hotsos/defs/scenarios/openvswitch/ovn/ovn_certs_valid.yaml index 9c830acfc..d5fe4fb4d 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/ovn_certs_valid.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/ovn_certs_valid.yaml @@ -1,12 +1,12 @@ vars: - ml2_mechanism_driver: '@hotsos.core.plugins.openstack.neutron.Config.mechanism_drivers:plugins/ml2/ml2_conf.ini' - data_root_is_sosreport: '@hotsos.core.plugins.sosreport.SOSReportChecks.data_root_is_sosreport' - ovn_cert_host_exists: '@hotsos.core.host_helpers.filestat.FileFactory.exists:etc/ovn/cert_host' - ovn_cert_host_days: '@hotsos.core.host_helpers.ssl.SSLCertificatesFactory.days_to_expire:etc/ovn/cert_host' + ml2_mechanism_driver: '@neutron.config.mechanism_drivers:plugins/ml2/ml2_conf.ini' + data_root_is_sosreport: '@sosreport.data_root_is_sosreport' + ovn_cert_host_exists: '@file.exists:etc/ovn/cert_host' + ovn_cert_host_days: '@sslcert.days_to_expire:etc/ovn/cert_host' neutron_ml2_cert_host_exists: - '@hotsos.core.host_helpers.filestat.FileFactory.exists:etc/neutron/plugins/ml2/cert_host' + '@file.exists:etc/neutron/plugins/ml2/cert_host' neutron_ml2_cert_host_days: - '@hotsos.core.host_helpers.ssl.SSLCertificatesFactory.days_to_expire:etc/neutron/plugins/ml2/cert_host' + '@sslcert.days_to_expire:etc/neutron/plugins/ml2/cert_host' checks: is_not_sosreport_data_root: varops: [[$data_root_is_sosreport], [ne, true]] diff --git a/hotsos/defs/scenarios/openvswitch/ovn/ovn_chassis_certs_logs.yaml b/hotsos/defs/scenarios/openvswitch/ovn/ovn_chassis_certs_logs.yaml index 6317be2d9..3326a29d6 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/ovn_chassis_certs_logs.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/ovn_chassis_certs_logs.yaml @@ -1,7 +1,7 @@ vars: - host_cert_mtime: '@hotsos.core.host_helpers.filestat.FileFactory.mtime:etc/ovn/cert_host' - ovn_chassis_cert_mtime: '@hotsos.core.host_helpers.filestat.FileFactory.mtime:etc/ovn/ovn-chassis.crt' - ovn_controller_start_time: '@hotsos.core.host_helpers.systemd.ServiceFactory.start_time_secs:ovn-controller' + host_cert_mtime: '@file.mtime:etc/ovn/cert_host' + ovn_chassis_cert_mtime: '@file.mtime:etc/ovn/ovn-chassis.crt' + ovn_controller_start_time: '@systemd.service.start_time_secs:ovn-controller' cert_expired_expr: '([\d-]+)T([\d:]+)\.\d+Z\|\S+\|stream_ssl\|WARN\|SSL_accept: error:\S+:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired' cert_invalid_expr: '([\d-]+)T([\d:]+)\.\d+Z\|\S+\|stream_ssl\|WARN\|SSL_accept: error:\S+:SSL routines:tls_process_client_certificate:certificate verify failed' checks: diff --git a/hotsos/defs/scenarios/openvswitch/ovn/ovn_upgrades.yaml b/hotsos/defs/scenarios/openvswitch/ovn/ovn_upgrades.yaml index aa710fc9b..fa84e5253 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/ovn_upgrades.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/ovn_upgrades.yaml @@ -1,6 +1,6 @@ vars: dbkey: 'ovn-match-northd-version' - external_ids: '@hotsos.core.plugins.openvswitch.OVSDB.external_ids:Open_vSwitch' + external_ids: '@openvswitch.db.external_ids:Open_vSwitch' message_boilerplate: >- The ovn-controller service on this node is reporting northd version mismatch errors. This happens when the version of OVN differs between diff --git a/hotsos/defs/scenarios/openvswitch/ovn/service_mem_usage.yaml b/hotsos/defs/scenarios/openvswitch/ovn/service_mem_usage.yaml index 56ceeae8d..0be9e7b0a 100644 --- a/hotsos/defs/scenarios/openvswitch/ovn/service_mem_usage.yaml +++ b/hotsos/defs/scenarios/openvswitch/ovn/service_mem_usage.yaml @@ -1,6 +1,6 @@ vars: limit: 5242880 # 5G in kb - northd_usage: '@hotsos.core.host_helpers.systemd.ServiceFactory.memory_current_kb:ovn-northd' + northd_usage: '@systemd.service.memory_current_kb:ovn-northd' version_fixed: '22.03.2-0ubuntu0.22.04.1' checks: northd_mem_use_above_limit: diff --git a/hotsos/defs/scenarios/openvswitch/service_restarts.yaml b/hotsos/defs/scenarios/openvswitch/service_restarts.yaml index e5a8eebfe..3558dcef3 100644 --- a/hotsos/defs/scenarios/openvswitch/service_restarts.yaml +++ b/hotsos/defs/scenarios/openvswitch/service_restarts.yaml @@ -1,5 +1,5 @@ vars: - ovs_version: '@hotsos.core.host_helpers.packaging.AptFactory.version:openvswitch-switch' + ovs_version: '@apt.package.version:openvswitch-switch' checks: ovs_frequent_restarts: input: @@ -15,7 +15,7 @@ checks: apt: [openvswitch-switch-dpdk, dpdk] ovs_dpdk_enabled: # see https://docs.openvswitch.org/en/latest/intro/install/dpdk/#setup-ovs - property: hotsos.core.plugins.openvswitch.OVSDPDK.enabled + property: openvswitch.dpdk.enabled conclusions: ovs_frequent_restarts_dpdk: priority: 2 diff --git a/hotsos/defs/scenarios/pacemaker/bugs/lp1874719.yaml b/hotsos/defs/scenarios/pacemaker/bugs/lp1874719.yaml index 9cd323a03..6b7e7a3f8 100644 --- a/hotsos/defs/scenarios/pacemaker/bugs/lp1874719.yaml +++ b/hotsos/defs/scenarios/pacemaker/bugs/lp1874719.yaml @@ -1,7 +1,7 @@ checks: node1-found: property: - path: hotsos.core.plugins.pacemaker.PacemakerBase.offline_nodes + path: pacemaker.offline_nodes ops: [[contains, node1]] conclusions: node1-found-needs-removal: diff --git a/hotsos/defs/scenarios/pacemaker/pacemaker.yaml b/hotsos/defs/scenarios/pacemaker/pacemaker.yaml index 5e7ca1a73..a21cb3c1c 100644 --- a/hotsos/defs/scenarios/pacemaker/pacemaker.yaml +++ b/hotsos/defs/scenarios/pacemaker/pacemaker.yaml @@ -1,2 +1,2 @@ requires: - property: hotsos.core.plugins.pacemaker.PacemakerChecks.plugin_runnable + property: pacemaker.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/rabbitmq/cluster_config.yaml b/hotsos/defs/scenarios/rabbitmq/cluster_config.yaml index eed53645f..3edb274f7 100644 --- a/hotsos/defs/scenarios/rabbitmq/cluster_config.yaml +++ b/hotsos/defs/scenarios/rabbitmq/cluster_config.yaml @@ -1,7 +1,7 @@ checks: partition_handling_is_ignore: property: - path: hotsos.core.plugins.rabbitmq.RabbitMQReport.partition_handling + path: rabbitmq.partition_handling ops: [[eq, ignore]] conclusions: partition-handling-is-ignore: diff --git a/hotsos/defs/scenarios/rabbitmq/cluster_resources.yaml b/hotsos/defs/scenarios/rabbitmq/cluster_resources.yaml index 46222a570..b92ec2690 100644 --- a/hotsos/defs/scenarios/rabbitmq/cluster_resources.yaml +++ b/hotsos/defs/scenarios/rabbitmq/cluster_resources.yaml @@ -1,7 +1,7 @@ checks: cluster_vhosts_unbalanced: property: - path: hotsos.core.plugins.rabbitmq.RabbitMQReport.skewed_nodes + path: rabbitmq.skewed_nodes ops: [[length_hint], [gt, 0]] conclusions: cluster-vhosts-unbalanced: diff --git a/hotsos/defs/scenarios/rabbitmq/rabbitmq.yaml b/hotsos/defs/scenarios/rabbitmq/rabbitmq.yaml index 2f174612c..7be3a2886 100644 --- a/hotsos/defs/scenarios/rabbitmq/rabbitmq.yaml +++ b/hotsos/defs/scenarios/rabbitmq/rabbitmq.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.rabbitmq.RabbitMQChecks.plugin_runnable + property: rabbitmq.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/sosreport/plugin_timeouts.yaml b/hotsos/defs/scenarios/sosreport/plugin_timeouts.yaml index 44f281b8f..acb2c00ac 100644 --- a/hotsos/defs/scenarios/sosreport/plugin_timeouts.yaml +++ b/hotsos/defs/scenarios/sosreport/plugin_timeouts.yaml @@ -1,7 +1,7 @@ checks: has_timed_out_plugins: property: - path: hotsos.core.plugins.sosreport.SOSReportChecks.timed_out_plugins + path: sosreport.timed_out_plugins ops: [[length_hint], [gt, 0]] conclusions: has-timed-out-plugins: diff --git a/hotsos/defs/scenarios/storage/bcache/bcache.yaml b/hotsos/defs/scenarios/storage/bcache/bcache.yaml index 380739c33..98133e264 100644 --- a/hotsos/defs/scenarios/storage/bcache/bcache.yaml +++ b/hotsos/defs/scenarios/storage/bcache/bcache.yaml @@ -1,5 +1,5 @@ requires: # don't run these checks if we are inside a lxc container property: - path: hotsos.core.plugins.system.system.SystemBase.virtualisation_type + path: system.virtualisation_type ops: [[ne, lxc]] diff --git a/hotsos/defs/scenarios/storage/bcache/bdev.yaml b/hotsos/defs/scenarios/storage/bcache/bdev.yaml index 9defa773b..e5956459e 100644 --- a/hotsos/defs/scenarios/storage/bcache/bdev.yaml +++ b/hotsos/defs/scenarios/storage/bcache/bdev.yaml @@ -1,10 +1,10 @@ vars: - sequential_cutoff: '@hotsos.core.plugins.storage.bcache.BDevsInfo.sequential_cutoff' - cache_mode: '@hotsos.core.plugins.storage.bcache.BDevsInfo.cache_mode' - writeback_percent: '@hotsos.core.plugins.storage.bcache.BDevsInfo.writeback_percent' + sequential_cutoff: '@bcache.bdevsinfo.sequential_cutoff' + cache_mode: '@bcache.bdevsinfo.cache_mode' + writeback_percent: '@bcache.bdevsinfo.writeback_percent' checks: bcache_enabled: - property: hotsos.core.plugins.storage.bcache.BcacheBase.bcache_enabled + property: bcache.bcache_enabled has_invalid_bdev_cutoff: varops: [[$sequential_cutoff], [getitem, 0], [ne, '0.0k']] has_invalid_bdev_cache_mode: diff --git a/hotsos/defs/scenarios/storage/bcache/cacheset.yaml b/hotsos/defs/scenarios/storage/bcache/cacheset.yaml index 3d63ce101..51fdcead1 100644 --- a/hotsos/defs/scenarios/storage/bcache/cacheset.yaml +++ b/hotsos/defs/scenarios/storage/bcache/cacheset.yaml @@ -1,10 +1,10 @@ vars: - congested_read_threshold_us: '@hotsos.core.plugins.storage.bcache.CachesetsInfo.congested_read_threshold_us' - congested_write_threshold_us: '@hotsos.core.plugins.storage.bcache.CachesetsInfo.congested_write_threshold_us' - cache_available_percent: '@hotsos.core.plugins.storage.bcache.CachesetsInfo.cache_available_percent' + congested_read_threshold_us: '@bcache.cachesetsinfo.congested_read_threshold_us' + congested_write_threshold_us: '@bcache.cachesetsinfo.congested_write_threshold_us' + cache_available_percent: '@bcache.cachesetsinfo.cache_available_percent' checks: bcache_enabled: - property: hotsos.core.plugins.storage.bcache.BcacheBase.bcache_enabled + property: bcache.bcache_enabled has_invalid_cset_congested_read_threshold_us: varops: [[$congested_read_threshold_us], [getitem, 0], [ne, 0]] has_invalid_cset_congested_write_threshold_us: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/auth_insecure_global_id_reclaim_allowed.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/auth_insecure_global_id_reclaim_allowed.yaml index ce775d965..309496e25 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/auth_insecure_global_id_reclaim_allowed.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/auth_insecure_global_id_reclaim_allowed.yaml @@ -5,7 +5,7 @@ checks: expr: '.+"message": "mon is allowing insecure global_id reclaim"' health_warning: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[eq, HEALTH_WARN]] conclusions: insecure-auth-allowed: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/autoscaler_bug.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/autoscaler_bug.yaml index ad6ca25b5..fafa3a3b2 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/autoscaler_bug.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/autoscaler_bug.yaml @@ -1,5 +1,5 @@ vars: - autoscaler_enabled_pools: '@hotsos.core.plugins.storage.ceph.CephCrushMap.autoscaler_enabled_pools' + autoscaler_enabled_pools: '@ceph.crushmap.autoscaler_enabled_pools' msg_main: >- This Ceph cluster is vulnerable to a bug in which OSDs can consume considerable amounts of memory and eventually be OOM killed due to diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_size.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_size.yaml index 56fb0bd91..ea57e4129 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_size.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_size.yaml @@ -1,7 +1,7 @@ checks: bluefs_osds_have_oversize_metadata: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.bluefs_oversized_metadata_osds + path: ceph.cluster.bluefs_oversized_metadata_osds ops: [[length_hint], [gt, 0]] conclusions: bluefs-osds-have-oversize-metadata: @@ -16,4 +16,4 @@ conclusions: compact the metadata, use 'ceph-bluestore-tool' which is available since 14.2.0. format-dict: bad_meta_osds: '@checks.bluefs_osds_have_oversize_metadata.requires.value_actual:comma_join' - limit_percent: hotsos.core.plugins.storage.ceph.CephCluster.OSD_META_LIMIT_PERCENT + limit_percent: ceph.cluster.OSD_META_LIMIT_PERCENT diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_spillover.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_spillover.yaml index 67e31edfb..50533f783 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_spillover.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/bluefs_spillover.yaml @@ -5,7 +5,7 @@ checks: expr: '.+experiencing BlueFS spillover' health_warning: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[eq, HEALTH_WARN]] conclusions: bluefs-spillover: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_address_overlap.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_address_overlap.yaml index 5d734f8c6..36d91cd0f 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_address_overlap.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_address_overlap.yaml @@ -1,12 +1,12 @@ vars: - cluster_network: '@hotsos.core.plugins.storage.ceph.CephConfig.cluster_network_set' - public_network: '@hotsos.core.plugins.storage.ceph.CephConfig.public_network_set' + cluster_network: '@ceph.config.cluster_network_set' + public_network: '@ceph.config.public_network_set' checks: network_configs_overlap: # The following logic passes if one or both of network sets P and C # have more than one network AND they share at least one network. config: - handler: hotsos.core.plugins.storage.ceph.CephConfig + handler: ceph.config assertions: - key: cluster_network_set ops: [[and_, $public_network], [length_hint], [gt, 0]] diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_cluster_health.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_cluster_health.yaml index 2fe86c23a..d1e4b63b2 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_cluster_health.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_cluster_health.yaml @@ -1,11 +1,11 @@ checks: cluster_health_available: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[ne, null]] cluster_unhealthy: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[ne, HEALTH_OK]] conclusions: cluster-health-not-ok: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_versions_mismatch.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_versions_mismatch.yaml index 80e456317..dea7c401c 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_versions_mismatch.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ceph_versions_mismatch.yaml @@ -1,8 +1,8 @@ checks: cluster_daemon_versions_aligned: - property: hotsos.core.plugins.storage.ceph.CephCluster.ceph_versions_aligned + property: ceph.cluster.ceph_versions_aligned mon_versions_aligned: - property: hotsos.core.plugins.storage.ceph.CephCluster.mon_versions_aligned_with_cluster + property: ceph.cluster.mon_versions_aligned_with_cluster conclusions: all-daemon-versions-not-aligned: priority: 1 diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/crushmap_bucket_checks.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/crushmap_bucket_checks.yaml index d95077188..d3156dfea 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/crushmap_bucket_checks.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/crushmap_bucket_checks.yaml @@ -1,11 +1,11 @@ checks: crushmap_has_mixed_type_buckets: property: - path: hotsos.core.plugins.storage.ceph.CephCrushMap.crushmap_mixed_buckets + path: ceph.crushmap.crushmap_mixed_buckets ops: [[length_hint], [gt, 0]] crushmap_has_unequal_buckets: property: - path: hotsos.core.plugins.storage.ceph.CephCrushMap.crushmap_equal_buckets + path: ceph.crushmap.crushmap_equal_buckets ops: [[length_hint], [gt, 0]] conclusions: crushmap-mixed-buckets: @@ -16,7 +16,7 @@ conclusions: Mixed crush bucket types identified in buckets '{buckets}'. This can cause data distribution to become skewed - please check crush map. format-dict: - buckets: hotsos.core.plugins.storage.ceph.CephCrushMap.crushmap_mixed_buckets_str + buckets: ceph.crushmap.crushmap_mixed_buckets_str crushmap-unbalanced-buckets: decision: crushmap_has_unequal_buckets raises: @@ -28,4 +28,4 @@ conclusions: Transient issues such as "out" OSDs, or cluster expansion/maintenance can trigger this warning. Affected CRUSH tree(s) and bucket types are {affected}. format-dict: - affected: hotsos.core.plugins.storage.ceph.CephCrushMap.crushmap_equal_buckets_pretty + affected: ceph.crushmap.crushmap_equal_buckets_pretty diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/empty_clog.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/empty_clog.yaml index ddd1ccb08..491f5db72 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/empty_clog.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/empty_clog.yaml @@ -1,6 +1,6 @@ vars: - clog_size: '@hotsos.core.host_helpers.filestat.FileFactory.size:var/log/ceph/ceph.log' - mc_clog_size: '@hotsos.core.host_helpers.filestat.FileFactory.size:var/snap/microceph/common/logs/ceph.log' + clog_size: '@file.size:var/log/ceph/ceph.log' + mc_clog_size: '@file.size:var/snap/microceph/common/logs/ceph.log' checks: empty_clog_size: or: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/eol.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/eol.yaml index ea9741014..e12cadc1b 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/eol.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/eol.yaml @@ -1,7 +1,7 @@ checks: is_eol: property: - path: hotsos.core.plugins.storage.ceph.CephChecks.days_to_eol + path: ceph.days_to_eol ops: [[le, 0]] conclusions: is-eol: @@ -14,4 +14,4 @@ conclusions: has limited support and is likely not receiving updates anymore. Please consider upgrading to a newer release. format-dict: - release: hotsos.core.plugins.storage.ceph.CephChecks.release_name + release: ceph.release_name diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/laggy_pgs.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/laggy_pgs.yaml index da5ec88ca..89f3b270a 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/laggy_pgs.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/laggy_pgs.yaml @@ -1,7 +1,7 @@ checks: cluster_has_laggy_pgs: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.laggy_pgs + path: ceph.cluster.laggy_pgs ops: [[length_hint], [gt, 0]] conclusions: cluster-has-laggy-pgs: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/large_omap_objects.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/large_omap_objects.yaml index 870b6af1a..d6bf26981 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/large_omap_objects.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/large_omap_objects.yaml @@ -1,7 +1,7 @@ checks: cluster_has_pgs_with_large_omap_objects: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.large_omap_pgs + path: ceph.cluster.large_omap_pgs ops: [[length_hint], [gt, 0]] conclusions: large-omap-pgs: @@ -19,4 +19,4 @@ conclusions: If the large OMAP objects are reported from a pool used by OpenStack Gnocchi, it may need tuning: https://portal.support.canonical.com/ua/s/article/Gnocchi-causing-large-OMAP-objects-in-a-Ceph-cluster format-dict: - large_omap_pgs: hotsos.core.plugins.storage.ceph.CephCluster.large_omap_pgs_str + large_omap_pgs: ceph.cluster.large_omap_pgs_str diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_db_too_big.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_db_too_big.yaml index 8f6897493..1abf37bc4 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_db_too_big.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_db_too_big.yaml @@ -5,7 +5,7 @@ checks: expr: '.*mon (.+) is using a lot of disk space.*' health_warning: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[ne, HEALTH_OK]] conclusions: db_too_large: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_elections_flapping.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_elections_flapping.yaml index a978b6c90..5e0f22aae 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_elections_flapping.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/mon_elections_flapping.yaml @@ -11,7 +11,7 @@ checks: search-result-age-hours: 48 min-hours-since-last-boot: 1 ceph_interfaces_have_errors: - property: hotsos.core.plugins.storage.ceph.CephChecks.has_interface_errors + property: ceph.has_interface_errors conclusions: cause-unknown: priority: 1 @@ -35,5 +35,5 @@ conclusions: period and the network interface(s) {interfaces} used by the ceph-mon are showing errors - please investigate. format-dict: - interfaces: hotsos.core.plugins.storage.ceph.CephChecks.bind_interface_names + interfaces: ceph.bind_interface_names count: '@checks.ceph_log_has_election_calls.search.num_results' diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_flapping.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_flapping.yaml index 010550c5f..1a1177e7b 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_flapping.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_flapping.yaml @@ -6,7 +6,7 @@ checks: path: ['var/log/ceph/ceph*.log', 'var/snap/microceph/common/logs/ceph*.log'] expr: '([\d-])+[T ][\d:]+\S+ .+ wrongly marked me down at .+' ceph_interfaces_have_errors: - property: hotsos.core.plugins.storage.ceph.CephChecks.has_interface_errors + property: ceph.has_interface_errors conclusions: cause-unknown: priority: 1 @@ -36,4 +36,4 @@ conclusions: interface(s) ({interfaces}) used by the Ceph are showing errors - please investigate. format-dict: - interfaces: hotsos.core.plugins.storage.ceph.CephChecks.bind_interface_names + interfaces: ceph.bind_interface_names diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_maps_backlog_too_large.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_maps_backlog_too_large.yaml index e8a85f8dd..2815082c8 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_maps_backlog_too_large.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_maps_backlog_too_large.yaml @@ -6,7 +6,7 @@ checks: # increasing which can result in more disk utilization, possibly slower # mons, etc. See https://docs.ceph.com/en/latest/dev/mon-osdmap-prune/. property: - path: hotsos.core.plugins.storage.ceph.CephCluster.osdmaps_count + path: ceph.cluster.osdmaps_count # mon_min_osdmap_epochs default ops: [[gt, 500]] conclusions: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_messenger_v2_protocol.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_messenger_v2_protocol.yaml index 6440e0c02..0528b17a3 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_messenger_v2_protocol.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_messenger_v2_protocol.yaml @@ -2,11 +2,11 @@ checks: ceph_release_gt_mimic: # v2 only available for >= Nautilus property: - path: hotsos.core.plugins.storage.ceph.CephChecks.release_name + path: ceph.release_name ops: [[gt, mimic]] cluster_has_v1_only_osds: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.cluster_osds_without_v2_messenger_protocol + path: ceph.cluster.cluster_osds_without_v2_messenger_protocol ops: [[length_hint], [gt, 0]] conclusions: some-osds-not-using-v2: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_slow_ops.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_slow_ops.yaml index 1748d4945..e84f9f3a7 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_slow_ops.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_slow_ops.yaml @@ -12,7 +12,7 @@ checks: search-period-hours: 1 search-result-age-hours: 24 ceph_interfaces_have_errors: - property: hotsos.core.plugins.storage.ceph.CephChecks.has_interface_errors + property: ceph.has_interface_errors conclusions: cause-unknown: priority: 1 @@ -38,4 +38,4 @@ conclusions: interface(s) ({interfaces}) used by the Ceph are showing errors - please investigate. format-dict: - interfaces: hotsos.core.plugins.storage.ceph.CephChecks.bind_interface_names + interfaces: ceph.bind_interface_names diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_unusual_raw.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_unusual_raw.yaml index a6c00949d..596d11086 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_unusual_raw.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/osd_unusual_raw.yaml @@ -1,7 +1,7 @@ checks: osds_have_unusual_raw_usage: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.osd_raw_usage_higher_than_data + path: ceph.cluster.osd_raw_usage_higher_than_data ops: [[length_hint], [gt, 0]] conclusions: osds-have-unusual-raw-usage: @@ -16,4 +16,4 @@ conclusions: full or misbehave, please restart them and possibly file a bug in Ceph tracker. format-dict: bad_osds: '@checks.osds_have_unusual_raw_usage.requires.value_actual:comma_join' - limit: hotsos.core.plugins.storage.ceph.CephCluster.OSD_DISCREPANCY_ALLOWED + limit: ceph.cluster.OSD_DISCREPANCY_ALLOWED diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_imbalance.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_imbalance.yaml index a9c492108..845113dec 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_imbalance.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_imbalance.yaml @@ -1,18 +1,18 @@ checks: cluster_has_osds_with_pgs_above_max: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.osds_pgs_above_max + path: ceph.cluster.osds_pgs_above_max ops: [[length_hint], [gt, 0]] cluster_has_osds_with_suboptimal_pgs: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.osds_pgs_suboptimal + path: ceph.cluster.osds_pgs_suboptimal ops: [[length_hint], [gt, 0]] cluster_has_non_empty_pools: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.cluster_has_non_empty_pools + path: ceph.cluster.cluster_has_non_empty_pools autoscaler_disabled_for_any_pool: property: - path: hotsos.core.plugins.storage.ceph.CephCrushMap.autoscaler_disabled_pools + path: ceph.crushmap.autoscaler_disabled_pools ops: [[length_hint]] conclusions: cluster-osds-with-pgs-above-max: @@ -24,7 +24,7 @@ conclusions: limit at which point they will stop creating pgs and fail - please investigate. format-dict: - limit: hotsos.core.plugins.storage.ceph.CephCluster.OSD_PG_MAX_LIMIT + limit: ceph.cluster.OSD_PG_MAX_LIMIT cluster-osds-with-suboptimal-pgs: decision: - cluster_has_osds_with_suboptimal_pgs @@ -37,5 +37,5 @@ conclusions: of {min}-{max} pgs. This could indicate poor data distribution across the cluster and result in performance degradation. format-dict: - min: hotsos.core.plugins.storage.ceph.CephCluster.OSD_PG_OPTIMAL_NUM_MIN - max: hotsos.core.plugins.storage.ceph.CephCluster.OSD_PG_OPTIMAL_NUM_MAX + min: ceph.cluster.OSD_PG_OPTIMAL_NUM_MIN + max: ceph.cluster.OSD_PG_OPTIMAL_NUM_MAX diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_overdose.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_overdose.yaml index de342f417..3a7d9ce8d 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_overdose.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/pg_overdose.yaml @@ -5,7 +5,7 @@ checks: expr: '.+ PGs pending on creation' health_warning: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[ne, HEALTH_OK]] conclusions: pending_creating_pgs: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/required_osd_release_mismatch.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/required_osd_release_mismatch.yaml index 7298bdb5e..5c89cc63a 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/required_osd_release_mismatch.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/required_osd_release_mismatch.yaml @@ -1,10 +1,10 @@ checks: has_required_osd_release_cluster_config: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.require_osd_release + path: ceph.cluster.require_osd_release ops: [[ne, null]] osd_versions_match_osd_required: - property: hotsos.core.plugins.storage.ceph.CephCluster.osd_daemon_release_names_match_required + property: ceph.cluster.osd_daemon_release_names_match_required conclusions: osd-versions-mismatch: decision: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/rgw_frontend.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/rgw_frontend.yaml index cf117d731..7e2559ebd 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/rgw_frontend.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/rgw_frontend.yaml @@ -5,7 +5,7 @@ checks: - min: 14.2.0 rgw_outdated_frontend: config: - handler: hotsos.core.plugins.storage.ceph.CephConfig + handler: ceph.config assertions: - key: rgw_frontends ops: [[ne, null]] @@ -13,7 +13,7 @@ checks: ops: [[contains, civetweb]] is_rgw_using_civetweb: property: - path: hotsos.core.plugins.storage.ceph.CephCrushMap.is_rgw_using_civetweb + path: ceph.crushmap.is_rgw_using_civetweb conclusions: rgw_outdated_frontend: decision: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ssds_using_bcache.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ssds_using_bcache.yaml index a7e608d1c..3881f43d9 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/ssds_using_bcache.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/ssds_using_bcache.yaml @@ -1,7 +1,7 @@ checks: ssds_using_bcache: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.ssds_using_bcache + path: ceph.cluster.ssds_using_bcache ops: [[length_hint], [gt, 0]] conclusions: ssd_osds_using_bcache: @@ -17,4 +17,4 @@ conclusions: the OSDs directly instead. Please compare the IOPs of the SSD (OSDs) vs. the bcache device (SSD/NVMe) to ascertain. format-dict: - osds: hotsos.core.plugins.storage.ceph.CephCluster.ssds_using_bcache + osds: ceph.cluster.ssds_using_bcache diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-mon/unresponsive_mon_mgr.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-mon/unresponsive_mon_mgr.yaml index f4ff9afaa..6fd19c344 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-mon/unresponsive_mon_mgr.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-mon/unresponsive_mon_mgr.yaml @@ -2,26 +2,26 @@ checks: # In older sosreports, the plugin is called 'ceph' (= mon + mgr + osd) and # in the newer ones it's called 'ceph_mon'. is_sosreport: - property: hotsos.core.plugins.sosreport.SOSReportChecks.plugin_runnable + property: sosreport.plugin_runnable sosreport_hung_ceph_mon_old: property: - path: hotsos.core.plugins.sosreport.SOSReportChecks.timed_out_plugins + path: sosreport.timed_out_plugins ops: [[contains, ceph]] sosreport_hung_ceph_mon_new: property: - path: hotsos.core.plugins.sosreport.SOSReportChecks.timed_out_plugins + path: sosreport.timed_out_plugins ops: [[contains, ceph_mon]] sosreport_hung_ceph_mgr: property: - path: hotsos.core.plugins.sosreport.SOSReportChecks.timed_out_plugins + path: sosreport.timed_out_plugins ops: [[contains, ceph_mgr]] ceph_osd_df_tree: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.osd_df_tree + path: ceph.cluster.osd_df_tree ops: [[eq, null]] ceph_pg_dump: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.pg_dump + path: ceph.cluster.pg_dump ops: [[eq, null]] conclusions: ceph_mon_hung: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1936136.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1936136.yaml index e1e21d5ad..9da72272a 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1936136.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1936136.yaml @@ -1,5 +1,5 @@ vars: - cache_available_percent: '@hotsos.core.plugins.storage.bcache.CachesetsInfo.cache_available_percent' + cache_available_percent: '@bcache.cachesetsinfo.cache_available_percent' checks: node_is_ceph_osd_and_has_version: # Get version of osd based on package installed. This is prone to @@ -16,15 +16,15 @@ checks: - min: 17.0.0 max: 17.0.0 node_has_osds_using_bcache: - property: hotsos.core.plugins.storage.ceph.CephChecks.local_osds_use_bcache + property: ceph.local_osds_use_bcache kernel_version_check: property: - path: hotsos.core.plugins.kernel.KernelBase.version + path: kernel.version ops: [[lt, '5.4']] bluefs_buffered_io_enabled: config: # We will need a better way to check the actual osd config - handler: hotsos.core.plugins.storage.ceph.CephConfig + handler: ceph.config assertions: key: bluefs_buffered_io ops: [[eq, true]] diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1959649.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1959649.yaml index 1d09dec80..853e1b09d 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1959649.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1959649.yaml @@ -1,8 +1,8 @@ vars: bluestore_volume_selection_policy: - '@hotsos.core.plugins.storage.ceph.CephDaemonAllOSDsFactory.bluestore_volume_selection_policy:CephDaemonConfigShow' + '@ceph.daemon.all-osds.bluestore_volume_selection_policy:CephDaemonConfigShow' bluestore_cache_onode: - '@hotsos.core.plugins.storage.ceph.CephDaemonAllOSDsFactory.bluestore_cache_onode:CephDaemonDumpMemPools' + '@ceph.daemon.all-osds.bluestore_cache_onode:CephDaemonDumpMemPools' checks: has_1959649: - apt: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1996010.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1996010.yaml index f143f0d58..48956ea3f 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1996010.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp1996010.yaml @@ -1,8 +1,8 @@ vars: bluestore_volume_selection_policy: - '@hotsos.core.plugins.storage.ceph.CephDaemonAllOSDsFactory.bluestore_volume_selection_policy:CephDaemonConfigShow' + '@ceph.daemon.all-osds.bluestore_volume_selection_policy:CephDaemonConfigShow' bluestore_cache_onode: - '@hotsos.core.plugins.storage.ceph.CephDaemonAllOSDsFactory.bluestore_cache_onode:CephDaemonDumpMemPools' + '@ceph.daemon.all-osds.bluestore_cache_onode:CephDaemonDumpMemPools' checks: has_1996010_osd_log: # NOTE: this needs quite a high debug level to appear - debug_bluestore=30/30 diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp2016845.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp2016845.yaml index a95c19698..066a8c311 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp2016845.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/bugs/lp2016845.yaml @@ -7,7 +7,7 @@ checks: # packages have this issue in the past or future. - min: 12.2.0 linked_with_tcmalloc: - property: hotsos.core.plugins.storage.ceph.CephChecks.linked_with_tcmalloc + property: ceph.linked_with_tcmalloc conclusions: node_affected_by_bug_2016845: decision: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/filestore_to_bluestore_upgrade.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/filestore_to_bluestore_upgrade.yaml index 63e2f1af8..0c76edc8f 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/filestore_to_bluestore_upgrade.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/filestore_to_bluestore_upgrade.yaml @@ -2,10 +2,10 @@ # This can happen e.g. after an upgrade from Filestore to Bluestore. checks: bluestore_enabled: - property: hotsos.core.plugins.storage.ceph.CephChecks.bluestore_enabled + property: ceph.bluestore_enabled ceph_config_has_journal: config: - handler: hotsos.core.plugins.storage.ceph.CephConfig + handler: ceph.config assertions: key: osd_journal ops: [[ne, null]] diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/juju_ceph_no_bcache_tuning.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/juju_ceph_no_bcache_tuning.yaml index 82c90ece4..4c835002a 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/juju_ceph_no_bcache_tuning.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/juju_ceph_no_bcache_tuning.yaml @@ -1,14 +1,14 @@ checks: juju_ceph_osd_charm_enabled: property: - path: hotsos.core.plugins.juju.resources.JujuBase.charm_names + path: juju.base.charm_names ops: [[contains, ceph-osd]] juju_bcache_tuning_charm_enabled: property: - path: hotsos.core.plugins.juju.resources.JujuBase.charm_names + path: juju.base.charm_names ops: [[contains, bcache-tuning]] local_osds_using_bcache: - property: hotsos.core.plugins.storage.ceph.CephChecks.local_osds_use_bcache + property: ceph.local_osds_use_bcache conclusions: charmed-ceph-osd-no-bcache-tuning: decision: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/pg_overdose.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/pg_overdose.yaml index 64772da19..219577091 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/pg_overdose.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/pg_overdose.yaml @@ -1,7 +1,7 @@ checks: health_warning: property: - path: hotsos.core.plugins.storage.ceph.CephCluster.health_status + path: ceph.cluster.health_status ops: [[ne, HEALTH_OK]] ceph_osd_withhold_creation: input: diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/ssd_osds_no_discard.yaml.disabled b/hotsos/defs/scenarios/storage/ceph/ceph-osd/ssd_osds_no_discard.yaml.disabled index 50e93f4c3..abba35e39 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/ssd_osds_no_discard.yaml.disabled +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/ssd_osds_no_discard.yaml.disabled @@ -1,11 +1,11 @@ checks: ssd_ceph_osds_exist: property: - path: hotsos.core.plugins.storage.ceph.CephChecks.local_osds_devtypes + path: ceph.local_osds_devtypes ops: [[contains, ssd]] ceph_discard_not_enabled: config: - handler: hotsos.core.plugins.storage.ceph.CephConfig + handler: ceph.config assertions: key: bdev enable_discard ops: [[ne, 'true']] diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-osd/system_cpufreq_mode.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-osd/system_cpufreq_mode.yaml index 7a51babb1..a8e468f27 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-osd/system_cpufreq_mode.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-osd/system_cpufreq_mode.yaml @@ -9,7 +9,7 @@ vars: message_ondemand: >- You will also need to stop and disable the ondemand systemd service in order for changes to persist. - scaling_governor: '@hotsos.core.plugins.kernel.sysfs.CPU.cpufreq_scaling_governor_all' + scaling_governor: '@kernel.sysfs.cpu.cpufreq_scaling_governor_all' checks: cpufreq_governor_not_performance: # can we actually see the setting diff --git a/hotsos/defs/scenarios/storage/ceph/ceph-rgw/bugs/lp1974138.yaml b/hotsos/defs/scenarios/storage/ceph/ceph-rgw/bugs/lp1974138.yaml index 575a3655e..ecaa81036 100644 --- a/hotsos/defs/scenarios/storage/ceph/ceph-rgw/bugs/lp1974138.yaml +++ b/hotsos/defs/scenarios/storage/ceph/ceph-rgw/bugs/lp1974138.yaml @@ -4,9 +4,9 @@ checks: librgw2: - min: 14.2.0 ssl_enabled: - property: hotsos.core.plugins.openstack.OpenstackBase.ssl_enabled + property: openstack.ssl_enabled apache2_allow_encoded_slashes_on: - property: hotsos.core.plugins.openstack.OpenstackBase.apache2_allow_encoded_slashes_on + property: openstack.apache2_allow_encoded_slashes_on conclusions: lp1974138: decision: diff --git a/hotsos/defs/scenarios/storage/ceph/common/ceph_charm_conflicts.yaml b/hotsos/defs/scenarios/storage/ceph/common/ceph_charm_conflicts.yaml index 64af497a7..b0ed5974d 100644 --- a/hotsos/defs/scenarios/storage/ceph/common/ceph_charm_conflicts.yaml +++ b/hotsos/defs/scenarios/storage/ceph/common/ceph_charm_conflicts.yaml @@ -1,5 +1,5 @@ vars: - local_charms: '@hotsos.core.plugins.juju.JujuChecks.charms' + local_charms: '@juju.charms' checks: ceph_osd_has_conflicts: varops: [[$local_charms], [contains, ceph-osd]] diff --git a/hotsos/defs/scenarios/storage/storage.yaml b/hotsos/defs/scenarios/storage/storage.yaml index 02ca66eaa..c279a2f81 100644 --- a/hotsos/defs/scenarios/storage/storage.yaml +++ b/hotsos/defs/scenarios/storage/storage.yaml @@ -2,5 +2,5 @@ # directory including subdirectories. requires: or: - - property: hotsos.core.plugins.storage.ceph.CephChecks.plugin_runnable - - property: hotsos.core.plugins.storage.bcache.BcacheChecks.plugin_runnable + - property: ceph.plugin_runnable + - property: bcache.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/system/sssd-ad-tokengroups.yaml b/hotsos/defs/scenarios/system/sssd-ad-tokengroups.yaml index 415e3174f..dba7c37fd 100644 --- a/hotsos/defs/scenarios/system/sssd-ad-tokengroups.yaml +++ b/hotsos/defs/scenarios/system/sssd-ad-tokengroups.yaml @@ -1,5 +1,5 @@ vars: - ad_domains_with_tokengroups_enabled: '@hotsos.core.plugins.system.system.SSSD.tokengroups_enabled_domains' + ad_domains_with_tokengroups_enabled: '@sssd.tokengroups_enabled_domains' checks: any_tokengroups_enabled_domains: diff --git a/hotsos/defs/scenarios/system/system.yaml b/hotsos/defs/scenarios/system/system.yaml index 6c2075470..133fb9a89 100644 --- a/hotsos/defs/scenarios/system/system.yaml +++ b/hotsos/defs/scenarios/system/system.yaml @@ -1,4 +1,4 @@ # This file is used to define overrides applicable to contents of this # directory including subdirectories. requires: - property: hotsos.core.plugins.system.SystemChecks.plugin_runnable + property: system.checks.plugin_runnable diff --git a/hotsos/defs/scenarios/system/unattended_upgrades.yaml b/hotsos/defs/scenarios/system/unattended_upgrades.yaml index ea2e5bf78..c9cee0361 100644 --- a/hotsos/defs/scenarios/system/unattended_upgrades.yaml +++ b/hotsos/defs/scenarios/system/unattended_upgrades.yaml @@ -1,6 +1,6 @@ checks: is_enabled: - property: hotsos.core.plugins.system.system.SystemBase.unattended_upgrades_enabled + property: system.unattended_upgrades_enabled conclusions: unattended-upgrades-enabled: decision: is_enabled