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

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

Vorheriges Thema - Nächstes Thema

suchmich1983

hier ein Auszug aus dem Log:

2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4187 Execute 'uptime' by SSH
2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4194 Call: 'ssh loginuser@192.168.178.100 uptime'
2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4212 Result undef


mache ich das via Console kommt:

ssh loginuser@192.168.178.100 uptime
14:31pm  up 31 days 21:10,  0 users,  load average: 0.05, 0.08, 0.12

kadettilac89

#1411
Zitat von: suchmich1983 am 09 Juni 2017, 14:42:42
hier ein Auszug aus dem Log:

2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4187 Execute 'uptime' by SSH
2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4194 Call: 'ssh loginuser@192.168.178.100 uptime'
2017.06.09 14:24:57 5: SYSMON sysmon: Exec_Ssh.4212 Result undef


mache ich das via Console kommt:

ssh loginuser@192.168.178.100 uptime
14:31pm  up 31 days 21:10,  0 users,  load average: 0.05, 0.08, 0.12


Du versuchst dich per Passwort einzuloggen, zuindest verstehe ich das so. Das ist ein Sicherheitsproblem. Ich habe es nicht im Einsazt aber soviel ich weiß geht das mit sysmon nur per ssh-trust ...

Es gab schon mal eine Diskssion dazu ... https://forum.fhem.de/index.php/topic,17201.msg599185.html#msg599185

Wenn sich die Systeme vertrauen (Zertifikate vorhanden sind) ist kein Passwort nötig. Kannst ja mal bei Google suchen. Wenn du vom Raspberry auf deinen Remotehost per ssh ohne passwort zugreifen kannst weil du Zertifikate installiert hast, sollte es funktionieren wie du dir das vorstellst.

Nachtrag: ... oder du liest dir die Commandref mal durch :)  ... https://fhem.de/commandref.html#SYSMON

o query a remote system at least the address (HOST) must be specified. Accompanied by the port and / or user name, if necessary. The password (if needed) has to be defined once with the command 'set password <password>'. For MODE parameter are 'telnet', 'ssh' and 'local' only allowed. 'local' does not require any other parameters and can also be omitted.
For SSH login with password, 'sshpass' must be installed (note: not recommended! Use public key authentication instead). For SSH login to work, a manual SSH connection to the remote machine from the FHEM-Acount may need to be done once (under whose rights FHEM runs) the fingerprint must be confirmed.

suchmich1983

Dank dir für dein Feedback!

Ich hab es in der Zwischenzeit auch auf "key auth" umgestellt, aber so richtig komme ich immer noch nicht weiter.
Mache ich an der fhem shell ein
ssh loginuser@firewall
dann werde ich direkt eingeloggt.

Im FHEM Log sehe ich aber die ganze Zeit nur:
Host key verification failed.

Ich habe alles schon eingestellt, dass der User unter dem FHEM läuft immer "key auth" nutzt.

Irgendwie stehe ich auf dem Schlauch. Komisch, dass es an der Konsole klappt..

suchmich1983

sorry, ich lerne noch laufen mit LINUX...

habe es hinbekommen. Hatte natürlich nicht den User unter dem fhem läuft ein entsprechendes Key-Pair verpasst, sondern dem User mit dem ich den Server administriere.

Habe es nun so gemacht wie hier (sehr schön) beschrieben:

http://heinz-otto.blogspot.de/2017/01/per-ssh-remote-befehle-direkt-ausfuhren.html

Ich erstelle nun mal eine schöne Übersicht zum Monitoren einer Sophos UTM.
Stelle das natürlich später auch hier online. Vielleichts kanns ja mal wer brauchen.

Danke und Grüße!

hexenmeister

Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

yrwyddfa

Das ist echt ne schicke Sache! Zumal das sehr elegant beantwortet, wieweit der Pi von seinen Leistungsgrenzen entfernt ist - Danke dafür!
If every day has its number, Monday would be a zero division.

TWART016

Hallo,

ich versuche gerade SYSMON auf Remote Systemen (Ubuntu Server) einzurichten. Die wenigen Daten werden mir jedoch als not available angezeigt.

Internals:
   CFGFN
   DEF        telnet:user@192.168.178.12:22 1 1 1 10
   HOST       192.168.178.12
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 10
   MODE       telnet
   NAME       sysmon_nextcloud
   NR         951
   PORT       22
   STATE      Initialized
   TYPE       SYSMON
   USER       user
   Readings:
     2017-06-16 01:35:38   cpu_core_count  1
     2017-06-16 01:35:38   eth0            not available
     2017-06-16 01:35:38   eth0_diff       not available
     2017-06-16 01:35:38   ram             n/a
     2017-06-16 01:35:38   root            Total: 0 MB, Used: 0 MB, 0 %, Available: 0 MB at / (not available)
     2017-06-16 01:35:38   swap            n/a
     2017-06-16 01:35:38   wlan0           not available
     2017-06-16 01:35:38   wlan0_diff      not available
   Helper:
     error_msg
     sys_cpu0_freq 0
     sys_cpu0_temp 0
     sys_cpu1_freq 0
     sys_cpu1_temp 0
     sys_cpu2_freq 0
     sys_cpu2_temp 0
     sys_cpu3_freq 0
     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 0
     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_idle_stat CPU0 min/max/avg (idle)
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu2_idle_stat CPU2 min/max/avg (idle)
       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_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       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
       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
       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
       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)
Attributes:



2017.06.16 01:41:03 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?
2017.06.16 01:41:03 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:41:03 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:41:00 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: updateReadings.1060
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: blockingFinish.1041 name|sysmon_nextcloud|wlan0_diff|not available|swap|n/a|root|Total: 0 MB, Used: 0 MB, 0 %, Available: 0 MB at / (not available)|eth0_diff|not available|ram|n/a|cpu_core_count|1|wlan0|not available|eth0|not available
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getFileSystemInfo.2610 recieved empty line
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getFileSystemInfo.2590 recieved 1 lines
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute 'df / -m 2>/dev/null'
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getFileSystemInfo.2585 exec df / -m 2>/dev/null
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getFileSystemInfo.2574 get root:/

2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getNetworkInfo.2686 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute '/sbin/ifconfig wlan0 2>&1'
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getNetworkInfo.2674 get wlan0

2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getNetworkInfo.2686 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute '/sbin/ifconfig eth0 2>&1'
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: getNetworkInfo.2674 get eth0
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute 'LANG=en free'
2017.06.16 01:40:58 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3610.
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute '[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0'
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute 'uptime'
2017.06.16 01:40:58 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3479.
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec.4036 Result undef
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Exec_Remote.4093 Execute '[ -d /proc/ ] && echo 1 || echo 0'
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: blockingCall.954 sysmon_nextcloud, 1
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: updateReadings.1060
2017.06.16 01:40:58 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud password Direktt0
2017.06.16 01:40:51 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?
2017.06.16 01:40:51 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:51 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:50 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?
2017.06.16 01:40:50 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:50 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:49 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 01:40:38 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3610.
2017.06.16 01:40:38 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3479.
2017.06.16 01:40:05 2: SYSMON sysmon_FHEM2: Open_Connection.3877 Could not open telnet connection to 192.168.178.11:23
2017.06.16 01:39:38 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3610.
2017.06.16 01:39:38 1: PERL WARNING: Use of uninitialized value in int at ./FHEM/42_SYSMON.pm line 3479.


Auch mit ssh habe ich es schon probiert. Dort erscheinen aber gar keine Readings.  User und Passwort ist auch gesetzt.

Selbst auf dem FHEM Server habe ich das gleiche Ergebnis.
Eingebunden habe ich das dort mit
define sysmon_FHEM SYSMON 1 1 1 10
Das hat auch wunderbar geklappt und mir werden alle Daten angezeigt.

sudo apt-get install libnet-telnet-perl
habe ich auf allen Systemen gemacht.


Gruß
TWART016

SabineT

Um vom Netzwerkinterface die Daten zu bekommen musst du das Attribute network-interfaces setzen. Bei meinem Ubuntu-Rechner hab ich da z.B.:
attr sysmon network-interfaces eth0:enp3s0:Ethernet,wlan0:wlp4s0:WiFi
Musst du natürlich an dein System anpassen bzw. wenn du nur ein Interface verwendest dann auch nur das hier angeben.

Für die Filesysteme das Attribute filesystems:
attr sysmon filesystems fs_root:/,fs_efi:/boot/efi
Auch passend zu deiner Installation vom Ubuntu.

ram und swap hatte mit der SYSMON Version älter als 15.5.2017 nicht funktioniert, wenn man am Remote-System eine andere Sprache als Englisch eingestellt hatte. Mit der aktuellen Version sollte das aber klappen (SYSMON verwendet jetzt für die Abfrage "LANG=en free").

lg, Sabine

hexenmeister

Aus den schnellen Blick sieht das nach einem Authentifizierungsproblem. Ich würde Schlüssel anlegen, Authentifizierung einrichten, User und Rechte prüfen und wieder auf SSH umstellen. Telnet-daemon würde ich deinstallieren.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

TWART016

#1419
Zitat von: SabineT am 16 Juni 2017, 06:38:26
Um vom Netzwerkinterface die Daten zu bekommen musst du das Attribute network-interfaces setzen. Bei meinem Ubuntu-Rechner hab ich da z.B.:
attr sysmon network-interfaces eth0:enp3s0:Ethernet,wlan0:wlp4s0:WiFi
Musst du natürlich an dein System anpassen bzw. wenn du nur ein Interface verwendest dann auch nur das hier angeben.
In Device vom FHEM kommen Werte an. Nur an dem externen Server gibt es Probleme.
attr sysmon_nextcloud network-interfaces inet:inet6


Zitat von: SabineT am 16 Juni 2017, 06:38:26
Für die Filesysteme das Attribute filesystems:.
attr sysmon filesystems fs_root:/,fs_efi:/boot/efi
Auch passend zu deiner Installation vom Ubuntu.
fs_efi wird bei mir z.B. nicht gefunden. Wie kann ich auslesen, welche ich verwende?

auch
/opt
funktioniert nicht

Zitat von: SabineT am 16 Juni 2017, 06:38:26
ram und swap hatte mit der SYSMON Version älter als 15.5.2017 nicht funktioniert, wenn man am Remote-System eine andere Sprache als Englisch eingestellt hatte. Mit der aktuellen Version sollte das aber klappen (SYSMON verwendet jetzt für die Abfrage "LANG=en free").
Mein FHEM ist aktuell, also sollte ich die aktuellste Version installiert haben.

Zitat von: hexenmeister am 16 Juni 2017, 06:53:09
Aus den schnellen Blick sieht das nach einem Authentifizierungsproblem. Ich würde Schlüssel anlegen, Authentifizierung einrichten, User und Rechte prüfen und wieder auf SSH umstellen. Telnet-daemon würde ich deinstallieren.
Ich habe wieder auf ssh und ohne Portangabe umgestellt. Auch den root User habe ich angegeben. Was benötige ich für Rechte? Passwort stimmt
Internals:
   DEF        ssh:root@192.168.178.12 1 1 1 10
   HOST       192.168.178.12
   INTERVAL_BASE 60
   INTERVAL_MULTIPLIERS 1 1 1 10
   MODE       ssh
   NAME       sysmon_nextcloud
   NR         562
   PORT       22
   STATE      Initialized
   TYPE       SYSMON
   USER       root
   Readings:
     2017-06-16 16:40:27   cpu_core_count  1
     2017-06-16 16:40:27   ens32           unexpected format
     2017-06-16 16:40:27   ens32_diff      unexpected format
     2017-06-16 16:40:27   fs_efi          Total: 0 MB, Used: 0 MB, 0 %, Available: 0 MB at /boot/efi (not available)
     2017-06-16 16:40:27   fs_root         Total: 0 MB, Used: 0 MB, 0 %, Available: 0 MB at / (not available)
     2017-06-16 16:40:27   ram             n/a
     2017-06-16 16:40:27   swap            n/a
   Helper:
     sys_cpu0_freq 0
     sys_cpu0_temp 0
     sys_cpu1_freq 0
     sys_cpu1_temp 0
     sys_cpu2_freq 0
     sys_cpu2_temp 0
     sys_cpu3_freq 0
     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 0
     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_idle_stat CPU0 min/max/avg (idle)
       cpu1_idle_stat CPU1 min/max/avg (idle)
       cpu2_idle_stat CPU2 min/max/avg (idle)
       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_idle_stat CPU min/max/avg (idle)
       cpu_model_name CPU model name
       date       Date
       ens32      Network adapter ens32
       ens32_diff Network adapter ens32 (diff)
       ens32_ip   Network adapter ens32 (IP)
       ens32_ip6  Network adapter ens32 (IP6)
       ens32_rx   Network adapter ens32 (RX)
       ens32_speed Network adapter ens32 (speed)
       ens32_tx   Network adapter ens32 (TX)
       fhemstarttime Fhem start time
       fhemstarttime_text Fhem start time
       fhemuptime System up time
       fhemuptime_text FHEM up time
       fs_efi     Filesystem /boot/efi
       fs_efi_free Filesystem /boot/efi (free)
       fs_efi_used Filesystem /boot/efi (used)
       fs_efi_used_percent Filesystem /boot/efi (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
       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
Attributes:
   filesystems fs_root:/,fs_efi:/boot/efi
   network-interfaces ens32
   verbose    5


Was meinst du mit Schlüssel anlegen, Authentifizierung einrichten?

2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: updateReadings.1060
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: blockingFinish.1041 name|sysmon_nextcloud|ens32_diff|unexpected format|ram|n/a|ens32|unexpected format|cpu_core_count|1|swap|n/a
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result '0'
sh: echo: I/O error
sh: 1: sshpass: not found
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh root@192.168.178.12 [ -f /sys/class/net/ens32/statistics/rx_bytes ] && echo 1 || echo 0'
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '[ -f /sys/class/net/ens32/statistics/rx_bytes ] && echo 1 || echo 0' by SSH
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file

2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: getNetworkInfo.2686 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = 'sh: 1: sshpass: not found';
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result 'sh: 1: sshpass: not found'
sh: echo: I/O error
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh root@192.168.178.12 /sbin/ifconfig ens32 2>&1'
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '/sbin/ifconfig ens32 2>&1' by SSH
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: getNetworkInfo.2674 get ens32
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4212 Result undef
sh: echo: I/O error
sh: 1: sshpass: not found
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh root@192.168.178.12 LANG=en free'
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute 'LANG=en free' by SSH
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result '0'
sh: echo: I/O error
sh: 1: sshpass: not found
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh root@192.168.178.12 [ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0'
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0' by SSH
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4212 Result undef
sh: echo: I/O error
sh: 1: sshpass: not found
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh root@192.168.178.12 uptime'
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute 'uptime' by SSH
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 16:43:27 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result '0'
sh: echo: I/O error
sh: 1: sshpass: not found



Übrigens, mein Ubuntu läuft auf einem Intel NUC mit ESXi.

hexenmeister

ZitatWas meinst du mit Schlüssel anlegen, Authentifizierung einrichten?
SSH funktioniert eigentlich nicht mit Passwort, sondern mit Schlüsselpaaren. Mit Passwort ist nut eine Krücke mit sshpass. Dass es bei Dir nicht funktioniert, liegt daran, dass sshpass nicht installiert ist. Ist leicht nachzuholen, dennoch rate ich eindringlich key authentication zu verwenden. sshpass ist nicht ohne Grund verpönt.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

SabineT

Zitat von: TWART016 am 16 Juni 2017, 16:42:47
In Device vom FHEM kommen Werte an. Nur an dem externen Server gibt es Probleme.
attr sysmon_nextcloud network-interfaces inet:inet6

fs_efi wird bei mir z.B. nicht gefunden. Wie kann ich auslesen, welche ich verwende?

auch
/opt
funktioniert nicht
Das Attribute für die network-interfaces musst du natürlich an deinen externen Server anpassen, das gleiche gilt für die Filesysteme. Wenn du kein /boot/efi in Verwendung hast dann lasst du das ",fs_efi:/boot/efi" einfach weg.

Aber als erstes muss halt der Remotezugriff für FHEM auf deinen externen Server klappen.

Wernieman

Also mit Hilfe von google findet man vieles, hier mal Exemplarisch und in Kürze:

Als Quell-user (für Dich fhem auf dem Hostsystem)
ssh-keygen -t rsa

Auf dem Zielhost beim Zieluser in der Datei .ssh/authorized_keys den Inhalt von .ssh/id_dsa.pub reinschreiben, bzw. wenn schon Inhalt existiert, dazuschreiben.

Hinweis:
NUR DIE .pub-Datei .. die andere hat aus Sicherheitsgründen den rechner NICHT zu verlassen!

Vereinfachen kann man es auch mit:
Als Quell-user (für Dich fhem auf dem Hostsystem)
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-system
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

TWART016

#1423
Zitat von: Wernieman am 16 Juni 2017, 18:41:59
Also mit Hilfe von google findet man vieles, hier mal Exemplarisch und in Kürze:

Als Quell-user (für Dich fhem auf dem Hostsystem)
ssh-keygen -t rsa

Auf dem Zielhost beim Zieluser in der Datei .ssh/authorized_keys den Inhalt von .ssh/id_dsa.pub reinschreiben, bzw. wenn schon Inhalt existiert, dazuschreiben.

Hinweis:
NUR DIE .pub-Datei .. die andere hat aus Sicherheitsgründen den rechner NICHT zu verlassen!

Vereinfachen kann man es auch mit:
Als Quell-user (für Dich fhem auf dem Hostsystem)
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-system

Ich habe nun die Keys erstellt. Sie wurde auch erfolgreich in den home Ordner des Benutzers auf dem anderen Server kopiert. Der Key steht in der Datei authorized_keys.


2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: updateReadings.1060
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: blockingFinish.1041 name|sysmon_nextcloud|ens32_diff|not available|swap|n/a|cpu_core_count|1|ram|n/a|ens32|not available

2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: getNetworkInfo.2686 SYSMON_getNetworkInfo>>>>>>>>>>>>>>>>$VAR1 = undef;
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4212 Result undef
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh tim@192.168.178.12 /sbin/ifconfig ens32 2>&1'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '/sbin/ifconfig ens32 2>&1' by SSH
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: getNetworkInfo.2674 get ens32
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4212 Result undef
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh tim@192.168.178.12 LANG=en free'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute 'LANG=en free' by SSH
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result '0'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh tim@192.168.178.12 [ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0' by SSH
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4212 Result undef
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh tim@192.168.178.12 uptime'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute 'uptime' by SSH
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4210 Result '0'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4194 Call: 'ssh tim@192.168.178.12 [ -d /proc/ ] && echo 1 || echo 0'
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: Exec_Ssh.4187 Execute '[ -d /proc/ ] && echo 1 || echo 0' by SSH
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: readPassword.3776 Read password from file
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: blockingCall.954 sysmon_nextcloud,
2017.06.16 20:13:28 5: SYSMON sysmon_nextcloud: updateReadings.1060
2017.06.16 20:13:24 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?
2017.06.16 20:13:24 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 20:13:24 5: SYSMON sysmon_nextcloud: Set.748 sysmon_nextcloud ?
2017.06.16 20:13:23 5: SYSMON sysmon_nextcloud: Get.666 sysmon_nextcloud ?


Auch der Login mit ssh tim@192.168.178.12 funktioniert.


Zitat von: SabineT am 16 Juni 2017, 18:35:53
Wenn du kein /boot/efi in Verwendung hast dann lasst du das ",fs_efi:/boot/efi" einfach weg.
Ist mir schon klar. Wie kann ich auslesen, was für mich zur Verfügung steht?
EDIT: Auch /opt wird als not available gekennzeichnet. Das Verzeichnis gibt es definitiv, dort ist FHEM instalilert.
fs_opt:/opt

SabineT

Zitat von: TWART016 am 16 Juni 2017, 20:20:09
Ist mir schon klar. Wie kann ich auslesen, was für mich zur Verfügung steht?
EDIT: Auch /opt wird als not available gekennzeichnet. Das Verzeichnis gibt es definitiv, dort ist FHEM instalilert.
fs_opt:/opt
mach einfach mal am anderen Server df da siehst du dann, welche Dateisysteme gemounted sind. Die mit /dev/ am Zeilenanfang sind dann die, die sinnvollerweise vom SYSMON abgefragt werden sollten. Falls da nur eine einzige Partition im Einsatz ist wird dann auch nur die Zeile mit / am Ende vorhanden sein.
Zeilen mit udev oder tmpfs am Anfang sind eher uninteressant für SYSMOM.