Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit f5855aba authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent c4497a9e
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1 import (
SNMPTree,
contains,
State,
render,
)
......@@ -55,7 +56,7 @@ def check_cisco_asyncos_bandwidth(params, section: CiscoAsyncosBandwidth) -> Che
levels_upper=params.get('upper', None),
levels_lower=params.get('lower', None),
metric_name='bandwith_now',
# render_func=
render_func=render.networkbandwidth
)
yield Result(state=State.OK,
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2021-03-24
#
# only use full for Cisco WSA appliances
#
from typing import Mapping, List, NamedTuple
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
check_levels,
Result,
Metric,
SNMPTree,
contains,
State,
)
class CiscoAsyncosConn(NamedTuple):
cacheClientIdleConns: int
cacheClientTotalConns: int
cacheClientMaxConns: int
# [[['0', '5', '66277']]]
def parse_cisco_asyncos_conn(string_table: List[StringTable]) -> CiscoAsyncosConn:
return CiscoAsyncosConn(
cacheClientIdleConns=int(string_table[0][0][0]),
cacheClientTotalConns=int(string_table[0][0][1]),
cacheClientMaxConns=int(string_table[0][0][2]),
)
def discovery_cisco_asyncos_conn(section: CiscoAsyncosConn) -> DiscoveryResult:
yield Service()
def check_cisco_asyncos_conn(params, section: CiscoAsyncosConn) -> CheckResult:
yield Result(state=State.OK,
summary='%s Active Connections - %s Idle Connections - Maximum Connections was %s' % (
section.cacheClientTotalConns, section.cacheClientIdleConns, section.cacheClientMaxConns))
yield Metric(name='cacheClientIdleConns', value=section.cacheClientIdleConns)
yield Metric(name='cacheClientTotalConns', value=section.cacheClientTotalConns)
yield Metric(name='cacheClientMaxConns', value=section.cacheClientMaxConns)
register.snmp_section(
name='cisco_asyncos_conn',
parse_function=parse_cisco_asyncos_conn,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.15497.1.2.3.2', # ASYNCOSWEBSECURITYAPPLIANCE-MIB::proxyClientSidePerf
oids=[
'7', # cacheClientIdleConns
'8', # cacheClientTotalConns
'9', # cacheClientMaxConns
]
),
],
detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'),
)
register.check_plugin(
name='cisco_asyncos_conn',
service_name='Connection Stats',
discovery_function=discovery_cisco_asyncos_conn,
check_function=check_cisco_asyncos_conn,
check_default_parameters={},
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2020-03-08
#
# monitors status Cisco IronPort Appliances (ESA) DNS requests
# Tested with: C380, C370
#
# 2021-03-24: rewrite for CMK 2.0
#
# .1.3.6.1.4.1.15497.1.1.1.15.0 = Gauge32: 0
# .1.3.6.1.4.1.15497.1.1.1.16.0 = Gauge32: 0
#
# ASYNCOS-MAIL-MIB::outstandingDNSRequests.0 = Gauge32: 0
# ASYNCOS-MAIL-MIB::pendingDNSRequests.0 = Gauge32: 0
#
#
from typing import Mapping, List, NamedTuple
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
check_levels,
Result,
Metric,
SNMPTree,
contains,
State,
)
class CiscoAsyncosDns(NamedTuple):
outstandingDNSRequests: int
pendingDNSRequests: int
# [[['0', '0']]]
def parse_cisco_asyncos_dns(string_table: List[StringTable]) -> CiscoAsyncosDns:
return CiscoAsyncosDns(
outstandingDNSRequests=int(string_table[0][0][0]),
pendingDNSRequests=int(string_table[0][0][1]),
)
def discovery_cisco_asyncos_dns(section: CiscoAsyncosDns) -> DiscoveryResult:
yield Service()
def check_cisco_asyncos_dns(params, section: CiscoAsyncosDns) -> CheckResult:
yield Result(state=State.OK,
summary='%s outstanding, %s pending' % (
section.outstandingDNSRequests, section.pendingDNSRequests))
yield Metric(name='outstandingDNSRequests', value=section.outstandingDNSRequests)
yield Metric(name='pendingDNSRequests', value=section.pendingDNSRequests)
register.snmp_section(
name='cisco_asyncos_dns',
parse_function=parse_cisco_asyncos_dns,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
oids=[
'15', # outstandingDNSRequests
'16', # pendingDNSRequests
]
),
],
detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'),
)
register.check_plugin(
name='cisco_asyncos_dns',
service_name='DNS requests',
discovery_function=discovery_cisco_asyncos_dns,
check_function=check_cisco_asyncos_dns,
check_default_parameters={},
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2020-03-08
#
# monitors status Cisco IronPort Appliances (ESA) oldest message age
# Tested with: C380, C370
#
# 2021-03-24: rewrite for CMK 2.0
#
# .1.3.6.1.4.1.15497.1.1.1.14.0 = Gauge32: 258454
#
# ASYNCOS-MAIL-MIB::oldestMessageAge.0 = Gauge32: 259706
#
from typing import Mapping, List, NamedTuple
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
check_levels,
Result,
Metric,
SNMPTree,
contains,
State,
render,
)
class CiscoAsyncosMessageage(NamedTuple):
messageage: int
# [[['259297']]]
def parse_cisco_asyncos_messageage(string_table: List[StringTable]) -> CiscoAsyncosMessageage:
return CiscoAsyncosMessageage(
messageage=int(string_table[0][0][0]),
)
def discovery_cisco_asyncos_messageage(section: CiscoAsyncosMessageage) -> DiscoveryResult:
yield Service()
def check_cisco_asyncos_messageage(params, section: CiscoAsyncosMessageage) -> CheckResult:
yield from check_levels(
value=section.messageage,
label='Oldest messages age',
metric_name='message_age',
levels_upper=params.get('upper', None),
render_func=render.timespan,
)
register.snmp_section(
name='cisco_asyncos_messageage',
parse_function=parse_cisco_asyncos_messageage,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
oids=[
'14', # oldestMessageAge
]
),
],
detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'),
)
register.check_plugin(
name='cisco_asyncos_messageage',
service_name='Message age',
discovery_function=discovery_cisco_asyncos_messageage,
check_function=check_cisco_asyncos_messageage,
check_default_parameters={},
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2020-02-10
#
# added wato, fixed inventory function, changed snmp scan function, changed item to 'work queue'
#
# 2021-03-24: rewrite for CMK 2.0
#
from typing import Mapping, List, NamedTuple
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
check_levels,
Result,
Metric,
SNMPTree,
contains,
State,
)
class CiscoAsyncosQueue(NamedTuple):
state: State
status_readable: str
workQueueMessages: int
def get_status_readable(st: str) -> str:
states = {
'1': 'enough',
'2': 'near full',
'3': 'full',
}
return states.get(st, st)
def get_cmk_state(st: str) -> State:
states = {
'1': State.OK,
'2': State.CRIT,
'3': State.WARN
}
return states.get(st, State.CRIT)
# [[['1', '1']]]
def parse_cisco_asyncos_messageage(string_table: List[StringTable]) -> CiscoAsyncosQueue:
return CiscoAsyncosQueue(
state=get_cmk_state(string_table[0][0][0]),
status_readable=get_status_readable(string_table[0][0][0]),
workQueueMessages=int(string_table[0][0][1])
)
def discovery_cisco_asyncos_queue(section: CiscoAsyncosQueue) -> DiscoveryResult:
yield Service()
def check_cisco_asyncos_queue(params, section: CiscoAsyncosQueue) -> CheckResult:
yield from check_levels(
value=section.workQueueMessages,
label='Messages in work queue',
levels_upper=params.get('upper', None),
metric_name='work_queue_size',
)
yield Result(state=section.state, notice='Queue space: %s' % section.status_readable)
register.snmp_section(
name='cisco_asyncos_queue',
parse_function=parse_cisco_asyncos_messageage,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
oids=[
'5', # queueAvailabilityStatus
'11' # workQueueMessages
]
),
],
detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'),
)
register.check_plugin(
name='cisco_asyncos_queue',
service_name='Queue',
discovery_function=discovery_cisco_asyncos_queue,
check_function=check_cisco_asyncos_queue,
check_default_parameters={'levels': (50, 100)},
check_ruleset_name='cisco_asyncos_queue',
)
No preview for this file type
......@@ -21,7 +21,8 @@
'- 2021-03-21: rewrite cisco_asyncos_cpu, cisco_asyncos_mem, '
'cisco_asyncos_temp for CMK 2.0\n'
'- 2021-03-24: rewrite cisco_asyncos_raid, '
'cisco_asyncos_bandwidth, cisco_asyncos_cache\n',
'cisco_asyncos_bandwidth, cisco_asyncos_cache, '
'cisco_asyncos_conn\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_asyncos_cpu.py',
'cisco_asyncos_mem.py',
......@@ -30,13 +31,13 @@
'cisco_asyncos_power.py',
'cisco_asyncos_raid.py',
'cisco_asyncos_bandwidth.py',
'cisco_asyncos_cache.py'],
'checks': ['cisco_asyncos_conn',
'cisco_asyncos_license',
'cisco_asyncos_queue',
'cisco_asyncos_cache.py',
'cisco_asyncos_conn.py',
'cisco_asyncos_dns.py',
'cisco_asyncos_messageage.py',
'cisco_asyncos_queue.py'],
'checks': ['cisco_asyncos_license',
'cisco_asyncos_update',
'cisco_asyncos_dns',
'cisco_asyncos_messageage',
'cisco_asyncos_resources'],
'web': ['plugins/wato/cisco_asyncos_license.py',
'plugins/wato/cisco_asyncos_queue.py',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment