From owner-freebsd-questions Wed Apr 8 20:46:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA12655 for freebsd-questions-outgoing; Wed, 8 Apr 1998 20:46:17 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail1.bellatlantic.net (mail1.bellatlantic.net [199.45.32.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA12635 for ; Wed, 8 Apr 1998 20:46:01 -0700 (PDT) (envelope-from chado@p3.net) Received: from chado2 (client-151-197-119-12.bellatlantic.net [151.197.119.12]) by mail1.bellatlantic.net (8.8.5/8.8.5) with SMTP id WAA20772 for ; Wed, 8 Apr 1998 22:45:43 -0500 (EST) Message-Id: <3.0.3.32.19980408233735.0090d270@popmail.p3.net> X-Sender: chado@popmail.p3.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32) Date: Wed, 08 Apr 1998 23:37:35 -0400 To: freebsd-questions@FreeBSD.ORG From: Chado Subject: Ping program not working from cron Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Gents, I have written a program that pings hosts on our network and the internet. When I run it from the command line it works fine...but when I install it in the cron it doesnt find any of the local machines. Here is an output of my routing tables (netstat -r): bash$ netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default gateway UGSc 5 0 ed0 localhost localhost UH 0 18 lo0 20.12.12/25 link#1 UC 0 0 gateway 0:e0:1e:b9:bf:d2 UHLW 6 36 ed0 1163 server1 0:40:33:54:7a:1e UHLW 1 134 lo0 Its really weird that it would work from the command line but not cron. Here is a copy of the program: #!/usr/local/bin/perl -w $host ="192.168.0.3"; #can be local or other machine IPs @output =`ping -c 3 $host`; for $test ( @output ) { if ( $test =~ /^64/ ) { $i = 1; } } if ( $i ) { print "Host was reachable\n"; } else { print "Could not reach host\n"; } If anyone has any ideas I would really appreciate them. Thanks, JS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message