Cron Job to Reboot if Minimal Network Traffic?

Cron Job to Reboot if Minimal Network Traffic?

am 27.01.2008 21:14:14 von WD

Had a server that was programmed to reboot in
the middle of the night. The NIC card didn't
pass traffic on reboot.

Is there someway to program a cron job to
reboot if a certain, minimal amount of traffic
doesn't occur?

I replace the NIC, but a script like this might
help if the card is just marginal.

Re: Cron Job to Reboot if Minimal Network Traffic?

am 27.01.2008 21:32:27 von Barry Margolin

In article <479CE616.28D@US-Webmasters.com>,
"W. D." wrote:

> Had a server that was programmed to reboot in
> the middle of the night. The NIC card didn't
> pass traffic on reboot.
>
> Is there someway to program a cron job to
> reboot if a certain, minimal amount of traffic
> doesn't occur?
>
> I replace the NIC, but a script like this might
> help if the card is just marginal.

Execute "netstat -in -I " a few minutes apart, and check
whether the Ipkts or Opkts columns have changed. If not, reboot.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Re: Cron Job to Reboot if Minimal Network Traffic?

am 30.01.2008 02:08:55 von gerg

WD@US-Webmasters.com writes:
>Had a server that was programmed to reboot in
>the middle of the night. The NIC card didn't
>pass traffic on reboot.
>
>Is there someway to program a cron job to
>reboot if a certain, minimal amount of traffic
>doesn't occur?
>
>I replace the NIC, but a script like this might
>help if the card is just marginal.
>

But what about when the card isn't marginal? Or human error shuts
down the server's port in the etherswitch? Or someone puts another
machine on the network with the same IP address? Or someone unplugs
the ethernet cable by mistake?

I suggest that in these circumstances you probably don't want your
server to suddenly start rebooting itself over and over. I.e. this
is not a good solution.

How often do your servers perform programmed (i.e. scheduled) reboots?
If it isn't often, wouldn't it be better to have a person monitor the
reboot and catch the problem quickly without reboots? Or set up an
automated monitoring system like Nagios that will detect the problem
and sound the alarm.


-Greg
--
::::::::::::: Greg Andrews ::::: gerg@panix.com :::::::::::::
I have a map of the United States that's actual size.
-- Steven Wright