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

update project

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 1134 additions and 0 deletions
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 10-02-2020
#
# include for Cisco IronPort appliances
#
# 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.
#
#
#
# find Cisco IronPort appliance by sysdescription
#
# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c public localhost sysDesc
# SNMPv2-MIB::sysDescr.0 = STRING: Cisco IronPort Model C380, AsyncOS Version: 12.5.1-037, Build Date: 2019-12-06, Serial #: E4AA5DAD515E-FCH1938V2J7
# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c public localhost sysDesc
# SNMPv2-MIB::sysDescr.0 = STRING: Cisco Model S370, AsyncOS Version: 9.0.1-162, Build Date: 2016-02-18, Serial #: 848F69E9A847-7QP2TW1
def scan_cisco_asyncos(oid):
if oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1:
return True
#
#
#!/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_bandwidth_default_levels = {}
def inventory_cisco_asyncos_bandwidth(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_bandwidth_default_levels')]
def check_cisco_asyncos_bandwidth(item, params, info):
state = 0
perfdata = []
warn, crit = None, None
now, onehour, oneday = info[0]
perfdata.append( ('now', now, warn, crit, 0, 1000000) )
perfdata.append( ('onehour', onehour, warn, crit, 0, 1000000) )
perfdata.append( ('oneday', oneday, warn, crit, 0, 1000000) )
infotext = 'Bandbreitennutzung aktuell %skBits - 1h Durchschnitt %skBits - 1d Durchschnitt %skBits' % (now, onehour, oneday)
return state, infotext, perfdata
check_info['cisco_asyncos_bandwidth'] = {
'check_function': check_cisco_asyncos_bandwidth,
'inventory_function': inventory_cisco_asyncos_bandwidth,
'service_description': 'Bandwidth total',
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.15497.1.2.3.7.4', [ # ASYNCOSWEBSECURITYAPPLIANCE-MIB::proxyRecentBandWTotPerf
'1', # cacheBwidthTotalNow
'3', # cacheBwidthTotal1hrMean
'5', # cacheBwidthTotal1dayMean
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/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_cache_default_levels = {}
def inventory_cisco_asyncos_cache(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_cache_default_levels')]
def check_cisco_asyncos_cache(item, params, info):
state = 0
perfdata = []
warn, crit = None, None
hits, misses, hitresp, missresp, totalresp = info[0]
perfdata.append( ('hits', int(hits) ) )
perfdata.append( ('misses', int(misses) ) )
perfdata.append( ('hitresp', int(hitresp) ) )
perfdata.append( ('missresp', int(missresp) ) )
perfdata.append( ('totalresp', int(totalresp) ) )
infotext = 'Cache Stats aktuell %s Hits (%sms Antwortzeit), %s Misses (%sms Antwortzeit) und %sms gesamt Antwortzeit' % (hits, hitresp, misses, missresp, totalresp)
return state, infotext, perfdata
check_info['cisco_asyncos_cache'] = {
'check_function': check_cisco_asyncos_cache,
'inventory_function': inventory_cisco_asyncos_cache,
'service_description': 'Cache Stats',
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.15497.1.2.3.7', [ # ASYNCOSWEBSECURITYAPPLIANCE-MIB::proxyRecentPerf
'5.1', # cacheHitsNow
'6.1', # cacheMissesNow
'7.1', # cacheHitRespTimeNow
'8.1', # cacheMissRespTimeNow
'9.1', # cacheTotalRespTimeNow
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/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': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/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.
cisco_asyncos_cpu_default_levels = (80.0, 90.0)
def inventory_cisco_asyncos_cpu(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_cpu_default_levels')]
def check_cisco_asyncos_cpu(_no_item, params, info):
warn, crit = params
util = float(info[0][0])
perfdata=[('util', util, warn, crit, 0, 100)]
infotext = '%2.1f%% utilization in the last minute' % util
if util >= crit:
return 2, infotext + ' (critical at %d%%)' % crit, perfdata
elif util >= warn:
return 1, infotext + ' (warning at %d%%)' % warn, perfdata
else:
return 0, infotext, perfdata
check_info['cisco_asyncos_cpu'] = {
'check_function': check_cisco_asyncos_cpu,
'inventory_function': inventory_cisco_asyncos_cpu,
'service_description': 'CPU Utilization',
'has_perfdata': True,
'group': 'cpu_utilization',
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', ['2']), # ASYNCOS-MAIL-MIB::perCentCPUUtilization
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 10-02-2020
#
# monitors status Cisco IronPort Appliances (ESA/SMA/WSA) fan sensors
# Tested with: C380, M380, C370, M670, S370
#
# based on original Check_MK fan checks
#
# 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.
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB -ObentU fanTable
# .1.3.6.1.4.1.15497.1.1.1.10.1.1.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.10.1.1.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.10.1.1.3 = INTEGER: 3
# .1.3.6.1.4.1.15497.1.1.1.10.1.1.4 = INTEGER: 4
# .1.3.6.1.4.1.15497.1.1.1.10.1.2.1 = Gauge32: 3600
# .1.3.6.1.4.1.15497.1.1.1.10.1.2.2 = Gauge32: 3600
# .1.3.6.1.4.1.15497.1.1.1.10.1.2.3 = Gauge32: 3600
# .1.3.6.1.4.1.15497.1.1.1.10.1.2.4 = Gauge32: 3480
# .1.3.6.1.4.1.15497.1.1.1.10.1.3.1 = STRING: FAN 1
# .1.3.6.1.4.1.15497.1.1.1.10.1.3.2 = STRING: FAN 2
# .1.3.6.1.4.1.15497.1.1.1.10.1.3.3 = STRING: FAN 3
# .1.3.6.1.4.1.15497.1.1.1.10.1.3.4 = STRING: FAN 4
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB fanTable
# ASYNCOS-MAIL-MIB::fanIndex.1 = INTEGER: 1
# ASYNCOS-MAIL-MIB::fanIndex.2 = INTEGER: 2
# ASYNCOS-MAIL-MIB::fanIndex.3 = INTEGER: 3
# ASYNCOS-MAIL-MIB::fanIndex.4 = INTEGER: 4
# ASYNCOS-MAIL-MIB::fanRPMs.1 = Gauge32: 3600
# ASYNCOS-MAIL-MIB::fanRPMs.2 = Gauge32: 3600
# ASYNCOS-MAIL-MIB::fanRPMs.3 = Gauge32: 3600
# ASYNCOS-MAIL-MIB::fanRPMs.4 = Gauge32: 3480
# ASYNCOS-MAIL-MIB::fanName.1 = STRING: FAN 1
# ASYNCOS-MAIL-MIB::fanName.2 = STRING: FAN 2
# ASYNCOS-MAIL-MIB::fanName.3 = STRING: FAN 3
# ASYNCOS-MAIL-MIB::fanName.4 = STRING: FAN 4
#
factory_settings['cisco_asyncos_fan_default_levels'] = {
'lower': (2000, 1000),
'upper': (8000, 8400),
'output_metrics': True,
}
def inventory_cisco_asyncos_fan(info):
if info:
for line in info:
fanRPM, fanName = line
if fanName.lower().startswith('fan '):
fanName = fanName[4:]
item = fanName
yield item, {}
def check_cisco_asyncos_fan(item, params, info):
if info:
for line in info:
fanRPM, fanName = line
if fanName.lower().startswith('fan '):
fanName = fanName[4:]
if fanName == item:
rpm = int(fanRPM)
yield check_fan(rpm, params)
check_info['cisco_asyncos_fan'] = {
'inventory_function': inventory_cisco_asyncos_fan,
'check_function': check_cisco_asyncos_fan,
'group': 'hw_fans',
'service_description': 'FAN %s',
'has_perfdata': True,
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1.10.1', # ASYNCOS-MAIL-MIB::fanEntry
[
'2', # fanRPMs
'3', # fanName
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include', 'fan.include'],
'default_levels_variable': 'cisco_asyncos_fan_default_levels',
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Rewriten by: Th.L.
# Date: 10-02-2020
#
# monitors license status of Cisco IronPort Appliances (ESA/SMA/WSA)
# Tested with: C380, M380, C370, M670, S370
#
# 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.
#
# sample snmpwalk:
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c public localhost -m ASYNCOS-MAIL-MIB -ObentU keyExpirationTable
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.3 = INTEGER: 3
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.4 = INTEGER: 4
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.5 = INTEGER: 5
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.6 = INTEGER: 6
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.7 = INTEGER: 7
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.8 = INTEGER: 8
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.9 = INTEGER: 9
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.10 = INTEGER: 10
# .1.3.6.1.4.1.15497.1.1.1.12.1.1.11 = INTEGER: 11
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.1 = STRING: Bounce Verification
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.2 = STRING: Data Loss Prevention
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.3 = STRING: External Threat Feeds
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.4 = STRING: File Analysis
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.5 = STRING: File Reputation
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.6 = STRING: Incoming Mail Handling
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.7 = STRING: IronPort Anti-Spam
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.8 = STRING: IronPort Email Encryption
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.9 = STRING: McAfee
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.10 = STRING: Outbreak Filters
# .1.3.6.1.4.1.15497.1.1.1.12.1.2.11 = STRING: Sophos Anti-Virus
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.3 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.4 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.5 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.6 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.7 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.8 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.9 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.10 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.3.11 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.1 = Gauge32: 0
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.2 = Gauge32: 0
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.3 = Gauge32: 32542740
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.4 = Gauge32: 32542804
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.5 = Gauge32: 32542804
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.6 = Gauge32: 0
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.7 = Gauge32: 32542740
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.8 = Gauge32: 0
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.9 = Gauge32: 1463722
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.10 = Gauge32: 32542740
# .1.3.6.1.4.1.15497.1.1.1.12.1.4.11 = Gauge32: 32542740
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c public localhost -m ASYNCOS-MAIL-MIB keyExpirationTable
# ASYNCOS-MAIL-MIB::keyExpirationIndex.1 = INTEGER: 1
# ASYNCOS-MAIL-MIB::keyExpirationIndex.2 = INTEGER: 2
# ASYNCOS-MAIL-MIB::keyExpirationIndex.3 = INTEGER: 3
# ASYNCOS-MAIL-MIB::keyExpirationIndex.4 = INTEGER: 4
# ASYNCOS-MAIL-MIB::keyExpirationIndex.5 = INTEGER: 5
# ASYNCOS-MAIL-MIB::keyExpirationIndex.6 = INTEGER: 6
# ASYNCOS-MAIL-MIB::keyExpirationIndex.7 = INTEGER: 7
# ASYNCOS-MAIL-MIB::keyExpirationIndex.8 = INTEGER: 8
# ASYNCOS-MAIL-MIB::keyExpirationIndex.9 = INTEGER: 9
# ASYNCOS-MAIL-MIB::keyExpirationIndex.10 = INTEGER: 10
# ASYNCOS-MAIL-MIB::keyExpirationIndex.11 = INTEGER: 11
# ASYNCOS-MAIL-MIB::keyDescription.1 = STRING: Bounce Verification
# ASYNCOS-MAIL-MIB::keyDescription.2 = STRING: Data Loss Prevention
# ASYNCOS-MAIL-MIB::keyDescription.3 = STRING: External Threat Feeds
# ASYNCOS-MAIL-MIB::keyDescription.4 = STRING: File Analysis
# ASYNCOS-MAIL-MIB::keyDescription.5 = STRING: File Reputation
# ASYNCOS-MAIL-MIB::keyDescription.6 = STRING: Incoming Mail Handling
# ASYNCOS-MAIL-MIB::keyDescription.7 = STRING: IronPort Anti-Spam
# ASYNCOS-MAIL-MIB::keyDescription.8 = STRING: IronPort Email Encryption
# ASYNCOS-MAIL-MIB::keyDescription.9 = STRING: McAfee
# ASYNCOS-MAIL-MIB::keyDescription.10 = STRING: Outbreak Filters
# ASYNCOS-MAIL-MIB::keyDescription.11 = STRING: Sophos Anti-Virus
# ASYNCOS-MAIL-MIB::keyIsPerpetual.1 = INTEGER: true(1)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.2 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.3 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.4 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.5 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.6 = INTEGER: true(1)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.7 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.8 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.9 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.10 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keyIsPerpetual.11 = INTEGER: false(2)
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.1 = Gauge32: 0
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.2 = Gauge32: 0
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.3 = Gauge32: 32542740
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.4 = Gauge32: 32542804
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.5 = Gauge32: 32542804
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.6 = Gauge32: 0
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.7 = Gauge32: 32542740
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.8 = Gauge32: 0
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.9 = Gauge32: 1463722
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.10 = Gauge32: 32542740
# ASYNCOS-MAIL-MIB::keySecondsUntilExpire.11 = Gauge32: 32542740
#
#
# sample info:
# [
# [u'Cisco Centralized Email Reporting', u'2', u'927000'],
# [u'Cisco Centralized Web Configuration Manager', u'2', u'927000'],
# [u'Cisco Centralized Web Reporting', u'2', u'2592000'],
# [u'Cisco IronPort Centralized Email Message Tracking', u'2', u'927000'],
# [u'Cisco IronPort Spam Quarantine', u'2', u'927000'],
# [u'Incoming Mail Handling', u'1', u'0']
# ]
#
cisco_asyncos_license_default_levels = {
'expire': (30, 7), # 30 days warn, 7 days crit
# 'features_ignore': ['McAfee', 'Data Loss Prevention'], # list of features to ignore in license check
}
def inventory_cisco_asyncos_license(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_license_default_levels')]
def check_cisco_asyncos_license(_no_item, params, info):
infotext = ''
longoutput = ''
features_warn = []
features_crit = []
features_ignore = params.get('features_ignore', [])
expire_warn, expire_crit = params.get('expire', (30, 15))
expire_warn = expire_warn * 24 * 3600
expire_crit = expire_crit * 24 * 3600
def get_isperpetual(isperpetual):
s_status = {'1': True,
'2': False}
return s_status.get(isperpetual,False)
for featurekey in info:
description, isperpetual, secondsuntilexpire = featurekey
isperpetual = get_isperpetual(isperpetual)
secondsuntilexpire = int(secondsuntilexpire)
expiredate = time.strftime("%d %b %Y", time.localtime(time.time()+secondsuntilexpire))
if isperpetual:
longoutput += '\n%s: perpetual: %s, expires at: %s' % (description, isperpetual, 'will not expire')
elif secondsuntilexpire == 0:
longoutput += '\n%s: perpetual: %s, has expired or is not licensed' % (description, isperpetual)
else:
longoutput += '\n%s: perpetual: %s, expires at: %s' % (description, isperpetual, expiredate)
if not isperpetual and description not in features_ignore:
if secondsuntilexpire < expire_crit:
features_crit.append(description)
elif secondsuntilexpire < expire_warn:
features_warn.append(description)
if len(features_crit) != 0:
temp = ', '.join(features_crit)
yield 2, '%d features about to expire (%s)' % (len(features_crit), temp)
if len(features_warn) != 0:
temp = ', '.join(features_warn)
yield 1, '%d features about to expire (%s)' % (len(features_warn), temp)
infotext += '%d features found' % len(info)
yield 0, infotext + longoutput
check_info['cisco_asyncos_license'] = {
'check_function': check_cisco_asyncos_license,
'inventory_function': inventory_cisco_asyncos_license,
'group': 'cisco_asyncos_license',
'service_description': 'License',
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1.12.1', # ASYNCOS-MAIL-MIB::keyExpirationEntry
['2', # keyDescription
'3', # keyIsPerpetual
'4', # keySecondsUntilExpire
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/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.
cisco_asyncos_mem_default_levels = (80.0, 90.0)
def inventory_cisco_asyncos_mem(info):
if len(info) > 0:
return [(None, 'cisco_asyncos_mem_default_levels')]
def check_cisco_asyncos_mem(item, params, info):
if 'levels' in params:
warn, crit = params['levels']
else:
warn, crit = params
perc_used = float(info[0][0])
perfdata=[ ('mem_used', perc_used, warn, crit, 0, 100 ) ]
infotext = '%2.1f%% Memory usage' % perc_used
if perc_used >= crit:
return 2, infotext + ' (critical at %d%%)' % crit, perfdata
elif perc_used >= warn:
return 1, infotext + ' (warning at %d%%)' % warn, perfdata
else:
return 0, infotext, perfdata
check_info['cisco_asyncos_mem'] = {
'check_function': check_cisco_asyncos_mem,
'inventory_function': inventory_cisco_asyncos_mem,
'service_description': 'Memory Usage',
'has_perfdata': True,
'group': 'memory',
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', ['1']), # ASYNCOS-MAIL-MIB::perCentMemoryUtilization
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 10-02-2020
#
# monitors status power supplies of Cisco IronPort Appliances (ESA/SMA/WSA)
# Tested with: C380, M380, C370, M670, S370
#
#
# based on original Check_MK power supply checks (fireeye/dell)
#
# 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.
#
# OMD[cmk16x]:~$ snmpwalk -ObentU -v2c -c public localhost -m ASYNCOS-MAIL-MIB powerSupplyTable
# .1.3.6.1.4.1.15497.1.1.1.8.1.1.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.8.1.1.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.8.1.2.1 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.8.1.2.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.8.1.3.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.8.1.3.2 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.8.1.4.1 = STRING: PS 1
# .1.3.6.1.4.1.15497.1.1.1.8.1.4.2 = STRING: PS 2
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c public localhost -m ASYNCOS-MAIL-MIB powerSupplyTable
# ASYNCOS-MAIL-MIB::powerSupplyIndex.1 = INTEGER: 1
# ASYNCOS-MAIL-MIB::powerSupplyIndex.2 = INTEGER: 2
# ASYNCOS-MAIL-MIB::powerSupplyStatus.1 = INTEGER: powerSupplyHealthy(2)
# ASYNCOS-MAIL-MIB::powerSupplyStatus.2 = INTEGER: powerSupplyHealthy(2)
# ASYNCOS-MAIL-MIB::powerSupplyRedundancy.1 = INTEGER: powerSupplyRedundancyOK(1)
# ASYNCOS-MAIL-MIB::powerSupplyRedundancy.2 = INTEGER: powerSupplyRedundancyOK(1)
# ASYNCOS-MAIL-MIB::powerSupplyName.1 = STRING: PS 1
# ASYNCOS-MAIL-MIB::powerSupplyName.2 = STRING: PS 2
#
def inventory_cisco_asyncos_power(info, has_item, has_params=False):
if info:
params = None
if has_params:
params = {}
for line in info:
if has_item:
status, redundancy, name = line
item = name
yield item, params
def check_cisco_asyncos_power_states(states):
# Now we only known the OK states and health states
# but we can expand if we know more
map_states = {
'status': {
'1': (1, 'not installed'),
'2': (0, 'healthy'),
'3': (2, 'no AC'),
'4': (2, 'faulty'),
},
'redundancy': {
'1': (0, 'OK'),
'2': (2, 'redundancy lost'),
}
}
states_evaluated = {}
for what, text in states:
states_evaluated.setdefault(text, map_states[text.lower()].get(what.lower(), (2, 'not %s' % what.lower())))
return states_evaluated
def check_cisco_asyncos_power(item, _no_params, info):
for line in info:
status, redundancy, name = line
if item == name:
for text, (state, state_readable) in \
check_cisco_asyncos_power_states([(status, 'Status'), (redundancy, 'redundancy')]).items():
yield state, '%s: %s' % (text, state_readable)
check_info['cisco_asyncos_power'] = {
'inventory_function': lambda info: inventory_cisco_asyncos_power(info, True),
'check_function': check_cisco_asyncos_power,
'service_description': 'Power Supply %s',
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1.8.1', # ASYNCOS-MAIL-MIB::powerSupplyEntry
[
'2', # powerSupplyStatus
'3', # powerSupplyRedundancy
'4', # powerSupplyName
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
\ No newline at end of file
#!/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.
#
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, 'cisco_asyncos_queue_default_levels')]
def check_cisco_asyncos_queue(_no_item, params, info):
warn, crit = params.get('levels', (50, 100))
queue = int(info[0][0])
perfdata=[('queue', queue, warn, crit)]
infotext = '%d message(s) in work queue' % queue
if queue >= crit:
return 2, infotext + ' (critical at %d)' % crit, perfdata
elif queue >= warn:
return 1, infotext + ' (warning at %d)' % warn, perfdata
else:
return 0, infotext, perfdata
check_info['cisco_asyncos_queue'] = {
'check_function': check_cisco_asyncos_queue,
'inventory_function': inventory_cisco_asyncos_queue,
'group': 'cisco_asyncos_queue',
'service_description': 'Work Queue Size',
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', ['11']), # ASYNCOS-MAIL-MIB::workQueueMessages
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 10-02-2020
#
# monitors status raid arrays of Cisco IronPort Appliances (ESA/SMA/WSA)
# Tested with: C380, M380, C370, M670, S370
#
#
# based on original Check_MK power supply checks (fireeye/dell)
#
# 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.
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB -ObentU raidTable
# .1.3.6.1.4.1.15497.1.1.1.18.1.1.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.18.1.1.2 = INTEGER: 2
# .1.3.6.1.4.1.15497.1.1.1.18.1.2.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.18.1.2.2 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.18.1.3.1 = STRING: Drive 0
# .1.3.6.1.4.1.15497.1.1.1.18.1.3.2 = STRING: Drive 1
# .1.3.6.1.4.1.15497.1.1.1.18.1.4.1 = STRING: No Errors
# .1.3.6.1.4.1.15497.1.1.1.18.1.4.2 = STRING: No Errors
#
# OMD[cmk16x]:~$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB raidTable
# ASYNCOS-MAIL-MIB::raidIndex.1 = INTEGER: 1
# ASYNCOS-MAIL-MIB::raidIndex.2 = INTEGER: 2
# ASYNCOS-MAIL-MIB::raidStatus.1 = INTEGER: driveHealthy(1)
# ASYNCOS-MAIL-MIB::raidStatus.2 = INTEGER: driveHealthy(1)
# ASYNCOS-MAIL-MIB::raidID.1 = STRING: Drive 0
# ASYNCOS-MAIL-MIB::raidID.2 = STRING: Drive 1
# ASYNCOS-MAIL-MIB::raidLastError.1 = STRING: No Errors
# ASYNCOS-MAIL-MIB::raidLastError.2 = STRING: No Errors
#
def inventory_cisco_asyncos_raid(info, has_item, has_params=False):
if info:
params = None
if has_params:
params = {}
for line in info:
if has_item:
status, name, lasterror = line
item = name
yield item, params
def check_cisco_asyncos_raid_states(states):
# Now we only known the OK states and health states
# but we can expand if we know more
map_states = {
'status': {
'1': (0, 'healthy'),
'2': (2, 'failure'),
'3': (1, 'rebuild'),
},
}
states_evaluated = {}
for what, text in states:
states_evaluated.setdefault(text, map_states[text.lower()].get(what.lower(), (2, 'not %s' % what.lower())))
return states_evaluated
def check_cisco_asyncos_raid(item, _no_params, info):
for line in info:
status, name, lasterror = line
if item == name:
for text, (state, state_readable) in check_cisco_asyncos_raid_states([(status, 'Status')]).items():
yield state, '%s: %s' % (text, state_readable)
if lasterror.lower() != 'no errors':
yield 0, 'Last error: %s' % lasterror
check_info['cisco_asyncos_raid'] = {
'inventory_function': lambda info: inventory_cisco_asyncos_raid(info, True),
'check_function': check_cisco_asyncos_raid,
'service_description': 'RAID %s',
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1.18.1', # ASYNCOS-MAIL-MIB::raidEntry
[
'2', # raidStatus
'3', # raidID
'4', # raidLastError
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author: Th.L.
# Date: 10-02-2020
#
# monitors status Cisco IronPort Appliances (ESA/SMA/WSA) temperature sensors
# Tested with: C380, M380, C370, M670, S370
#
#
# based on original Check_MK temp checks (fireeye)
#
# 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.
#
# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c C370-MAIL localhost -ObentU -m ASYNCOS-MAIL-MIB temperatureTable
# .1.3.6.1.4.1.15497.1.1.1.9.1.1.1 = INTEGER: 1
# .1.3.6.1.4.1.15497.1.1.1.9.1.2.1 = INTEGER: 22
# .1.3.6.1.4.1.15497.1.1.1.9.1.3.1 = STRING: Ambient
#
# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB temperatureTable
# ASYNCOS-MAIL-MIB::temperatureIndex.1 = INTEGER: 1
# ASYNCOS-MAIL-MIB::degreesCelsius.1 = INTEGER: 22
# ASYNCOS-MAIL-MIB::temperatureName.1 = STRING: Ambient
#
factory_settings['cisco_asyncos_temp_default_levels'] = {'levels_lower': (0.0, -10.0),
'levels': (60, 80),
'output_unit': 'c',
'device_levels_handling': 'usr',
}
def inventory_cisco_asyncos_temp(info):
if info:
for line in info:
celsius, name = line
item = name
yield item, {}
def check_cisco_asyncos_temp(item, params, info):
if info:
for line in info:
reading_str, name = line
if item == name:
yield check_temperature(float(reading_str),
params,
'cisco_asyncos_temp_%s' % name,
)
check_info['cisco_asyncos_temp'] = {
'inventory_function': inventory_cisco_asyncos_temp,
'check_function': check_cisco_asyncos_temp,
'service_description': 'Temperature %s',
'has_perfdata': True,
'snmp_info': (
'.1.3.6.1.4.1.15497.1.1.1.9.1', # ASYNCOS-MAIL-MIB::temperatureEntry
[
'2', # degreesCelsius
'3', # temperatureName
]),
'snmp_scan_function': scan_cisco_asyncos,
'group': 'temperature',
'default_levels_variable': 'cisco_asyncos_temp_default_levels',
'includes': ['temperature.include', 'cisco_asyncos.include'],
}
#!/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.
def inventory_cisco_asyncos_update(info):
if len(info) > 0:
for line in info:
yield line[0], None
def check_cisco_asyncos_update(item, _no_params, info):
message = ''
for line in info:
if line[0] == item:
status = 0
name, amount, error = line
if int(amount) > 0:
message += '%s(!) Updates present' % amount
status = 0
if error != '0':
if len(message) > 0:
message += ', '
message += '%s(!) Error messages present' % error
status = 0
if status == 0 and len(message) == 0:
message = 'No Updates and Errors present'
return status, message
return 3, 'Update not found in SNMP output'
check_info['cisco_asyncos_update'] = {
'check_function': check_cisco_asyncos_update,
'inventory_function': inventory_cisco_asyncos_update,
'service_description': 'Update %s',
'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1.13.1', [ # ASYNCOS-MAIL-MIB::updateEntry
'2', # updateServiceName --> A textual name for an update entry
'3', # updates --> The number of successful attempts that have occurred when updating a service
'4', # updateFailures --> "The number of failed attempts that have occurred when updating a service
]),
'snmp_scan_function': scan_cisco_asyncos,
'includes': ['cisco_asyncos.include'],
}
File added
{'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 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',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['cisco_asyncos_bandwidth',
'cisco_asyncos_cache',
'cisco_asyncos_conn',
'cisco_asyncos_cpu',
'cisco_asyncos_fan',
'cisco_asyncos_license',
'cisco_asyncos_mem',
'cisco_asyncos_power',
'cisco_asyncos_queue',
'cisco_asyncos_raid',
'cisco_asyncos_temp',
'cisco_asyncos_update',
'cisco_asyncos.include'],
'web': ['plugins/wato/cisco_asyncos_license.py',
'plugins/wato/cisco_asyncos_queue.py']},
'name': 'cisco_asyncos',
'num_files': 15,
'title': u'Cisco AsyncOS (IronPort) checks',
'version': '20200210_v0.1.1',
'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 -*-
#
#
register_check_parameters(
subgroup_applications,
'cisco_asyncos_license',
_('Cisco AsyncOS license'),
Dictionary(
# help=_(''),
elements=[
('features_ignore',
ListOfStrings(
title=_('license features to ignore'),
orientation='horizontal',
help=_('there will be no warning/critical if this features are expired'
'Examples: McAfee, IronPort Email Encryption, Data Loss Prevention, etc.'),
)
),
('expire',
Tuple(
title=_('Levels for licence expiration in days'),
elements=[
Integer(title=_('Warning'), default_value=30, unit=_('days before expiration')),
Integer(title=_('Critical'), default_value=7, unit=_('days before expiration')),
])),
],
),
None,
match_type='dict',
)
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
#
register_check_parameters(
subgroup_applications,
'cisco_asyncos_queue',
_('Cisco AsyncOS queue'),
Dictionary(
# help=_(''),
elements=[
('levels',
Tuple(
title=_('Levels for nuber of messages in work queue'),
elements=[
Integer(title=_('Warning'), default_value=50, unit=_('# of messages')),
Integer(title=_('Critical'), default_value=100, unit=_('# of messages')),
])),
],
),
None,
match_type='dict',
)
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