Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Ping über bestimmtes Interface

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Ping über bestimmtes Interface

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MCU @UncleB last edited by MCU

      @uncleb
      52baa5bf-97df-42f9-a3bf-f1d3a64b889c-image.png
      Was kommt als Ergebnis? Bitte in Codetags (</>) senden.

      U 1 Reply Last reply Reply Quote 0
      • OliverIO
        OliverIO @UncleB last edited by OliverIO

        @uncleb sagte in Ping über bestimmtes Interface:

        ping -I eth1 google.de

        du solltest auf jeden fall ein timeout einbauen, da ansonsten ping relativ lang wartet.
        Parameter w steht für timeout in sekunden. Wenn die Verbindungsaufnahme deines sticks länger dauert, dann ggfs. vergrößern

        ping -I eth1 -w 2 google.de
        

        ich würde dann mit grep auf den text packet loss prüfen

        if ping -I eth1 -w 2 google.de | grep -q "100% packet loss" ; then
            echo not found
            iobroker state set "id" "not found"
        else
            echo found
            iobroker state set "id" "found"
        fi
        

        das ssh müsstest du dann noch vor den ping befehl setzen,
        aber das konnte ich hier nicht testen
        evtl wegen den zwei verschachtelten anführungsstriche dann die inneren noch mit \" escapen
        getestet habe ich einmal mit google.de und einmal mit xgoogle.de

        1 Reply Last reply Reply Quote 0
        • U
          UncleB @MCU last edited by

          @mcu
          ich erhalte nur ein

          info	javascript.0 (6459) script.js.common.lte_test: undefined
          

          @oliverio said in Ping über bestimmtes Interface:

          du solltest auf jeden fall ein timeout einbauen, da ansonsten ping relativ lang wartet.
          Parameter w steht für timeout in sekunden. Wenn die Verbindungsaufnahme deines sticks länger dauert, dann ggfs. vergrößern

          Der Timeout Tipp is natürlich super, soweit war ich noch gar nicht 🙂
          Aber am liebsten wäre mir das ganze als Blockly, falls es umsetzbar ist

          M 1 Reply Last reply Reply Quote 0
          • M
            MCU @UncleB last edited by MCU

            @uncleb Zeig mal Dein Blockly. evtl hast du die Variable result nicht so angelegt. Result? Es muss genauso aussehen, wie es oben gezeigt wurde.

            U 1 Reply Last reply Reply Quote 0
            • U
              UncleB @MCU last edited by

              @mcu sollte eigtl passen, Variable result hab ich angelegt

              Screenshot - 2021-04-08T225541.085.png

              M 1 Reply Last reply Reply Quote 0
              • M
                MCU @UncleB last edited by MCU

                @uncleb Mit Ergebnissen anklicken. Lass den Zeitplan erstmal zum Testen weg. Kann man hinterher setzen.

                U 1 Reply Last reply Reply Quote 0
                • U
                  UncleB @MCU last edited by

                  @mcu
                  Den hab ich nur gesetzt damit das Script paar mal hinteinander ausgeführt wird 🙂
                  Hast Recht Ergebnisse habe ich vergessen..
                  Aber im Debug erhalte ich dennoch keine nützlichen Infos:

                  2:57:12.447	info	javascript.0 (583) Start javascript script.js.common.lte_test
                  22:57:12.482	info	javascript.0 (583) script.js.common.lte_test: registered 0 subscriptions and 1 schedule
                  22:57:31.118	info	javascript.0 (583) script.js.common.lte_test:
                  22:58:00.890	info	javascript.0 (583) script.js.common.lte_test:
                  22:58:30.918	info	javascript.0 (583) script.js.common.lte_test:
                  22:59:00.986	info	javascript.0 (583) script.js.common.lte_test:
                  22:59:31.037	info	javascript.0 (583) script.js.common.lte_test:
                  23:00:01.141	info	javascript.0 (583) script.js.common.lte_test:
                  
                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @UncleB last edited by

                    @uncleb Zeig mal das Ergebnis auf der Console.

                    U 1 Reply Last reply Reply Quote 0
                    • U
                      UncleB @MCU last edited by

                      @mcu
                      Auswahl_139.png

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @UncleB last edited by

                        @uncleb Versuch mal ein sudo davor.

                        U 1 Reply Last reply Reply Quote 0
                        • U
                          UncleB @MCU last edited by

                          @mcu passiert auch nichts.
                          Im Adapter muss ich ja nur Exec erlauben aktivieren oder?

                          M 1 Reply Last reply Reply Quote 0
                          • M
                            MCU @UncleB last edited by MCU

                            @uncleb Ja
                            b70e82e7-be91-4927-9ea1-fccf15fe23c3-image.png

                            1 Reply Last reply Reply Quote 0
                            • U
                              UncleB last edited by

                              @mcu hm ja okay.. is alles aktiviert..
                              Script liegt im Common Ordner... passt auch?

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                MCU @UncleB last edited by MCU

                                @uncleb
                                28d6e2ce-1e46-406e-b4af-f84bd754fdf3-image.png

                                javascript.0 (1699) script.js.TESTS.Alexa_Frage: exec: sudo ping -c 1 192.168.178.105
                                23:17:19.850	info	javascript.0 (1699) script.js.TESTS.Alexa_Frage: registered 0 subscriptions and 0 schedules
                                23:17:20.269	info	javascript.0 (1699) script.js.TESTS.Alexa_Frage: PING 192.168.178.105 (192.168.178.105) 56(84) bytes of data. From 192.168.178.89 icmp_seq=1 Destination Host Unreachable --- 192.168.178.105 ping statistics --- 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
                                
                                

                                Versuch es bei Dir mal erst mit einem Ping.

                                U 1 Reply Last reply Reply Quote 0
                                • U
                                  UncleB @MCU last edited by UncleB

                                  @mcu said in Ping über bestimmtes Interface:

                                  Versuch es bei Dir mal erst mit einem Ping.

                                  das funktioniert, aber sobald ich mich mit dem Router über SSH verbinden will passiert nichts mehr, in der Console gehts ohne Probleme

                                  Screenshot - 2021-04-08T234019.394.png

                                  M 2 Replies Last reply Reply Quote 0
                                  • M
                                    MCU @UncleB last edited by MCU

                                    @uncleb Vielleicht hat @apollon77 eine Idee? (germanbluefox nur über Adapter github erreichbar?)
                                    Oder es mal als question einbringen:
                                    https://github.com/ioBroker/ioBroker.javascript/issues

                                    U 1 Reply Last reply Reply Quote 0
                                    • U
                                      UncleB @MCU last edited by

                                      @mcu ich dank dir derweil schon mal für deine Mühe

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        MCU @UncleB last edited by

                                        @uncleb sudo davor hast du versucht? -> sudo ssh root....

                                        U 1 Reply Last reply Reply Quote 0
                                        • U
                                          UncleB @MCU last edited by

                                          @mcu ja, das bringt auch nix

                                          OliverIO 1 Reply Last reply Reply Quote 0
                                          • OliverIO
                                            OliverIO @UncleB last edited by

                                            @uncleb

                                            evtl. hilft euch dieser hinweis weiter
                                            https://forum.iobroker.net/topic/25798/gelöst-blockly-py-script-per-ssh-auf-pi/2?_=1617918676157
                                            iobroker/blockly greift als user iobroker zu.
                                            dieser user muss auf dem anderen rechner auch bekannt sein.

                                            ob es funktioniert kann auf der kommandozeile getestet werden, wenn man den befehl als user iobroker eingibt
                                            wenn es dabei fehlermeldungen gibt, dann kann stimmt etwas noch nicht an den berechtigungen auf dem anderen rechner.
                                            die tests oben mit ssh wurden ja alle nur mit dem user pi gemacht.

                                            sudo -u iobroker bash
                                            
                                            U 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            489
                                            Online

                                            32.0k
                                            Users

                                            80.4k
                                            Topics

                                            1.3m
                                            Posts

                                            3
                                            37
                                            1455
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo