Exemplo n.º 1
0
def test_check_netscaler_vservers_clustered_best(clustered_vservers):
    assert list(
        _check_netscaler_vservers(
            Parameters({
                "health_levels": (100.0, 0.1),
                "cluster_status": "best",
            }),
            clustered_vservers,
        )
    ) == [
        Result(state=state.OK, summary='Status: up (node1)'),
        Result(state=state.OK, summary='Status: busy (node2)'),
        Result(state=state.WARN,
               summary='Health: 75.2% (warn/crit below 100%/0.10%)',
               details='Health: 75.2% (warn/crit below 100%/0.10%)'),
        Metric('health_perc', 75.2, boundaries=(0.0, 100.0)),
        Result(
            state=state.OK,
            summary='Type: loadbalancing, Protocol: ssl, Socket: 0.0.0.0:0',
            details='Type: loadbalancing, Protocol: ssl, Socket: 0.0.0.0:0'),
        Result(state=state.OK, summary='Request rate: 1/s'),
        Metric('request_rate', 1.0),
        Result(state=state.OK, summary='In: 16.0 Bit/s'),
        Metric('if_in_octets', 2.0),
        Result(state=state.OK, summary='Out: 40.0 Bit/s'),
        Metric('if_out_octets', 5.0),
    ]
Exemplo n.º 2
0
def test_check_netscaler_vservers_clustered_best(clustered_vservers):
    assert list(
        _check_netscaler_vservers(
            {
                "health_levels": (100.0, 0.1),
                "cluster_status": "best",
            },
            clustered_vservers,
        )
    ) == [
        Result(state=state.OK, summary="Status: up (node1)"),
        Result(state=state.OK, summary="Status: busy (node2)"),
        Result(
            state=state.WARN,
            summary="Health: 75.20% (warn/crit below 100.00%/0.10%)",
            details="Health: 75.20% (warn/crit below 100.00%/0.10%)",
        ),
        Metric("health_perc", 75.2, boundaries=(0.0, 100.0)),
        Result(
            state=state.OK,
            summary="Type: loadbalancing, Protocol: ssl, Socket: 0.0.0.0:0",
            details="Type: loadbalancing, Protocol: ssl, Socket: 0.0.0.0:0",
        ),
        Result(state=state.OK, summary="Request rate: 1/s"),
        Metric("request_rate", 1.0),
        Result(state=state.OK, summary="In: 16.0 Bit/s"),
        Metric("if_in_octets", 2.0),
        Result(state=state.OK, summary="Out: 40.0 Bit/s"),
        Metric("if_out_octets", 5.0),
    ]
Exemplo n.º 3
0
def test_check_netscaler_vservers_clustered_worst(clustered_vservers):
    clustered_vservers[0]['service_state'] = (
        1,
        "transition to out of service",
    )
    assert next(
        _check_netscaler_vservers(
            Parameters({
                "health_levels": (100.0, 0.1),
                "cluster_status": "worst",
            }),
            clustered_vservers,
        )) == Result(
            state=state.WARN,
            summary='Status: transition to out of service (node1)',
            details='Status: transition to out of service (node1)',
        )
Exemplo n.º 4
0
def test_check_netscaler_vservers_clustered_worst(clustered_vservers):
    clustered_vservers[0]["service_state"] = (
        1,
        "transition to out of service",
    )
    result, *_ = _check_netscaler_vservers(
        {
            "health_levels": (100.0, 0.1),
            "cluster_status": "worst",
        },
        clustered_vservers,
    )
    assert result == Result(
        state=state.WARN,
        summary="Status: transition to out of service (node1)",
        details="Status: transition to out of service (node1)",
    )