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

Habe jetzt DeineVorschläge zum Netwerk übernommen. Ich hoffe, mit der Variablen klappt es jetzt auch.
Der Wert für RAM ergibt sich aus deinen Werten. Meines Wissens ist die Berechnung:
$used_clean = $used - $buffers - $cached;
korrekt.
Korrigiere mich, wenn ich falsch liege.


franky08

Ok, muss ich morgen den Ubuntu mal hochfahren, habe z.Zt. wieder ein Wheezy Server am laufen. Danke für deine Arbeit, ich hatte es dann erst mal zur Seite gelegt da sich Pfade zu verschiedenen Ressourcen sowie etliche cat Ausgaben deutlich zu Debian unterscheiden.

VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

#1217
@hexenmeister
Hallo, hab die Version gerade mal getestet. Es gibt immer noch das Problem mit der Netzwerkgeschwindigkeit und mit der Berechnung des Ram sowie RX, TX, und Total (isn´t numeric --> siehe Logmeldung). Da ram_used mit einem negativen Vorzeichen behaftet ist stimmt die Prozentangabe und Free natürlich auch nicht.
Anbei das list:
Internals:
   DEF        1 1 1 10
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 10
   MODE       local
   NAME       Zotac_Status
   NR         20
   STATE      Active
   TYPE       SYSMON
   Readings:
     2016-05-29 15:19:27   cpu0_freq       499
     2016-05-29 15:19:27   cpu0_freq_stat  499.00 499.00 499.00
     2016-05-29 15:19:27   cpu0_idle_stat  99.18 99.97 99.88
     2016-05-29 15:19:27   cpu1_freq       499
     2016-05-29 15:19:27   cpu1_freq_stat  499.00 596.00 500.66
     2016-05-29 15:19:27   cpu1_idle_stat  99.52 99.97 99.89
     2016-05-29 15:19:27   cpu1_temp       49.00
     2016-05-29 15:19:27   cpu1_temp_avg   48.6
     2016-05-29 15:19:27   cpu1_temp_stat  48.00 49.00 48.64
     2016-05-29 15:19:27   cpu2_freq       499
     2016-05-29 15:19:27   cpu2_freq_stat  499.00 600.00 500.06
     2016-05-29 15:19:27   cpu2_idle_stat  98.53 99.98 99.90
     2016-05-29 15:19:27   cpu2_temp       49.00
     2016-05-29 15:19:27   cpu2_temp_avg   48.6
     2016-05-29 15:19:27   cpu2_temp_stat  48.00 49.00 48.64
     2016-05-29 15:19:27   cpu3_freq       499
     2016-05-29 15:19:27   cpu3_freq_stat  499.00 530.00 499.17
     2016-05-29 15:19:27   cpu3_idle_stat  98.18 99.97 99.83
     2016-05-29 15:19:27   cpu3_temp       48.00
     2016-05-29 15:19:27   cpu3_temp_avg   48.2
     2016-05-29 15:19:27   cpu3_temp_stat  48.00 50.00 48.02
     2016-05-29 15:19:27   cpu4_temp       48.00
     2016-05-29 15:19:27   cpu4_temp_avg   48.2
     2016-05-29 15:19:27   cpu4_temp_stat  48.00 50.00 48.03
     2016-05-29 15:19:27   cpu_core_count  256
     2016-05-29 15:19:27   cpu_freq        499
     2016-05-29 15:19:27   cpu_freq_stat   499.00 499.00 499.00
     2016-05-29 15:19:27   cpu_idle_stat   98.86 99.92 99.88
     2016-05-29 15:09:27   cpu_model_name  Intel(R) Celeron(R) CPU  N2930  @ 1.83GHz
     2016-05-29 15:19:27   eth0            RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
     2016-05-29 15:19:27   eth0_diff       RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
     2016-05-29 15:19:27   eth0_ip         192.168.2.73
     2016-05-29 15:19:27   eth0_ip6        fe80::201:2eff:fe00:a188/64
     2016-05-29 15:19:27   eth0_rx         RX-Bytes:5680154
     2016-05-29 15:19:27   eth0_speed      not available
     2016-05-29 15:19:27   eth0_tx         TX-Bytes:2218737
     2016-05-29 15:19:27   fhemstarttime   1464527307
     2016-05-29 15:19:27   fhemstarttime_text 29.05.2016 15:08:27
     2016-05-29 15:19:27   fhemuptime      660
     2016-05-29 15:19:27   fhemuptime_text 0 days, 00 hours, 11 minutes
     2016-05-29 15:19:27   idletime        166 1.56 %
     2016-05-29 15:19:27   idletime_text   0 days, 00 hours, 02 minutes (1.56 %)
     2016-05-29 15:19:27   loadavg         0.00 0.01 0.05
     2016-05-29 15:09:27   perl_version    v5.22.1
     2016-05-29 15:19:27   ram             Total: 7875.16 MB, Used: -7801.00 MB, -99.06 %, Free: 15409.27 MB
     2016-05-29 15:19:27   ram_used_stat   -7805.69 -7764.53 -7797.90
     2016-05-29 15:10:27   root            Total: 460886 MB, Used: 4309 MB, 1 %, Available: 433143 MB at /
     2016-05-29 15:19:27   starttime       1464517296
     2016-05-29 15:19:27   starttime_text  29.05.2016 12:21:36
     2016-05-29 15:19:27   stat_cpu        3759 0 1452 4255633 5592 0 84
     2016-05-29 15:19:27   stat_cpu0       383 0 316 1064540 1326 0 40
     2016-05-29 15:19:27   stat_cpu0_diff  0 0 2 5994 0 0 1
     2016-05-29 15:19:27   stat_cpu0_percent 0.00 0.00 0.03 99.95 0.00 0.00 0.02
     2016-05-29 15:19:27   stat_cpu0_text  user: 0.00 %, nice: 0.00 %, sys: 0.03 %, idle: 99.95 %, io: 0.00 %, irq: 0.00 %, sirq: 0.02 %
     2016-05-29 15:19:27   stat_cpu1       586 0 341 1064126 1254 0 21
     2016-05-29 15:19:27   stat_cpu1_diff  1 0 2 5993 0 0 0
     2016-05-29 15:19:27   stat_cpu1_percent 0.02 0.00 0.03 99.95 0.00 0.00 0.00
     2016-05-29 15:19:27   stat_cpu1_text  user: 0.02 %, nice: 0.00 %, sys: 0.03 %, idle: 99.95 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 15:19:27   stat_cpu2       1632 0 341 1063650 1295 0 14
     2016-05-29 15:19:27   stat_cpu2_diff  1 0 3 5995 0 0 0
     2016-05-29 15:19:27   stat_cpu2_percent 0.02 0.00 0.05 99.93 0.00 0.00 0.00
     2016-05-29 15:19:27   stat_cpu2_text  user: 0.02 %, nice: 0.00 %, sys: 0.05 %, idle: 99.93 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 15:19:27   stat_cpu3       1158 0 452 1063317 1716 0 8
     2016-05-29 15:19:27   stat_cpu3_diff  4 0 4 5990 0 0 0
     2016-05-29 15:19:27   stat_cpu3_percent 0.07 0.00 0.07 99.87 0.00 0.00 0.00
     2016-05-29 15:19:27   stat_cpu3_text  user: 0.07 %, nice: 0.00 %, sys: 0.07 %, idle: 99.87 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 15:19:27   stat_cpu_diff   5 0 12 23971 0 0 1
     2016-05-29 15:19:27   stat_cpu_percent 0.02 0.00 0.05 99.92 0.00 0.00 0.00
     2016-05-29 15:19:27   stat_cpu_text   user: 0.02 %, nice: 0.00 %, sys: 0.05 %, idle: 99.92 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 15:19:27   swap            Total: 8084.00 MB, Used: 0.00 MB,  0.00 %, Free: 8084.00 MB
     2016-05-29 15:19:27   swap_used_stat  0.00 0.00 0.00
     2016-05-29 15:19:27   uptime          10670
     2016-05-29 15:19:27   uptime_text     0 days, 02 hours, 57 minutes
     2016-05-29 15:19:27   wlan            RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
     2016-05-29 15:19:27   wlan_diff       RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
     2016-05-29 15:19:27   wlan_rx         RX-Bytes:0
     2016-05-29 15:19:27   wlan_speed      not available
     2016-05-29 15:19:27   wlan_tx         TX-Bytes:0
   Helper:
     sys_cpu0_freq 1
     sys_cpu0_temp 0
     sys_cpu1_freq 1
     sys_cpu1_temp 1
     sys_cpu2_freq 1
     sys_cpu2_temp 1
     sys_cpu3_freq 1
     sys_cpu3_temp 1
     sys_cpu4_freq 0
     sys_cpu4_temp 1
     sys_cpu5_freq 0
     sys_cpu5_temp 0
     sys_cpu6_freq 0
     sys_cpu6_temp 0
     sys_cpu7_freq 0
     sys_cpu7_temp 0
     sys_cpu_freq_rpi_bbb 1
     sys_cpu_temp_bbb 0
     sys_cpu_temp_rpi 0
     sys_fb     0
     sys_power_ac 0
     sys_power_bat 0
     sys_power_usb 0
     u_first_mark 1
     Cur_readings_map:
       cpu0_freq  CPU frequency (core 0)
       cpu0_freq_stat CPU frequency (core 0) stat
       cpu0_idle_stat CPU0 min/max/avg (idle)
       cpu1_freq  CPU frequency (core 1)
       cpu1_freq_stat CPU frequency (core 1) stat
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu1_temp  CPU temperature (core 1)
       cpu1_temp_avg Average CPU temperature (core 1)
       cpu1_temp_stat CPU temperature stat (core 1)
       cpu2_freq  CPU frequency (core 2)
       cpu2_freq_stat CPU frequency (core 2) stat
       cpu2_idle_stat CPU2 min/max/avg (idle)
       cpu2_temp  CPU temperature (core 2)
       cpu2_temp_avg Average CPU temperature (core 2)
       cpu2_temp_stat CPU temperature stat (core 2)
       cpu3_freq  CPU frequency (core 3)
       cpu3_freq_stat CPU frequency (core 3) stat
       cpu3_idle_stat CPU3 min/max/avg (idle)
       cpu3_temp  CPU temperature (core 3)
       cpu3_temp_avg Average CPU temperature (core 3)
       cpu3_temp_stat CPU temperature stat (core 3)
       cpu4_idle_stat CPU4 min/max/avg (idle)
       cpu4_temp  CPU temperature (core 4)
       cpu4_temp_avg Average CPU temperature (core 4)
       cpu4_temp_stat CPU temperature stat (core 4)
       cpu5_idle_stat CPU5 min/max/avg (idle)
       cpu6_idle_stat CPU6 min/max/avg (idle)
       cpu7_idle_stat CPU7 min/max/avg (idle)
       cpu_bogomips BogoMIPS
       cpu_core_count Number of CPU cores
       cpu_freq   CPU frequency
       cpu_freq_stat CPU frequency stat
       cpu_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       date       Date
       eth0       Ethernet
       eth0_diff  Ethernet (diff)
       eth0_ip    Ethernet (IP)
       eth0_ip6   Ethernet (IP6)
       eth0_rx    Ethernet (RX)
       eth0_speed Ethernet (speed)
       eth0_tx    Ethernet (TX)
       fhemstarttime Fhem start time
       fhemstarttime_text Fhem start time
       fhemuptime System up time
       fhemuptime_text FHEM up time
       idletime   Idle time
       idletime_text Idle time
       io_sda     TEST
       io_sda_diff TEST
       io_sda_raw TEST
       loadavg    Load average
       loadavg_1  Load average 1
       loadavg_15 Load average 15
       loadavg_5  Load average 5
       perl_version Perl Version
       ram        RAM
       ram_free   RAM free
       ram_free_percent RAM free %
       ram_total  RAM total
       ram_used   RAM used
       ram_used_stat RAM used stat
       root       Filesystem /
       starttime  System start time
       starttime_text System start time
       stat_cpu   CPU statistics
       stat_cpu0  CPU0 statistics
       stat_cpu0_diff CPU0 statistics (diff)
       stat_cpu0_percent CPU0 statistics (diff, percent)
       stat_cpu0_text CPU0 statistics (text)
       stat_cpu1  CPU1 statistics
       stat_cpu1_diff CPU1 statistics (diff)
       stat_cpu1_percent CPU1 statistics (diff, percent)
       stat_cpu1_text CPU1 statistics (text)
       stat_cpu2  CPU2 statistics
       stat_cpu2_diff CPU2 statistics (diff)
       stat_cpu2_percent CPU2 statistics (diff, percent)
       stat_cpu2_text CPU2 statistics (text)
       stat_cpu3  CPU3 statistics
       stat_cpu3_diff CPU3 statistics (diff)
       stat_cpu3_percent CPU3 statistics (diff, percent)
       stat_cpu3_text CPU3 statistics (text)
       stat_cpu4  CPU4 statistics
       stat_cpu4_diff CPU4 statistics (diff)
       stat_cpu4_percent CPU4 statistics (diff, percent)
       stat_cpu4_text CPU4 statistics (text)
       stat_cpu5  CPU5 statistics
       stat_cpu5_diff CPU5 statistics (diff)
       stat_cpu5_percent CPU5 statistics (diff, percent)
       stat_cpu5_text CPU5 statistics (text)
       stat_cpu6  CPU6 statistics
       stat_cpu6_diff CPU6 statistics (diff)
       stat_cpu6_percent CPU6 statistics (diff, percent)
       stat_cpu6_text CPU6 statistics (text)
       stat_cpu7  CPU7 statistics
       stat_cpu7_diff CPU7 statistics (diff)
       stat_cpu7_percent CPU7 statistics (diff, percent)
       stat_cpu7_text CPU7 statistics (text)
       stat_cpu_diff CPU statistics (diff)
       stat_cpu_idle_percent CPU statistics idle %
       stat_cpu_io_percent CPU statistics io %
       stat_cpu_irq_percent CPU statistics irq %
       stat_cpu_nice_percent CPU statistics nice %
       stat_cpu_percent CPU statistics (diff, percent)
       stat_cpu_sirq_percent CPU statistics sirq %
       stat_cpu_sys_percent CPU statistics sys %
       stat_cpu_text CPU statistics (text)
       stat_cpu_user_percent CPU statistics user %
       swap       swap
       swap_free  swap free
       swap_total swap total
       swap_used  swap used
       swap_used_percent swap used %
       swap_used_stat swap used stat
       uptime     System up time
       uptime_text System up time
       wlan       WIFI
       wlan_diff  WIFI (diff)
       wlan_ip    WIFI (IP)
       wlan_ip6   WIFI (IP6)
       wlan_rx    WIFI (RX)
       wlan_speed WIFI (speed)
       wlan_tx    WIFI (TX)
     Excludes:
Attributes:
   network-interfaces eth0:enp1s0:Ethernet,wlan:wlp3s0:WIFI


und es hagelt massive Meldungen im Log wenn ich $nName wieder hardcodiert verwende, in deiner Version bekomme ich für speed leider sonst keine Ausgabe ---> Zeile2831

2016.05.29 15:40:41 0: Server started with 10 defined entities (fhem.pl:11476/2016-05-18 perl:5.022001 os:linux user:fhem pid:2658)
[Sun May 29 15:41:41 2016] fhem.pl: Argument "RX-Bytes:6280552" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:41:41 2016] fhem.pl: Argument "TX-Bytes:2713506" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:41:41 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:41:41 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:42:41 2016] fhem.pl: Argument "RX-Bytes:6293865" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:42:41 2016] fhem.pl: Argument "TX-Bytes:2722792" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:42:41 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:42:41 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:43:41 2016] fhem.pl: Argument "RX-Bytes:6297557" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:43:41 2016] fhem.pl: Argument "TX-Bytes:2735563" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:43:41 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:43:41 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:44:41 2016] fhem.pl: Argument "RX-Bytes:6331991" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:44:41 2016] fhem.pl: Argument "TX-Bytes:2898193" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:44:41 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:44:41 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:45:41 2016] fhem.pl: Argument "RX-Bytes:6351810" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:45:41 2016] fhem.pl: Argument "TX-Bytes:2966448" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:45:41 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:45:41 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:46:41 2016] fhem.pl: Argument "RX-Bytes:6356287" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:46:41 2016] fhem.pl: Argument "TX-Bytes:2981675" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:46:42 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:46:42 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:47:41 2016] fhem.pl: Argument "RX-Bytes:6359401" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:47:41 2016] fhem.pl: Argument "TX-Bytes:2994596" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.
[Sun May 29 15:47:42 2016] fhem.pl: Argument "RX-Bytes:0" isn't numeric in numeric lt (<) at ./FHEM/42_SYSMON.pm line 2799.
[Sun May 29 15:47:42 2016] fhem.pl: Argument "TX-Bytes:0" isn't numeric in division (/) at ./FHEM/42_SYSMON.pm line 2808.

VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

Zeile 2831 hardcodiert funktioniert wieder wie gehabt:
my $speed = SYSMON_execute($hash, "[ -f /sys/class/net/enp1s0/speed ] && cat /sys/class/net/enp1s0/speed 2>/dev/null || echo not available");
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

#1219
Zeilen 2769 und 2780 wie folgt ändern (das hattest du in einer vorherigen Version schon einmal)

  $dataThroughput =~ s/RX.[Bb]ytes://;
      $dataThroughput =~ s/TX.[Bb]ytes://;


Damit funktioniert die Ausgabe RX,TX und Total sowie ..diff wieder. Mit dem Ram komme ich heute wahrscheinlich nicht weiter. Ich hänge meine Version mal an, die ist für speed aber hardcodiert da $nName nicht funktioniert.

VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

Obwohl dein "Test" richtig ist:
# TEST
  #@speicher=('              gesamt       benutzt     frei      gemns.  Puffer/Cache verf¸gbar',
  #           'speicher:     8064160      588576     6629832      205760      845752     7199412',
  #           'Auslagerungsspeicher:     8278012           0     8278012'); 
  # ----


free liefert bei mir:

frank2@frank-ZBOX-UBUNTU:~$ free
              gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
Speicher:     8064160      120844     7665576        9384      277740     7875636
Auslagerungsspeicher:     8278012           0     8278012
frank2@frank-ZBOX-UBUNTU:~$


ist die Ausgabe nicht OK.

2016-05-29 17:27:02   ram             Total: 7875.16 MB, Used: -7769.94 MB, -98.66 %, Free: 15373.72 MB
2016-05-29 17:27:02   ram_used_stat   -7792.31 -7750.25 -7771.75
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

hexenmeister

Mein Test ist nicht 'richtig'. der liefert auch negative Zahlen. Ich verstehe nur nicht, was Dein System so ausgibt und warum.
Nach meinem Wissensstand, real genutzter Speicher ergibt sich aus 'used' abzüglich 'buffers' und 'shared'. Dein System scheint sich anders zu verhalten. Ich habe keine sichere Idee, wie ich das erkennen soll. Weiterhin ist mir überhaupt nicht verständlich, warum die Variable, die überall funktioniert, bei dir nicht will (und hardcoded dennoch tut). Stehe völlig auf dem Schlauch.

franky08

#1222
ZitatStehe völlig auf dem Schlauch.

Geht mir genau so, hängt´s an der Perl Version??? Ist auf dem Ubuntu die 5.22.1

ZitatMein Test ist nicht 'richtig'. der liefert auch negative Zahlen

dachte es funktioniert bei dir

P.S. hast du ein Ubuntu System zum testen?

VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

#1223
Ich habe hier mal eine Log 3 Ausgabe eingebaut um zu sehen wie die Variablen belegt sind:
Im Log:
2016.05.29 19:10:56 3: 7875.15625
2016.05.29 19:10:56 3: 157.66796875
2016.05.29 19:10:56 3: 7445.66015625
2016.05.29 19:10:56 3: 271.828125


Log 3:
if(defined($total) && $total > 0) {
 
    $total   = $total / 1024;
    $used    = $used / 1024;
    $free    = $free / 1024;
    $buffers = $buffers / 1024;
    Log 3, $total;
    Log 3, $used;
    Log 3, $free;
    Log 3, $buffers;


da kommt man dann sofort in's negative mit $used_clean = $used - $buffers - $cached;
da $used schon wesentlich < als $buffers ist


Da fehlt noch $cached:
2016.05.29 19:41:03 3: 7875.15625 total
2016.05.29 19:41:03 3: 149.9296875 used
2016.05.29 19:41:03 3: 7452.8203125 free
2016.05.29 19:41:03 3: 272.40625 buffers
2016.05.29 19:41:03 3: 7659.0234375 cached


free:
root@frank-ZBOX-UBUNTU:~# free
              gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
Speicher:     8064160      122584     7662520        9416      279056     7873732
Auslagerungsspeicher:     8278012           0     8278012
root@frank-ZBOX-UBUNTU:~#

Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

#1224
Soo, ein Fortschritt, für Ubuntu müsste der Code so aussehen:
Nee, ist noch ein Fehler drin.

$used_clean;
 
  if(defined($total) && $total > 0) {
 
    $total   = $total / 1024;
    $used    = $used / 1024;
    $free    = $free / 1024;
    $buffers = $buffers / 1024;
    #Log 3, $total;
    #Log 3, $used;
    #Log 3, $free;
    #Log 3, $buffers;
    if(defined($cached)) {
      $cached  = $cached / 1024;
      #Log 3, $cached;
    } else {
      # Bei FritzBox wird dieser Wert nicht ausgageben
      $cached  = 0;
    }
    # speicher:, 7875.15625, 574.78125, 6474.4453125, 205760, 825.9296875, 7030.67578125
    #SYSMON_Log($hash, 3, "XXXXXXXXXXXX 1: $fs_desc, $total, $used, $free, $shared, $buffers, $cached");
    $used_clean = $total - $buffers - $free;
    #SYSMON_Log($hash, 3, "XXXXXXXXXXXX 2: $used_clean");
    $ram = sprintf("Total: %.2f MB, Used: %.2f MB, %.2f %%, Free: %.2f MB", $total, $used_clean, ($used_clean / $total * 100), ($free + $buffers));
  }
  else
  {


List:

Internals:
   DEF        1 1 1 10
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 10
   MODE       local
   NAME       Zotac_Status
   NR         20
   STATE      Active
   TYPE       SYSMON
   Readings:
     2016-05-29 22:11:03   cpu0_freq       499
     2016-05-29 22:11:03   cpu0_freq_stat  499.00 594.00 540.50
     2016-05-29 22:11:03   cpu0_idle_stat  99.45 99.95 99.76
     2016-05-29 22:11:03   cpu1_freq       499
     2016-05-29 22:11:03   cpu1_freq_stat  499.00 499.00 499.00
     2016-05-29 22:11:03   cpu1_idle_stat  98.71 99.93 99.60
     2016-05-29 22:11:03   cpu1_temp       49.00
     2016-05-29 22:11:03   cpu1_temp_avg   49.6
     2016-05-29 22:11:03   cpu1_temp_stat  49.00 50.00 49.63
     2016-05-29 22:11:03   cpu2_freq       499
     2016-05-29 22:11:03   cpu2_freq_stat  499.00 499.00 499.00
     2016-05-29 22:11:03   cpu2_idle_stat  99.39 99.95 99.81
     2016-05-29 22:11:03   cpu2_temp       50.00
     2016-05-29 22:11:03   cpu2_temp_avg   49.8
     2016-05-29 22:11:03   cpu2_temp_stat  49.00 50.00 49.95
     2016-05-29 22:11:03   cpu3_freq       499
     2016-05-29 22:11:03   cpu3_freq_stat  499.00 499.00 499.00
     2016-05-29 22:11:03   cpu3_idle_stat  99.74 99.92 99.82
     2016-05-29 22:11:03   cpu3_temp       50.00
     2016-05-29 22:11:03   cpu3_temp_avg   49.8
     2016-05-29 22:11:03   cpu3_temp_stat  49.00 50.00 49.81
     2016-05-29 22:11:03   cpu4_temp       50.00
     2016-05-29 22:11:03   cpu4_temp_avg   50.0
     2016-05-29 22:11:03   cpu4_temp_stat  50.00 50.00 50.00
     2016-05-29 22:11:03   cpu_core_count  256
     2016-05-29 22:11:03   cpu_freq        499
     2016-05-29 22:11:03   cpu_freq_stat   499.00 594.00 540.50
     2016-05-29 22:11:03   cpu_idle_stat   99.32 99.89 99.75
     2016-05-29 22:10:03   cpu_model_name  Intel(R) Celeron(R) CPU  N2930  @ 1.83GHz
     2016-05-29 22:11:03   eth0            RX: 16.16 MB, TX: 10.31 MB, Total: 26.47 MB
     2016-05-29 22:11:03   eth0_diff       RX: 0.01 MB, TX: 0.01 MB, Total: 0.02 MB
     2016-05-29 22:11:03   eth0_ip         192.168.2.73
     2016-05-29 22:11:03   eth0_ip6        fe80::201:2eff:fe00:a188/64
     2016-05-29 22:11:03   eth0_rx         16942186
     2016-05-29 22:11:03   eth0_speed      1000
     2016-05-29 22:11:03   eth0_tx         10815600
     2016-05-29 22:11:03   fhemstarttime   1464552543
     2016-05-29 22:11:03   fhemstarttime_text 29.05.2016 22:09:03
     2016-05-29 22:11:03   fhemuptime      120
     2016-05-29 22:11:03   fhemuptime_text 0 days, 00 hours, 02 minutes
     2016-05-29 22:11:03   idletime        551 1.56 %
     2016-05-29 22:11:03   idletime_text   0 days, 00 hours, 09 minutes (1.56 %)
     2016-05-29 22:11:03   loadavg         0.00 0.01 0.05
     2016-05-29 22:10:03   perl_version    v5.22.1
     2016-05-29 22:11:03   ram             Total: 7875.16 MB, Used: 151.26 MB, 1.92 %, Free: 7723.90 MB
     2016-05-29 22:11:03   ram_used_stat   147.58 158.21 151.62
     2016-05-29 22:10:03   root            Total: 460886 MB, Used: 4310 MB, 1 %, Available: 433142 MB at /
     2016-05-29 22:11:03   starttime       1464517296
     2016-05-29 22:11:03   starttime_text  29.05.2016 12:21:36
     2016-05-29 22:11:03   stat_cpu        12164 654 9781 14110564 7651 0 293
     2016-05-29 22:11:03   stat_cpu0       2095 0 2307 3528871 1592 0 102
     2016-05-29 22:11:03   stat_cpu0_diff  1 0 2 5992 0 0 0
     2016-05-29 22:11:03   stat_cpu0_percent 0.02 0.00 0.03 99.95 0.00 0.00 0.00
     2016-05-29 22:11:03   stat_cpu0_text  user: 0.02 %, nice: 0.00 %, sys: 0.03 %, idle: 99.95 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:11:03   stat_cpu1       4023 2 2580 3526243 1669 0 81
     2016-05-29 22:11:03   stat_cpu1_diff  3 0 5 5991 0 0 1
     2016-05-29 22:11:03   stat_cpu1_percent 0.05 0.00 0.08 99.85 0.00 0.00 0.02
     2016-05-29 22:11:03   stat_cpu1_text  user: 0.05 %, nice: 0.00 %, sys: 0.08 %, idle: 99.85 %, io: 0.00 %, irq: 0.00 %, sirq: 0.02 %
     2016-05-29 22:11:03   stat_cpu2       2890 58 2323 3529397 1426 0 68
     2016-05-29 22:11:03   stat_cpu2_diff  2 0 5 5995 0 0 0
     2016-05-29 22:11:03   stat_cpu2_percent 0.03 0.00 0.08 99.88 0.00 0.00 0.00
     2016-05-29 22:11:03   stat_cpu2_text  user: 0.03 %, nice: 0.00 %, sys: 0.08 %, idle: 99.88 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:11:03   stat_cpu3       3156 593 2570 3526052 2964 0 40
     2016-05-29 22:11:03   stat_cpu3_diff  2 0 8 5991 0 0 0
     2016-05-29 22:11:03   stat_cpu3_percent 0.03 0.00 0.13 99.83 0.00 0.00 0.00
     2016-05-29 22:11:03   stat_cpu3_text  user: 0.03 %, nice: 0.00 %, sys: 0.13 %, idle: 99.83 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:11:03   stat_cpu_diff   6 0 19 23969 0 0 1
     2016-05-29 22:11:03   stat_cpu_percent 0.03 0.00 0.08 99.89 0.00 0.00 0.00
     2016-05-29 22:11:03   stat_cpu_text   user: 0.03 %, nice: 0.00 %, sys: 0.08 %, idle: 99.89 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:11:03   swap            Total: 8084.00 MB, Used: 0.00 MB,  0.00 %, Free: 8084.00 MB
     2016-05-29 22:11:03   swap_used_stat  0.00 0.00 0.00
     2016-05-29 22:11:03   uptime          35366
     2016-05-29 22:11:03   uptime_text     0 days, 09 hours, 49 minutes
     2016-05-29 22:11:03   wlan            RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
     2016-05-29 22:11:03   wlan_diff       RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
     2016-05-29 22:11:03   wlan_rx         0
     2016-05-29 22:11:03   wlan_speed      1000
     2016-05-29 22:11:03   wlan_tx         0
   Helper:
     sys_cpu0_freq 1
     sys_cpu0_temp 0
     sys_cpu1_freq 1
     sys_cpu1_temp 1
     sys_cpu2_freq 1
     sys_cpu2_temp 1
     sys_cpu3_freq 1
     sys_cpu3_temp 1
     sys_cpu4_freq 0
     sys_cpu4_temp 1
     sys_cpu5_freq 0
     sys_cpu5_temp 0
     sys_cpu6_freq 0
     sys_cpu6_temp 0
     sys_cpu7_freq 0
     sys_cpu7_temp 0
     sys_cpu_freq_rpi_bbb 1
     sys_cpu_temp_bbb 0
     sys_cpu_temp_rpi 0
     sys_fb     0
     sys_power_ac 0
     sys_power_bat 0
     sys_power_usb 0
     u_first_mark 1
     Cur_readings_map:
       cpu0_freq  CPU frequency (core 0)
       cpu0_freq_stat CPU frequency (core 0) stat
       cpu0_idle_stat CPU0 min/max/avg (idle)
       cpu1_freq  CPU frequency (core 1)
       cpu1_freq_stat CPU frequency (core 1) stat
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu1_temp  CPU temperature (core 1)
       cpu1_temp_avg Average CPU temperature (core 1)
       cpu1_temp_stat CPU temperature stat (core 1)
       cpu2_freq  CPU frequency (core 2)
       cpu2_freq_stat CPU frequency (core 2) stat
       cpu2_idle_stat CPU2 min/max/avg (idle)
       cpu2_temp  CPU temperature (core 2)
       cpu2_temp_avg Average CPU temperature (core 2)
       cpu2_temp_stat CPU temperature stat (core 2)
       cpu3_freq  CPU frequency (core 3)
       cpu3_freq_stat CPU frequency (core 3) stat
       cpu3_idle_stat CPU3 min/max/avg (idle)
       cpu3_temp  CPU temperature (core 3)
       cpu3_temp_avg Average CPU temperature (core 3)
       cpu3_temp_stat CPU temperature stat (core 3)
       cpu4_idle_stat CPU4 min/max/avg (idle)
       cpu4_temp  CPU temperature (core 4)
       cpu4_temp_avg Average CPU temperature (core 4)
       cpu4_temp_stat CPU temperature stat (core 4)
       cpu5_idle_stat CPU5 min/max/avg (idle)
       cpu6_idle_stat CPU6 min/max/avg (idle)
       cpu7_idle_stat CPU7 min/max/avg (idle)
       cpu_bogomips BogoMIPS
       cpu_core_count Number of CPU cores
       cpu_freq   CPU frequency
       cpu_freq_stat CPU frequency stat
       cpu_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       date       Date
       eth0       Ethernet
       eth0_diff  Ethernet (diff)
       eth0_ip    Ethernet (IP)
       eth0_ip6   Ethernet (IP6)
       eth0_rx    Ethernet (RX)
       eth0_speed Ethernet (speed)
       eth0_tx    Ethernet (TX)
       fhemstarttime Fhem start time
       fhemstarttime_text Fhem start time
       fhemuptime System up time
       fhemuptime_text FHEM up time
       idletime   Idle time
       idletime_text Idle time
       io_sda     TEST
       io_sda_diff TEST
       io_sda_raw TEST
       loadavg    Load average
       loadavg_1  Load average 1
       loadavg_15 Load average 15
       loadavg_5  Load average 5
       perl_version Perl Version
       ram        RAM
       ram_free   RAM free
       ram_free_percent RAM free %
       ram_total  RAM total
       ram_used   RAM used
       ram_used_stat RAM used stat
       root       Filesystem /
       starttime  System start time
       starttime_text System start time
       stat_cpu   CPU statistics
       stat_cpu0  CPU0 statistics
       stat_cpu0_diff CPU0 statistics (diff)
       stat_cpu0_percent CPU0 statistics (diff, percent)
       stat_cpu0_text CPU0 statistics (text)
       stat_cpu1  CPU1 statistics
       stat_cpu1_diff CPU1 statistics (diff)
       stat_cpu1_percent CPU1 statistics (diff, percent)
       stat_cpu1_text CPU1 statistics (text)
       stat_cpu2  CPU2 statistics
       stat_cpu2_diff CPU2 statistics (diff)
       stat_cpu2_percent CPU2 statistics (diff, percent)
       stat_cpu2_text CPU2 statistics (text)
       stat_cpu3  CPU3 statistics
       stat_cpu3_diff CPU3 statistics (diff)
       stat_cpu3_percent CPU3 statistics (diff, percent)
       stat_cpu3_text CPU3 statistics (text)
       stat_cpu4  CPU4 statistics
       stat_cpu4_diff CPU4 statistics (diff)
       stat_cpu4_percent CPU4 statistics (diff, percent)
       stat_cpu4_text CPU4 statistics (text)
       stat_cpu5  CPU5 statistics
       stat_cpu5_diff CPU5 statistics (diff)
       stat_cpu5_percent CPU5 statistics (diff, percent)
       stat_cpu5_text CPU5 statistics (text)
       stat_cpu6  CPU6 statistics
       stat_cpu6_diff CPU6 statistics (diff)
       stat_cpu6_percent CPU6 statistics (diff, percent)
       stat_cpu6_text CPU6 statistics (text)
       stat_cpu7  CPU7 statistics
       stat_cpu7_diff CPU7 statistics (diff)
       stat_cpu7_percent CPU7 statistics (diff, percent)
       stat_cpu7_text CPU7 statistics (text)
       stat_cpu_diff CPU statistics (diff)
       stat_cpu_idle_percent CPU statistics idle %
       stat_cpu_io_percent CPU statistics io %
       stat_cpu_irq_percent CPU statistics irq %
       stat_cpu_nice_percent CPU statistics nice %
       stat_cpu_percent CPU statistics (diff, percent)
       stat_cpu_sirq_percent CPU statistics sirq %
       stat_cpu_sys_percent CPU statistics sys %
       stat_cpu_text CPU statistics (text)
       stat_cpu_user_percent CPU statistics user %
       swap       swap
       swap_free  swap free
       swap_total swap total
       swap_used  swap used
       swap_used_percent swap used %
       swap_used_stat swap used stat
       uptime     System up time
       uptime_text System up time
       wlan       WIFI
       wlan_diff  WIFI (diff)
       wlan_ip    WIFI (IP)
       wlan_ip6   WIFI (IP6)
       wlan_rx    WIFI (RX)
       wlan_speed WIFI (speed)
       wlan_tx    WIFI (TX)
     Excludes:
Attributes:
   network-interfaces eth0:enp1s0:Ethernet,wlan:wlp3s0:WIFI


Bleibt nur noch das $nName  ;)
VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

franky08

#1225
Habe mal $nName mittels Log 3 ausgelesen und damit kann es nicht funktionieren:
2016.05.29 22:38:43 3: eth0
2016.05.29 22:38:43 3: wlan


da müsste enp1s0 und wlp3s0 drin stehen
jetzt noch enp1s0:enp1s0:Ethernet,wlp3s0:wlp3s0:WIFI in network-interfaces geändert und ALLES funktioniert  :)

List
Internals:
   DEF        1 1 1 10
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 10
   MODE       local
   NAME       Zotac_Status
   NR         20
   STATE      Active
   TYPE       SYSMON
   Readings:
     2016-05-29 22:47:47   cpu0_freq       499
     2016-05-29 22:47:47   cpu0_freq_stat  499.00 612.00 499.19
     2016-05-29 22:47:47   cpu0_idle_stat  98.99 99.97 99.77
     2016-05-29 22:47:47   cpu1_freq       499
     2016-05-29 22:47:47   cpu1_freq_stat  499.00 593.00 499.01
     2016-05-29 22:47:47   cpu1_idle_stat  98.71 99.93 99.74
     2016-05-29 22:47:47   cpu1_temp       49.00
     2016-05-29 22:47:47   cpu1_temp_avg   49.2
     2016-05-29 22:47:47   cpu1_temp_stat  49.00 50.00 49.19
     2016-05-29 22:47:47   cpu2_freq       499
     2016-05-29 22:47:47   cpu2_freq_stat  499.00 904.00 503.27
     2016-05-29 22:47:47   cpu2_idle_stat  99.39 99.95 99.80
     2016-05-29 22:47:47   cpu2_temp       50.00
     2016-05-29 22:47:47   cpu2_temp_avg   49.8
     2016-05-29 22:47:47   cpu2_temp_stat  49.00 50.00 49.89
     2016-05-29 22:47:47   cpu3_freq       499
     2016-05-29 22:47:47   cpu3_freq_stat  499.00 504.00 499.01
     2016-05-29 22:47:47   cpu3_idle_stat  99.37 99.92 99.83
     2016-05-29 22:47:47   cpu3_temp       50.00
     2016-05-29 22:47:47   cpu3_temp_avg   49.8
     2016-05-29 22:47:47   cpu3_temp_stat  49.00 50.00 49.98
     2016-05-29 22:47:47   cpu4_temp       50.00
     2016-05-29 22:47:47   cpu4_temp_avg   49.8
     2016-05-29 22:47:47   cpu4_temp_stat  49.00 50.00 49.96
     2016-05-29 22:47:47   cpu_core_count  256
     2016-05-29 22:47:47   cpu_freq        499
     2016-05-29 22:47:47   cpu_freq_stat   499.00 612.00 499.19
     2016-05-29 22:47:47   cpu_idle_stat   99.32 99.90 99.79
     2016-05-29 22:45:47   cpu_model_name  Intel(R) Celeron(R) CPU  N2930  @ 1.83GHz
     2016-05-29 22:47:47   enp1s0          RX: 16.90 MB, TX: 10.85 MB, Total: 27.75 MB
     2016-05-29 22:47:47   enp1s0_diff     RX: 0.00 MB, TX: 0.01 MB, Total: 0.01 MB
     2016-05-29 22:47:47   enp1s0_ip       192.168.2.73
     2016-05-29 22:47:47   enp1s0_ip6      fe80::201:2eff:fe00:a188/64
     2016-05-29 22:47:47   enp1s0_rx       17723650
     2016-05-29 22:47:47   enp1s0_speed    1000
     2016-05-29 22:47:47   enp1s0_tx       11382215
     2016-05-29 22:47:47   fhemstarttime   1464554687
     2016-05-29 22:47:47   fhemstarttime_text 29.05.2016 22:44:47
     2016-05-29 22:47:47   fhemuptime      180
     2016-05-29 22:47:47   fhemuptime_text 0 days, 00 hours, 03 minutes
     2016-05-29 22:47:47   idletime        585 1.56 %
     2016-05-29 22:47:47   idletime_text   0 days, 00 hours, 09 minutes (1.56 %)
     2016-05-29 22:47:47   loadavg         0.07 0.04 0.05
     2016-05-29 22:45:47   perl_version    v5.22.1
     2016-05-29 22:47:47   ram             Total: 7875.16 MB, Used: 152.26 MB, 1.93 %, Free: 7722.90 MB
     2016-05-29 22:47:47   ram_used_stat   147.58 168.69 154.33
     2016-05-29 22:45:47   root            Total: 460886 MB, Used: 4310 MB, 1 %, Available: 433142 MB at /
     2016-05-29 22:47:47   starttime       1464517297
     2016-05-29 22:47:47   starttime_text  29.05.2016 12:21:37
     2016-05-29 22:47:47   stat_cpu        12876 654 10561 14989978 7755 0 307
     2016-05-29 22:47:47   stat_cpu0       2269 0 2492 3748716 1595 0 108
     2016-05-29 22:47:47   stat_cpu0_diff  0 0 4 5992 0 0 0
     2016-05-29 22:47:47   stat_cpu0_percent 0.00 0.00 0.07 99.93 0.00 0.00 0.00
     2016-05-29 22:47:47   stat_cpu0_text  user: 0.00 %, nice: 0.00 %, sys: 0.07 %, idle: 99.93 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:47:47   stat_cpu1       4306 2 2780 3745968 1690 0 83
     2016-05-29 22:47:47   stat_cpu1_diff  3 0 4 5991 0 0 0
     2016-05-29 22:47:47   stat_cpu1_percent 0.05 0.00 0.07 99.88 0.00 0.00 0.00
     2016-05-29 22:47:47   stat_cpu1_text  user: 0.05 %, nice: 0.00 %, sys: 0.07 %, idle: 99.88 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:47:47   stat_cpu2       3038 58 2511 3749364 1426 0 73
     2016-05-29 22:47:47   stat_cpu2_diff  1 0 5 5992 0 0 0
     2016-05-29 22:47:47   stat_cpu2_percent 0.02 0.00 0.08 99.90 0.00 0.00 0.00
     2016-05-29 22:47:47   stat_cpu2_text  user: 0.02 %, nice: 0.00 %, sys: 0.08 %, idle: 99.90 %, io: 0.00 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:47:47   stat_cpu3       3262 593 2776 3745930 3042 0 41
     2016-05-29 22:47:47   stat_cpu3_diff  2 0 5 5986 4 0 0
     2016-05-29 22:47:47   stat_cpu3_percent 0.03 0.00 0.08 99.82 0.07 0.00 0.00
     2016-05-29 22:47:47   stat_cpu3_text  user: 0.03 %, nice: 0.00 %, sys: 0.08 %, idle: 99.82 %, io: 0.07 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:47:47   stat_cpu_diff   6 0 19 23959 5 0 1
     2016-05-29 22:47:47   stat_cpu_percent 0.03 0.00 0.08 99.87 0.02 0.00 0.00
     2016-05-29 22:47:47   stat_cpu_text   user: 0.03 %, nice: 0.00 %, sys: 0.08 %, idle: 99.87 %, io: 0.02 %, irq: 0.00 %, sirq: 0.00 %
     2016-05-29 22:47:47   swap            Total: 8084.00 MB, Used: 0.00 MB,  0.00 %, Free: 8084.00 MB
     2016-05-29 22:47:47   swap_used_stat  0.00 0.00 0.00
     2016-05-29 22:47:47   uptime          37569
     2016-05-29 22:47:47   uptime_text     0 days, 10 hours, 26 minutes
     2016-05-29 22:47:47   wlp3s0          RX: 0.00 MB, TX: 0.00 MB, Total: 0 MB
     2016-05-29 22:47:47   wlp3s0_diff     RX: 0.00 MB, TX: 0.00 MB, Total: 0.00 MB
     2016-05-29 22:47:47   wlp3s0_rx       0
     2016-05-29 22:47:47   wlp3s0_speed    not available
     2016-05-29 22:47:47   wlp3s0_tx       0
   Helper:
     sys_cpu0_freq 1
     sys_cpu0_temp 0
     sys_cpu1_freq 1
     sys_cpu1_temp 1
     sys_cpu2_freq 1
     sys_cpu2_temp 1
     sys_cpu3_freq 1
     sys_cpu3_temp 1
     sys_cpu4_freq 0
     sys_cpu4_temp 1
     sys_cpu5_freq 0
     sys_cpu5_temp 0
     sys_cpu6_freq 0
     sys_cpu6_temp 0
     sys_cpu7_freq 0
     sys_cpu7_temp 0
     sys_cpu_freq_rpi_bbb 1
     sys_cpu_temp_bbb 0
     sys_cpu_temp_rpi 0
     sys_fb     0
     sys_power_ac 0
     sys_power_bat 0
     sys_power_usb 0
     u_first_mark 1
     Cur_readings_map:
       cpu0_freq  CPU frequency (core 0)
       cpu0_freq_stat CPU frequency (core 0) stat
       cpu0_idle_stat CPU0 min/max/avg (idle)
       cpu1_freq  CPU frequency (core 1)
       cpu1_freq_stat CPU frequency (core 1) stat
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu1_temp  CPU temperature (core 1)
       cpu1_temp_avg Average CPU temperature (core 1)
       cpu1_temp_stat CPU temperature stat (core 1)
       cpu2_freq  CPU frequency (core 2)
       cpu2_freq_stat CPU frequency (core 2) stat
       cpu2_idle_stat CPU2 min/max/avg (idle)
       cpu2_temp  CPU temperature (core 2)
       cpu2_temp_avg Average CPU temperature (core 2)
       cpu2_temp_stat CPU temperature stat (core 2)
       cpu3_freq  CPU frequency (core 3)
       cpu3_freq_stat CPU frequency (core 3) stat
       cpu3_idle_stat CPU3 min/max/avg (idle)
       cpu3_temp  CPU temperature (core 3)
       cpu3_temp_avg Average CPU temperature (core 3)
       cpu3_temp_stat CPU temperature stat (core 3)
       cpu4_idle_stat CPU4 min/max/avg (idle)
       cpu4_temp  CPU temperature (core 4)
       cpu4_temp_avg Average CPU temperature (core 4)
       cpu4_temp_stat CPU temperature stat (core 4)
       cpu5_idle_stat CPU5 min/max/avg (idle)
       cpu6_idle_stat CPU6 min/max/avg (idle)
       cpu7_idle_stat CPU7 min/max/avg (idle)
       cpu_bogomips BogoMIPS
       cpu_core_count Number of CPU cores
       cpu_freq   CPU frequency
       cpu_freq_stat CPU frequency stat
       cpu_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       date       Date
       enp1s0     Ethernet
       enp1s0_diff Ethernet (diff)
       enp1s0_ip  Ethernet (IP)
       enp1s0_ip6 Ethernet (IP6)
       enp1s0_rx  Ethernet (RX)
       enp1s0_speed Ethernet (speed)
       enp1s0_tx  Ethernet (TX)
       fhemstarttime Fhem start time
       fhemstarttime_text Fhem start time
       fhemuptime System up time
       fhemuptime_text FHEM up time
       idletime   Idle time
       idletime_text Idle time
       io_sda     TEST
       io_sda_diff TEST
       io_sda_raw TEST
       loadavg    Load average
       loadavg_1  Load average 1
       loadavg_15 Load average 15
       loadavg_5  Load average 5
       perl_version Perl Version
       ram        RAM
       ram_free   RAM free
       ram_free_percent RAM free %
       ram_total  RAM total
       ram_used   RAM used
       ram_used_stat RAM used stat
       root       Filesystem /
       starttime  System start time
       starttime_text System start time
       stat_cpu   CPU statistics
       stat_cpu0  CPU0 statistics
       stat_cpu0_diff CPU0 statistics (diff)
       stat_cpu0_percent CPU0 statistics (diff, percent)
       stat_cpu0_text CPU0 statistics (text)
       stat_cpu1  CPU1 statistics
       stat_cpu1_diff CPU1 statistics (diff)
       stat_cpu1_percent CPU1 statistics (diff, percent)
       stat_cpu1_text CPU1 statistics (text)
       stat_cpu2  CPU2 statistics
       stat_cpu2_diff CPU2 statistics (diff)
       stat_cpu2_percent CPU2 statistics (diff, percent)
       stat_cpu2_text CPU2 statistics (text)
       stat_cpu3  CPU3 statistics
       stat_cpu3_diff CPU3 statistics (diff)
       stat_cpu3_percent CPU3 statistics (diff, percent)
       stat_cpu3_text CPU3 statistics (text)
       stat_cpu4  CPU4 statistics
       stat_cpu4_diff CPU4 statistics (diff)
       stat_cpu4_percent CPU4 statistics (diff, percent)
       stat_cpu4_text CPU4 statistics (text)
       stat_cpu5  CPU5 statistics
       stat_cpu5_diff CPU5 statistics (diff)
       stat_cpu5_percent CPU5 statistics (diff, percent)
       stat_cpu5_text CPU5 statistics (text)
       stat_cpu6  CPU6 statistics
       stat_cpu6_diff CPU6 statistics (diff)
       stat_cpu6_percent CPU6 statistics (diff, percent)
       stat_cpu6_text CPU6 statistics (text)
       stat_cpu7  CPU7 statistics
       stat_cpu7_diff CPU7 statistics (diff)
       stat_cpu7_percent CPU7 statistics (diff, percent)
       stat_cpu7_text CPU7 statistics (text)
       stat_cpu_diff CPU statistics (diff)
       stat_cpu_idle_percent CPU statistics idle %
       stat_cpu_io_percent CPU statistics io %
       stat_cpu_irq_percent CPU statistics irq %
       stat_cpu_nice_percent CPU statistics nice %
       stat_cpu_percent CPU statistics (diff, percent)
       stat_cpu_sirq_percent CPU statistics sirq %
       stat_cpu_sys_percent CPU statistics sys %
       stat_cpu_text CPU statistics (text)
       stat_cpu_user_percent CPU statistics user %
       swap       swap
       swap_free  swap free
       swap_total swap total
       swap_used  swap used
       swap_used_percent swap used %
       swap_used_stat swap used stat
       uptime     System up time
       uptime_text System up time
       wlp3s0     WIFI
       wlp3s0_diff WIFI (diff)
       wlp3s0_ip  WIFI (IP)
       wlp3s0_ip6 WIFI (IP6)
       wlp3s0_rx  WIFI (RX)
       wlp3s0_speed WIFI (speed)
       wlp3s0_tx  WIFI (TX)
     Excludes:
Attributes:
   network-interfaces enp1s0:enp1s0:Ethernet,wlp3s0:wlp3s0:WIFI


Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

Vize

Hallo zusammen,

ich hab mir mal per SYSMON die Systemdaten meines Raspis anzeigen lassen. Ohne Anpassung ist das ja erstmal ein ganz schöner Wust an Informationen...
Per exclude-Attribut konnte ich schonmal die "Gruppen" ausblenden, die mich nicht interessieren.

Meine Frage ist nun, ist es auch möglich, gezielt einzelne readings aus dem, was übrig bleibt, auszublenden?
Wenn ich mir den Beitrag zu SYSYMON auf der homepage von hexenmeister anschaue, scheint es ja zu funktionieren!?

Ich habe mal nen screenshot angehängt. Die dort gelb markierten readings würde ich gerne noch ausblenden.

Hier noch das list von meinem SYSMON-device:
Internals:
   CFGFN
   DEF        1 1 1 1
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 1
   MODE       local
   NAME       sysmon
   NR         9899
   STATE      Active
   TYPE       SYSMON
   Readings:
     2016-06-24 18:06:45   cpu_temp        44.92
     2016-06-24 18:06:45   cpu_temp_avg    44.8
     2016-06-24 18:06:45   cpu_temp_stat   44.39 45.46 44.81
     2016-06-24 18:06:45   fs_boot         Total: 56 MB, Used: 20 MB, 35 %, Available: 37 MB at /boot
     2016-06-24 18:06:45   fs_root         Total: 7338 MB, Used: 2764 MB, 40 %, Available: 4228 MB at /
     2016-06-24 18:06:45   ram             Total: 973.61 MB, Used: 75.45 MB, 7.75 %, Free: 898.16 MB
     2016-06-24 18:06:45   ram_used_stat   75.26 82.25 75.86
     2016-06-24 18:06:45   swap            Total: 100.00 MB, Used: 0.00 MB,  0.00 %, Free: 100.00 MB
     2016-06-24 18:06:45   swap_used_stat  0.00 0.00 0.00
   Helper:
     net_eth0_stat_class 1
     proc_fs    1
     sys_cpu0_freq 1
     sys_cpu0_temp 0
     sys_cpu1_freq 1
     sys_cpu1_temp 0
     sys_cpu2_freq 1
     sys_cpu2_temp 0
     sys_cpu3_freq 1
     sys_cpu3_temp 0
     sys_cpu4_freq 0
     sys_cpu4_temp 0
     sys_cpu5_freq 0
     sys_cpu5_temp 0
     sys_cpu6_freq 0
     sys_cpu6_temp 0
     sys_cpu7_freq 0
     sys_cpu7_temp 0
     sys_cpu_freq_rpi_bbb 1
     sys_cpu_temp_bbb 0
     sys_cpu_temp_rpi 1
     sys_fb     0
     sys_power_ac 0
     sys_power_bat 0
     sys_power_usb 0
     u_first_mark 1
     Cur_readings_map:
       cpu0_freq  CPU frequency (core 0)
       cpu0_freq_stat CPU frequency (core 0) stat
       cpu0_idle_stat CPU0 min/max/avg (idle)
       cpu1_freq  CPU frequency (core 1)
       cpu1_freq_stat CPU frequency (core 1) stat
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu2_freq  CPU frequency (core 2)
       cpu2_freq_stat CPU frequency (core 2) stat
       cpu2_idle_stat CPU2 min/max/avg (idle)
       cpu3_freq  CPU frequency (core 3)
       cpu3_freq_stat CPU frequency (core 3) stat
       cpu3_idle_stat CPU3 min/max/avg (idle)
       cpu4_idle_stat CPU4 min/max/avg (idle)
       cpu5_idle_stat CPU5 min/max/avg (idle)
       cpu6_idle_stat CPU6 min/max/avg (idle)
       cpu7_idle_stat CPU7 min/max/avg (idle)
       cpu_bogomips BogoMIPS
       cpu_core_count Number of CPU cores
       cpu_freq   CPU frequency
       cpu_freq_stat CPU frequency stat
       cpu_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       cpu_temp   CPU temperature
       cpu_temp_avg Average CPU temperature
       cpu_temp_stat CPU temperature stat
       date       Date
       eth0       Network adapter eth0
       eth0_diff  Network adapter eth0 (diff)
       eth0_ip    Network adapter eth0 (IP)
       eth0_ip6   Network adapter eth0 (IP6)
       eth0_rx    Network adapter eth0 (RX)
       eth0_speed Network adapter eth0 (speed)
       eth0_tx    Network adapter eth0 (TX)
       fhemstarttime Fhem start time
       fhemstarttime_text Fhem start time
       fhemuptime System up time
       fhemuptime_text FHEM up time
       fs_boot    Filesystem /boot
       fs_boot_free Filesystem /boot (free)
       fs_boot_used Filesystem /boot (used)
       fs_boot_used_percent Filesystem /boot (used %)
       fs_root    Filesystem /
       fs_root_free Filesystem / (free)
       fs_root_used Filesystem / (used)
       fs_root_used_percent Filesystem / (used %)
       idletime   Idle time
       idletime_text Idle time
       io_sda     TEST
       io_sda_diff TEST
       io_sda_raw TEST
       loadavg    Load average
       loadavg_1  Load average 1
       loadavg_15 Load average 15
       loadavg_5  Load average 5
       perl_version Perl Version
       ram        RAM
       ram_free   RAM free
       ram_free_percent RAM free %
       ram_total  RAM total
       ram_used   RAM used
       ram_used_stat RAM used stat
       starttime  System start time
       starttime_text System start time
       stat_cpu   CPU statistics
       stat_cpu0  CPU0 statistics
       stat_cpu0_diff CPU0 statistics (diff)
       stat_cpu0_percent CPU0 statistics (diff, percent)
       stat_cpu0_text CPU0 statistics (text)
       stat_cpu1  CPU1 statistics
       stat_cpu1_diff CPU1 statistics (diff)
       stat_cpu1_percent CPU1 statistics (diff, percent)
       stat_cpu1_text CPU1 statistics (text)
       stat_cpu2  CPU2 statistics
       stat_cpu2_diff CPU2 statistics (diff)
       stat_cpu2_percent CPU2 statistics (diff, percent)
       stat_cpu2_text CPU2 statistics (text)
       stat_cpu3  CPU3 statistics
       stat_cpu3_diff CPU3 statistics (diff)
       stat_cpu3_percent CPU3 statistics (diff, percent)
       stat_cpu3_text CPU3 statistics (text)
       stat_cpu4  CPU4 statistics
       stat_cpu4_diff CPU4 statistics (diff)
       stat_cpu4_percent CPU4 statistics (diff, percent)
       stat_cpu4_text CPU4 statistics (text)
       stat_cpu5  CPU5 statistics
       stat_cpu5_diff CPU5 statistics (diff)
       stat_cpu5_percent CPU5 statistics (diff, percent)
       stat_cpu5_text CPU5 statistics (text)
       stat_cpu6  CPU6 statistics
       stat_cpu6_diff CPU6 statistics (diff)
       stat_cpu6_percent CPU6 statistics (diff, percent)
       stat_cpu6_text CPU6 statistics (text)
       stat_cpu7  CPU7 statistics
       stat_cpu7_diff CPU7 statistics (diff)
       stat_cpu7_percent CPU7 statistics (diff, percent)
       stat_cpu7_text CPU7 statistics (text)
       stat_cpu_diff CPU statistics (diff)
       stat_cpu_idle_percent CPU statistics idle %
       stat_cpu_io_percent CPU statistics io %
       stat_cpu_irq_percent CPU statistics irq %
       stat_cpu_nice_percent CPU statistics nice %
       stat_cpu_percent CPU statistics (diff, percent)
       stat_cpu_sirq_percent CPU statistics sirq %
       stat_cpu_sys_percent CPU statistics sys %
       stat_cpu_text CPU statistics (text)
       stat_cpu_user_percent CPU statistics user %
       swap       swap
       swap_free  swap free
       swap_total swap total
       swap_used  swap used
       swap_used_percent swap used %
       swap_used_stat swap used stat
       uptime     System up time
       uptime_text System up time
       wlan0      Network adapter wlan0
       wlan0_diff Network adapter wlan0 (diff)
       wlan0_ip   Network adapter wlan0 (IP)
       wlan0_ip6  Network adapter wlan0 (IP6)
       wlan0_rx   Network adapter wlan0 (RX)
       wlan0_speed Network adapter wlan0 (speed)
       wlan0_tx   Network adapter wlan0 (TX)
     Excludes:
       cpucount   1
       cpufreq    1
       cpustat    1
       fhemuptime 1
       loadavg    1
       network    1
       uptime     1
     Shadow_map:
       cpu_temp   44.92
       cpu_temp_avg 44.8
       cpu_temp_stat 44.39 44.92 44.86
       eth0       RX: 234.51 MB, TX: 106.83 MB, Total: 341.34 MB
       eth0_diff  RX: 0.06 MB, TX: 0.03 MB, Total: 0.09 MB
       eth0_ip    192.XXX.XXX.XXX
       eth0_rx    245902318
       eth0_speed 100
       eth0_tx    112024372
       ram        Total: 973.61 MB, Used: 71.38 MB, 7.33 %, Free: 902.23 MB
       ram_used_stat 71.38 79.71 75.39
       root       Total: 7338 MB, Used: 2764 MB, 40 %, Available: 4228 MB at /
       swap       Total: 100.00 MB, Used: 0.00 MB,  0.00 %, Free: 100.00 MB
       swap_used_stat 0.00 0.00 0.00
       wlan0      not available
       wlan0_diff not available
Attributes:
   disable    0
   exclude    cpucount,cpufreq,cpustat,uptime,fhemuptime,loadavg,network
   filesystems fs_boot:/boot,fs_root:/


Vielen Dank schonmal für Hilfe aller Art!

Gruß
Andreas

PeMue

... mach doch eine readigsGroup (siehe fhem.de/commandref) mit dem, was Dich interessiert.

Gruß PeMue
RPi3Bv1.2 rpiaddon 1.66 6.0 1xHM-CC-RT-DN 1.4 1xHM-TC-IT-WM 1.1 2xHB-UW-Sen-THPL-O 0.15 1x-I 0.14OTAU  1xCUNO2 1.67 2xEM1000WZ 2xUniroll 1xASH2200 3xHMS100T(F) 1xRFXtrx 90 1xWT440H 3xTFA30.3150 5xFA21
RPi1Bv2 LCDCSM 1.63 5.8 2xMAX HKT 1xMAX RT V200KW1 Heizung Wasser

hexenmeister

Mit exclude kann man Aktualisierung einzelnen Readings unterbinden (s. Commandref). Dann kannst Du sie mit FHEM-Mitteln löschen.
Der Screenshot auf der Homepage ist aber einfach alt, da gab es nicht so viele.

Vize

Hallo Alexander,

danke für die Info, aber da habe ich irgendwie wohl ein Brett vor dem Kopf...

ZitatDann kannst Du sie mit FHEM-Mitteln löschen.

Beispiel:
Die Daten der CPU-Temperatur möchte ich angezeigt und aktualisiert haben. Also packe ich die nicht in das exclude-Atrribut.
Jetzt interessiert mich aus dieser "Gruppe" nur das reading cpu_temp. Cpu_temp_avg und cpu_temp_stat aber nicht.
Lösche ich diese readings mit deletereading <device> <reading>, werden sie aber beim nächsten Aktualisieren wieder angelegt...

Kann man denn überhaupt einzelne readings in SYSMON löschen?

Gruß
Andreas