Moin,
ich habe die Tabs einmal entfernt und ich auch wenig gespielt. Im Iventory habe ich das gewünschte Ergebnis.
OMD[clage]:~/local/share/check_mk/checks$ cmk -v -II XXXXXX
Discovering services on: XXXXXX
XXXXXX:
+ FETCHING DATA
[snmp] Execute data source
+ EXECUTING DISCOVERY PLUGINS (8)
1 hr_cpu
1 hr_mem
2 if_lancom
1 lancomwlc
1 snmp_info
1 snmp_uptime
Wenn ich über WATO suche, dann steht er direkt unten drin, allerdings mit einem UNKN Status…
Hier noch einmal der komplette Check:
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# (c) 2022 Gesellschaft für Digitale Werte mbH
# Heiner Ohm <heiner.ohm@digitale-werte.com>
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
def inventory_lancom_wlc_ap_status(parsed):
return [(None, None)]
def parse_lancom_wlc_ap_status(info):
parsed = {
"expected": int(info[0][0]),
"connectedExpected": int(info[0][1]),
"connectedManaged": int(info[0][2]),
"connectedNew": int(info[0][3])
}
return parsed
@get_parsed_item_data
def check_lancom_wlc_ap_status(item, params, parsed):
perf = [("Expected AP",parsed['expected'], parsed['expected'] + ":" + parsed['expected'] )]
statustext = "Accesspoints expected: %d; Accespoints connected %d; Accespoints connected and managed: %d; new Accespoints: %d;" % (parsed['expected'], parsed['connectedExpected'], parsed['connectedManaged'], parsed['connectedNew'])
print(statustext)
if parsed['expected'] == parsed['connectedExpected']:
status = 0
elif parsed['connectedNew'] > 0:
status = 1
else:
status = 2
return status, statustext, perf
check_info["lancomwlc"] = {
"inventory_function": inventory_lancom_wlc_ap_status,
#"inventory_function": discover(),
"parse_function": parse_lancom_wlc_ap_status,
"check_function": check_lancom_wlc_ap_status,
"service_description": "LANCOM WLC AP Status",
"snmp_scan_function": lambda oid: "WLC-1000" in oid(".1.3.6.1.4.1.2356.11.1.47.6.0"),
"snmp_info": ( ".1.3.6.1.4.1.2356.11.1.73",
[
"5", # lcsStatusWlanMngmtExpectedAp
"6", # lcsStatusWlanMngmtConnectedExpectedAp
"7", # lcsStatusWlanMngmtConnectedManagedAp
"8" # lcsStatusWlanMngmtConnectedNewAp
]),
"has_perfdata": True,
"group": "lancomwlc",
}
Vermutlich ist es total offensichtlich und ich sehe den Baum vor lauter Bäumen nicht…