diff --git a/checkpoint_soft_raid.mkp b/checkpoint_soft_raid.mkp index dfdb61c4bd34e178e14268469828634e06e714e6..3897ab2a2d9a6e33e0883ab7fb335bdcb343de34 100644 Binary files a/checkpoint_soft_raid.mkp and b/checkpoint_soft_raid.mkp differ diff --git a/checks/checkpoint_soft_raid b/checks/checkpoint_soft_raid index eaa00467dc04e5e8ad95efe21b77e68053a8d254..5ee8a9376b69ee42c0d9b26226603b9a21f31af4 100644 --- a/checks/checkpoint_soft_raid +++ b/checks/checkpoint_soft_raid @@ -1,11 +1,16 @@ #!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- - # -# 31.05.2016 : Th.L. : monitor Check Point appliance soft RAID -# 08.03.2018 : Th.L. : changed snmp scan function -# 13.03.2018 : Th.L. : code cleanup -# 15.03.2018 : Th.L. : more code cleanup +# License: GNU General Public License v2 +# +# Author: thl-cmk[at]outlook[dot]com +# URL : https://thl-cmk.hopto.org +# +# 31.05.2016 : monitor Check Point appliance soft RAID +# 08.03.2018 : changed snmp scan function +# 13.03.2018 : code cleanup +# 15.03.2018 : more code cleanup +# 08.06.2020 : changed snmp-scan function # # sample snmpwalk (one volume / two disks) # @@ -121,11 +126,9 @@ def inventory_checkpoint_soft_raid(parse): disksonvolume.append(disk) disks.remove(disk) yield item, [volume, disksonvolume] - else: - return -def check_checkpoint_soft_raid(item, params, parse): +def check_checkpoint_soft_raid(_no_item, _no_params, parse): raidvolumestate = { 0: 'OPTIMAL', 1: 'DEGRADED', @@ -199,8 +202,6 @@ def check_checkpoint_soft_raid(item, params, parse): return description volumes, disks = parse - disksonvolume = [] - state = 0 infotext = '' longoutput = '' perfdata = [] @@ -217,7 +218,7 @@ def check_checkpoint_soft_raid(item, params, parse): if volume.get('volumestate') != 0: yield 2, 'Volume state %s' % raidvolumestate.get(volume.get('volumestate')) else: - infotext += 'Volume state: %s, ' % raidvolumestate.get(volume.get('volumestate')) + yield 0, 'Volume state: %s' % raidvolumestate.get(volume.get('volumestate')) infotext += '%s, ' % volume.get('volumetype') infotext += '%d disks, ' % volume.get('numofdisksonraid') @@ -230,7 +231,6 @@ def check_checkpoint_soft_raid(item, params, parse): longoutput += 'max LBA: %d, ' % volume.get('volumemaxlba') longoutput += 'Flags: %s' % getflags(volume.get('volumeflags'), raidvolumeflags) - # disk infos for disk in disks: diskid = disk.get('diskid') @@ -238,7 +238,7 @@ def check_checkpoint_soft_raid(item, params, parse): if disk.get('diskstate') != 0: yield 2, 'Disk ID: %d state: %s' % (diskid, raiddiskstate.get(disk.get('diskstate'))) else: - infotext += 'Disk ID %d state %s, ' % (diskid, raiddiskstate.get(disk.get('diskstate'))) + 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')) @@ -253,9 +253,9 @@ def check_checkpoint_soft_raid(item, params, parse): perfdata.append(('disk_id_%d' % diskid, syncstate, None, None, 0, 100)) # remove last ', ' - infotext = infotext[:-2] + # infotext = infotext[:-2] - yield state, infotext + longoutput, perfdata + yield 0, infotext + longoutput, perfdata check_info['checkpoint_soft_raid'] = { @@ -264,16 +264,11 @@ check_info['checkpoint_soft_raid'] = { 'parse_function' : parse_checkpoint_soft_raid, 'default_levels_variable' : 'checkpoint_soft_raid_defaults', 'service_description' : 'Soft RAID', - 'group' : 'cp_soft_raid', + 'group' : 'checkpoint_soft_raid', 'has_perfdata' : True, - - #'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.2620.1.6.123.1.67', # ClusterXL Gateway - # '.1.3.6.1.4.1.2620.1.6.123.1.65', # Appliance - # '.1.3.6.1.4.1.2620.1.6.123.1.64', # VSX Gateway - # '.1.3.6.1.4.1.2620.1.6.123.1.62', # Gateway - # '.1.3.6.1.4.1.2620.1.6.123.1.49', # R77.30 Gateway - # '.1.3.6.1.4.1.2620.1.6.123.1.48', # Mgmt - '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'), + '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'), 'snmp_info' : [('.1.3.6.1.4.1.2620.1.6.7.7.1.1', [ # CHECKPOINT-MIB::raidVolumeEntry '1', # raidVolumeIndex '2', # raidVolumeID @@ -298,5 +293,4 @@ check_info['checkpoint_soft_raid'] = { '11', # raidDiskSyncState '12', # raidDiskSize ])], -} - +} \ No newline at end of file diff --git a/packages/checkpoint_soft_raid b/packages/checkpoint_soft_raid index d79f4dc2830caeb1993cc79ebff93170c184d1e2..992578cc99b42d9d48bb83d6c803b2c6d99dac29 100644 --- a/packages/checkpoint_soft_raid +++ b/packages/checkpoint_soft_raid @@ -6,6 +6,6 @@ 'name': 'checkpoint_soft_raid', 'num_files': 2, 'title': u'Check Point appliance soft RAID', - 'version': '20180731.v0.2b', + 'version': '20200608.v0.2c', 'version.min_required': '1.2.8b8', - 'version.packaged': '1.4.0p35'} \ No newline at end of file + 'version.packaged': '1.4.0p38'} \ No newline at end of file diff --git a/web/plugins/metrics/checkpoint_soft_raid.py b/web/plugins/metrics/checkpoint_soft_raid.py index 94f5fb492e61c1a83b7f139424ec18e39114c92a..53cd9cec44c0db5aecdd45b21be59639c5332ff3 100644 --- a/web/plugins/metrics/checkpoint_soft_raid.py +++ b/web/plugins/metrics/checkpoint_soft_raid.py @@ -1,24 +1,27 @@ #!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # -# Check Point soft RAID metrics plugin +# License: GNU General Public License v2 # -# Author: Th.L. +# Author: thl-cmk[at]outlook[dot]com +# URL : https://thl-cmk.hopto.org # Date : 2018-04-11 # +# Check Point soft RAID metrics plugin +# -##################################################################################################################### +############################################################################## # # define units for perfdata # -##################################################################################################################### +############################################################################## -##################################################################################################################### +############################################################################## # # define metrics for perfdata # -##################################################################################################################### +############################################################################## metric_info['checkpoint_soft_raid_disk_id_0'] = { 'title': _('Sync Disk 0'), @@ -33,22 +36,22 @@ metric_info['checkpoint_soft_raid_disk_id_1'] = { 'color': '21/a', } -###################################################################################################################### +############################################################################## # # map perfdata to metric # -###################################################################################################################### +############################################################################## check_metrics['check_mk-checkpoint_soft_raid'] = { 'disk_id_0': {'name': 'checkpoint_soft_raid_disk_id_0', }, 'disk_id_1': {'name': 'checkpoint_soft_raid_disk_id_1', } } -###################################################################################################################### +############################################################################## # # how to graph perdata # -###################################################################################################################### +############################################################################## graph_info.append({ 'title': _('Check Point soft RAID sync status'), @@ -58,11 +61,11 @@ graph_info.append({ ], }) -###################################################################################################################### +############################################################################## # # define perf-o-meter # -###################################################################################################################### +############################################################################## perfometer_info.append(('stacked', [