Skip to content

Commit 1d4153f

Browse files
committed
feature: add Windows System screen
1 parent bfefac8 commit 1d4153f

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

mamonsu/lib/zbx_template.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,18 @@ class ZbxTemplate(object):
133133
dashboard_page_wal = {'name': 'PostgreSQL WAL', 'hsize': 2, 'vsize': 5}
134134
dashboard_page_locks = {'name': 'PostgreSQL Locks', 'hsize': 3, 'vsize': 5}
135135
dashboard_page_transactions = {'name': 'PostgreSQL Transactions', 'hsize': 2, 'vsize': 5}
136-
dashboard_page_system = {'name': 'System', 'hsize': 2, 'vsize': 5}
136+
dashboard_page_system_linux = {'name': 'System (Linux)', 'hsize': 2, 'vsize': 5}
137+
dashboard_page_system_windows = {'name': 'System (Windows)', 'hsize': 2, 'vsize': 5}
137138

138139
dashboard_pages = [dashboard_page_overview,
139140
dashboard_page_instance,
140141
dashboard_page_wal,
141142
dashboard_page_locks,
142143
dashboard_page_transactions]
143144
if platform.UNIX:
144-
dashboard_pages.append(dashboard_page_system)
145+
dashboard_pages.append(dashboard_page_system_linux)
146+
if platform.WINDOWS:
147+
dashboard_pages.append(dashboard_page_system_windows)
145148

146149
dashboard_widget_size_large = {'width': 500, 'height': 250}
147150
dashboard_widget_size_medium = {'width': 500, 'height': 150}

mamonsu/plugins/system/linux/disk_stats.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def graphs(self, template, dashboard=False):
120120
return result + template.graph(graph)
121121
else:
122122
return [{'dashboard': {'name': 'Block devices: read/write bytes',
123-
'page': ZbxTemplate.dashboard_page_system['name'],
123+
'page': ZbxTemplate.dashboard_page_system_linux['name'],
124124
'size': ZbxTemplate.dashboard_widget_size_medium,
125125
'position': 1}},
126126
{'dashboard': {'name': 'Block devices: read/write operations',
127-
'page': ZbxTemplate.dashboard_page_system['name'],
127+
'page': ZbxTemplate.dashboard_page_system_linux['name'],
128128
'size': ZbxTemplate.dashboard_widget_size_medium,
129129
'position': 2}}]
130130

mamonsu/plugins/system/linux/proc_stat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def graphs(self, template, dashboard=False):
137137
'size': ZbxTemplate.dashboard_widget_size_medium,
138138
'position': 3}},
139139
{'dashboard': {'name': 'Processes overview',
140-
'page': ZbxTemplate.dashboard_page_system['name'],
140+
'page': ZbxTemplate.dashboard_page_system_linux['name'],
141141
'size': ZbxTemplate.dashboard_widget_size_medium,
142142
'position': 3}}]
143143

mamonsu/plugins/system/windows/cpu.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .helpers import PerfData
22

33
from mamonsu.plugins.system.plugin import SystemPlugin as Plugin
4+
from mamonsu.lib.zbx_template import ZbxTemplate
45

56

67
class Cpu(Plugin):
@@ -53,7 +54,10 @@ def graphs(self, template, dashboard=False):
5354
if not dashboard:
5455
return template.graph(graph)
5556
else:
56-
return []
57+
return [{'dashboard': {'name': 'CPU overview',
58+
'page': ZbxTemplate.dashboard_page_system_windows['name'],
59+
'size': ZbxTemplate.dashboard_widget_size_medium,
60+
'position': 0}}]
5761

5862
def triggers(self, template, dashboard=False):
5963
return template.trigger({

mamonsu/plugins/system/windows/memory.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mamonsu.plugins.system.plugin import Plugin
22
from .helpers import PerfData
3+
from mamonsu.lib.zbx_template import ZbxTemplate
34

45

56
class Memory(Plugin):
@@ -51,4 +52,7 @@ def graphs(self, template, dashboard=False):
5152
if not dashboard:
5253
return template.graph(graph)
5354
else:
54-
return []
55+
return [{'dashboard': {'name': 'Memory overview',
56+
'page': ZbxTemplate.dashboard_page_system_windows['name'],
57+
'size': ZbxTemplate.dashboard_widget_size_medium,
58+
'position': 1}}]

mamonsu/plugins/system/windows/network.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mamonsu.plugins.system.plugin import SystemPlugin as Plugin
22
from .helpers import PerfData
3+
from mamonsu.lib.zbx_template import ZbxTemplate
34

45

56
class Network(Plugin):
@@ -52,4 +53,7 @@ def graphs(self, template, dashboard=False):
5253
if not dashboard:
5354
return template.graph(graph)
5455
else:
55-
return []
56+
return [{'dashboard': {'name': 'Network overview',
57+
'page': ZbxTemplate.dashboard_page_system_windows['name'],
58+
'size': ZbxTemplate.dashboard_widget_size_medium,
59+
'position': 2}}]

0 commit comments

Comments
 (0)