Networking Forums

Networking Forums > Computer Networking > Linux Networking > Ping from cron not having same effect as ping from console

Reply
Thread Tools Display Modes

Ping from cron not having same effect as ping from console

 
 
Dean Schulze
Guest
Posts: n/a

 
      02-24-2004, 03:18 PM
I'm running a RedHat Enterprise 2.1 server as a group development
platform. We're having some network problems which are being worked
on, but right now I need a workaround. The problem is that this
server drops off of the network a couple of times a day. I've found
that if I just ping another server from that server it comes back on
the network, everybody can see it and everything is fine.

To keep the server on the network I set up a cron job to ping another
server every two minutes. I can see this ping running every two
minutes with "ps -e | grep ping". However, the machine still drops
off of the network. When the server drops off of the network I wait
until I see the cron ping as above and then verify that it is still
off of the network. So the cron ping doesn't get the machine back on
the network. Then I do a ping from a console and the server comes
back on the network.

For some reason the cron ping doesn't have the same effect that a ping
from the console does. The crontab ping entry is by the same user
that I am logged in as when I do the ping from the console.

Anyone have any suggestions? Why does a ping from the console have a
different effect than a ping from cron.
 
Reply With Quote
 
 
 
 
Ken
Guest
Posts: n/a

 
      02-24-2004, 06:58 PM
Hi Dean -

On 24 Feb 2004 08:18:17 -0800, (E-Mail Removed) (Dean Schulze)
wrote:

>For some reason the cron ping doesn't have the same effect that a ping
>from the console does. The crontab ping entry is by the same user
>that I am logged in as when I do the ping from the console.
>
>Anyone have any suggestions? Why does a ping from the console have a
>different effect than a ping from cron.


I just set up my first cron stuff last night and found that a command
that worked from the console and wasn't working from cron was because
the command couldn't be found.

I had to add PATH=[path directories] to the crontab file. Apparently
without that the path is empty. As an alternative, you could put in
the full path with the ping command, e.g. /bin/ping [ping parameters]
(or whatever directory is correct for ping on your system).

This may not be your problem, but it's something to check.

--
Ken
http://www.ke9nr.net/
 
Reply With Quote
 
Brendon Caligari
Guest
Posts: n/a

 
      02-24-2004, 08:10 PM

"Dean Schulze" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I'm running a RedHat Enterprise 2.1 server as a group development
> platform. We're having some network problems which are being worked
> on, but right now I need a workaround. The problem is that this
> server drops off of the network a couple of times a day. I've found
> that if I just ping another server from that server it comes back on
> the network, everybody can see it and everything is fine.
>
> To keep the server on the network I set up a cron job to ping another
> server every two minutes. I can see this ping running every two
> minutes with "ps -e | grep ping". However, the machine still drops
> off of the network. When the server drops off of the network I wait
> until I see the cron ping as above and then verify that it is still
> off of the network. So the cron ping doesn't get the machine back on
> the network. Then I do a ping from a console and the server comes
> back on the network.
>
> For some reason the cron ping doesn't have the same effect that a ping
> from the console does. The crontab ping entry is by the same user
> that I am logged in as when I do the ping from the console.
>
> Anyone have any suggestions? Why does a ping from the console have a
> different effect than a ping from cron.



I prefer fping (http://www.fping.com) for scheduled / scripted stuff.

However, to me what you're saying sounds more like a network switch / mac
address / arp issue. Try changing the port on the switch to which the
server is connected.

Brendon
++++



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When Client Ping DC not respond,but when DC ping clients they resp ahmad Windows Networking 3 07-17-2007 07:44 PM
Can resolve DNS, can ping IP, but can't ping by DNS?? Bryan L Windows Networking 14 01-22-2007 09:21 PM
Ping 224.0.0.2 ping: sendmsg: Operation not permitted interessato@gmail.com Linux Networking 4 01-24-2006 02:47 AM
Some services working but can't ping (not ping-able) Micah Elliott Linux Networking 1 12-05-2003 09:47 AM
Windows ping and Linux ping command? tom Linux Networking 5 11-10-2003 08:52 PM



1 2 3 4 5 6 7 8 9 10 11