Skip to content

Commit 3b733a1

Browse files
committed
agent_based migration: q*
Change-Id: I9b671ee194445908332f329c5f6d8c2069a27ce3
1 parent 4303077 commit 3b733a1

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

cmk/base/plugins/agent_based/quantum_storage.py renamed to cmk/plugins/collection/agent_based/quantum_storage.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@
66
from collections.abc import Mapping
77
from typing import NamedTuple
88

9-
from .agent_based_api.v1 import Attributes, exists, register, Result, Service, SNMPTree, State
10-
from .agent_based_api.v1.type_defs import CheckResult, DiscoveryResult, InventoryResult, StringTable
9+
from cmk.agent_based.v2 import (
10+
Attributes,
11+
CheckPlugin,
12+
CheckResult,
13+
DiscoveryResult,
14+
exists,
15+
InventoryPlugin,
16+
InventoryResult,
17+
Result,
18+
Service,
19+
SimpleSNMPSection,
20+
SNMPTree,
21+
State,
22+
StringTable,
23+
)
1124

1225

1326
class Section(NamedTuple):
@@ -22,7 +35,7 @@ def parse_quantum_storage_info(string_table: StringTable) -> Section | None:
2235
return Section(*string_table[0]) if string_table else None
2336

2437

25-
register.snmp_section(
38+
snmp_section_snmp_quantum_storage_info = SimpleSNMPSection(
2639
name="snmp_quantum_storage_info",
2740
parse_function=parse_quantum_storage_info,
2841
fetch=SNMPTree(
@@ -62,7 +75,7 @@ def check_quantum_storage_status( # type: ignore[no-untyped-def]
6275
)
6376

6477

65-
register.check_plugin(
78+
check_plugin_quantum_storage_status = CheckPlugin(
6679
name="quantum_storage_status",
6780
sections=["snmp_quantum_storage_info"],
6881
service_name="Device status",
@@ -94,7 +107,7 @@ def inv_snmp_quantum_storage_info(section: Section) -> InventoryResult:
94107
)
95108

96109

97-
register.inventory_plugin(
110+
inventory_plugin_snmp_quantum_storage_info = InventoryPlugin(
98111
name="snmp_quantum_storage_info",
99112
inventory_function=inv_snmp_quantum_storage_info,
100113
)

0 commit comments

Comments
 (0)