Пример #1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

import pytest  # type: ignore[import]
from testlib import get_value_store_fixture
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
    IgnoreResultsError,
    Metric,
    type_defs,
)
from cmk.base.plugins.agent_based import winperf_phydisk

value_store_fixture = get_value_store_fixture(winperf_phydisk)

STRING_TABLE = [
    ['1435670669.29', '234', '2', '3'],
    ['2', 'instances:', '0_C:', '_Total'],
    ['-36', '0', '0', 'rawcount'],
    ['-34', '2446915000', '2446915000', 'type(20570500)'],
    ['-34', '130801442692895024', '130801442692895024', 'type(40030500)'],
    ['1166', '2446915000', '2446915000', 'type(550500)'],
    ['-32', '1552698000', '1552698000', 'type(20570500)'],
    ['-32', '130801442692895024', '130801442692895024', 'type(40030500)'],
    ['1168', '1552698000', '1552698000', 'type(550500)'],
    ['-30', '894217000', '894217000', 'type(20570500)'],
    ['-30', '130801442692895024', '130801442692895024', 'type(40030500)'],
    ['1170', '894217000', '894217000', 'type(550500)'],
    ['-28', '732825839', '732825839', 'average_timer'],
Пример #2
0
import copy
from typing import Dict
import pytest  # type: ignore[import]
from testlib import get_value_store_fixture
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
    IgnoreResultsError,
    Result,
    Service,
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based import lnx_if
from cmk.base.plugins.agent_based.utils import interfaces

value_store_fixture = get_value_store_fixture(interfaces)


@pytest.mark.parametrize('string_table, result', [
    (
        [
            [u'[start_iplink]'],
            [
                u'1:', u'wlp3s0:', u'<BROADCAST,MULTICAST>', u'mtu', u'1500',
                u'qdisc', u'fq_codel', u'state', u'UP', u'mode', u'DORMANT',
                u'group', u'default', u'qlen', u'1000'
            ],
            [
                u'link/ether', u'AA:AA:AA:AA:AA:AA', u'brd',
                u'BB:BB:BB:BB:BB:BB'
            ],
Пример #3
0
# conditions defined in the file COPYING, which is part of this source code package.

# pylint: disable=protected-access

import pytest  # type: ignore[import]
from testlib import get_value_store_fixture
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
    IgnoreResultsError,
    Metric,
    Result,
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based import aix_diskiod

value_store_fixture = get_value_store_fixture(aix_diskiod)

DISK = {
    'read_throughput': 2437253982208,
    'write_throughput': 12421567621120,
}


def test_parse_aix_diskiod():
    assert aix_diskiod.parse_aix_diskiod([
        ['hdisk0', '5.1', '675.7', '46.5', '2380130842', '12130437130'],
        ['hdisk0000', '58.5', '19545.1', '557.3', '%l', '%l'],
    ], ) == {
        'hdisk0': DISK,
    }
Пример #4
0
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

import pytest  # type: ignore[import]
from testlib import get_value_store_fixture
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
    IgnoreResultsError,
    Metric,
    Result,
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based import diskstat

value_store_fixture = get_value_store_fixture(diskstat)


def test_parse_diskstat_minimum():
    assert diskstat.parse_diskstat([
        ['12341241243'],
    ]) == {}


def test_parse_diskstat_simple():
    assert diskstat.parse_diskstat([
        ['1439297971'],
        [
            '8', '0', 'sda', '83421', '32310', '3426701', '108964', '24516',
            '35933', '639474', '32372', '0', '18532', '141496'
        ],
Пример #5
0
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

import pytest
from testlib import get_value_store_fixture
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
    IgnoreResultsError,
    Metric,
    Result,
    State as state,
    type_defs,
)
from cmk.base.plugins.agent_based import netapp_api_cpu, netapp_api_vf_stats

value_store_fixture = get_value_store_fixture(netapp_api_vf_stats)

SECTION_NETAPP_API_VF_STATS = {
    'vfiler0': {
        'vfiler': 'vfiler0',
        'instance_uuid': '',
        'node_uuid': '',
        'vfiler_cpu_busy': '774093444785907',
        'vfiler_net_data_sent': '11257211',
        'vfiler_read_ops': '16501039',
        'vfiler_cpu_busy_base': '48126443476302566',
        'process_name': '',
        'vfiler_write_bytes': '16990138',
        'node_name': '',
        'instance_name': 'vfiler0',
        'vfiler_write_ops': '35590594',