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

update project

parent 33aa1fd9
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -11,6 +11,9 @@
# 13.03.2018 : code cleanup
# 15.03.2018 : more code cleanup
# 08.06.2020 : changed snmp-scan function
# 10.11.2020 : removed perfdata
# added wato option to configure 'ignore disks'. For example on the Smart-1 5150 (Array has 12 Disks,
# but only 6 Disks are in the default hardware
#
# sample snmpwalk (one volume / two disks)
#
......@@ -57,7 +60,7 @@
#
factory_settings['checkpoint_soft_raid_defaults'] = {
'ignore_disks': '',
}
......@@ -125,10 +128,10 @@ def inventory_checkpoint_soft_raid(parse):
if disk.get('diskvolumeid') == volumeid:
disksonvolume.append(disk)
disks.remove(disk)
yield item, [volume, disksonvolume]
yield item, None
def check_checkpoint_soft_raid(item, _no_params, parse):
def check_checkpoint_soft_raid(item, params, parse):
raidvolumestate = {
0: 'OPTIMAL',
1: 'DEGRADED',
......@@ -206,6 +209,9 @@ def check_checkpoint_soft_raid(item, _no_params, parse):
longoutput = ''
perfdata = []
if params:
ignore_disks = params.get('ignore_disks', '').split(',')
if len(volumes) != 0:
for volume in volumes:
volumeid = volume.get('volumeid')
......@@ -234,28 +240,29 @@ def check_checkpoint_soft_raid(item, _no_params, parse):
# disk infos
for disk in disks:
diskid = disk.get('diskid')
syncstate = disk.get('disksyncstate')
if disk.get('diskstate') != 0:
yield 2, 'Disk ID: %d state: %s' % (diskid, raiddiskstate.get(disk.get('diskstate')))
else:
yield 0, 'Disk ID %d state %s' % (diskid, raiddiskstate.get(disk.get('diskstate')))
if not str(diskid) in ignore_disks:
syncstate = disk.get('disksyncstate')
if disk.get('diskstate') != 0:
yield 2, 'Disk ID: %d state: %s' % (diskid, raiddiskstate.get(disk.get('diskstate')))
else:
yield 0, 'Disk ID %d state %s' % (diskid, raiddiskstate.get(disk.get('diskstate')))
longoutput += '\n%s disk (id %d): ' % (raiddiskid.get(diskid), diskid)
longoutput += 'State: %s, ' % raiddiskstate.get(disk.get('diskstate'))
longoutput += 'Sync: %d%s, ' % (syncstate, '%')
longoutput += 'Size: %d GB, ' % disk.get('disksize')
longoutput += 'max LBA: %d, ' % disk.get('diskmaxlba')
longoutput += 'Vendor: %s, ' % disk.get('diskvendor')
longoutput += 'Product id: %s, ' % disk.get('diskproductid')
longoutput += 'Revision: %s, ' % disk.get('diskrevision')
longoutput += 'Flags: %s' % getflags(disk.get('diskflags'), raiddiskflags)
longoutput += '\n%s disk (id %d): ' % (raiddiskid.get(diskid), diskid)
longoutput += 'State: %s, ' % raiddiskstate.get(disk.get('diskstate'))
longoutput += 'Sync: %d%s, ' % (syncstate, '%')
longoutput += 'Size: %d GB, ' % disk.get('disksize')
longoutput += 'max LBA: %d, ' % disk.get('diskmaxlba')
longoutput += 'Vendor: %s, ' % disk.get('diskvendor')
longoutput += 'Product id: %s, ' % disk.get('diskproductid')
longoutput += 'Revision: %s, ' % disk.get('diskrevision')
longoutput += 'Flags: %s' % getflags(disk.get('diskflags'), raiddiskflags)
perfdata.append(('disk_id_%d' % diskid, syncstate, None, None, 0, 100))
# perfdata.append(('disk_id_%d' % diskid, syncstate, None, None, 0, 100))
# remove last ', '
# infotext = infotext[:-2]
yield 0, infotext + longoutput, perfdata
yield 0, infotext + longoutput # , perfdata
check_info['checkpoint_soft_raid'] = {
......@@ -265,7 +272,7 @@ check_info['checkpoint_soft_raid'] = {
'default_levels_variable' : 'checkpoint_soft_raid_defaults',
'service_description' : 'Soft RAID %s',
'group' : 'checkpoint_soft_raid',
'has_perfdata' : True,
# 'has_perfdata' : True,
'snmp_scan_function': lambda oid: (oid('.1.3.6.1.2.1.1.2.0').startswith('.1.3.6.1.4.1.2620.1.6.123.1') or
oid('.1.3.6.1.2.1.1.2.0').startswith('.1.3.6.1.4.1.8072.3.2.10')) and
oid('.1.3.6.1.4.1.2620.1.6.1.0', '').lower().startswith('svn foundation'),
......
......@@ -2,10 +2,12 @@
'description': u'monitor Check Point appliance soft RAID\n',
'download_url': 'http://thl-cmk.hopto.org/',
'files': {'checks': ['checkpoint_soft_raid'],
'web': ['plugins/metrics/checkpoint_soft_raid.py']},
'web': ['plugins/metrics/checkpoint_soft_raid.py',
'plugins/wato/checkpoint_soft_raid.py']},
'name': 'checkpoint_soft_raid',
'num_files': 2,
'num_files': 3,
'title': u'Check Point appliance soft RAID',
'version': '20200608.v0.2c',
'version': '20201110.v0.3',
'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p38'}
\ No newline at end of file
'version.packaged': '1.6.0p12',
'version.usable_until': None}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
#
# Check_MK checkpoint_soft_rais WATO plugin
#
#
#
register_check_parameters(
subgroup_networking,
'checkpoint_soft_raid',
_('Check Point Soft Raid'),
Dictionary(
help=_(''),
elements=[
('ignore_disks',
TextUnicode(
title=_('list of comma separated disk IDs to ignore'),
help=_('This is usefull for RAID Arrays with missing disks like on the Smart-1 5150. There the '
'array is configured for 12 Disk but in the default Hardware are only 6 Disks.'),
default_value=None,
allow_empty=False,
)),
],
),
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