def test_cluster_check_veritas_vcs_resource():
    SECTION["resource"]["lan_phantom"] = [Vcs(attr="State", value="OFFLINE", cluster="minions")]
    third_section: veritas_vcs.Section = {
        "resource": {"lan_phantom": [Vcs(attr="State", value="OFFLINE", cluster="minions")]}
    }
    assert list(
        veritas_vcs.cluster_check_veritas_vcs_resource(
            "lan_phantom",
            PARAMS,
            {
                "node1": SECTION,
                "node2": SECTION_HASHES,
                "node3": third_section,
            },
        )
    ) == [
        Result(state=state.OK, summary="All nodes OK"),
        Result(
            state=state.OK,
            notice="[node1]: offline, [node2]: online, [node3]: offline",
        ),
        Result(
            state=state.OK,
            summary="cluster: minions",
        ),
    ]
    del SECTION["resource"]["lan_phantom"]
Beispiel #2
0
def test_cluster_check_veritas_vcs_resource():
    SECTION['resource']['lan_phantom'] = [Vcs(attr='State', value='OFFLINE', cluster='minions')]
    third_section: veritas_vcs.Section = {
        'resource': {
            'lan_phantom': [Vcs(attr='State', value='OFFLINE', cluster='minions')]
        }
    }
    assert list(
        veritas_vcs.cluster_check_veritas_vcs_resource(
            'lan_phantom',
            PARAMS,
            {
                'node1': SECTION,
                'node2': SECTION_HASHES,
                'node3': third_section,
            },
        )) == [
            Result(
                state=state.WARN,
                summary='[node1]: offline',
            ),
            Result(
                state=state.OK,
                notice='[node2]: online',
            ),
            Result(
                state=state.WARN,
                summary='[node3]: offline',
            ),
            Result(
                state=state.OK,
                summary='cluster: minions',
            ),
        ]
    del SECTION['resource']['lan_phantom']
Beispiel #3
0
def test_cluster_check_veritas_vcs_group():
    SECTION['group']['omd'] = [
        Vcs(attr='State', value='ONLINE', cluster='minions')
    ]
    assert list(
        veritas_vcs.cluster_check_veritas_vcs_group(
            'omd',
            PARAMS,
            {
                'node1': SECTION,
                'node2': SECTION_HASHES,
            },
        )) == [
            Result(
                state=state.OK,
                notice='[node1]: online',
            ),
            Result(
                state=state.CRIT,
                summary='[node2]: frozen(!!), online',
                details='[node2]: frozen(!!)\n[node2]: online',
            ),
            Result(
                state=state.OK,
                summary='cluster: c7dbacpt',
            ),
        ]
    del SECTION['group']['omd']
Beispiel #4
0
def test_cluster_check_veritas_vcs_group():
    SECTION["group"]["omd"] = [
        Vcs(attr="State", value="ONLINE", cluster="minions")
    ]
    assert list(
        veritas_vcs.cluster_check_veritas_vcs_group(
            "omd",
            PARAMS,
            {
                "node1": SECTION,
                "node2": SECTION_HASHES,
            },
        )) == [
            Result(
                state=state.OK,
                notice="[node1]: online",
            ),
            Result(
                state=state.CRIT,
                notice="[node2]: frozen",
            ),
            Result(
                state=state.OK,
                notice="[node2]: online",
            ),
            Result(
                state=state.OK,
                summary="cluster: c7dbacpt",
            ),
        ]
    del SECTION["group"]["omd"]
Beispiel #5
0
    ['bob4-vol', 'State', 'stuart', 'OFFLINE'],
    ['bob5-db', 'State', 'stuart', 'OFFLINE'],
    ['bob5-dg', 'State', 'stuart', 'OFFLINE'],
    ['bob5-ip', 'State', 'stuart', 'OFFLINE'],
    ['bob5-mnt', 'State', 'stuart', 'OFFLINE'],
    ['bob5-nic-proxy', 'State', 'stuart', 'ONLINE'],
    ['bob5-vol', 'State', 'stuart', 'OFFLINE'],
    ['agnes-nic', 'State', 'stuart', 'ONLINE'],
    ['agnes-phantom', 'State', 'stuart', 'ONLINE'],
    ['webip', 'State', 'stuart', 'OFFLINE'],
]

SECTION: veritas_vcs.Section = {
    'resource': {
        'bob3-nic-proxy':
        [Vcs(attr='State', value='ONLINE', cluster='minions')],
        'bob3-dg': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob1-db': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob3-db': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob1-dg': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob2-vol': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob2-nic-proxy':
        [Vcs(attr='State', value='ONLINE', cluster='minions')],
        'bob5-ip': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob1-nic-proxy':
        [Vcs(attr='State', value='ONLINE', cluster='minions')],
        'webip': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob5-vol': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'bob2-dg': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
        'gru': [Vcs(attr='State', value='ONLINE', cluster='minions')],
        'bob2-db': [Vcs(attr='State', value='OFFLINE', cluster='minions')],
    ["bob4-nic-proxy", "State", "stuart", "ONLINE"],
    ["bob4-vol", "State", "stuart", "OFFLINE"],
    ["bob5-db", "State", "stuart", "OFFLINE"],
    ["bob5-dg", "State", "stuart", "OFFLINE"],
    ["bob5-ip", "State", "stuart", "OFFLINE"],
    ["bob5-mnt", "State", "stuart", "OFFLINE"],
    ["bob5-nic-proxy", "State", "stuart", "ONLINE"],
    ["bob5-vol", "State", "stuart", "OFFLINE"],
    ["agnes-nic", "State", "stuart", "ONLINE"],
    ["agnes-phantom", "State", "stuart", "ONLINE"],
    ["webip", "State", "stuart", "OFFLINE"],
]

SECTION: veritas_vcs.Section = {
    "resource": {
        "bob3-nic-proxy": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob3-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob3-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-vol": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-nic-proxy": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob5-ip": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-nic-proxy": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "webip": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob5-vol": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "gru": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob2-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "agnes-phantom": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob1-vol": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
Beispiel #7
0
    ["bob4-vol", "State", "stuart", "OFFLINE"],
    ["bob5-db", "State", "stuart", "OFFLINE"],
    ["bob5-dg", "State", "stuart", "OFFLINE"],
    ["bob5-ip", "State", "stuart", "OFFLINE"],
    ["bob5-mnt", "State", "stuart", "OFFLINE"],
    ["bob5-nic-proxy", "State", "stuart", "ONLINE"],
    ["bob5-vol", "State", "stuart", "OFFLINE"],
    ["agnes-nic", "State", "stuart", "ONLINE"],
    ["agnes-phantom", "State", "stuart", "ONLINE"],
    ["webip", "State", "stuart", "OFFLINE"],
]

SECTION: veritas_vcs.Section = {
    "resource": {
        "bob3-nic-proxy":
        [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob3-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob3-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-vol": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-nic-proxy":
        [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob5-ip": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob1-nic-proxy":
        [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "webip": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob5-vol": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "bob2-dg": [Vcs(attr="State", value="OFFLINE", cluster="minions")],
        "gru": [Vcs(attr="State", value="ONLINE", cluster="minions")],
        "bob2-db": [Vcs(attr="State", value="OFFLINE", cluster="minions")],