I'm trying to test a telnet connection with check_tcp. When the end-service is not working, it still accepts connections, but closes them immediately. So check_tcp always passes.
Is there anyway to make check_tcp require a few seconds of open connection? I tried using delay parameter - no good. I tried sending commands and using expected text, but I'm not familiar with what commands to send and via a manual test connection, it doesn't really respond to anything.
Thanks.
check_tcp - how to check for immediately closed connection
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: check_tcp - how to check for immediately closed connecti
What does the TCP connection do? Generally you can use --send and expect some sort of reply. If your device is closing the connection you won't get that reply and that would be where you'd error out.
Re: check_tcp - how to check for immediately closed connecti
Code: Select all
-m, --maxbytes=INTEGER
Close connection once more than this number of bytes are received
Code: Select all
-e, --expect=STRING
String to expect in server response (may be repeated)