ioBroker.ping icon indicating copy to clipboard operation
ioBroker.ping copied to clipboard

Monitoring eines bestimmen Ports

Open jotbed opened this issue 4 years ago • 7 comments

Hallo,

ich bin neu bei IoB und bin dabei auf den Adapter gestoßen. Ein paar Dinge kann ich damit erreichen. In meinem alten System war es auch möglich einen bestimmten Port einer Adresse auf Erreichbarkeit zu prüfen. Kann ich das hiermit auch hinbekommen. Wenn ich aktuell einfach den Port anhänge bleibt die Ausgabe immer bei "false" obwohl ich weiß, dass der Port aktuell erreichbar ist.

jotbed avatar Jan 14 '21 13:01 jotbed

Wie genau pingst du denn einen pot? Das ist soweit ich weiss kein standard ping behaviour (und ich kenne es auch nur noch cusx) ...

Apollon77 avatar Jan 14 '21 17:01 Apollon77

Ich habe sonst FHEM genutzt. Dort kann man die Erreichbarkeit eines Ports an einem Gerät als Presence überprüfen.

als Bsp.: function { presence_port('XXX.XXX.XXX.XXX', 10011) }

technisch weiß ich nicht genau was dahinter steht. Beim Presence Modul in FHEM gab es halt die Möglichkeit für Ping und Port-Überwachung. Darum dachte ich, ich frag mal.

jotbed avatar Jan 15 '21 07:01 jotbed

When my recherche is correct then this isonly possible with trying to connect to the port and see if the connection can be established ... SO this would e a feature request because it is no real "ping" logic, just "comparable"

Apollon77 avatar Jan 15 '21 07:01 Apollon77

Der normale Ping nutzt das ICMP-Protokoll, bei dem es keine Ports gibt. Ports spielen bei TCP und UDP eine Rolle.

Es müsste z.B. ein TCP-SYN/ACK-Ping gemacht werden, um den Zustand eines bestimmten Ports zu prüfen.

Siehe z.B.

  • https://serverfault.com/questions/309357/ping-a-specific-port
  • https://www.npmjs.com/package/evilscan
  • https://www.npmjs.com/package/node-nmap

cooper2k4 avatar Mar 04 '21 07:03 cooper2k4

Ich habe letztens auch nochmal gesucht. Als Werkzeug ist mir da "Netcat" in die Hände gefallen. Das kann auch einem Unix System diese abfragen machen. Hilft evtl. nicht weiter aber ich vielleicht ja auch doch.

https://wiki.ubuntuusers.de/netcat/

jotbed avatar Apr 19 '21 09:04 jotbed

would be possible with hping3. see #107

mcm1957 avatar Jul 07 '23 20:07 mcm1957

It could be implemented (only TCP, because UDP may just not answer) when node.js opens TCP socket and closes it immediately after handshake or after timeout. No hping3 required

GermanBluefox avatar Jul 19 '23 07:07 GermanBluefox