0

I've installed an application that connects inside my local network to another machine's database. If I run this software every 30min-2hours I get a socket error in the software. I want to troubleshoot if its the software's problem, if its due to the specific port is using or if its the whole network connection that drops briefly.

What can I run between my PC and this server PC to detect if there are any socket timeouts or drops in connection?

1
  • Use the ping command.
    – harrymc
    Commented Nov 11, 2018 at 8:22

1 Answer 1

0

Thanks harrymc for the advice to use the ping command, I ended up writing a simple python script to ping every second the server and log in a text file whenever it times out.

import os, time
from time import gmtime, strftime

def log(text):
    with open(".\pinglog.txt", 'a') as f:
        f.write(strftime("%H:%M:%S", gmtime()) + " - " + text + "\n")


def check_ping():
    while True:
        response = os.system("ping -n 1 192.168.1.101")
        if response != 0:
            log("----------  Timeout!!!!!!!!!!!!  ----------")
        time.sleep(1)

check_ping()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .