2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Visualizations (Plots) for SYSMON

git-svn-id: https://svn.fhem.de/fhem/trunk@4645 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hexenmeister 2014-01-14 16:59:42 +00:00
parent ecb2bb0aa3
commit 44d0bd9fbf
14 changed files with 455 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# SYSMON
#
# Anzeige der gemessenen CPU Temperatur und des errechneten Durchschnitts
#
# Beispiel aus dem Logfile:
# 2013-11-16_23:06:05 sysmon cpu_temp_avg: 49.6
# 2013-11-16_23:06:05 sysmon cpu_temp: 49.77
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set ytics
set yrange [650:950]
set y2tics
set title '<L1>'
set grid xtics y2tics
set ylabel "Frequenz"
set y2label "Temperatur in C"
#FileLog 4:cpu_temp_avg\x3a:0:
#FileLog 4:cpu_temp\x3a:0:
#FileLog 4:cpu_freq\x3a:0:
plot \
"< egrep 'cpu_temp_avg:' <IN>"\
using 1:4 axes x1y2 title 'Durchschnitt' ls l4 lw 3 with lines \
"< egrep 'cpu_temp:' <IN>"\
using 1:4 axes x1y2 title 'Temperatur' ls l0 lw 1 with lines \
"< egrep 'cpu_freq:' <IN>"\
using 1:4 axes x1y1 title 'Frequenz' ls l1fill lw 1 with steps

View File

@ -0,0 +1,21 @@
# SYSMON
#
# Anzeige: CPU Frequenz
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ytics
set y2tics
set grid ytics y2tics
set ylabel "Frequenz"
#DbLog <SPEC1>:cpu_freq:::
plot \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l0fill axes x1y1 title 'MHz' lw 1 with lines \

View File

@ -0,0 +1,24 @@
# SYSMON
#
# Anzeige der gemessenen CPU Temperatur und des errechneten Durchschnitts
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ytics
set grid ytics y2tics
set ylabel "Temperatur"
set y2label "Temperatur"
#DbLog <SPEC1>:cpu_temp:::
#DbLog <SPEC1>:cpu_temp_avg:::
plot \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l0 axes x1y1 title 'Temp' lw 1 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l1 axes x1y1 title 'Temp' lw 2 with lines \

View File

@ -0,0 +1,35 @@
# SYSMON
#
# Anzeige: system load
#
# define wl_sysmon_load SVG myDbLog:SMLoadDB:CURRENT
# attr wl_sysmon_load label "Load Min: $data{min1}, Max: $data{max1}, Aktuell: $data{currval1}"
# attr wl_sysmon_load plotfunction sysmon
# attr wl_sysmon_load room RaspberryPi
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ytics
set y2tics
set grid ytics y2tics
set ylabel "Last 1 Minute"
set y2label "Last 5 / 15 Minuten"
set yrange [0.00:1.0]
set y2range [0.00:0.35]
#DbLog <SPEC1>:loadavg:::$val=~s/([\d.]*).[\d.]*.[\d.]*/$1/eg
#DbLog <SPEC1>:loadavg:::$val=~s/[\d.]*.([\d.]*).[\d.]*/$1/eg
#DbLog <SPEC1>:loadavg:::$val=~s/[\d.]*.[\d.]*.([\d.]*)/$1/eg
plot \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l0fill axes x1y1 title '1 min' lw 1 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l1 axes x1y2 title '5 min' lw 2 with lines \
"< awk '/load avg15:/ {print $1, $4}' <IN>" \
using 1:2 ls l2 axes x1y2 title '15 min' lw 2 with lines

View File

@ -0,0 +1,31 @@
# SYSMON
#
# Network-Traffic ETH0 (DbLog)
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ylabel "Traffic RX / TX"
set y2label "Traffic Total"
set grid
set ytics
set y2tics
set format y "%.2f"
set format y2 "%.2f"
#DbLog <SPEC1>:eth0_diff:::$val=~s/^RX..([\d.]*).*/$1/eg
#DbLog <SPEC1>:eth0_diff:::$val=~s/.*TX..([\d.]*).*/$1/eg
#DbLog <SPEC1>:eth0_diff:::$val=~s/.*Total..([\d.]*).*/$1/eg
plot \
"< awk '/eth0_diff:/ {print $1, $4}' <IN>" \
using 1:2 ls l0 axes x1y1 title 'RX' lw 1 with lines \
"< awk '/eth0_diff:/ {print $1, $4}' <IN>" \
using 1:2 ls l1 axes x1y1 title 'TX' lw 1 with lines \
"< awk '/eth0_diff:/ {print $1, $4}' <IN>" \
using 1:2 ls l2 axes x1y2 title 'Total' lw 1 with lines \

View File

@ -0,0 +1,31 @@
# SYSMON
#
# Visualisierung: RAM-Nutzung
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ylabel "Ram Total / Free (MB)"
set y2label "Ram Used (MB)"
set grid
set ytics
set y2tics
set format y "%.2f"
set format y2 "%.2f"
#DbLog <SPEC1>:ram:::$val=~s/^Total..([\d.]*).*/$1/eg
#DbLog <SPEC1>:ram:::$val=~s/.*Used..([\d.]*).*/$1/eg
#DbLog <SPEC1>:ram:::$val=~s/.*Free..([\d.]*).*/$1/eg
plot \
"< awk '/ram:/ {print $1, $4}' <IN>" \
using 1:2 ls l0 axes x1y1 title 'Total' lw 1 with lines \
"< awk '/ram:/ {print $1, $4}' <IN>" \
using 1:2 ls l1 axes x1y2 title 'Used' lw 1 with lines \
"< awk '/ram:/ {print $1, $4}' <IN>" \
using 1:2 ls l2 axes x1y1 title 'Free' lw 1 with lines \

View File

@ -0,0 +1,36 @@
# SYSMON
#
# Anzeige verschiedener Statistiken aus SYSMON (DbLog)
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ytics
set grid ytics y2tics
set ylabel "Temperatur"
set y2label "Last"
#DbLog <SPEC1>:cpu_temp:::
#DbLog <SPEC1>:cpu_temp_avg:::
#DbLog <SPEC1>:cpu_freq:::
#DbLog <SPEC1>:loadavg:::$val=~s/([\d.]*).[\d.]*.[\d.]*/$1/eg
#DbLog <SPEC1>:loadavg:::$val=~s/[\d.]*.([\d.]*).[\d.]*/$1/eg
#DbLog <SPEC1>:loadavg:::$val=~s/[\d.]*.[\d.]*.([\d.]*)/$1/eg
plot \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l0 axes x1y1 title 'Temp' lw 1 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l1 axes x1y1 title 'Temp' lw 2 with lines \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l2 axes x1y1 title 'MHz' lw 1 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l3 axes x1y2 title '1 Min' lw 2 with lines \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l4 axes x1y2 title '5 Min' lw 1 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l5 axes x1y2 title '15 Min' lw 2 with lines \

View File

@ -0,0 +1,45 @@
# SYSMON
#
# Visualisierung: Dateisysteminformationen (/)
#
# Beispiel aus dem Logfile:
# 2013-11-21_20:00:54 sysmon ~ /: Total: 7404 MB, Used: 3292 MB, 47 %, Available: 3787 MB
# 2013-11-21_20:00:54 sysmon ~ /media/usb1: Total: 30942 MB, Used: 6330 MB, 21 %, Available: 24613 MB
# 2013-11-21_20:00:54 sysmon fs_root: Total: 7404 MB, Used: 3292 MB, 47 %, Available: 3787 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set yrange [0:90]
set y2range [0:7500]
set ylabel "Nutzung %"
set y2label "Nutzung MB"
#FileLog 0:fs_root|~\s/\x3a:0:$fld[4]+$fld[5]
#FileLog 0:fs_root|~\s/\x3a:0:$fld[7]+$fld[8]
#FileLog 0:fs_root|~\s/\x3a:0:$fld[9]+$fld[10]
#nur ~# FileLog 6:~\s/\x3a:0:
#nur ~# FileLog 9:~\s/\x3a:0:
#nur ~# FileLog 11:~\s/\x3a:0:
#nur fs# FileLog 5:fs_root\x3a:0:
#nur fs# FileLog 8:fs_root\x3a:0:
#nur fs# FileLog 10:fs_root\x3a:0:
plot \
"< egrep 'total:' <IN>"\
using 1:6 axes x1y2 title '' ls l0 lw 2 with lines
plot \
"< egrep 'used:' <IN>"\
using 1:9 axes x1y2 title 'Verwendet MB' ls l2fill lw 0.5 with lines
plot \
"< egrep 'percent:' <IN>"\
using 1:11 axes x1y1 title 'Verwendet %' ls l1 lw 1.5 with lines

View File

@ -0,0 +1,45 @@
# SYSMON
#
# Visualisierung: Dateisysteminformationen (/media/usb1)
#
# Beispiel aus dem Logfile:
# 2013-11-21_20:00:54 sysmon ~ /: Total: 7404 MB, Used: 3292 MB, 47 %, Available: 3787 MB
# 2013-11-21_20:00:54 sysmon ~ /media/usb1: Total: 30942 MB, Used: 6330 MB, 21 %, Available: 24613 MB
# 2013-11-21_20:00:54 sysmon fs_usb1: Total: 7404 MB, Used: 3292 MB, 47 %, Available: 3787 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set yrange [0:90]
set y2range [0:30700]
set ylabel "Nutzung %"
set y2label "Nutzung MB"
#FileLog 0:fs_usb1|~\s/media/usb1\x3a:0:$fld[4]+$fld[5]
#FileLog 0:fs_usb1|~\s/media/usb1\x3a:0:$fld[7]+$fld[8]
#FileLog 0:fs_usb1|~\s/media/usb1\x3a:0:$fld[9]+$fld[10]
#nur ~# FileLog 6:~\s/media/usb1\x3a:0:
#nur ~# FileLog 9:~\s/media/usb1\x3a:0:
#nur ~# FileLog 11:~\s/media/usb1\x3a:0:
#nur fs# FileLog 5:fs_usb1\x3a:0:
#nur fs# FileLog 8:fs_usb1\x3a:0:
#nur fs# FileLog 10:fs_usb1\x3a:0:
plot \
"< egrep 'total:' <IN>"\
using 1:6 axes x1y2 title '' ls l0 lw 2 with lines
plot \
"< egrep 'used:' <IN>"\
using 1:9 axes x1y2 title 'Verwendet MB' ls l2fill lw 0.5 with lines
plot \
"< egrep 'percent:' <IN>"\
using 1:11 axes x1y1 title 'Verwendet %' ls l1 lw 1.5 with lines

View File

@ -0,0 +1,35 @@
# SYSMON
#
# Anzeige: system load
#
# Beispiel aus dem Logfile:
# 2013-11-18_21:33:17 sysmon loadavg: 0.11 0.11 0.17
#
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set ytics
set title '<L1>'
set grid xtics y2tics
set y2label "Load average"
#FileLog 4:load:0:
#FileLog 5:load:0:
#FileLog 6:load:0:
plot \
"< awk '/load avg:/ {print $1, $4}' <IN>" \
using 1:2 ls l8fill axes x1y1 title '1 min' lw 0 with lines \
"< awk '/load avg5:/ {print $1, $4}' <IN>" \
using 1:2 ls l0 axes x1y1 title '5 min' lw 2 with lines \
"< awk '/load avg15:/ {print $1, $4}' <IN>" \
using 1:2 ls l4 axes x1y1 title '15 min' lw 3 with lines

View File

@ -0,0 +1,28 @@
# SYSMON
#
# Network-Traffic ETH0
#
# Beispiel aus dem Logfile:
# 2013-11-17_21:35:57 sysmon eth0_diff: Received: 23.54 MB, Sent: 42.64 MB, Total: 66.18 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set y2label "Traffic in MB"
#FileLog 5:eth0_diff\x3a:0:
#FileLog 8:eth0_diff\x3a:0:
plot \
"< egrep 'RX:' <IN>"\
using 1:5 axes x1y2 title 'Empfangen' ls l1 lw 2 with lines \
"< egrep 'TX:' <IN>"\
using 1:8 axes x1y2 title 'Gesendet' ls l0 lw 2 with lines

View File

@ -0,0 +1,31 @@
# SYSMON
#
# Network-Traffic ETH0
#
# Beispiel aus dem Logfile:
# 2013-11-17_21:35:57 sysmon eth0_diff: Received: 23.54 MB, Sent: 42.64 MB, Total: 66.18 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set y2label "Traffic in MB"
#FileLog 5:eth0_diff\x3a:0:
#FileLog 8:eth0_diff\x3a:0:
#FileLog 11:eth0_diff\x3a:0:
plot \
"< egrep 'RX:' <IN>"\
using 1:5 axes x1y2 title 'Empfangen' ls l1 lw 2 with lines \
"< egrep 'TX:' <IN>"\
using 1:8 axes x1y2 title 'Gesendet' ls l0 lw 2 with lines \
"< egrep 'Total:' <IN>"\
using 1:11 axes x1y2 title 'Gesamt' ls l2 lw 2 with lines

View File

@ -0,0 +1,28 @@
# SYSMON
#
# Network-Traffic WLAN0
#
# Beispiel aus dem Logfile:
# 2013-11-17_21:35:57 sysmon wlan0_diff: Received: 23.54 MB, Sent: 42.64 MB, Total: 66.18 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set y2label "Traffic in MB"
#FileLog 5:wlan0_diff\x3a:0:
#FileLog 8:wlan0_diff\x3a:0:
plot \
"< egrep 'RX:' <IN>"\
using 1:5 axes x1y2 title 'Empfangen' ls l1 lw 2 with lines \
"< egrep 'TX:' <IN>"\
using 1:8 axes x1y2 title 'Gesendet' ls l0 lw 2 with lines

View File

@ -0,0 +1,30 @@
# SYSMON
#
# Visualisierung: RAM-Nutzung
#
# Beispiel aus dem Logfile:
# 2013-11-19_21:51:41 sysmon ram: Total: 485 MB, Used: 118 MB, 24.33 %, Free: 366 MB
#
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set y2tics
set title '<L1>'
set grid xtics y2tics
set y2label "RAM-Nutzung MB"
set y2range [0:495]
#FileLog 5:ram\x3a:0:
#FileLog 8:ram\x3a:0:
plot \
"< egrep 'total:' <IN>"\
using 1:5 axes x1y2 title '' ls l0 lw 2 with lines
plot \
"< egrep 'used:' <IN>"\
using 1:8 axes x1y2 title 'Verwendet' ls l2fill lw 0.5 with lines