Thanks fo the help guys! I will try this now since we are having problem with our connection.
More power to PLUG..


-Jun

Rowel Atienza wrote:

no need for crontab. just save and run this perl script:


#!/usr/bin/perl -w


use strict;

my $host = "my_isp_host";
my $email_addy = "[EMAIL PROTECTED]";

my $ping = "/bin/ping";
my $sleep = "/bin/sleep";
my $mail = "/bin/mail";
my $echo = "/bin/echo";

while(1){
       `$ping $host -c 2 -w 2`;        #ping with 2 sec timeout
       if($?) {
               `$echo \"\" | $mail -s \"No ping from $host\" $email_addy`;
       }
       `$sleep 300`;     #sleep for 5 mins
}


rowel




Gabriel L. Briones III wrote:



you can make a script that will check the connections and
place it at your cron job

here's a sample script for you to use as a referrence


#!/bin/sh


ping -c 2 <ip-address-here>

if [ ! "$?" = 0 ]; then
<mail command here>
 exit 1
fi







--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to