Skip to content

Commit a4ffe96

Browse files
committed
fix: added old Zabbix check for Windows template
1 parent 33539cc commit a4ffe96

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

mamonsu/plugins/system/windows/disk_stats.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,29 @@ def run(self, zbx):
2424
del devices
2525

2626
def discovery_rules(self, template, dashboard=False):
27+
if Plugin.Type == 'mamonsu':
28+
key_discovery = 'system.disk.discovery[]'
29+
else:
30+
key_discovery = 'system.disk.discovery'
2731
rule = {
2832
'name': 'Logical disks discovery',
29-
'key': 'system.disk.discovery[]',
30-
'filter': '{#LOGICALDEVICE}:.*'
33+
'key': key_discovery
3134
}
35+
if Plugin.old_zabbix:
36+
rule['filter'] = '{#LOGICALDEVICE}:.*'
37+
conditions = []
38+
else:
39+
conditions = [
40+
{
41+
'condition': [
42+
{'macro': '{#LOGICALDEVICE}',
43+
'value': '.*',
44+
'operator': 8,
45+
'formulaid': 'A'}
46+
]
47+
}
48+
49+
]
3250
items = [
3351
{
3452
'key': 'system.disk.read[{#LOGICALDEVICE}]',
@@ -58,4 +76,4 @@ def discovery_rules(self, template, dashboard=False):
5876
'name': 'Logical device {#LOGICALDEVICE}: queue',
5977
'yaxisside': 1}]
6078
}]
61-
return template.discovery_rule(rule=rule, items=items, graphs=graphs)
79+
return template.discovery_rule(rule=rule, conditions=conditions, items=items, graphs=graphs)

0 commit comments

Comments
 (0)