Skip to content

Commit

Permalink
Fix new linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuka committed Jun 10, 2024
1 parent d6f53b6 commit b81b007
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions agent_based/veeam_o365jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# 01234567-89ab-cdef-0123-456789abcdef cmk.onmicrosoft.com Outlook Online Success 29.05.2020 16:45:46 29.05.2020 16:47:55 128.7511818 191 142
# 12345678-9abc-def0-1234-56789abcdef0 cmk.onmicrosoft.com Outlook Online2 Failed 29.05.2020 16:45:46 29.05.2020 16:47:55 128.7511818

from dataclasses import dataclass
from typing import Optional
from cmk.agent_based.v2 import (
Service,
Result,
Expand All @@ -29,8 +31,9 @@
render,
CheckPlugin,
RuleSetType,
StringTable,
AgentSection,
)
from .agent_based_api.v1.type_defs import StringTable

VEEAM_O365JOBS_CHECK_DEFAULT_PARAMETERS = {
'states': {
Expand Down Expand Up @@ -83,7 +86,7 @@ def parse_veeam_o365jobs(string_table: StringTable) -> dict[str, VeeamO365Job]:
return parsed


register.agent_section(
agent_section_veeam_o365jobs = AgentSection(
name='veeam_o365jobs',
parse_function=parse_veeam_o365jobs,
)
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/agent_based/test_veeam_o356jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,31 +166,31 @@ def test_discovery_veeam_o365jobs(params, section, result):
]
),
(
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': (500, 600)},
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': ('fixed', (500, 600))},
[
Result(state=State.OK, summary='Running since: 5 minutes 14 seconds'),
Result(state=State.OK, notice='Last Success: 1 day 1 hour'),
Metric('age', 90041.0),
]
),
(
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': (120, 600)},
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': ('fixed', (120, 600))},
[
Result(state=State.WARN, summary='Running since: 5 minutes 14 seconds (warn/crit at 2 minutes 0 seconds/10 minutes 0 seconds)'),
Result(state=State.OK, notice='Last Success: 1 day 1 hour'),
Metric('age', 90041.0),
]
),
(
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': (120, 300)},
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'duration': ('fixed', (120, 300))},
[
Result(state=State.CRIT, summary='Running since: 5 minutes 14 seconds (warn/crit at 2 minutes 0 seconds/5 minutes 0 seconds)'),
Result(state=State.OK, notice='Last Success: 1 day 1 hour'),
Metric('age', 90041.0),
]
),
(
'cmk.onmicrosoft.com Outlook Online', {'jobId': '01234567-89ab-cdef-0123-456789abcdef', 'success_maxage': (1800, 504000)},
'cmk.onmicrosoft.com Outlook Online', {'jobId': '01234567-89ab-cdef-0123-456789abcdef', 'success_maxage': ('fixed', (1800, 504000))},
[
Result(state=State.OK, summary='Status: Success'),
Result(state=State.OK, summary='Transferred Items: 191.00'),
Expand All @@ -204,7 +204,7 @@ def test_discovery_veeam_o365jobs(params, section, result):
]
),
(
'cmk.onmicrosoft.com Outlook Online', {'jobId': '01234567-89ab-cdef-0123-456789abcdef', 'success_maxage': (1800, 3600)},
'cmk.onmicrosoft.com Outlook Online', {'jobId': '01234567-89ab-cdef-0123-456789abcdef', 'success_maxage': ('fixed', (1800, 3600))},
[
Result(state=State.OK, summary='Status: Success'),
Result(state=State.OK, summary='Transferred Items: 191.00'),
Expand All @@ -218,7 +218,7 @@ def test_discovery_veeam_o365jobs(params, section, result):
]
),
(
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'success_maxage': (86400, 504000)},
'cmk.onmicrosoft.com Outlook Online3', {'jobId': '23456789-abcd-ef01-2345-6789abcdef01', 'success_maxage': ('fixed', (86400, 504000))},
[
Result(state=State.OK, summary='Running since: 5 minutes 14 seconds'),
Result(state=State.WARN, summary='Last Success: 1 day 1 hour (warn/crit at 1 day 0 hours/5 days 20 hours)'),
Expand Down

0 comments on commit b81b007

Please sign in to comment.