8000 feature: updated color scheme · postgrespro/mamonsu@3cbeb49 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cbeb49

Browse files
committed
feature: updated color scheme
1 parent 00cbb21 commit 3cbeb49

25 files changed

+196
-188
lines changed

mamonsu/lib/zbx_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ZbxTemplate(object):
9191

9292
graph_items_defaults = [
9393
('sortorder', None), ('drawtype', 0),
94-
('color', '00CC00'), ('yaxisside', 0),
94+
('color', '578159'), ('yaxisside', 0),
9595
('calc_fnc', 2), ('type', Template.GRAPH_TYPE.normal)
9696
]
9797

mamonsu/plugins/pgsql/archive_command.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ class ArchiveCommand(Plugin):
5858
name = "PostgreSQL archive command {0}"
5959
Items = [
6060
# key, desc, color, side, graph
61-
("count_files_to_archive", "count files in archive_status need to archive", "FFD700", 0, 1),
62-
("size_files_to_archive", "size of files need to archive", "00FF00", 0, 0),
63-
("archived_files", "count archived files", "00F000", 0, 1),
64-
("failed_trying_to_archive", "count attempts to archive files", "FF0000", 0, 1),
61+
("count_files_to_archive", "count files in archive_status need to archive", "9C8A4E", 0, 1),
62+
("size_files_to_archive", "size of files need to archive", "6A4f5D", 0, 0),
63+
("archived_files", "count archived files", "578159", 0, 1),
64+
("failed_trying_to_archive", "count attempts to archive files", "E57862", 0, 1),
6565
]
6666
old_archived_count = None
6767
old_failed_count = None
@@ -179,7 +179,7 @@ def graphs(self, template, dashboard=False):
179179
for item in self.Items:
180180
if item[4] == 1:
181181
graph.append({
182-
"key": self.right_type(self.key, item[0]), "color": item[2], "yaxisside": item[3]
182+
"key": self.right_type(self.key, item[0]), "color": item[2], "yaxisside": item[3], "drawtype": 2
183183
})
184184
result += template.graph({
185185
"name": self.name.format("") + " archive status ",

mamonsu/plugins/pgsql/bgwriter.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ class BgWriter(Plugin):
1818

1919
("buffers_checkpoint", "bgwriter[buffers_checkpoint]",
2020
"bgwriter: buffers written during checkpoints",
21-
("PostgreSQL bgwriter", "CCCC00", 1),
21+
("PostgreSQL bgwriter", "6A4f5D", 1),
2222
Plugin.DELTA.simple_change),
2323

2424
("buffers_clean", "bgwriter[buffers_clean]",
2525
"bgwriter: buffers written",
26-
("PostgreSQL bgwriter", "0000CC", 1),
26+
("PostgreSQL bgwriter", "9C8A4E", 1),
2727
Plugin.DELTA.simple_change),
2828

2929
("maxwritten_clean", "bgwriter[maxwritten_clean]",
3030
"bgwriter: number of bgwriter stopped by max write count",
31-
("PostgreSQL bgwriter", "777777", 0),
31+
("PostgreSQL bgwriter", "8B817C", 0),
3232
Plugin.DELTA.simple_change),
3333

3434
("buffers_backend", "bgwriter[buffers_backend]",
3535
"bgwriter: buffers written directly by a backend",
36-
("PostgreSQL bgwriter", "CC0000", 1),
36+
("PostgreSQL bgwriter", "7EB29B", 1),
3737
Plugin.DELTA.simple_change),
3838

3939
("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]",
4040
"bgwriter: times a backend execute its own fsync",
41-
("PostgreSQL bgwriter", "CC00CC", 0),
41+
("PostgreSQL bgwriter", "00B0B8", 0),
4242
Plugin.DELTA.simple_change),
4343

4444
("buffers_alloc", "bgwriter[buffers_alloc]",
4545
"bgwriter: buffers allocated",
46-
("PostgreSQL bgwriter", "00CC00", 1),
46+
("PostgreSQL bgwriter", "3B415A", 1),
4747
Plugin.DELTA.simple_change)
4848
]
4949

@@ -83,12 +83,14 @@ def graphs(self, template, dashboard=False):
8383
if item[3][2] == 0:
8484
items_write_sync.append({
8585
"key": self.right_type(self.key, item[0]),
86-
"color": item[3][1]
86+
"color": item[3][1],
87+
"drawtype": 2
8788
})
8889
if item[3][2] == 1:
8990
items_buffers.append({
9091
"key": self.right_type(self.key, item[0]),
91-
"color": item[3][1]
92+
"color": item[3][1],
93+
"drawtype": 2
9294
})
9395
result = template.graph({
9496
"name": self.graph_name_buffers,

mamonsu/plugins/pgsql/cfs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ def discovery_rules(self, template, dashboard=False):
148148
items = [{
149149
"key": "pgsql.cfs.compress_ratio[{#COMPRESSED_RELATION}]",
150150
"name": "Relation {#COMPRESSED_RELATION}: compress ratio",
151-
"delay": self.timeRatioInterval
151+
"delay": self.timeRatioInterval,
152+
"drawtype": 2
152153
}]
153154
graphs = [{
154155
"name": "Relation {#COMPRESSED_RELATION}: compress ratio",
155156
"delay": self.timeRatioInterval,
156157
"items": [{
157-
"color": "00CC00",
158+
"color": "8B817C",
158159
"key": "pgsql.cfs.compress_ratio[{#COMPRESSED_RELATION}]"
159160
}]
160161
}]

mamonsu/plugins/pgsql/checkpoint.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ class Checkpoint(Plugin):
2929

3030
("checkpoints_timed", "count_timed",
3131
"checkpoints: by timeout (in hour)",
32-
("PostgreSQL checkpoint", "00CC00", 0),
32+
("PostgreSQL checkpoint", "578159", 0),
3333
Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
3434

3535
("checkpoints_req", "count_wal",
3636
"checkpoints: by wal (in hour)",
37-
("PostgreSQL checkpoint", "CC0000", 0),
37+
("PostgreSQL checkpoint", "6A4F5D", 0),
3838
Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
3939

4040
("checkpoint_write_time", "write_time",
4141
"checkpoint: write time",
42-
("PostgreSQL checkpoints", "0000CC", 1),
42+
("PostgreSQL checkpoints", "00B0B8", 1),
4343
Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
4444

4545
("checkpoint_sync_time", "checkpoint_sync_time",
4646
"checkpoint: sync time",
47-
("PostgreSQL checkpoints", "000000", 1),
47+
("PostgreSQL checkpoints", "9C8A4E", 1),
4848
Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
4949
]
5050

@@ -86,13 +86,15 @@ def graphs(self, template, dashboard=False):
8686
items_checkpoints.append({
8787
"key": self.right_type(self.key, item[1]),
8888
"color": item[3][1],
89-
"delay": self.Interval
89+
"delay": self.Interval,
90+
"drawtype": 2
9091
})
9192
if item[3][2] == 1:
9293
items_checkpoints_write_sync.append({
9394
"key": self.right_type(self.key, item[1]),
9495
"color": item[3][1],
95-
"delay": self.Interval
96+
"delay": self.Interval,
97+
"drawtype": 2
9698
})
9799
result = template.graph({
98100
"name": self.graph_name_count,

mamonsu/plugins/pgsql/connections.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ class Connections(Plugin):
1414
}
1515
# (state, key, name, graph item color)
1616
Items = [
17-
("active", "active", "number of active user connections", "00BB00"),
18-
("idle", "idle", "number of idle user connections", "0000BB"),
17+
("active", "active", "number of active user connections", "578159"),
18+
("idle", "idle", "number of idle user connections", "8B817C"),
1919
("idle in transaction", "idle_in_transaction",
20-
"number of user idle in transaction connections", "CC00CC"),
20+
"number of user idle in transaction connections", "9C8A4E"),
2121
("idle in transaction (aborted)", "idle_in_transaction_aborted",
22-
"number of user idle in transaction (aborted) connections", "CCCCCC"),
22+
"number of user idle in transaction (aborted) connections", "F6CB93"),
2323
("fastpath function call", "fastpath_function_call",
24-
"number of user fastpath function call connections", "CCCC00"),
24+
"number of user fastpath function call connections", "00B0B8"),
2525
("disabled", "disabled",
2626
"number of user disabled connections",
27-
"00CCCC")
27+
"3B415A")
2828
]
2929

3030
# for PG 10+
@@ -180,25 +180,30 @@ def graphs(self, template, dashboard=False):
180180
for item in self.Items:
181181
items.append({
182182
"key": self.right_type(self.key, item[1]),
183-
"color": item[3]
183+
"color": item[3],
184+
"drawtype": 2
184185
})
185186
items.append({
186187
"key": self.right_type(self.key, "total"),
187-
"color": "BB0000"
188+
"color": "E57862",
189+
"drawtype": 2
188190
})
189191
items.append({
190192
"key": self.right_type(self.key, "waiting"),
191-
"color": "546E7A"
193+
"color": "0082A5",
194+
"drawtype": 2
192195
})
193196
items.append({
194197
"key": self.right_type(self.key, "max_connections"),
195-
"color": "067845"
198+
"color": "FF3C47",
199+
"drawtype": 2
196200
})
197201

198202
if Pooler.server_version_greater("10.0"):
199203
items.append({
200204
"key": self.right_type(self.key, "other"),
201-
"color": "8D6E63"
205+
"color": "7EB29B",
206+
"drawtype": 2
202207
})
203208

204209
graph = {

mamonsu/plugins/pgsql/databases.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,31 @@ def discovery_rules(self, template, dashboard=False):
141141
"name": "Database: {#DATABASE} size",
142142
"type": 1,
143143
"items": [
144-
{"color": "00CC00",
145-
"key": self.right_type(self.key_db_size, var_discovery="{#DATABASE},")}]
144+
{"color": "8B817C",
145+
"key": self.right_type(self.key_db_size, var_discovery="{#DATABASE},"),
146+
"drawtype": 2}]
146147
},
147148
{
148149
"name": "Database bloating overview: {#DATABASE}",
149150
"items": [
150-
{"color": "CC0000",
151-
"key": self.right_type(self.key_db_bloating_tables, var_discovery="{#DATABASE},")},
152-
{"color": "00CC00",
151+
{"color": "7EB29B",
152+
"key": self.right_type(self.key_db_bloating_tables, var_discovery="{#DATABASE},"),
153+
"drawtype": 2},
154+
{"color": "6A4F5D",
153155
"key": self.right_type(self.key_autovacumm),
154-
"yaxisside": 1}]
156+
"yaxisside": 1,
157+
"drawtype": 2}]
155158
},
156159
{
157160
"name": "Database max age overview: {#DATABASE}",
158161
"items": [
159-
{"color": "CC0000",
160-
"key": self.right_type(self.key_db_age, var_discovery="{#DATABASE},")},
161-
{"color": "00CC00",
162+
{"color": "7EB29B",
163+
"key": self.right_type(self.key_db_age, var_discovery="{#DATABASE},"),
164+
"drawtype": 2},
165+
{"color": "6A4F5D",
162166
"key": self.right_type(self.key_autovacumm),
163-
"yaxisside": 1}]
167+
"yaxisside": 1,
168+
"drawtype": 2}]
164169
}]
165170
triggers = [{
166171
"name": "PostgreSQL invalid indexes in database {#DATABASE} (hostname={HOSTNAME} value={ITEM.LASTVALUE})",

mamonsu/plugins/pgsql/instance.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,54 @@ class Instance(Plugin):
1818
# ('graph name', color, side), units, delta
1919

2020
("xact_commit", "transactions[committed]", "transactions: committed",
21-
("PostgreSQL instance: transactions rate", "0000CC", 0),
21+
("PostgreSQL instance: transactions rate", "578159", 0),
2222
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
2323
("blks_hit", "blocks[hit]", "blocks: hit",
24-
("PostgreSQL instance: blocks rate", "00CC00", 0),
24+
("PostgreSQL instance: blocks rate", "7EB29B", 0),
2525
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
2626
("blks_read", "blocks[read]", "blocks: read",
27-
("PostgreSQL instance: blocks rate", "CC0000", 0),
27+
("PostgreSQL instance: blocks rate", "6A4F5D", 0),
2828
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
2929

3030
("conflicts", "events[conflicts]", "event: conflicts",
31-
("PostgreSQL instance: events", "0000CC", 0),
31+
("PostgreSQL instance: events", "9C8A4E", 0),
3232
Plugin.UNITS.none, Plugin.DELTA.simple_change),
3333
("deadlocks", "events[deadlocks]", "event: deadlocks",
34-
("PostgreSQL instance: events", "000000", 0),
34+
("PostgreSQL instance: events", "3B415A", 0),
3535
Plugin.UNITS.none, Plugin.DELTA.simple_change),
3636
("xact_rollback", "events[xact_rollback]", "event: rollbacks",
37-
("PostgreSQL instance: transactions rate", "CC0000", 0),
37+
("PostgreSQL instance: transactions rate", "E57862", 0),
3838
Plugin.UNITS.none, Plugin.DELTA.simple_change),
3939

4040
("temp_bytes", "temp[bytes]", "temp: bytes written",
41-
("PostgreSQL instance: temp files", "CC0000", 0),
41+
("PostgreSQL instance: temp files", "00B0B8", 0),
4242
Plugin.UNITS.bytes, Plugin.DELTA.simple_change),
4343
("temp_files", "temp[files]", "temp: files created",
44-
("PostgreSQL instance: temp files", "0000CC", 1),
44+
("PostgreSQL instance: temp files", "0082A5", 1),
4545
Plugin.UNITS.none, Plugin.DELTA.simple_change),
4646

4747
# stacked
4848
("tup_deleted", "tuples[deleted]", "tuples: deleted",
49-
("PostgreSQL instance: tuples", "000000", 0),
49+
("PostgreSQL instance: tuples", "3B415A", 0),
5050
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
5151
("tup_fetched", "tuples[fetched]", "tuples: fetched",
52-
("PostgreSQL instance: tuples", "0000CC", 0),
52+
("PostgreSQL instance: tuples", "7EB29B", 0),
5353
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
5454
("tup_inserted", "tuples[inserted]", "tuples: inserted",
55-
("PostgreSQL instance: tuples", "00CC00", 0),
55+
("PostgreSQL instance: tuples", "00B0B8", 0),
5656
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
5757
("tup_returned", "tuples[returned]", "tuples: returned",
58-
("PostgreSQL instance: tuples", "CC00CC", 1),
58+
("PostgreSQL instance: tuples", "9C8A4E", 1),
5959
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
6060
("tup_updated", "tuples[updated]", "tuples: updated",
61-
("PostgreSQL instance: tuples", "CC0000", 0),
61+
("PostgreSQL instance: tuples", "6A4F5F", 0),
6262
Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
6363
]
6464
Items_pg_12 = [
6565
# key, zbx_key, description,
6666
# ('graph name', color, side), units, delta
6767
("checksum_failures", "events[checksum_failures]", "event: checksum_failures",
68-
("PostgreSQL instance: events", "00FF00", 0),
68+
("PostgreSQL instance: events", "6A4F5D", 0),
6969
Plugin.UNITS.none, Plugin.DELTA.simple_change)
7070
]
7171

@@ -161,7 +161,8 @@ def graphs(self, template, dashboard=False):
161161
items.append({
162162
"key": self.right_type(self.key + keys[0] + "{0}", keys[1][:-1]),
163163
"color": item[3][1],
164-
"yaxisside": item[3][2]
164+
"yaxisside": item[3][2],
165+
"drawtype": 2
165166
})
166167
graph = {
167168
"name": name,

mamonsu/plugins/pgsql/pg_buffercache.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class PgBufferCache(Plugin):
2323
query = [query_agent_size, query_agent_twice_used, query_agent_dirty]
2424
Items = [
2525
# key, name, color
26-
("size", "PostgreSQL: shared buffer size", "0000CC"),
27-
("twice_used", "PostgreSQL: shared buffer twice used size", "CC0000"),
28-
("dirty", "PostgreSQL: shared buffer dirty size", "00CC00")
26+
("size", "PostgreSQL: shared buffer size", "E57862"),
27+
("twice_used", "PostgreSQL: shared buffer twice used size", "7EB29B"),
28+
("dirty", "PostgreSQL: shared buffer dirty size", "6A4F5D")
2929
]
3030

3131
graph_name = "PostgreSQL: shared buffer"
@@ -56,7 +56,8 @@ def graphs(self, template, dashboard=False):
5656
for item in self.Items:
5757
items.append({
5858
"key": self.right_type(self.key, item[0]),
59-
"color": item[2]})
59+
"color": item[2],
60+
"drawtype": 2})
6061
if not dashboard:
6162
return template.graph({
6263
"name": self.graph_name,

0 commit comments

Comments
 (0)
0