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 c4497a9e authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent 7bc78a44
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2013 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk 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-
# ails. 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.
#
# only use full for Cisco WSA appliances
#
cisco_asyncos_conn_default_levels = {}
def inventory_cisco_asyncos_conn(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_conn_default_levels')]
def check_cisco_asyncos_conn(_no_item, params, info):
state = 0
perfdata = []
warn, crit = None, None
idle, total, max = info[0]
active = int(total) - int(idle)
perfdata.append(('active', active, warn, crit, 0, int(max)))
perfdata.append(('idle', idle, '', '', 0, int(max)))
infotext = '%s Active Connections - %s Idle Connections - Maximum Connections was %s' % (active, idle, max)
return state, infotext, perfdata
check_info['cisco_asyncos_conn'] = {
'check_function': check_cisco_asyncos_conn,
'inventory_function': inventory_cisco_asyncos_conn,
'service_description': 'Connection Stats',
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.15497.1.2.3.2', [ # ASYNCOSWEBSECURITYAPPLIANCE-MIB::proxyClientSidePerf
'7', # cacheClientIdleConns
'8', # cacheClientTotalConns
'9', # cacheClientMaxConns
]),
'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1,
# 'snmp_scan_function': scan_cisco_asyncos,
# 'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 08-03-2020
#
# monitors status Cisco IronPort Appliances (ESA) DNS requests
# Tested with: C380, C370
#
# check_mk 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.
#
# .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
#
# sample info
# [[u'0', u'0']]
#
factory_settings['cisco_asyncos_dns_default_levels'] = {
}
def inventory_cisco_asyncos_dns(info):
if len(info[0]) == 2:
return [(None, None)]
def check_cisco_asyncos_dns(_no_item, params, info):
if len(info[0]) == 2:
outstandingDNSRequests, pendingDNSRequests = info[0]
outstandingDNSRequests = int(outstandingDNSRequests)
pendingDNSRequests = int(pendingDNSRequests)
# Outstanding DNS requests --> DNS requests awaiting answer
# Pending DNS requests --> DNS requests waiting to be send
infotext = 'DNS requests awaiting answer: %d, DNS requests waiting to be send: %d' %(outstandingDNSRequests, pendingDNSRequests)
perfdata = []
perfdata.append(('outstandingdnsrequests', outstandingDNSRequests))
perfdata.append(('pendingdnsrequests', pendingDNSRequests))
return 0, infotext, perfdata
check_info['cisco_asyncos_dns'] = {
'inventory_function': inventory_cisco_asyncos_dns,
'check_function': check_cisco_asyncos_dns,
'group': 'aysncos_dns',
'service_description': 'DNS requests',
'has_perfdata': True,
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
[
'15', # outstandingDNSRequests
'16', # pendingDNSRequests
]),
'default_levels_variable': 'cisco_asyncos_dns_default_levels',
'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1,
# 'snmp_scan_function': scan_cisco_asyncos,
# 'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 08-03-2020
#
# monitors status Cisco IronPort Appliances (ESA) oldest message age
# Tested with: C380, C370
#
# check_mk 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.
#
# .1.3.6.1.4.1.15497.1.1.1.14.0 = Gauge32: 258454
#
# ASYNCOS-MAIL-MIB::oldestMessageAge.0 = Gauge32: 259706
#
# sample info
# [[u'258454']]
#
factory_settings['cisco_asyncos_messageage_default_levels'] = {
}
def inventory_cisco_asyncos_messageage(info):
if len(info[0]) == 1:
return [(None, None)]
def check_cisco_asyncos_messageage(_no_item, params, info):
def get_messageage(messageage): # expects time in seconds
m, s = divmod(messageage, 60) # break in seconds / minutes
h, m = divmod(m, 60) # break in mintes / hours
if h >= 24: # more then one day
d, h = divmod(h, 24) # break in hours / days
else:
return '%02d:%02d:%02d' % (h, m, s)
if d >= 365: # more the one year
y, d = divmod(d, 365) # break in days / years
return '%dy %dd %02d:%02d:%02d' % (y, d, h, m, s)
else:
return '%dd %02d:%02d:%02d' % (d, h, m, s)
if len(info[0]) == 1:
oldestMessageAge = int(info[0][0])
perfdata = []
perfdata.append(('oldestmessageage', oldestMessageAge))
infotext = 'Oldest message age: %s' %(get_messageage(oldestMessageAge))
return 0, infotext, perfdata
check_info['cisco_asyncos_messageage'] = {
'inventory_function': inventory_cisco_asyncos_messageage,
'check_function': check_cisco_asyncos_messageage,
'group': 'aysncos_messageage',
'service_description': 'Message age',
'has_perfdata': True,
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
[
'14', # oldestMessageAge
]),
'default_levels_variable': 'cisco_asyncos_messageage_default_levels',
'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1,
# 'snmp_scan_function': scan_cisco_asyncos,
# 'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Rewritten by: Th.L.
# Date: 10-02-2020
#
# added wato, fixed inventory function, changed snmp scan function, changed item to 'work queue'
#
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2013 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk 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-
# ails. 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.
#
factory_settings['cisco_asyncos_queue_default_levels'] = {
'levels': (50, 100), # warn/crit # of messages in work queue
}
def inventory_cisco_asyncos_queue(info):
if len(info) > 0:
return [(None, None)]
def check_cisco_asyncos_queue(_no_item, params, info):
warn, crit = params.get('levels', (50, 100))
queuestatus, workqueuesize = info[0]
queuestatus = int(queuestatus)
workqueuesize = int(workqueuesize)
perfdata=[('queue', workqueuesize, warn, crit)]
infotext = '%d message(s) in work queue' % workqueuesize
if workqueuesize >= crit:
yield 2, infotext + ' (critical at %d)' % crit, perfdata
elif workqueuesize >= warn:
yield 1, infotext + ' (warning at %d)' % warn, perfdata
else:
yield 0, infotext, perfdata
if queuestatus == 1:
yield 0, 'Queue space: enough'
elif queuestatus == 2:
yield 1, 'Queue space: near full'
elif queuestatus == 3:
yield 2, 'Queue space: full'
check_info['cisco_asyncos_queue'] = {
'check_function': check_cisco_asyncos_queue,
'inventory_function': inventory_cisco_asyncos_queue,
'group': 'cisco_asyncos_queue',
'service_description': 'Queue',
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', [ # ASYNCOS-MAIL-MIB:
'5', # queueAvailabilityStatus
'11' # workQueueMessages
]
),
'default_levels_variable': 'cisco_asyncos_queue_default_levels',
'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1,
# 'snmp_scan_function': scan_cisco_asyncos,
# 'includes': ['cisco_asyncos.include'],
}
No preview for this file type
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