#!/usr/bin/env python3 # # This file is for combining metrics of a P1 Meter from https://www.homewizard.com/ in Checkmk (https://checkmk.com). # from cmk.gui.i18n import _ from cmk.gui.plugins.metrics.utils import graph_info, metric_info # . # .--Metrics-------------------------------------------------------------. # | __ __ _ _ | # | | \/ | ___| |_ _ __(_) ___ ___ | # | | |\/| |/ _ \ __| '__| |/ __/ __| | # | | | | | __/ |_| | | | (__\__ \ | # | |_| |_|\___|\__|_| |_|\___|___/ | # | | # +----------------------------------------------------------------------+ # | Definitions of metrics | # '----------------------------------------------------------------------' # Title are always lower case - except the first character! # Colors: See indexed_color() in cmk/gui/plugins/metrics/utils.py metric_info["active_power_w"] = { "title": _("Total active power"), "unit": "W", "color": "31/a", } metric_info["active_power_l1_w"] = { "title": _("Active power L1"), "unit": "w", "color": "#40a0b0", } metric_info["active_power_l2_w"] = { "title": _("Active power L2"), "unit": "w", "color": "#ff6000", } metric_info["active_power_l3_w"] = { "title": _("Active power L3"), "unit": "w", "color": "43/a", } # . # .--Graphs--------------------------------------------------------------. # | ____ _ | # | / ___|_ __ __ _ _ __ | |__ ___ | # | | | _| '__/ _` | '_ \| '_ \/ __| | # | | |_| | | | (_| | |_) | | | \__ \ | # | \____|_| \__,_| .__/|_| |_|___/ | # | |_| | # +----------------------------------------------------------------------+ # | Definitions of time series graphs | # '----------------------------------------------------------------------' graph_info["p1_power"] = { "title": _l("P1 Power"), "metrics": [ ("active_power_w", "stack"), ("active_power_l1_w", "stack"), ("active_power_l2_w", "stack"), ("active_power_l3_w", "stack"), ], }