As gbonvehi suggest use ping.
I would like to add to the suggestion to add time to the log file.
You can add to your crontab to execute a simple script every 1 - 5 minutes
for example
EDITED:
Code:
#!/bin/bash
date >> /var/log/net/pinginfo.log
ping -c 5 <net address> >> /var/log/net/pinginfo.log
alright, figured out the code for you. Hope it helps.
EDITED:
there is no /var/log/net directory. You have to create it if you want to use it.
EDITED:
the log file output example:
Sat Nov 27 09:10:42 MYT 2004
PING 161.XXX.XXX.XXX (161.XXX.XXX.XXX) 56(84) bytes of data.
64 bytes from 161.XXX.XXX.XXX: icmp_seq=1 ttl=64 time=3.22 ms
64 bytes from 161.XXX.XXX.XXX: icmp_seq=2 ttl=64 time=3.29 ms
64 bytes from 161.XXX.XXX.XXX: icmp_seq=3 ttl=64 time=6.99 ms
64 bytes from 161.XXX.XXX.XXX: icmp_seq=4 ttl=64 time=3.19 ms
64 bytes from 161.XXX.XXX.XXX: icmp_seq=5 ttl=64 time=4.46 ms
--- 161.XXX.XXX.XXX ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 40144ms
rtt min/avg/max/mdev = 3.192/4.234/6.992/1.459 ms