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

update project

parent 1d714844
No related branches found
No related tags found
No related merge requests found
File added
No preview for this file type
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2019-10-28
#
# Cisco flash metrics plugin
#
# change log
# 2019-10-28: initial release
# 2021-07-31: rewritten for CMK 2.0
#
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics.utils import (
metric_info,
graph_info,
perfometer_info
)
metric_info['cisco_flash_partusedspace'] = {
'title': _('Sapce used'),
'unit': 'bytes',
'color': '36/a',
}
metric_info['cisco_flash_percent_used'] = {
'title': _('Percent used'),
'unit': '%',
'color': '26/a',
}
metric_info['cisco_flash_partfilecount'] = {
'title': _('# of files'),
'unit': 'count',
'color': '21/a',
}
graph_info['cisco_flash_space_used'] = {
'title': _('Space used'),
'metrics': [
('cisco_flash_partusedspace', 'area'),
],
'scalars': [
('cisco_flash_partusedspace:crit', _('crit')),
('cisco_flash_partusedspace:warn', _('warn')),
],
"range": (0, "cisco_flash_partusedspace:max"),
}
graph_info['cisco_flash_percent_used'] = {
'title': _('Percent used'),
'metrics': [
('cisco_flash_percent_used', 'area'),
],
'scalars': [
('cisco_flash_percent_used:crit', _('crit')),
('cisco_flash_percent_used:warn', _('warn')),
],
"range": (0, 100),
}
graph_info['cisco_flash_files_on_partition'] = {
'title': _('# of files on partition'),
'metrics': [
('cisco_flash_partfilecount', 'area'),
],
}
perfometer_info.append(('stacked', [
{
'type': 'linear',
'segments': ['cisco_flash_percent_used'],
'total': 100,
},
{
'type': 'linear',
'segments': ['cisco_flash_partfilecount'],
'total': 100000,
}
]))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from cmk.gui.plugins.views.utils import (
inventory_displayhints,
)
from cmk.gui.i18n import _
from cmk.gui.plugins.views.inventory import declare_invtable_view
inventory_displayhints.update({
'.hardware.components.flash.devices:': {
'title': _('Flash devices'),
'keyorder': ['index', 'name', 'description', 'size', ],
'view': 'invflashdevices_of_host',
},
'.hardware.components.flash.devices:*.index': {'title': _('Index'), },
'.hardware.components.flash.devices:*.size': {'title': _('Size (MB)'), },
'.hardware.components.flash.devices:*.minpartitionsize': {'title': _('min. partition size (MB)'), },
'.hardware.components.flash.devices:*.maxprtitions': {'title': _('max. partitions'), },
'.hardware.components.flash.devices:*.chipcount': {'title': _('Chip count'), },
'.hardware.components.flash.devices:*.name': {'title': _('Name'), },
'.hardware.components.flash.devices:*.description': {'title': _('Description'), },
'.hardware.components.flash.devices:*.controller': {'title': _('Controller'), },
'.hardware.components.flash.devices:*.programmingjumper': {'title': _('Programming jumper'), },
'.hardware.components.flash.devices:*.inittime': {'title': _('Init time'), },
'.hardware.components.flash.devices:*.removable': {'title': _('Removable'), },
'.hardware.components.flash.devices:*.physentindex': {'title': _('Phys entity index'), },
'.hardware.components.flash.devices:*.nameextended': {'title': _('Name extended'), },
'.hardware.components.flash.chips:': {
'title': _('Flash chips'),
'keyorder': ['flashindex', 'index', 'description', ],
'view': 'invflashchips_of_host',
},
'.hardware.components.flash.chips:*.index': {'title': _('Chip index'), },
'.hardware.components.flash.chips:*.flashindex': {'title': _('Device index'), },
'.hardware.components.flash.chips:*.code': {'title': _('Code'), },
'.hardware.components.flash.chips:*.description': {'title': _('Description'), },
'.hardware.components.flash.chips:*.writeretries': {'title': _('Write retries'), },
'.hardware.components.flash.chips:*.eraseretries': {'title': _('Erase retries'), },
'.hardware.components.flash.chips:*.maxwriteretries': {'title': _('max. write retries'), },
'.hardware.components.flash.chips:*.maxeraseretries': {'title': _('max. erasure retries'), },
'.hardware.components.flash.partitions:': {
'title': _('Flash partitions'),
'keyorder': ['flashindex', 'index', 'name', 'size', 'freespace', 'filecount', ],
'view': 'invflashpartitions_of_host',
},
'.hardware.components.flash.partitions:*.index': {'title': _('Partition index'), },
'.hardware.components.flash.partitions:*.flashindex': {'title': _('Device index'), },
'.hardware.components.flash.partitions:*.startchip': {'title': _('Start chip'), },
'.hardware.components.flash.partitions:*.endchip': {'title': _('End chip'), },
'.hardware.components.flash.partitions:*.size': {'title': _('Size (MB)'), },
'.hardware.components.flash.partitions:*.freespace': {'title': _('Free space (MB)'), },
'.hardware.components.flash.partitions:*.filecount': {'title': _('File count'), },
'.hardware.components.flash.partitions:*.crcsumalgo': {'title': _('Checksumm algorithm'), },
'.hardware.components.flash.partitions:*.status': {'title': _('Status'), },
'.hardware.components.flash.partitions:*.upgrademethod': {'title': _('Upgrade method'), },
'.hardware.components.flash.partitions:*.name': {'title': _('Name'), },
'.hardware.components.flash.partitions:*.neederasure': {'title': _('Need erasure'), },
'.hardware.components.flash.partitions:*.filenamelength': {'title': _('File name length'), },
'.hardware.components.flash.partitions:*.lowspacenotifythreshold': {'title': _('Low space notify threshold (%)'), },
})
declare_invtable_view('invflashdevices', '.hardware.components.flash.devices:', _('Flash devices'), _('Flash devices'))
declare_invtable_view('invflashchips', '.hardware.components.flash.chips:', _('Flash chips'), _('Flash chips'))
declare_invtable_view('invflashpartitions', '.hardware.components.flash.partitions:', _('Flash partitions'),
_('Flash partitions'))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2019-11-04
#
#
# Check_MK cisco_flash WATO plugin
#
# 2019-11-04: initial release
# 2021-07-31: rewritten for CMK 2.0
#
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Integer,
TextAscii,
Tuple,
)
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _parameter_valuespec_cisco_flash():
return Dictionary(
elements=[
('levels_upper_percent',
Tuple(
title=_('Levels for usage in %'),
elements=[
Integer(title=_('Warning at'), unit='%', default_value=85, minvalue=0, maxvalue=100),
Integer(title=_('Critical at'), unit='%', default_value=90, minvalue=0, maxvalue=100)
],
)),
],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='cisco_flash',
group=RulespecGroupCheckParametersNetworking,
item_spec=lambda: TextAscii(title=_('Partition specific configuration'), ),
match_type='dict',
parameter_valuespec=_parameter_valuespec_cisco_flash,
title=lambda: _('Cisco flash'),
))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2019-10-28
#
# Cisco flash metrics plugin
#
# change log
# 2019-10-28: initial release
# 2021-07-31: rewritten for CMK 2.0
from cmk.gui.i18n import _
from cmk.gui.plugins.wato.utils import (
HostRulespec,
rulespec_registry,
)
from cmk.gui.valuespec import (
Dictionary,
FixedValue,
ListChoice,
)
from cmk.gui.plugins.wato.inventory import (
RulespecGroupInventory,
)
_inv_cisco_flash_cflDeviceRemovecolumns = [
('minpartitionsize', 'min. partition size (MB)'),
('maxprtitions', 'max. partitions'),
('chipcount', 'Chip count'),
('controller', 'Controller'),
('programmingjumper', 'Programming jumper'),
('inittime', 'Init time'),
('removable', 'Removable'),
('physentindex', 'Phys entity index'),
('nameextended', 'Name extended'),
]
_inv_cisco_flash_cflPartitionRemovecolumns = [
('startchip', 'Start chip'),
('endchip', 'End chip'),
('crcsumalgo', 'Checksumm algorithm'),
('status', 'Status'),
('upgrademethod', 'Upgrade method'),
('neederasure', 'Need erasure'),
('filenamelength', 'File name length'),
('lowspacenotifythreshold', 'Low space notify threshold (%)'),
]
_inv_cisco_flash_cflChipRemovecolumns = [
('code', 'Code'),
('writeretries', 'Write retries'),
('eraseretries', 'Erase retries'),
('maxwriteretries', 'max. write retries'),
('maxeraseretries', 'max. erasure retries'),
]
def _valuespec_inv_cisco_flash():
return Dictionary(
title=_('Cisco flash inventory'),
elements=[
('cflDeviceDisable',
FixedValue(
True,
title=_('disable Flash device inventory'),
)),
('cflPartitionDisable',
FixedValue(
True,
title=_('disable Flash partition inventory'),
)),
('cflChipDisable',
FixedValue(
True,
title=_('disable Flash chips inventory'),
)),
('cflDeviceRemovecolumns',
ListChoice(
title=_('list of columns to remove from flash devices'),
help=_('information to remove from inventory'),
choices=_inv_cisco_flash_cflDeviceRemovecolumns,
default_value=[
'chipcount',
'controller',
'programmingjumper',
'inittime',
'physentindex',
'nameextended',
],
)),
('cflPartitionRemovecolumns',
ListChoice(
title=_('list of columns to remove from flash partitions'),
help=_('information to remove from inventory'),
choices=_inv_cisco_flash_cflPartitionRemovecolumns,
default_value=[
'startchip',
'endchip',
],
)),
('cflChipRemovecolumns',
ListChoice(
title=_('list of columns to remove from flash chips'),
help=_('information to remove from inventory'),
choices=_inv_cisco_flash_cflChipRemovecolumns,
default_value=[
'code',
'writeretries',
'eraseretries',
'maxwriteretries',
'maxeraseretries'
],
)),
],
)
rulespec_registry.register(
HostRulespec(
group=RulespecGroupInventory,
match_type='dict',
name='inv_parameters:inv_cisco_flash',
valuespec=_valuespec_inv_cisco_flash,
))
...@@ -7,15 +7,13 @@ ...@@ -7,15 +7,13 @@
'- 2021-07-31: rewritten for CMK 2.0\n', '- 2021-07-31: rewritten for CMK 2.0\n',
'download_url': 'https://thl-cmk.hopto.org', 'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_flash.py', 'inv_cisco_flash.py'], 'files': {'agent_based': ['cisco_flash.py', 'inv_cisco_flash.py'],
'checkman': ['cisco_flash'], 'gui': ['metrics/cisco_flash.py',
'web': ['plugins/metrics/cisco_flash.py', 'views/inv_cisco_flash.py',
'plugins/views/inv_cisco_flash.py', 'wato/cisco_flash.py',
'plugins/wato/cisco_flash.py', 'wato/inv_cisco_flash.py']},
'plugins/wato/inv_cisco_flash.py']},
'name': 'cisco_flash', 'name': 'cisco_flash',
'num_files': 7,
'title': 'Cisco flash plugins', 'title': 'Cisco flash plugins',
'version': '20210731.v.0.3', 'version': '0.3.0-20230607',
'version.min_required': '2.0.0', 'version.min_required': '2.1.0b1',
'version.packaged': '2021.09.20', 'version.packaged': '2.1.0p21',
'version.usable_until': None} 'version.usable_until': None}
\ No newline at end of file
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