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

update project

parent bb3da2a2
No related branches found
No related tags found
No related merge requests found
#!/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
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
'default_levels_variable': 'cisco_asyncos_dns_default_levels',
}
#!/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
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
'default_levels_variable': 'cisco_asyncos_messageage_default_levels',
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 08-03-2020
#
# monitors status Cisco IronPort Appliances (ESA) system resources
# 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.5.0 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.6.0 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.7.0 = INTEGER: 1
#
# ASYNCOS-MAIL-MIB::queueAvailabilityStatus.0 = INTEGER: queueSpaceAvailable(1)
# ASYNCOS-MAIL-MIB::resourceConservationReason.0 = INTEGER: noResourceConservation(1)
# ASYNCOS-MAIL-MIB::memoryAvailabilityStatus.0 = INTEGER: memoryAvailable(1)
#
# sample info
# [[u'1', u'1', u'1']]
#
def inventory_cisco_asyncos_resources(info):
if len(info[0]) == 3:
return [(None, None)]
def check_cisco_asyncos_resources(_no_item, _no_params, info):
if len(info[0]) == 3:
queueStatus, recsourceStatus, memoryStatus = info[0]
queueStatus = int(queueStatus)
recsourceStatus = int(recsourceStatus)
memoryStatus = int(memoryStatus)
if recsourceStatus == 1:
yield 0, 'Resource conservation: no'
elif recsourceStatus ==2:
yield 1, 'Resource conservation: memory shortage'
elif recsourceStatus ==3:
yield 1, 'Resource conservation: queue space shortage'
elif recsourceStatus == 4:
yield 2, 'Resource conservation: queue Full'
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'
if memoryStatus == 1:
yield 0, 'Memory: available'
elif memoryStatus ==2:
yield 2, 'Memory: shortage'
elif memoryStatus ==3:
yield 1, 'Memory: full'
check_info['cisco_asyncos_resources'] = {
'inventory_function': inventory_cisco_asyncos_resources,
'check_function': check_cisco_asyncos_resources,
'service_description': 'Resources',
'has_perfdata': False,
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1', # ASYNCOS-MAIL-MIB
[
'5', # queueAvailabilityStatus
'6', # resourceConservationReason
'7', # memoryAvailabilityStatus
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
No preview for this file type
{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u'Cisco AsyncOS (IronPort) checks\n\n- fixed inventory function\n- changed scan function, to look for "AsyncOS"\n- cisco_asyncos_queue: added wato\n\n- cisco_asyncos_fan, cisco_asyncos_power, cisco_asyncos_raid, cisco_asyncos_license, cisco_asyncos_update and cisco_asyncos_temp rewriten by Th.L. all other checks by A.Doehler\n\n- cisco_asyncos_fan uses fan.include\n- cisco_asyncos_temp uses temperature.include\n',
'description': u'Cisco AsyncOS (IronPort) checks\n\n- fixed inventory function\n- changed scan function, to look for "AsyncOS"\n- cisco_asyncos_queue: added wato\n\n- cisco_asyncos_fan, cisco_asyncos_power, cisco_asyncos_raid, cisco_asyncos_license, cisco_asyncos_update and cisco_asyncos_temp rewriten by Th.L. all other checks by A.Doehler\n\n- cisco_asyncos_fan uses fan.include\n- cisco_asyncos_temp uses temperature.include\n\n- 08.03.2020: added cisco_asyncos_dns, cisco_asyncos_resources, cisco_asyncos_messageage\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['cisco_asyncos_bandwidth',
'cisco_asyncos_cache',
......@@ -13,13 +13,17 @@
'cisco_asyncos_raid',
'cisco_asyncos_temp',
'cisco_asyncos_update',
'cisco_asyncos.include'],
'cisco_asyncos.include',
'cisco_asyncos_dns',
'cisco_asyncos_messageage',
'cisco_asyncos_resources'],
'web': ['plugins/wato/cisco_asyncos_license.py',
'plugins/wato/cisco_asyncos_queue.py',
'plugins/wato/cisco_asyncos_update.py']},
'plugins/wato/cisco_asyncos_update.py',
'plugins/metrics/cisco_asyncos.py']},
'name': 'cisco_asyncos',
'num_files': 16,
'num_files': 20,
'title': u'Cisco AsyncOS (IronPort) checks',
'version': '20200219_v0.1.2',
'version': '2020308_v0.1.3',
'version.min_required': '1.6.0p6',
'version.packaged': '1.6.0p8'}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Cisco AsyncOS metrics plugin
#
# Author: Th.L.
# Date : 2020-03-08
#
#####################################################################################################################
#
# define units for cisco_ise perfdata
#
#####################################################################################################################
#####################################################################################################################
#
# define metrics for perfdata
#
#####################################################################################################################
metric_info['cisco_asyncos_dns_outstandingdnsrequests'] = {
'title': _('Awaiting answer'),
'help': _('Number of DNS requests that have been sent but for which no reply has been received.'),
'unit': 'count',
'color': '26/a',
}
metric_info['cisco_asyncos_dns_pendingdnsrequests'] = {
'title': _('Waiting to be send'),
'help': _('Number of DNS requests waiting to be sent.'),
'unit': 'count',
'color': '22/a',
}
metric_info['cisco_asyncos_messageage_oldestmessageage'] = {
'title': _('Oldest message age'),
'help': _('The number of seconds the oldest message has been in queue.'),
'unit': 's',
'color': '26/a',
}
######################################################################################################################
#
# map perfdata to metric
#
######################################################################################################################
check_metrics['check_mk-cisco_asyncos_dns'] = {
'outstandingdnsrequests': {'name': 'cisco_asyncos_dns_outstandingdnsrequests', },
'pendingdnsrequests': {'name': 'cisco_asyncos_dns_pendingdnsrequests', },
}
check_metrics['check_mk-cisco_asyncos_messageage'] = {
'oldestmessageage': {'name': 'cisco_asyncos_messageage_oldestmessageage', },
}
######################################################################################################################
#
# how to graph perdata
#
######################################################################################################################
graph_info.append({
'title': _('AsyncOS DNS requests'),
'metrics': [
('cisco_asyncos_dns_pendingdnsrequests', '-area'),
('cisco_asyncos_dns_outstandingdnsrequests', 'area'),
],
})
graph_info.append({
'title': _('AsyncOS oldest message age'),
'metrics': [
('cisco_asyncos_messageage_oldestmessageage', 'area'),
],
})
######################################################################################################################
#
# define perf-o-meter
#
######################################################################################################################
perfometer_info.append(('stacked', [
{
'type': 'linear',
'segments': ['cisco_asyncos_dns_outstandingdnsrequests',
],
'total': 100,
},
{
'type': 'linear',
'segments': ['cisco_asyncos_dns_pendingdnsrequests',
],
'total': 100,
}
]))
perfometer_info.append({
'type': 'logarithmic',
'metric': 'cisco_asyncos_messageage_oldestmessageage',
'half_value': 2592000.0,
'exponent': 2,
})
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