50 lines
2.0 KiB
Python
50 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
|
|
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
|
|
# conditions defined in the file COPYING, which is part of this source code package.
|
|
|
|
# NOTE: Careful when replacing the *-import below with a more specific import. This can cause
|
|
# problems because it might remove variables from the check-context which are necessary for
|
|
# resolving legacy discovery results such as [("SUMMARY", "diskstat_default_levels")]. Furthermore,
|
|
# it might also remove variables needed for accessing discovery rulesets.
|
|
from cmk.base.check_legacy_includes.infoblox import * # pylint: disable=wildcard-import,unused-wildcard-import
|
|
|
|
|
|
#ibNetworkMonitorDNSAAT5AvgLatency(.1.3.6.1.4.1.7779.3.1.1.2.1.3.1.3.2.1.0)--)--DNS AAT5 Latency
|
|
infoblox_aat5_latency_default_levels = (50, 100)
|
|
|
|
def inventory_infoblox_aat5_latency(info):
|
|
item = "DNS AAT5 Latency"
|
|
yield item, {}
|
|
|
|
def check_infoblox_aat5_latency(item, params, info):
|
|
latency=int(info[0][0])
|
|
if params:
|
|
warn, crit = params['infoblox_latency']
|
|
else:
|
|
warn, crit = (50, 100)
|
|
state = 0
|
|
latency_info = ""
|
|
if latency > warn:
|
|
if latency > crit:
|
|
state = 2
|
|
latency_info = "Latency is %s ms (crit above %s ms)" % (latency, crit)
|
|
else:
|
|
state = 1
|
|
latency_info = "Latency is %s ms (warn above %s ms)" % (latency, warn)
|
|
else:
|
|
latency_info = "Latency is %s ms" % latency
|
|
yield state, latency_info, [('Latency', latency, warn, crit)]
|
|
|
|
check_info['infoblox_aat5_latency'] = {
|
|
'default_levels_variable': 'infoblox_aat5_latency_default_levels',
|
|
'inventory_function': inventory_infoblox_aat5_latency,
|
|
'check_function': check_infoblox_aat5_latency,
|
|
'service_description': '%s',
|
|
'snmp_info': ( ".1.3.6.1.4.1.7779.3.1.1.2.1.3.1.3.2.1", ["0"] ),
|
|
'snmp_scan_function': scan_infoblox,
|
|
'has_perfdata': True,
|
|
'group': 'infoblox_latency',
|
|
}
|