Ping from cron not having same effect as ping from console
by dean_w_schulze » Thu, 26 Feb 2004 01:18:17 GMT
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.
Re: Ping from cron not having same effect as ping from console
by Ken » Thu, 26 Feb 2004 04:58:51 GMT
Hi Dean -
On 24 Feb 2004 08:18:17 -0800, XXXX@XXXXX.COM (Dean Schulze)
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.**--****.com/
Re: Ping from cron not having same effect as ping from console
by Brendon Caligari » Thu, 26 Feb 2004 06:10:30 GMT
I prefer fping ( http://www.**--****.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
++++