[eepro100] eepro problem: Transmit timed out...

Mark Cox mark@idrive.com
Tue, 25 Jul 2000 10:23:34 -0700


	Sure. Like I said --its not pretty, but it keeps the servers up.

------->8 Snip 8<---------------------------

#!/bin/sh

# Grab a few server-specific values.
# If this does not do it for you, eyeball your
# /etc/sysconfig/network file and change the 
# section below appropriately
. /etc/sysconfig/network
IP=$IP_ADDR
MASK=$NETMASK
hostname=`hostname`

# The actual ping test
pinger () {
(sleep 5)| ping -c 2 ${GATEWAY} 2>&1 | grep transmitted \
| awk '{print $4}' | sed 's/%//'
}

# Change this to apply to your device
# This forces 100Mb/full-duplex
uplink () {
ifconfig eth0 down
rmmod eepro100
insmod eepro100 options="0x30"
ifconfig eth0 inet ${IP} netmask ${MASK} up
route add default gw ${GATEWAY}
# Add any static routes specific to the machine
if [ -e /etc/rc.d/rc3.d/S40route ]; then
  /etc/rc.d/rc3.d/S40route
fi
}

# This is for notification to a newsgroup
post () {
export NNTPSERVER=news

TEMPFILE=/tmp/link-check.$$
DATE=`date +'%m/%d/%y %H:%M'`
INEWS=/usr/bin/inews

cat > $TEMPFILE <<EOF
From: "ops"  <ops@idrive.com>
Newsgroups: idrive.site-log
MIME-Version: 1.0
Content-Type: text/html
Subject: joggled link on ${hostname} ${date} $1:$2

joggled link in ${hostname} ${date}
EOF
$INEWS -h $TEMPFILE
rm $TEMPFILE

echo $date >> /var/log/link.log

}

while :; do
  SECS=1
  pinger > /tmp/ping.$$ &
  OPID="$!"
  while :; do
    if [ "${SECS}X" = "X" ]; then
      SECS=1
    fi
    echo Top of ping check loop -SECS=${SECS} >> /dev/stderr
    if [ "${SECS}" -ge 5 ]||[ -s /tmp/ping.$$ ]; then
      sleep 1
      COUNT=`cat /tmp/ping.$$`
      echo Got $COUNT for count >> /dev/stderr
      # Had to start checking for COUNT to be unset
      # If the pinger() is unable to fork due to system
      # resource saturation, we never made it out of 
      # this loop.
      if [ "${COUNT}X" = "X" ]||[ "${COUNT}" -lt 1 ]; then
        echo "Joggling ethernet adapter..." >> /dev/stderr
        uplink
        post
        break
      else
        echo Looking good... >> /dev/stderr
        break
      fi
    else
      SECS=`echo $SECS + 1 |bc`
      sleep 1
    fi
  done
  kill -KILL ${OPID} >> /dev/null 2>&1
  > /tmp/ping.$$
done

------->8 Snip! 8<----------------------------------

============================================ 
Mark Cox | UNIX sysadmin | i-drive.com 
T: 415.551.2307 | F: 415.551.7599 | 
E: mark@idrive.com | 
I: www.idrive.com/mark
============================================ 

"Top Five Applications on the Web" CNet.com 
Save, Access & Share at www.idrive.com 

 

-----Original Message-----
From: Daniel Soto Alvarez [mailto:danisoto@uol.es]
Sent: Tuesday, July 25, 2000 9:59 AM
To: eepro100@scyld.com
Cc: mark@idrive.com
Subject: RE: [eepro100] eepro problem: Transmit timed out...


Hi Mark!

>I have the same problem. I have not received positive responses from this
>list about it. Currently I automate a ping check on the server's default
>router. When it fails for 5 seconds I ifconfig the card down, unload the
>module, reload the module, and re-ifconfig it. Makes for a crappy fix, but
I
>have yet to see a better one.

You can put your config/program/shell-script of this?

Anyone can help me in this TUX-Group. I have the same problem with
a EEPRO100+ and a 3COM 905B in my Linux server, and I like a
simple, and robust, solution.

Thanks!