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

update project

parent 9b600f76
No related branches found
No related tags found
No related merge requests found
No preview for this file type
#!/usr/bin/python #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*- # -*- encoding: utf-8; py-indent-offset: 4 -*-
# #
# 31.05.2016 : Th.L. : monitor Check Point appliance soft RAID # License: GNU General Public License v2
# 08.03.2018 : Th.L. : changed snmp scan function #
# 13.03.2018 : Th.L. : code cleanup # Author: thl-cmk[at]outlook[dot]com
# 15.03.2018 : Th.L. : more code cleanup # 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) # sample snmpwalk (one volume / two disks)
# #
...@@ -121,11 +126,9 @@ def inventory_checkpoint_soft_raid(parse): ...@@ -121,11 +126,9 @@ def inventory_checkpoint_soft_raid(parse):
disksonvolume.append(disk) disksonvolume.append(disk)
disks.remove(disk) disks.remove(disk)
yield item, [volume, disksonvolume] 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 = { raidvolumestate = {
0: 'OPTIMAL', 0: 'OPTIMAL',
1: 'DEGRADED', 1: 'DEGRADED',
...@@ -199,8 +202,6 @@ def check_checkpoint_soft_raid(item, params, parse): ...@@ -199,8 +202,6 @@ def check_checkpoint_soft_raid(item, params, parse):
return description return description
volumes, disks = parse volumes, disks = parse
disksonvolume = []
state = 0
infotext = '' infotext = ''
longoutput = '' longoutput = ''
perfdata = [] perfdata = []
...@@ -217,7 +218,7 @@ def check_checkpoint_soft_raid(item, params, parse): ...@@ -217,7 +218,7 @@ def check_checkpoint_soft_raid(item, params, parse):
if volume.get('volumestate') != 0: if volume.get('volumestate') != 0:
yield 2, 'Volume state %s' % raidvolumestate.get(volume.get('volumestate')) yield 2, 'Volume state %s' % raidvolumestate.get(volume.get('volumestate'))
else: 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 += '%s, ' % volume.get('volumetype')
infotext += '%d disks, ' % volume.get('numofdisksonraid') infotext += '%d disks, ' % volume.get('numofdisksonraid')
...@@ -230,7 +231,6 @@ def check_checkpoint_soft_raid(item, params, parse): ...@@ -230,7 +231,6 @@ def check_checkpoint_soft_raid(item, params, parse):
longoutput += 'max LBA: %d, ' % volume.get('volumemaxlba') longoutput += 'max LBA: %d, ' % volume.get('volumemaxlba')
longoutput += 'Flags: %s' % getflags(volume.get('volumeflags'), raidvolumeflags) longoutput += 'Flags: %s' % getflags(volume.get('volumeflags'), raidvolumeflags)
# disk infos # disk infos
for disk in disks: for disk in disks:
diskid = disk.get('diskid') diskid = disk.get('diskid')
...@@ -238,7 +238,7 @@ def check_checkpoint_soft_raid(item, params, parse): ...@@ -238,7 +238,7 @@ def check_checkpoint_soft_raid(item, params, parse):
if disk.get('diskstate') != 0: if disk.get('diskstate') != 0:
yield 2, 'Disk ID: %d state: %s' % (diskid, raiddiskstate.get(disk.get('diskstate'))) yield 2, 'Disk ID: %d state: %s' % (diskid, raiddiskstate.get(disk.get('diskstate')))
else: 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 += '\n%s disk (id %d): ' % (raiddiskid.get(diskid), diskid)
longoutput += 'State: %s, ' % raiddiskstate.get(disk.get('diskstate')) longoutput += 'State: %s, ' % raiddiskstate.get(disk.get('diskstate'))
...@@ -253,9 +253,9 @@ def check_checkpoint_soft_raid(item, params, parse): ...@@ -253,9 +253,9 @@ def check_checkpoint_soft_raid(item, params, parse):
perfdata.append(('disk_id_%d' % diskid, syncstate, None, None, 0, 100)) perfdata.append(('disk_id_%d' % diskid, syncstate, None, None, 0, 100))
# remove last ', ' # remove last ', '
infotext = infotext[:-2] # infotext = infotext[:-2]
yield state, infotext + longoutput, perfdata yield 0, infotext + longoutput, perfdata
check_info['checkpoint_soft_raid'] = { check_info['checkpoint_soft_raid'] = {
...@@ -264,16 +264,11 @@ check_info['checkpoint_soft_raid'] = { ...@@ -264,16 +264,11 @@ check_info['checkpoint_soft_raid'] = {
'parse_function' : parse_checkpoint_soft_raid, 'parse_function' : parse_checkpoint_soft_raid,
'default_levels_variable' : 'checkpoint_soft_raid_defaults', 'default_levels_variable' : 'checkpoint_soft_raid_defaults',
'service_description' : 'Soft RAID', 'service_description' : 'Soft RAID',
'group' : 'cp_soft_raid', '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
#'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 oid('.1.3.6.1.2.1.1.2.0').startswith('.1.3.6.1.4.1.8072.3.2.10')) and
# '.1.3.6.1.4.1.2620.1.6.123.1.65', # Appliance oid('.1.3.6.1.4.1.2620.1.6.1.0', '').lower().startswith('svn foundation'),
# '.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_info' : [('.1.3.6.1.4.1.2620.1.6.7.7.1.1', [ # CHECKPOINT-MIB::raidVolumeEntry 'snmp_info' : [('.1.3.6.1.4.1.2620.1.6.7.7.1.1', [ # CHECKPOINT-MIB::raidVolumeEntry
'1', # raidVolumeIndex '1', # raidVolumeIndex
'2', # raidVolumeID '2', # raidVolumeID
...@@ -298,5 +293,4 @@ check_info['checkpoint_soft_raid'] = { ...@@ -298,5 +293,4 @@ check_info['checkpoint_soft_raid'] = {
'11', # raidDiskSyncState '11', # raidDiskSyncState
'12', # raidDiskSize '12', # raidDiskSize
])], ])],
} }
\ No newline at end of file
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
'name': 'checkpoint_soft_raid', 'name': 'checkpoint_soft_raid',
'num_files': 2, 'num_files': 2,
'title': u'Check Point appliance soft RAID', 'title': u'Check Point appliance soft RAID',
'version': '20180731.v0.2b', 'version': '20200608.v0.2c',
'version.min_required': '1.2.8b8', 'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p35'} 'version.packaged': '1.4.0p38'}
\ No newline at end of file \ No newline at end of file
#!/usr/bin/python #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*- # -*- 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 # Date : 2018-04-11
# #
# Check Point soft RAID metrics plugin
#
##################################################################################################################### ##############################################################################
# #
# define units for perfdata # define units for perfdata
# #
##################################################################################################################### ##############################################################################
##################################################################################################################### ##############################################################################
# #
# define metrics for perfdata # define metrics for perfdata
# #
##################################################################################################################### ##############################################################################
metric_info['checkpoint_soft_raid_disk_id_0'] = { metric_info['checkpoint_soft_raid_disk_id_0'] = {
'title': _('Sync Disk 0'), 'title': _('Sync Disk 0'),
...@@ -33,22 +36,22 @@ metric_info['checkpoint_soft_raid_disk_id_1'] = { ...@@ -33,22 +36,22 @@ metric_info['checkpoint_soft_raid_disk_id_1'] = {
'color': '21/a', 'color': '21/a',
} }
###################################################################################################################### ##############################################################################
# #
# map perfdata to metric # map perfdata to metric
# #
###################################################################################################################### ##############################################################################
check_metrics['check_mk-checkpoint_soft_raid'] = { check_metrics['check_mk-checkpoint_soft_raid'] = {
'disk_id_0': {'name': 'checkpoint_soft_raid_disk_id_0', }, 'disk_id_0': {'name': 'checkpoint_soft_raid_disk_id_0', },
'disk_id_1': {'name': 'checkpoint_soft_raid_disk_id_1', } 'disk_id_1': {'name': 'checkpoint_soft_raid_disk_id_1', }
} }
###################################################################################################################### ##############################################################################
# #
# how to graph perdata # how to graph perdata
# #
###################################################################################################################### ##############################################################################
graph_info.append({ graph_info.append({
'title': _('Check Point soft RAID sync status'), 'title': _('Check Point soft RAID sync status'),
...@@ -58,11 +61,11 @@ graph_info.append({ ...@@ -58,11 +61,11 @@ graph_info.append({
], ],
}) })
###################################################################################################################### ##############################################################################
# #
# define perf-o-meter # define perf-o-meter
# #
###################################################################################################################### ##############################################################################
perfometer_info.append(('stacked', [ perfometer_info.append(('stacked', [
......
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