1
1
import os
2
2
from mamonsu .plugins .system .plugin import SystemPlugin as Plugin
3
3
4
- #PATH = "/etc/zabbix/scripts/agentd/zapgix"
4
+
5
+ # PATH = "/etc/zabbix/scripts/agentd/zapgix"
5
6
6
7
7
8
class DiskSizes (Plugin ):
@@ -91,12 +92,14 @@ def discovery_rules(self, template):
91
92
'key' : 'system.vfs.percent_free[{#MOUNTPOINT}]' ,
92
93
'name' : 'Mount point {#MOUNTPOINT}: free in percents' ,
93
94
'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' ),
99
95
'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 })
100
103
101
104
graphs = [{
102
105
'name' : 'Mount point overview: {#MOUNTPOINT}' ,
@@ -115,13 +118,15 @@ def discovery_rules(self, template):
115
118
'expression' : '{#TEMPLATE:system.vfs.'
116
119
'percent_free[{#MOUNTPOINT}].last'
117
120
'()}<' + self .plugin_config ('vfs_percent_free' )},
118
- {
121
+ ]
122
+ if Plugin .Type == 'mamonsu' :
123
+ triggers .append ({
119
124
'name' : 'Free inode space less then 10% on mountpoint '
120
125
'{#MOUNTPOINT} (hostname={HOSTNAME} value={ITEM.LASTVALUE})' ,
121
126
'expression' : '{#TEMPLATE:system.vfs.'
122
127
'percent_inode_free[{#MOUNTPOINT}].last'
123
128
'()}<' + self .plugin_config ('vfs_inode_percent_free' )
124
- }]
129
+ })
125
130
126
131
return template .discovery_rule (
127
132
rule = rule , items = items , graphs = graphs , triggers = triggers )
0 commit comments