Skip to content

Commit a203518

Browse files
committed
fix: exclude percent inode free metric from native zabbix agent template
1 parent 9df0a69 commit a203518

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

mamonsu/plugins/system/linux/disk_sizes.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
22
from mamonsu.plugins.system.plugin import SystemPlugin as Plugin
33

4-
#PATH = "/etc/zabbix/scripts/agentd/zapgix"
4+
5+
# PATH = "/etc/zabbix/scripts/agentd/zapgix"
56

67

78
class DiskSizes(Plugin):
@@ -91,12 +92,14 @@ def discovery_rules(self, template):
9192
'key': 'system.vfs.percent_free[{#MOUNTPOINT}]',
9293
'name': 'Mount point {#MOUNTPOINT}: free in percents',
9394
'delay': self.plugin_config('interval'),
94-
'units': Plugin.UNITS.percent},
95-
{
96-
'key': 'system.vfs.percent_inode_free[{#MOUNTPOINT}]',
97-
'name': 'Mount point {#MOUNTPOINT}: free inodes in percent',
98-
'delay': self.plugin_config('interval'),
9995
'units': Plugin.UNITS.percent}]
96+
if Plugin.Type == 'mamonsu':
97+
items.append(
98+
{
99+
'key': 'system.vfs.percent_inode_free[{#MOUNTPOINT}]',
100+
'name': 'Mount point {#MOUNTPOINT}: free inodes in percent',
101+
'delay': self.plugin_config('interval'),
102+
'units': Plugin.UNITS.percent})
100103

101104
graphs = [{
102105
'name': 'Mount point overview: {#MOUNTPOINT}',
@@ -115,13 +118,15 @@ def discovery_rules(self, template):
115118
'expression': '{#TEMPLATE:system.vfs.'
116119
'percent_free[{#MOUNTPOINT}].last'
117120
'()}<' + self.plugin_config('vfs_percent_free')},
118-
{
121+
]
122+
if Plugin.Type == 'mamonsu':
123+
triggers.append({
119124
'name': 'Free inode space less then 10% on mountpoint '
120125
'{#MOUNTPOINT} (hostname={HOSTNAME} value={ITEM.LASTVALUE})',
121126
'expression': '{#TEMPLATE:system.vfs.'
122127
'percent_inode_free[{#MOUNTPOINT}].last'
123128
'()}<' + self.plugin_config('vfs_inode_percent_free')
124-
}]
129+
})
125130

126131
return template.discovery_rule(
127132
rule=rule, items=items, graphs=graphs, triggers=triggers)

0 commit comments

Comments
 (0)