Ein Modul zur Erfassen von diversen RPi/Linux-Statistiken (SYSMON)

Begonnen von hexenmeister, 06 Dezember 2013, 17:44:38

Vorheriges Thema - Nächstes Thema

hexenmeister

Zitat von: raspklaus am 13 Juli 2015, 19:46:53
Habe es geändert, ist trotzdem noch undef
Tut mir leid, ich verstehe nicht, was Du alles definiert oder geändert hast.
Wie heiß jetzt das Reading jetzt? Im Plot steht ja #FileLog 5:fs_usb1\x3a:0:
Wie ist Plot definiert?
Poste doch deine komplette Konfiguration.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

hexenmeister

Zitat von: CoolTux am 13 Juli 2015, 11:48:35
Ich habe mal ein reload 42_SYSMON gemacht das hier ist für meinen proxy01 das Ergebnis
Ich tappe echt im Dunklem :(
Ich sehe, dass die Ausführung per Telnet fehl schlägt. Es wird praktisch nichts zurückübertragen. Aber zu den Ursachen steht nichts. Sollte aber.
Offensichtlich hast Du auch nicht die aktuellste Version. Kannst Du bitte die neuste nehmen und nach dem FHEM-Neustart 'get sysmon update' eingeben und den entstandenen Log posten.

Außerdem könntest Du probieren, das Attribut nonblocking auf 0 zu setzen. Dann wissen wir zumindest (hoffentlich), ob das Problem mit Telnet oder BlockingCall zusammenhängt.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

raspklaus

#992
Hier das Filelog:

2015-07-13_10:30:09 sysmon cpu_freq: 1008
2015-07-13_10:30:10 sysmon fs_root: Total: 112675 MB, Used: 1576 MB, 2 %, Available: 105376 MB at /
2015-07-13_10:30:10 sysmon fs_usb0: Total: 29757 MB, Used: 23 MB, 1 %, Available: 29735 MB at /media/usb0
2015-07-13_10:30:10 sysmon cpu_temp_avg: 34.4
2015-07-13_10:30:10 sysmon cpu_temp: 34.60
2015-07-13_10:30:10 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:30:10 sysmon stat_cpu_percent: 0.78 0.00 1.19 95.81 1.11 0.00 1.10
2015-07-13_10:30:10 sysmon ram: Total: 1998.96 MB, Used: 129.45 MB, 6.48 %, Free: 1869.52 MB
2015-07-13_10:30:10 sysmon cpu0_temp: 34.60
2015-07-13_10:30:10 sysmon eth0_diff: RX: 0.01 MB, TX: 0.01 MB, Total: 0.02 MB
2015-07-13_10:30:10 sysmon loadavg: 0.35 0.24 0.22
2015-07-13_10:34:33 sysmon cpu_freq: 480
2015-07-13_10:34:33 sysmon cpu_freq_stat: 480.00 480.00 480.00
2015-07-13_10:34:33 sysmon cpu1_freq: 480
2015-07-13_10:34:33 sysmon cpu0_freq_stat: 480.00 480.00 480.00
2015-07-13_10:34:33 sysmon cpu0_freq: 480
2015-07-13_10:34:33 sysmon cpu1_freq_stat: 480.00 480.00 480.00
2015-07-13_10:34:33 sysmon fs_root: Total: 112675 MB, Used: 1576 MB, 2 %, Available: 105376 MB at /
2015-07-13_10:34:33 sysmon perl_version: 5.014002
2015-07-13_10:34:33 sysmon cpu_model_name: ARMv7 Processor rev 4 (v7l)
2015-07-13_10:34:33 sysmon cpu_bogomips: 1744.50
2015-07-13_10:34:33 sysmon eth0: RX: 144.87 MB, TX: 125.33 MB, Total: 270.2 MB
2015-07-13_10:34:33 sysmon cpu_temp_stat: 34.60 34.60 34.60
2015-07-13_10:34:33 sysmon fs_usb0: Total: 29757 MB, Used: 23 MB, 1 %, Available: 29735 MB at /media/usb0
2015-07-13_10:34:33 sysmon eth0_rx: 151911727
2015-07-13_10:34:33 sysmon starttime: 1436423990
2015-07-13_10:34:33 sysmon uptime: 352482
2015-07-13_10:34:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:34:33 sysmon swap: n/a
2015-07-13_10:34:33 sysmon cpu_temp: 34.60
2015-07-13_10:34:33 sysmon stat_cpu: 643227 0 360949 69338606 257866 78 779603
2015-07-13_10:34:33 sysmon power_ac_text: ac: present / online, voltage: 5.066 V, current: 280 mA, 1.4 W
2015-07-13_10:34:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:34:33 sysmon power_ac_stat: 1 1 5.066 280
2015-07-13_10:34:33 sysmon eth0_ip: 192.200.100.95
2015-07-13_10:34:33 sysmon fhemstarttime_text: 13.07.2015 10:33:41
2015-07-13_10:34:33 sysmon cpu_core_count: 2
2015-07-13_10:34:33 sysmon starttime_text: 09.07.2015 08:39:50
2015-07-13_10:34:33 sysmon ram: Total: 1998.96 MB, Used: 100.35 MB, 5.02 %, Free: 1898.62 MB
2015-07-13_10:34:33 sysmon eth0_tx: 131417829
2015-07-13_10:34:33 sysmon wlan0_speed: not available
2015-07-13_10:34:33 sysmon fhemuptime: 52
2015-07-13_10:34:33 sysmon fhemstarttime: 1436776421
2015-07-13_10:34:33 sysmon power_battery_stat: 0 0 0 0 0
2015-07-13_10:34:33 sysmon cpu0_temp: 34.60
2015-07-13_10:34:33 sysmon eth0_diff: RX: 144.87 MB, TX: 125.33 MB, Total: 270.20 MB
2015-07-13_10:34:33 sysmon uptime_text: 4 days, 01 hours, 54 minutes
2015-07-13_10:34:33 sysmon idletime_text: 4 days, 01 hours, 00 minutes (99.09 %)
2015-07-13_10:34:33 sysmon stat_cpu1: 471394 0 172006 34000999 238582 2 776944
2015-07-13_10:34:33 sysmon stat_cpu0: 171833 0 188943 35337606 19283 76 2659
2015-07-13_10:34:33 sysmon power_usb_stat: 0 0 0.02 0
2015-07-13_10:34:33 sysmon wlan0_diff: RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
2015-07-13_10:34:33 sysmon wlan0_rx: 0
2015-07-13_10:34:33 sysmon swap_used_stat: 0.00 0.00 0.00
2015-07-13_10:34:33 sysmon power_battery_text: battery: absent / offline, voltage: 0 V, current: 0 mA, 0 W, capacity: 0 %
2015-07-13_10:34:33 sysmon wlan0: RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
2015-07-13_10:34:33 sysmon wlan0_tx: 0
2015-07-13_10:34:33 sysmon power_battery_info: battery info: n/a , capacity: n/a %, status: n/a , health: n/a , total capacity: n/a mAh
2015-07-13_10:34:33 sysmon loadavg: 0.23 0.29 0.25
2015-07-13_10:34:33 sysmon idletime: 349259 99.09 %
2015-07-13_10:34:33 sysmon fhemuptime_text: 0 days, 00 hours, 00 minutes
2015-07-13_10:34:33 sysmon eth0_speed: 1000
2015-07-13_10:34:33 sysmon power_usb_text: usb: absent / offline, voltage: 0.02 V, current: 0 mA, 0 W
2015-07-13_10:34:33 sysmon ram_used_stat: 100.35 100.35 100.35
2015-07-13_10:35:33 sysmon cpu_freq: 480
2015-07-13_10:35:33 sysmon stat_cpu0_text: user: 2.50 %, nice: 0.00 %, sys: 1.58 %, idle: 95.35 %, io: 0.56 %, irq: 0.00 %, sirq: 0.00 %
2015-07-13_10:35:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:35:33 sysmon stat_cpu1_percent: 13.37 0.00 0.94 83.48 0.03 0.00 2.17
2015-07-13_10:35:33 sysmon cpu_temp: 34.60
2015-07-13_10:35:33 sysmon stat_cpu1_text: user: 13.37 %, nice: 0.00 %, sys: 0.94 %, idle: 83.48 %, io: 0.03 %, irq: 0.00 %, sirq: 2.17 %
2015-07-13_10:35:33 sysmon stat_cpu_diff: 965 0 153 10858 35 0 133
2015-07-13_10:35:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:35:33 sysmon stat_cpu_percent: 7.95 0.00 1.26 89.41 0.29 0.00 1.10
2015-07-13_10:35:33 sysmon ram: Total: 1998.96 MB, Used: 121.72 MB, 6.09 %, Free: 1877.25 MB
2015-07-13_10:35:33 sysmon cpu1_idle_stat: 83.48 83.48 83.48
2015-07-13_10:35:33 sysmon cpu0_idle_stat: 95.35 95.35 95.35
2015-07-13_10:35:33 sysmon cpu0_temp: 34.60
2015-07-13_10:35:33 sysmon stat_cpu0_percent: 2.50 0.00 1.58 95.35 0.56 0.00 0.00
2015-07-13_10:35:33 sysmon eth0_diff: RX: 0.56 MB, TX: 0.12 MB, Total: 0.68 MB
2015-07-13_10:35:33 sysmon stat_cpu1_diff: 812 0 57 5069 2 0 132
2015-07-13_10:35:33 sysmon stat_cpu_text: user: 7.95 %, nice: 0.00 %, sys: 1.26 %, idle: 89.41 %, io: 0.29 %, irq: 0.00 %, sirq: 1.10 %
2015-07-13_10:35:33 sysmon cpu_idle_stat: 89.41 89.41 89.41
2015-07-13_10:35:33 sysmon stat_cpu0_diff: 152 0 96 5789 34 0 0
2015-07-13_10:35:33 sysmon loadavg: 0.14 0.25 0.24
2015-07-13_10:36:33 sysmon cpu_freq: 480
2015-07-13_10:36:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:36:33 sysmon cpu_temp: 34.60
2015-07-13_10:36:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:36:33 sysmon stat_cpu_percent: 0.76 0.00 0.55 96.69 0.91 0.00 1.09
2015-07-13_10:36:33 sysmon ram: Total: 1998.96 MB, Used: 121.80 MB, 6.09 %, Free: 1877.16 MB
2015-07-13_10:36:33 sysmon cpu0_temp: 34.60
2015-07-13_10:36:33 sysmon eth0_diff: RX: 0.02 MB, TX: 0.01 MB, Total: 0.03 MB
2015-07-13_10:36:33 sysmon loadavg: 0.05 0.21 0.22
2015-07-13_10:37:33 sysmon cpu_freq: 480
2015-07-13_10:37:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:37:33 sysmon cpu_temp: 34.60
2015-07-13_10:37:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:37:33 sysmon stat_cpu_percent: 0.83 0.00 0.55 96.89 0.63 0.00 1.09
2015-07-13_10:37:33 sysmon ram: Total: 1998.96 MB, Used: 121.99 MB, 6.10 %, Free: 1876.97 MB
2015-07-13_10:37:33 sysmon cpu0_temp: 34.60
2015-07-13_10:37:33 sysmon eth0_diff: RX: 0.03 MB, TX: 0.00 MB, Total: 0.03 MB
2015-07-13_10:37:33 sysmon loadavg: 0.02 0.17 0.21
2015-07-13_10:38:33 sysmon cpu_freq: 480
2015-07-13_10:38:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:38:33 sysmon cpu_temp: 34.60
2015-07-13_10:38:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:38:33 sysmon stat_cpu_percent: 1.56 0.00 1.02 95.74 0.58 0.00 1.09
2015-07-13_10:38:33 sysmon ram: Total: 1998.96 MB, Used: 122.36 MB, 6.12 %, Free: 1876.60 MB
2015-07-13_10:38:33 sysmon cpu0_temp: 34.60
2015-07-13_10:38:33 sysmon eth0_diff: RX: 0.07 MB, TX: 0.08 MB, Total: 0.15 MB
2015-07-13_10:38:33 sysmon loadavg: 0.01 0.14 0.20
2015-07-13_10:39:33 sysmon cpu_freq: 480
2015-07-13_10:39:33 sysmon cpu_temp_avg: 34.6
2015-07-13_10:39:33 sysmon cpu_temp: 34.60
2015-07-13_10:39:33 sysmon cpu0_temp_avg: 34.6
2015-07-13_10:39:33 sysmon stat_cpu_percent: 0.74 0.00 0.54 95.49 2.13 0.00 1.09
2015-07-13_10:39:33 sysmon ram: Total: 1998.96 MB, Used: 122.27 MB, 6.12 %, Free: 1876.69 MB
2015-07-13_10:39:33 sysmon cpu0_temp: 34.60
2015-07-13_10:39:33 sysmon eth0_diff: RX: 0.02 MB, TX: 0.01 MB, Total: 0.03 MB
2015-07-13_10:39:33 sysmon loadavg: 0.06 0.13 0.19
2015-07-13_10:40:33 sysmon cpu_freq: 480
2015-07-13_10:40:33 sysmon fs_root: Total: 112675 MB, Used: 1576 MB, 2 %, Available: 105376 MB at /
2015-07-13_10:40:33 sysmon fs_usb0: Total: 29757 MB, Used: 23 MB, 1 %, Available: 29735 MB at /media/usb0
2015-07-13_10:40:33 sysmon cpu_temp_avg: 34.6


die conf:

# SYSMON Module
define sysmon SYSMON 1 1 1 10
attr sysmon event-on-update-reading cpu_temp,cpu_temp_avg,cpu_freq,eth0_diff,loadavg,ram,fs_.*,stat_cpu_percent
attr sysmon filesystems fs_root:/:Root,fs_usb0:/media/usb0:USB-Stick
attr sysmon group Cubietruck
attr sysmon network-interfaces eth0:eth0:Ethernet,wlan0:wlan0:WiFi
attr sysmon room Cubietruck



der Plot:

# SYSMON
#
# Visualisierung: Dateisysteminformationen (/media/usb0)
#
# 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/usb0: Total: 30942 MB, Used: 6330 MB, 21 %, Available: 24613 MB
# 2013-11-21_20:00:54 sysmon fs_usb0: 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 5:fs_usb0\x3a:0:
#FileLog 8:fs_usb0\x3a:0:
#FileLog 10:fs_usb0\x3a:0:

#----FileLog 0:fs_usb0|~\s/media/usb0\x3a:0:$fld[4]+$fld[5]
#----FileLog 0:fs_usb0|~\s/media/usb0\x3a:0:$fld[7]+$fld[8]
#----FileLog 0:fs_usb0|~\s/media/usb0\x3a:0:$fld[9]+$fld[10]
#nur ~# FileLog 6:~\s/media/usb0\x3a:0:
#nur ~# FileLog 9:~\s/media/usb0\x3a:0:
#nur ~# FileLog 11:~\s/media/usb0\x3a:0:
#nur fs# FileLog 5:fs_usb0\x3a:0:
#nur fs# FileLog 8:fs_usb0\x3a:0:
#nur fs# FileLog 10:fs_usb0\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


Sorry, hatte ich vergessen, hier noch die Definition aus der cfg:

define wl_sysmon_fs_usb0 SVG FileLog_sysmon:SM_FS_usb0:CURRENT
attr wl_sysmon_fs_usb0 group Cubietruck
attr wl_sysmon_fs_usb0 label "USB0 Total: $data{max1}, Min: $data{min2}, Max: $data{max2}, Aktuell: $data{currval2}"
attr wl_sysmon_fs_usb0 room Cubietruck



Sunny

@raspklaus,

und siehst Du jetzt Deinen Usb0 ?

Schaue Dir doch nochmal das "attr sysmon event-on-update-reading" bzg. "power_ac" genauer an...

Wenn Du bei "FileLog_sysmon" mal ganz unten auf ein SVG klickst, kannst Du die auch anpassen. ;)

Gruß
Sunny

FHEM 6.0 (RPi's 1b-4,CeleronM,Odroid C1+)
1-Wire (DS18B20,DS2406) |miniCUL|miniCUL868WLAN|HM|IT(-1500,LR-3500) |FB6591,FB7490,FB7580|DECT200|Powerline546E|520E|openwrt
Anfänger: Linux,FHEM+Perl

raspklaus

#994
@ sunny

Der Edit Plot sieht bei mir so aus:

Kannst Du mir Deinen mal posten ?

Danke

Sunny

@raspklaus,

habe keinen USB, nur HDD.

Bild im Anhang.

Gruss
Sunny
FHEM 6.0 (RPi's 1b-4,CeleronM,Odroid C1+)
1-Wire (DS18B20,DS2406) |miniCUL|miniCUL868WLAN|HM|IT(-1500,LR-3500) |FB6591,FB7490,FB7580|DECT200|Powerline546E|520E|openwrt
Anfänger: Linux,FHEM+Perl

raspklaus

Kannst Du mir das mit den zu lesenden Columes anhand von diesem Beispiel mal erklären ?

sysmon fs_usb0: Total: 29757 MB, Used: 25 MB, 1 %, Available: 29733 MB at /media/usb0

Danke

Sunny

@raspklaus,

verstehe leider nicht, was Du daran nicht verstehst.
<OT an>
Zitat von: raspklaus am 14 Juli 2015, 21:31:51
sysmon fs_usb0: Total: 29757 MB, Used: 25 MB, 1 %, Available: 29733 MB at /media/usb0
sysmon fs_usb0 <=> Name von usb0
Total: 29757 MB <=> Größe von usbO in MB
Used: 25 MB, 1 % <=> Verwendet sind 25MB / ca. 1% von der Größe des usb0
Available: 29733 MB at /media/usb0  <=>  Frei sind 29733 MB auf usb0
<OT aus>

Hoffe ich habe Dich richtig verstanden und Dir das geantwortet, was Du wissen wolltest.

Gruss
Sunny

Hier mal zwei Suchlinks: (https://ixquick.com/ oder https://startpage.com/;)
FHEM 6.0 (RPi's 1b-4,CeleronM,Odroid C1+)
1-Wire (DS18B20,DS2406) |miniCUL|miniCUL868WLAN|HM|IT(-1500,LR-3500) |FB6591,FB7490,FB7580|DECT200|Powerline546E|520E|openwrt
Anfänger: Linux,FHEM+Perl

raspklaus

#998
@ sunny

Ich glaube fast du hast mich etwas missverstanden.

Es geht mir um die Auswertung des Logeintrags (siehe Screenshot oben)

eine blaue Linie für die 25 MB erscheint überhaupt nicht und wofür steht die rote Linie
Das wird ja über die Spalten des Logeintrags festgelegt

sysmon fs_usb0: Total: 29757 MB, Used: 25 MB, 1 %, Available: 29733 MB at /media/usb0

Spalte 5, 8 und 10 im Ploteditor

Edit:

Ich habs hinbekommen:

Sunny

@raspklaus,

<OT an>
Zitat von: raspklaus am 15 Juli 2015, 09:54:25
Ich glaube fast du hast mich etwas missverstanden.
::)
Zitat von: raspklaus am 15 Juli 2015, 09:54:25
wofür steht die rote Linie
Zitat von: Sunny am 14 Juli 2015, 21:54:45
Total: 29757 MB <=> Größe von usbO in MB

Zitat von: raspklaus am 15 Juli 2015, 09:54:25
eine blaue Linie für die 25 MB erscheint überhaupt nicht

Bei 1%
Zitat von: raspklaus am 13 Juli 2015, 20:39:26
der Plot:
set yrange [0:90]

und
Zitat von: raspklaus am 13 Juli 2015, 20:39:26
der Plot:
set y2range [0:30700]
wird Sie mit der grünen Linie überlagert.
<OT aus>

Gruss
Sunny

PS: Während des Schreibens habe ich Dein Edit gelesen. Freut mich, das Du es hinbekommen hast.
Mache Dir doch mal ein Backup und teste einfach mal ein bißchen...
Viel Erfolg

<Edit an:>
Denke ich nicht, den "Min: 1, Max: 1, Aktuell: 1" Du solltest nur bis "Tics.." Werte verändern, den Rest im Edit.
Sorry hat ich vergessen.
Wie hexenmeister die Plots hin bekommen hat, kann ich Dir leider auch noch nicht erklären.
( Bin noch Anfänger in FHEM. Teste, lese und "spiele" auch noch mit dieser tollen großen "Eisenbahn"  ;) )
FHEM 6.0 (RPi's 1b-4,CeleronM,Odroid C1+)
1-Wire (DS18B20,DS2406) |miniCUL|miniCUL868WLAN|HM|IT(-1500,LR-3500) |FB6591,FB7490,FB7580|DECT200|Powerline546E|520E|openwrt
Anfänger: Linux,FHEM+Perl

Blackcat

Hi,

Mein Fhem hat neue Hardware bekommen (zbox ci320), installiert habe ich ubuntu Server.

Habe jetzt aber ein kleines Problem mit meinen sysmon Plots ... Die gehen durch die Decke. Wie bekomme ich die y-Achse angepasst?

Leider bekomme ich auch keine CPU temp mehr. Liegt das an den 4threads die laufen? Im der Shell bekomme ich für jeden die temp ausgegeben.

Vielen Dank schonmal ;)


Anbei meine Config:


# Modul-Definition
define sysmon SYSMON 1 1 1 10
attr sysmon event-on-update-reading cpu_temp,cpu_temp_avg,cpu_freq,eth0_diff,loadavg,ram,fs_.*
attr sysmon filesystems fs_boot:/boot,fs_root:/:Root
attr sysmon group Raspberry Pi
attr sysmon icon it_server
attr sysmon network-interfaces eth0:eth0:Ethernet
attr sysmon room System
#attr sysmon event-on-update-reading cpu_temp,cpu_temp_avg,cpu_freq,eth0_diff,loadavg,ram,^~ /.*usb.*,~ /$

# Log
define FileLog_sysmon FileLog ./log/sysmon-%Y-%m.log sysmon
attr FileLog_sysmon group Raspberry Pi
attr FileLog_sysmon icon edit_copy
attr FileLog_sysmon logtype SM_CPUTemp:Plot,text
attr FileLog_sysmon room hidden

# Visualisierung: CPU-Temperatur
define wl_sysmon_temp SVG FileLog_sysmon:SM_CPUTemp:CURRENT
attr wl_sysmon_temp group Raspberry Pi
attr wl_sysmon_temp label "CPU Temperatur: Min $data{min2}, Max $data{max2}, Last $data{currval2}"
attr wl_sysmon_temp room System

# Visualisierung: Netzwerk-Datenübertragung fü eth0
define wl_sysmon_eth0 SVG FileLog_sysmon:SM_Network_eth0:CURRENT
attr wl_sysmon_eth0 group Raspberry Pi
attr wl_sysmon_eth0 label "Netzwerk-Traffic eth0: $data{min1}, Max: $data{max1}, Aktuell: $data{currval1}"
attr wl_sysmon_eth0 room System

# Visualisierung: CPU-Auslastung (load average)
define wl_sysmon_load SVG FileLog_sysmon:SM_Load:CURRENT
attr wl_sysmon_load group Raspberry Pi
attr wl_sysmon_load label "Load Min: $data{min1}, Max: $data{max1}, Aktuell: $data{currval1}"
attr wl_sysmon_load room System

# Visualisierung: RAM-Nutzung
define wl_sysmon_ram SVG FileLog_sysmon:SM_RAM:CURRENT
attr wl_sysmon_ram group Raspberry Pi
attr wl_sysmon_ram label "RAM-Nutzung Total: $data{max1}, Min: $data{min2}, Max: $data{max2}, Aktuell: $data{currval2}"
attr wl_sysmon_ram room System

# Visualisierung: Dateisystem: Root-Partition
define wl_sysmon_fs_root SVG FileLog_sysmon:SM_FS_root:CURRENT
attr wl_sysmon_fs_root group Raspberry Pi
attr wl_sysmon_fs_root label "Root Partition Total: $data{max1}, Min: $data{min2}, Max: $data{max2}, Aktuell: $data{currval2}"
attr wl_sysmon_fs_root room System

# Anzeige der Readings zum Einbinden in ein 'Raum'.
define SysValues weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
attr SysValues group Raspberry Pi
attr SysValues room System
Viele Grüße Sandra - FHEM Style Entwicklerin iOS6+12
-----
ZBox nano, Homematic, Homebridge, Hue + Mi Light, ZWave, Dyson, etc.
https://www.foodcat.de
https://www.youtube.com/c/FoodCat (hier gibt es auch immer mehr Hausautomatisierungsvideos)

Sunny

#1001
Moin Sandra,

Zitat von: Blackcat am 15 Juli 2015, 13:57:53
Wie bekomme ich die y-Achse angepasst?

define wl_sysmon_temp SVG FileLog_sysmon:SM_CPUTemp:CURRENT

Am Beispiel "wl_sysmon_temp":
Unter "Edit Files", findest Du "wl_sysmon_temp.gplot"
dort kannst Du "set yrange [123:456]" die Werte für die linke Achse einstellen.

Die rechte Achse wird mit "set y2range [123:456]" angepasst.
"SM_FS_xyz.gplot"  sind Plots für Filelog.
"SM_DB_xyz.gplot" sind Plots für DBLog.
"wl_sysmon_xyz" vermute ich auch für FileLog
Vielleicht hilft Dir das ja weiter.

Viele Grüße
Sunny

<Edit an>
Sorry, bin ein gerade wenig unkonzentriert.
Ich hatte die Werte in den "SM_FS_xyz.gplot" geändert und diese als "SM_FS_xyz1.gplot" gespeichert und in Config angepasst.
Sie wurden sonst mit "update" wieder überschrieben, weiß nicht, ob es jetzt auch noch so ist.
FHEM 6.0 (RPi's 1b-4,CeleronM,Odroid C1+)
1-Wire (DS18B20,DS2406) |miniCUL|miniCUL868WLAN|HM|IT(-1500,LR-3500) |FB6591,FB7490,FB7580|DECT200|Powerline546E|520E|openwrt
Anfänger: Linux,FHEM+Perl

Blackcat

#1002
Danke, das mit den Plot hat funktioniert :)

Nur die CPU temp will noch nicht  ::) muss ich da auch etwas neu konfigurieren?

Edit: nach restart wegen update war aufeinmal wieder alles weg :( wie bleiben die Änderungen dauerhaft
Viele Grüße Sandra - FHEM Style Entwicklerin iOS6+12
-----
ZBox nano, Homematic, Homebridge, Hue + Mi Light, ZWave, Dyson, etc.
https://www.foodcat.de
https://www.youtube.com/c/FoodCat (hier gibt es auch immer mehr Hausautomatisierungsvideos)

CoolTux

Zitat von: hexenmeister am 13 Juli 2015, 20:10:55
Ich tappe echt im Dunklem :(
Ich sehe, dass die Ausführung per Telnet fehl schlägt. Es wird praktisch nichts zurückübertragen. Aber zu den Ursachen steht nichts. Sollte aber.
Offensichtlich hast Du auch nicht die aktuellste Version. Kannst Du bitte die neuste nehmen und nach dem FHEM-Neustart 'get sysmon update' eingeben und den entstandenen Log posten.

Außerdem könntest Du probieren, das Attribut nonblocking auf 0 zu setzen. Dann wissen wir zumindest (hoffentlich), ob das Problem mit Telnet oder BlockingCall zusammenhängt.


Hallo Hexenmeister,

Habe nun die neuste Version des Modules installiert und ein get SYSMON update gemacht.

2015.07.16 10:59:51 5: SYSMON SYSMON_Proxy01: Get.660 SYSMON_Proxy01 update
2015.07.16 10:59:51 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: blockingCall.945 SYSMON_Proxy01, 1
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -d /proc/ ] && echo 1 || echo 0'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3416.
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'uptime'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3547.
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'free'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $val in concatenation (.) or string at ./FHEM/42_SYSMON.pm line 1460.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $val in numeric gt (>) at ./FHEM/42_SYSMON.pm line 1463.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $val in numeric lt (<) at ./FHEM/42_SYSMON.pm line 1464.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $val in addition (+) at ./FHEM/42_SYSMON.pm line 1465.
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get eth0
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig eth0 2>&1'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $dataThroughput[0] in index at ./FHEM/42_SYSMON.pm line 2673.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2690.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2693.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2697.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2700.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2703.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $_ in index at ./FHEM/42_SYSMON.pm line 2707.
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/class/net/eth0/statistics/rx_bytes ] && echo 1 || echo 0'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3557.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $d in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2756.
2015.07.16 10:59:52 1: PERL WARNING: Use of uninitialized value $d in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2759.
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get wlan0
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig wlan0 2>&1'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/class/net/wlan0/statistics/rx_bytes ] && echo 1 || echo 0'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2532 get root:/
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2543 exec df / -m 2>/dev/null
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'df / -m 2>/dev/null'
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2548 recieved 1 lines
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2568 recieved empty line
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: blockingFinish.1032 name|SYSMON_Proxy01|eth0|unexpected format|wlan0_diff|unexpected format|cpu_core_count|1|ram_used_stat|0.00 0.00 0.00|eth0_diff|unexpected format|ram|n/a|wlan0|unexpected format|root|Total: 0 MB, Used: 0 MB, 0 %, Available: 0 MB at / (not available)|swap|n/a|swap_used_stat|0.00 0.00 0.00
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 10:59:52 5: SYSMON SYSMON_Proxy01: Set.742 SYSMON_Proxy01 ?


Ausserdem hier noch mal das nonblocking=0


2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Get.660 SYSMON_Proxy01 update
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -d /proc/ ] && echo 1 || echo 0'
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3416.
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'uptime'
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0'
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3547.
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'free'
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value $val in concatenation (.) or string at ./FHEM/42_SYSMON.pm line 1460.
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value $val in numeric gt (>) at ./FHEM/42_SYSMON.pm line 1463.
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value $val in numeric lt (<) at ./FHEM/42_SYSMON.pm line 1464.
2015.07.16 11:22:35 1: PERL WARNING: Use of uninitialized value $val in addition (+) at ./FHEM/42_SYSMON.pm line 1465.
2015.07.16 11:22:35 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get eth0
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig eth0 2>&1'
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $dataThroughput[0] in index at ./FHEM/42_SYSMON.pm line 2673.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2690.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2693.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2697.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2700.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2703.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $_ in index at ./FHEM/42_SYSMON.pm line 2707.
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/class/net/eth0/statistics/rx_bytes ] && echo 1 || echo 0'
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3557.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $d in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2756.
2015.07.16 11:22:36 1: PERL WARNING: Use of uninitialized value $d in pattern match (m//) at ./FHEM/42_SYSMON.pm line 2759.
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get wlan0
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig wlan0 2>&1'
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute '[ -f /sys/class/net/wlan0/statistics/rx_bytes ] && echo 1 || echo 0'
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2532 get root:/
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2543 exec df / -m 2>/dev/null
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'df / -m 2>/dev/null'
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2548 recieved 1 lines
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: getFileSystemInfo.2568 recieved empty line
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 11:22:36 5: SYSMON SYSMON_Proxy01: Set.742 SYSMON_Proxy01 ?
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'uptime'
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'free'
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get eth0
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig eth0 2>&1'
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2632 get wlan0
2015.07.16 11:23:35 5: SYSMON SYSMON_Proxy01: Exec_Remote.4025 Execute 'ifconfig wlan0 2>&1'
2015.07.16 11:23:36 5: SYSMON SYSMON_Proxy01: Exec.3972 Result undef
2015.07.16 11:23:36 5: SYSMON SYSMON_Proxy01: getNetworkInfo.2644 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;

2015.07.16 11:23:36 5: SYSMON SYSMON_Proxy01: updateReadings.1051
2015.07.16 11:23:36 5: SYSMON SYSMON_Proxy01: Set.742 SYSMON_Proxy01 ?
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

hexenmeister

Deine Logs sind irgendwie zu klurz.
Z.B. in diesem Block gibt es eine Menge Ausgaben:
[...]
   SYSMON_Log($hash, 5, "Open Telnet connection to $host:$port");
   my $timeout = AttrVal( $name, "telnet-time-out", "10");
   my $t_prompt=AttrVal($name,'telnet-prompt-regx','(#|\$)\s*$');
   #my $telnet = new Net::Telnet ( Host=>$host, Port => $port, Timeout=>$timeout, Errmode=>'return', Prompt=>'/(#|\$) $/');
   my $telnet = new Net::Telnet ( Host=>$host, Port => $port, Timeout=>$timeout, Errmode=>'return', Prompt=>'/'.$t_prompt.'/');
   if (!$telnet) {
      $msg = "Could not open telnet connection to $host:$port";
      SYSMON_Log($hash, 2, $msg);
      $telnet = undef;
      $hash->{".telnet"}=$telnet;
      return $msg;
   }
   $hash->{".telnet"}=$telnet;

   SYSMON_Log($hash, 5, "Wait for user or password prompt.");
   unless ( ($before,$match) = $telnet->waitfor('/(user|login|password): $/i') )
   {
      $msg = "Telnet error while waiting for user or password prompt: ".$telnet->errmsg;
      SYSMON_Log($hash, 2, $msg);
      $telnet->close;
      $telnet = undef;
      return $msg;
   }
   if ( $match =~ /(user|login): / && $user eq "")
   {
      $msg = "Telnet login requires user name but attribute 'telnetUser' not defined";
      SYSMON_Log($hash, 2, $msg);
      $telnet->close;
      $telnet = undef;
      return $msg;
   }
   elsif ( $match =~ /(user|login): /)
   {
      SYSMON_Log($hash, 5, "Entering user name");
      $telnet->print( $user );

      SYSMON_Log($hash, 5, "Wait for password prompt");
      unless ($telnet->waitfor( '/password: $/i' ))
      {
         $msg = "Telnet error while waiting for password prompt: ".$telnet->errmsg;
         SYSMON_Log($hash, 2, $msg);
         $telnet->close;
         $telnet = undef;
         return $msg;
      }
   }
   elsif ( $match eq "password: " && $user ne "")
   {
      SYSMON_Log($hash, 3, "remote user was defined but telnet login did not prompt for user name.");
   }

   SYSMON_Log($hash, 5, "Entering password");
   $telnet->print( $pwd );

   SYSMON_Log($hash, 5, "Wait for command prompt");
   my $tlogin_prompt=AttrVal($name,'telnet-login-prompt-regx','(#|\$|>)\s*$|Login failed.');
   #unless ( ($before,$match) = $telnet->waitfor( '/# $|Login failed./i' ))
   unless ( ($before,$match) = $telnet->waitfor( '/'.$tlogin_prompt.'/i' ))
   {
      $msg = "Telnet error while waiting for command prompt: ".$telnet->errmsg;
      SYSMON_Log($hash, 2, $msg);
      $telnet->close;
      $telnet = undef;
      return $msg;
   }
   elsif ( $match eq "Login failed.")
   {
      $msg = "Telnet error: Login failed. Wrong password.";
      SYSMON_Log($hash, 2, $msg);
      $telnet->close;
      $telnet = undef;
      return $msg;
[...]

Diese will ich sehen. Suche doch bitte mal Dein Log nach 'Open Telnet connection to'...
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy