LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Logging ISP failures - Slack 10 (https://www.linuxquestions.org/questions/slackware-14/logging-isp-failures-slack-10-a-259344/)

ionmich 11-25-2004 08:30 PM

Logging ISP failures - Slack 10
 
Is there any connection monitoring software that can log the time and date when my ethernet cable ISP goes off line?

gbonvehi 11-26-2004 02:25 AM

You could create a simple script or program to ping somewhere if it doesn't answer it could log it.
It shouldn't be so hard, there are some bash guides that can teach you to make a script easily to do that kind of stuff.

carboncopy 11-26-2004 08:35 AM

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

ionmich 11-26-2004 10:26 PM

Thanks people. What a great solution!


All times are GMT -5. The time now is 03:38 PM.