Skip to content

Commit 2e3d467

Browse files
committed
refactoring: fixed trigger and discoveries names
1 parent f45fb56 commit 2e3d467

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

mamonsu/plugins/common/health.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ def items(self, template, dashboard=False):
5555
def triggers(self, template, dashboard=False):
5656
if self.Type == "mamonsu":
5757
result = template.trigger({
58-
"name": "Mamonsu plugin errors on {HOSTNAME}. {ITEM.LASTVALUE}",
58+
"name": "Mamonsu health: plugin errors on {HOSTNAME}. {ITEM.LASTVALUE}",
5959
"expression": "{#TEMPLATE:mamonsu.plugin.errors[].strlen()}>1"
6060
}) + template.trigger({
61-
"name": "Mamonsu nodata from {HOSTNAME}",
61+
"name": "Mamonsu health: nodata from {HOSTNAME}",
6262
"expression": "{#TEMPLATE:" + self.right_type("mamonsu.plugin.keepalive{0}") + ".nodata(180)}=1"
6363
})
6464
if platform.LINUX:
6565
result += template.trigger({
66-
"name": "Mamonsu agent memory usage alert on {HOSTNAME}: {ITEM.LASTVALUE} bytes",
66+
"name": "Mamonsu health: agent memory usage alert on {HOSTNAME}: {ITEM.LASTVALUE} bytes",
6767
"expression": "{#TEMPLATE:mamonsu.memory.rss[max].last()}>" + self.plugin_config(
6868
"max_memory_usage")
6969
})
7070
else:
7171
result = template.trigger({
72-
"name": "Mamonsu nodata from {HOSTNAME}",
72+
"name": "Mamonsu health: nodata from {HOSTNAME}",
7373
"expression": "{#TEMPLATE:" + self.right_type("mamonsu.plugin.keepalive{0}") + ".nodata(180)}=1"
7474
})
7575
return result

mamonsu/plugins/pgsql/databases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def discovery_rules(self, template, dashboard=False):
101101
}]
102102
items = [
103103
{"key": self.right_type(self.key_db_size, var_discovery="{#DATABASE},"),
104-
"name": "PostgreSQL Databases {#DATABASE}: size",
104+
"name": "PostgreSQL Databases: {#DATABASE} size",
105105
"units": Plugin.UNITS.bytes,
106106
"value_type": Plugin.VALUE_TYPE.numeric_unsigned,
107107
"delay": self.plugin_config("interval")},

mamonsu/plugins/pgsql/replication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ def items(self, template, dashboard=False):
112112

113113
def triggers(self, template, dashboard=False):
114114
triggers = template.trigger({
115-
"name": "PostgreSQL streaming lag too high on {HOSTNAME} (value={ITEM.LASTVALUE})",
115+
"name": "PostgreSQL Replication: streaming lag too high on {HOSTNAME} (value={ITEM.LASTVALUE})",
116116
"expression": "{#TEMPLATE:" + self.right_type(self.key_replication,
117117
"sec") + ".last()}>" + self.plugin_config(
118118
"lag_more_than_in_sec")
119119
}) + template.trigger({
120-
"name": "PostgreSQL number of non-active replication slots on {HOSTNAME} (value={ITEM.LASTVALUE})",
120+
"name": "PostgreSQL Replication: number of non-active replication slots on {HOSTNAME} (value={ITEM.LASTVALUE})",
121121
"expression": "{#TEMPLATE:" + self.right_type(self.key_non_active_slots) + ".last()}>" + str(
122122
NUMBER_NON_ACTIVE_SLOTS)
123123
})

mamonsu/plugins/system/linux/disk_sizes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def discovery_rules(self, template, dashboard=False):
6161
else:
6262
key_discovery = "system.vfs.discovery"
6363
rule = {
64-
"name": "VFS Discovery",
64+
"name": "System: VFS Discovery",
6565
"key": key_discovery
6666
}
6767
if Plugin.old_zabbix:
@@ -136,7 +136,7 @@ def discovery_rules(self, template, dashboard=False):
136136

137137
triggers = [
138138
{
139-
"name": "Free disk space less than 10% on mountpoint "
139+
"name": "System: free disk space less than 10% on mountpoint "
140140
"{#MOUNTPOINT} (hostname={HOSTNAME} value={ITEM.LASTVALUE})",
141141
"expression": "{#TEMPLATE:system.vfs."
142142
"percent_free[{#MOUNTPOINT}].last"
@@ -147,7 +147,7 @@ def discovery_rules(self, template, dashboard=False):
147147
if Plugin.Type == "mamonsu":
148148
triggers.append(
149149
{
150-
"name": "Free inode space less than 10% on mountpoint "
150+
"name": "System: free inode space less than 10% on mountpoint "
151151
"{#MOUNTPOINT} (hostname={HOSTNAME} value={ITEM.LASTVALUE})",
152152
"expression": "{#TEMPLATE:system.vfs.percent_inode_free[{#MOUNTPOINT}].last"
153153
"()}<" + self.plugin_config("vfs_inode_percent_free")

mamonsu/plugins/system/linux/net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def discovery_rules(self, template, dashboard=False):
5050
})
5151

5252
rule = {
53-
"name": "Net Iface Discovery",
53+
"name": "System: net Iface Discovery",
5454
"key": key_discovery
5555
}
5656
if Plugin.old_zabbix:

mamonsu/plugins/system/linux/pg_probackup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def run(self, zbx):
107107

108108
def discovery_rules(self, template, dashboard=False):
109109
rule = {
110-
"name": "pg_probackup discovery",
110+
"name": "pg_probackup Discovery",
111111
"key": self.key_main.format("[{0}]".format(self.Macros[self.Type])),
112112
}
113113
if Plugin.old_zabbix:
@@ -129,21 +129,21 @@ def discovery_rules(self, template, dashboard=False):
129129
items = [
130130
{
131131
"key": self.right_type(self.key_dir_size, var_discovery="{#BACKUPDIR},"),
132-
"name": "pg_probackup dir {#BACKUPDIR}: size",
132+
"name": "pg_probackup dir {#BACKUPDIR}: Size",
133133
"units": Plugin.UNITS.bytes,
134134
"value_type": Plugin.VALUE_TYPE.numeric_unsigned,
135135
"delay": self.plugin_config("interval")
136136
},
137137
{
138138
"key": self.right_type(self.key_dir_error, var_discovery="{#BACKUPDIR},"),
139-
"name": "pg_probackup dir {#BACKUPDIR}: error",
139+
"name": "pg_probackup dir {#BACKUPDIR}: Error",
140140
"value_type": Plugin.VALUE_TYPE.text,
141141
"delay": self.plugin_config("interval")
142142
},
143143
]
144144
graphs = [
145145
{
146-
"name": "pg_probackup backup dir: {#BACKUPDIR} size",
146+
"name": "pg_probackup Backup dir: {#BACKUPDIR} Size",
147147
"type": 1,
148148
"items": [
149149
{
@@ -156,7 +156,7 @@ def discovery_rules(self, template, dashboard=False):
156156
]
157157
triggers = [
158158
{
159-
"name": "Error in pg_probackup dir {#BACKUPDIR} (hostname={HOSTNAME} value={ITEM.LASTVALUE})",
159+
"name": "pg_probackup: error in dir {#BACKUPDIR} (hostname={HOSTNAME} value={ITEM.LASTVALUE})",
160160
"expression": "{#TEMPLATE:pg_probackup.dir.error[{#BACKUPDIR}].str(ok)}<>1"
161161
}
162162
]

mamonsu/plugins/system/linux/proc_stat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def graphs(self, template, dashboard=False):
142142
def triggers(self, template, dashboard=False):
143143
return template.trigger(
144144
{
145-
"name": "Process fork-rate too frequently on {HOSTNAME}",
145+
"name": "System: process fork-rate too frequently on {HOSTNAME}",
146146
"expression": "{#TEMPLATE:" + self.right_type("system.processes{0}", "forkrate") +
147147
".min(5m)}>" + str(self.ForkRate)
148148
}

mamonsu/plugins/system/linux/uptime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def items(self, template, dashboard=False):
2727
def triggers(self, template, dashboard=False):
2828
return template.trigger(
2929
{
30-
"name": "System was restarted on {HOSTNAME} (uptime={ITEM.LASTVALUE})",
30+
"name": "System: {HOSTNAME} was restarted (uptime={ITEM.LASTVALUE})",
3131
"expression": "{#TEMPLATE:" + self.right_type(self.key) + ".last()}<" + self.plugin_config("uptime")
3232
}
3333
)

mamonsu/plugins/system/windows/cpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ def graphs(self, template, dashboard=False):
6464

6565
def triggers(self, template, dashboard=False):
6666
return template.trigger({
67-
"name": "CPU privileged time is too big on {HOSTNAME}",
67+
"name": "System: CPU privileged time is too big on {HOSTNAME}",
6868
"expression": "{#TEMPLATE:system.cpu[privileged_time].last()}>" + str(self.MaxPrivilegedTime)
6969
})

0 commit comments

Comments
 (0)