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

Delete checkpoint_powersupply

parent 12f40c42
No related branches found
No related tags found
No related merge requests found
#!/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
# Date : 2018-07-31
#
# Monitor status of Check Point appliance power supply
#
# 2020-06-08: changed snmp-scan function
#
# ToDo: remove VSX...
#
# sample snmpwalk (two power supplys)
#
# CHECKPOINT-MIB::powerSupplyIndex.1.0 = INTEGER: 1
# CHECKPOINT-MIB::powerSupplyIndex.2.0 = INTEGER: 2
# CHECKPOINT-MIB::powerSupplyStatus.1.0 = STRING: Up
# CHECKPOINT-MIB::powerSupplyStatus.2.0 = STRING: Up
#
#
# .1.3.6.1.4.1.2620.1.6.7.9.1.1.1.1.0 = INTEGER: 1
# .1.3.6.1.4.1.2620.1.6.7.9.1.1.1.2.0 = INTEGER: 2
# .1.3.6.1.4.1.2620.1.6.7.9.1.1.2.1.0 = STRING: Up
# .1.3.6.1.4.1.2620.1.6.7.9.1.1.2.2.0 = STRING: Up
#
#
# sample info
# two power supplys
# [[u'1', u'Up'], [u'2', u'Up']]
#
#
factory_settings['checkpoint_powersupply_defaults'] = {
}
def inventory_checkpoint_powersupply(info):
for powersupply in info:
psindex, psstatus = powersupply
if psindex.isdigit():
yield psindex, {}
def check_checkpoint_powersupply(item, params, info):
for powersupply in info:
psindex, psstatus = powersupply
if psindex == item:
state = 0
infotext = ''
longoutput = ''
infotext = 'Status: %s' % psstatus
if psstatus.lower() != 'up':
status = 2
return state, infotext + longoutput
check_info['checkpoint_powersupply'] = {
'check_function' : check_checkpoint_powersupply,
'inventory_function' : inventory_checkpoint_powersupply,
'default_levels_variable' : 'checkpoint_powersupply_defaults',
'service_description' : 'Power supply %s',
'group' : 'cp_powersupply',
'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.9.1.1', [ # CHECKPOINT-MIB::powerSupplyEntry
'1', # powerSupplyIndex
'2', # powerSupplyStatus
]),
}
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