New to CheckMK, a few questions

This will do: Put this code in $OMD_ROOT/local/share/check_mk/web/plugins/metrics/network_stacked.py

graph_info["bandwidth_translated"] = {
    "title": _("Bandwidth"),
    "metrics": [
        ("if_in_octets,8,*@bits/s", "stack", _("Input bandwidth")),
        ("if_out_octets,8,*@bits/s", "stack", _("Output bandwidth")),
    ],
    "scalars": [
        ("if_in_octets:warn", _("Warning (In)")),
        ("if_in_octets:crit", _("Critical (In)")),
        ("if_out_octets:warn", _("Warning (Out)")),
        ("if_out_octets:crit", _("Critical (Out)")),
    ],
}

# Same but for checks that have been translated in to bits/s
graph_info["bandwidth"] = {
    "title": _("Bandwidth"),
    "metrics": [
        (
            "if_in_bps",
            "stack",
        ),
        (
            "if_out_bps",
            "stack",
        ),
    ],
    "scalars": [
        ("if_in_bps:warn", _("Warning (In)")),
        ("if_in_bps:crit", _("Critical (In)")),
        ("if_out_bps:warn", _("Warning (Out)")),
        ("if_out_bps:crit", _("Critical (Out)")),
    ],
}

graph_info["packets_1"] = {
    "title": _("Packets"),
    "metrics": [
        ("if_in_unicast", "line"),
        ("if_in_non_unicast", "line"),
        ("if_out_unicast", "line"),
        ("if_out_non_unicast", "line"),
    ],
}

graph_info["packets_2"] = {
    "title": _("Packets"),
    "metrics": [
        ("if_in_pkts", "area"),
        ("if_out_non_unicast", "stack"),
        ("if_out_unicast", "stack"),
    ],
}

graph_info["packets_3"] = {
    "title": _("Packets"),
    "metrics": [
        ("if_in_pkts", "stack"),
        ("if_out_pkts", "stack"),
    ],
}

The original graph definitions are in $OMD_ROOT/lib/check_mk/gui/plugins/metrics/network.py. The local mechanism of checkmk will replace these with the definitions of the new file after running omd restart apache.

1 Like