Networking – How to monitor the connection continuity within 24 hours

home-networkinginternet connectionispmonitoringnetwork-monitoring

I have a bad ISP, and my internet cuts off for like 10 seconds every 2 hours or so and return.
According to my ISP it's fixed, but they've been saying that for weeks now.

My question is, is there a way to monitor if my internet is being cut off for a duration of 24 hours?

I tried ping, but it's hardly reliable and I will have to set on front of the pc to keep track.

Is there a software that can monitor the continuity of my internet connection for 24 hours straight?

Your help would be highly appreciated on the matter.

Thank you for taking the time in reading this.

Best Answer

You mentioned using ping, and you're absolutely right, only you don't need to stare at your screen and wait for connectivity issues. Send the output of ping to a file, and Ctrl+C to stop pinging when you feel enough time has passed.

ping 8.8.8.8 > log.txt

8.8.8.8 is Google's public DNS. The ping command will write to log.txt in whatever your current working directory is.

Alternatively, here is a quick-and-dirty way to incorporate time stamps with each ping using Powershell, assuming you're using a version of Windows with PowerShell. When you break and decide to run this again later, it will append to your log file.

    $hostToPing = '8.8.8.8'
    $logPath = "C:\Users\username\Desktop\temp\pinglog.txt"
    $alwaysTrue = 1


while($alwaysTrue -eq "1")
{

        # refresh the timestamp before each ping attempt
        $theTime = Get-Date -format g

        # refresh the ping variable
        $result = ping $hostToPing -n 1

                if ($result -like '*reply*')
                {
                    Write-Output "$theTime - pass - connection to $hostToPing is up" | Out-File $logPath -append
                }
                else
                {
                    Write-Output "$theTime - fail - connection to $hostToPing is down" | Out-File $logPath -append
                }

        Sleep 1
        echo ' '

}
Related Question