Commit 27b2a6cc authored by Roman Alifanov's avatar Roman Alifanov

modules: update system_monitor with new graph types

parent 5c7d7b62
......@@ -29,6 +29,16 @@ case "$1" in
cpu[0-9]*)
get_cpu_usage "$1"
;;
cpus_all)
cores=$(nproc)
echo -n "["
for i in $(seq 0 $((cores-1))); do
usage=$(get_cpu_usage "cpu$i")
[ $i -gt 0 ] && echo -n ", "
echo -n "{'name': 'CPU $i', 'value': $usage}"
done
echo "]"
;;
ram)
free | awk '/Mem:/ {printf "%.1f", $3/$2*100}'
;;
......
- name: "System Monitor"
weight: 50
pages:
- name: "Monitor"
icon: utilities-system-monitor-symbolic
- name: "Monitor Inline"
icon: view-list-symbolic
- name: "Monitor Large"
icon: view-fullscreen-symbolic
- name: "Monitor Cards"
icon: view-grid-symbolic
sections:
- name: "CPU"
weight: 0
page: "Monitor"
page: "Monitor Inline"
type: custom
settings:
- name: CPU Total
......@@ -17,31 +21,9 @@
min: 0
max: 100
points: 60
color: "#e5a50a"
color: "#3584e4"
suffix: "%"
- name: "CPU Cores"
weight: 5
page: "Monitor"
type: dynamic
generator_command: "seq 0 $(($(nproc)-1))"
setting_template:
name: "Core {_item}"
type: info_graph
update_interval: 1
get_command: "{module_path}/bin/stats.sh cpu{_item}"
map:
min: 0
max: 100
points: 60
color: "#ff7800"
suffix: "%"
- name: "Memory"
weight: 10
page: "Monitor"
type: custom
settings:
- name: RAM Usage
type: info_graph
update_interval: 1
......@@ -50,7 +32,7 @@
min: 0
max: 100
points: 60
color: "#3584e4"
color: "#e5a50a"
suffix: "%"
- name: Swap Usage
......@@ -63,3 +45,53 @@
points: 30
color: "#c061cb"
suffix: "%"
- name: "CPU"
weight: 0
page: "Monitor Large"
type: custom
settings:
- name: Total Usage
type: info_graph_large
update_interval: 1
get_command: "{module_path}/bin/stats.sh cpu"
map:
min: 0
max: 100
points: 60
color: "#3584e4"
suffix: "%"
- name: "Memory"
weight: 10
page: "Monitor Large"
type: custom
settings:
- name: RAM Usage
type: info_graph_large
update_interval: 1
get_command: "{module_path}/bin/stats.sh ram"
map:
min: 0
max: 100
points: 60
color: "#e5a50a"
suffix: "%"
show_max: true
- name: "CPU Cores"
weight: 0
page: "Monitor Cards"
type: custom
settings:
- name: CPU Cores
type: info_graph_multi
update_interval: 1
get_command: "{module_path}/bin/stats.sh cpus_all"
map:
min: 0
max: 100
points: 40
columns: 3
color: "#3584e4"
suffix: "%"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment