Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuka committed Jun 10, 2024
1 parent 46f3b3c commit 76fa61b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion agent_based/veeam_o365jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def check_veeam_o365jobs(item, params, section):
discovery_ruleset_name='veeam_o365jobs',
discovery_ruleset_type=RuleSetType.MERGED,
discovery_default_parameters={},
check_function=discovery_veeam_o365jobs,
check_function=check_veeam_o365jobs,
check_ruleset_name='veeam_o365jobs',
check_default_parameters=VEEAM_O365JOBS_CHECK_DEFAULT_PARAMETERS,
)
2 changes: 1 addition & 1 deletion package
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
'name': 'veeam_o365',
'title': u'Veeam for Office 365 Checks',
'version': '2.7.0-0',
'version': '2.7.0-1',
'version.min_required': '2.3.0p3',
'version.packaged': '2.3.0',
'version.usable_until': '2.4.0'
Expand Down
17 changes: 15 additions & 2 deletions rulesets/check_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _parameter_form_veeam_o365jobs():
'states': DictElement(
parameter_form=Dictionary(
title=Title('State mapping'),
help=Help('Remap the job stat to different monitoring states.'),
help_text=Help('Remap the job stat to different monitoring states.'),
elements={
'Success': DictElement(
parameter_form=ServiceState(
Expand Down Expand Up @@ -103,7 +103,20 @@ def _parameter_form_veeam_o365jobs():
}
),
required=False,
)
),
'success_maxage': DictElement(
parameter_form=SimpleLevels(
title=Title('Maximal time since last successfull run'),
help_text=Help('Thresholds for last successfull run.'),
level_direction=LevelDirection.UPPER,
form_spec_template=TimeSpan(
displayed_magnitudes=[TimeMagnitude.DAY, TimeMagnitude.HOUR, TimeMagnitude.MINUTE]
),
migrate=migrate_to_float_simple_levels,
prefill_fixed_levels=InputHint(value=(86400, 172800)),
),
required=False,
),
}
)

Expand Down
26 changes: 14 additions & 12 deletions rulesets/discovery_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,29 @@
from cmk.rulesets.v1 import Help, Title
from cmk.rulesets.v1.form_specs import (
DefaultValue,
DictElement,
Dictionary,
SingleChoice,
SingleChoiceElement,
)
from cmk.rulesets.v1.rule_specs import DiscoveryParameters, Topic, HostCondition
from cmk.rulesets.v1.rule_specs import DiscoveryParameters, Topic


def _parameter_form_veeam_o365jobs_discovery():
return Dictionary(
elements={
'item_appearance': SingleChoice(
title=Title('Appearance of job'),
help_text=Help('This option lets Check_MK use either only the job name, '
'prepend it with the shortend org oder the full org.'),
elements=[
SingleChoiceElement(name='name', title=Title('Use only the job name')),
SingleChoiceElement(name='short', title=Title('Use the shortend org and the name')),
SingleChoiceElement(name='full', title=Title('Use the full org and the name')),
],
prefill=DefaultValue('name'),
'item_appearance': DictElement(
parameter_form=SingleChoice(
title=Title('Appearance of job'),
help_text=Help('This option lets Check_MK use either only the job name, '
'prepend it with the shortend org oder the full org.'),
elements=[
SingleChoiceElement(name='name', title=Title('Use only the job name')),
SingleChoiceElement(name='short', title=Title('Use the shortend org and the name')),
SingleChoiceElement(name='full', title=Title('Use the full org and the name')),
],
prefill=DefaultValue('name'),
)
)
},
)
Expand All @@ -53,5 +56,4 @@ def _parameter_form_veeam_o365jobs_discovery():
help_text=Help('This rule can be used to control the inventory for Veeam for '
'Office 365 Jobs. You can configure the service name to include'
'the Organisation.'),
condition=HostCondition(),
)

0 comments on commit 76fa61b

Please sign in to comment.