Esempio n. 1
0
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based.utils import ipmi


@pytest.mark.parametrize(
    'item, params, sensor, temperature_metrics_only, status_txt_mapping, exp_result',
    [
        (
            'something',
            {},
            ipmi.Sensor(status_txt='ok',
                        unit='',
                        value=None,
                        crit_low=None,
                        warn_low=None,
                        warn_high=None,
                        crit_high=None),
            False,
            lambda txt: state.OK,
            [
                Result(state=state.OK, summary='Status: ok'),
            ],
        ),
        (
            'PCH_1.05V',
            {},
            ipmi.Sensor(status_txt='ok',
                        unit='Volts',
                        value=1.04,
Esempio n. 2
0
from cmk.base.plugins.agent_based.agent_based_api.v1 import State as state
from cmk.base.plugins.agent_based.agent_based_api.v1 import type_defs
from cmk.base.plugins.agent_based.utils import ipmi


@pytest.mark.parametrize(
    "item, params, sensor, temperature_metrics_only, status_txt_mapping, exp_result",
    [
        (
            "something",
            {},
            ipmi.Sensor(
                status_txt="ok",
                unit="",
                value=None,
                crit_low=None,
                warn_low=None,
                warn_high=None,
                crit_high=None,
            ),
            False,
            lambda txt: state.OK,
            [
                Result(state=state.OK, summary="Status: ok"),
            ],
        ),
        (
            "PCH_1.05V",
            {},
            ipmi.Sensor(
                status_txt="ok",
Esempio n. 3
0
        ["182", "Power Meter", "Other", "260.00", "W", "OK"],
        ["72", "Memory Status", "Memory", "N/A", "error", "OK"],
        ["187", "Megacell Status", "Battery", "N/A", "", "OK"],
        ["35", "CPU Utilization", "Processor", "68.00", "", "OK"],
    ],
]

_SECTIONS = [
    {},
    {
        "Fan_FAN1":
        ipmi_utils.Sensor(
            status_txt="OK",
            unit="RPM",
            value=6800.0,
            crit_low=600.0,
            warn_low=None,
            warn_high=None,
            crit_high=25400.0,
        ),
        "Fan_FAN2":
        ipmi_utils.Sensor(
            status_txt="OK",
            unit="RPM",
            value=6700.0,
            crit_low=600.0,
            warn_low=None,
            warn_high=None,
            crit_high=25400.0,
        ),
        "Physical_Security_Chassis_Intru":
Esempio n. 4
0
    Result,
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based.utils import ipmi


@pytest.mark.parametrize(
    'item, params, sensor, temperature_metrics_only, status_txt_mapping, exp_result', [
        (
            'something',
            type_defs.Parameters({}),
            ipmi.Sensor(status_txt='ok',
                        unit='',
                        value=None,
                        crit_low=None,
                        warn_low=None,
                        warn_high=None,
                        crit_high=None),
            False,
            lambda txt: state.OK,
            [
                Result(state=state.OK, summary='Status: ok', details='Status: ok'),
            ],
        ),
        (
            'PCH_1.05V',
            type_defs.Parameters({}),
            ipmi.Sensor(status_txt='ok',
                        unit='Volts',
                        value=1.04,