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
# -*- 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
......@@ -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
#!/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', [
......
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