Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

have been redirected from stackoverflow.com

We have a Suse Linux 11 server with network bonding which we named DBSERVER.

With the following script running on another similar machine named CLIENTMACHINE, we observe no errors when pointing the script toward DBSERVER:

(begin script)

 #!/bin/bash

 # parameter: IP address 

 if [ ${#*} != 1 ]
 then
  echo "Need one parameter: IP address"
  exit 1
 fi

 echo "Please monitor log with command tail -f /root/bin/report_ping_${1}.txt"

 echo "Script began at `date +'%Y-%m-%d %T'`" >> /root/bin/report_ping_${1}.txt

 while [ 1 ]
 do
  RESULT=`ping -c 1 "${1}" | grep transmitted`
  #echo "RESULT is ${RESULT}"

  PERCENTAGE_LOST=`echo $RESULT | awk '{ print $6 }'`
  #echo "PERCENTAGE_LOST is ${PERCENTAGE_LOST}"

  NUMBER_LOST=${PERCENTAGE_LOST:0:${#PERCENTAGE_LOST}-1}
  #echo "NUMBER_LOST is ${NUMBER_LOST}"

  if [ "${NUMBER_LOST}" != "0" ]
  then
   echo "${PERCENTAGE_LOST} lost for ${1} at `date +'%Y-%m-%d %T'`" >> /root/bin/report_ping_${1}.txt
  fi
 done

(end script)

However if we use the same script pointing from DBSERVER to CLIENTMACHINE, we observe errors in the log.

Any suggestions on what to check for?

Thanks in advance,

Bert


Forgot to say errors are intermittent! Works most of the time.

share|improve this question

1 Answer 1

You could try running tcpdump or tshark while running your script with

tcpdump -i eth0 -n -p icmp

Somewhere you should see the tcpdump output stop at either an outbound ping request or an inbound ping reply. This, of course, you can do on both the client and the server and see if both machines request and answer correctly. Since you're using bonding, you might want to tail -f /var/log/syslog or /var/log/messages and see if the kernel logs something about the bond failing over to the slave NIC.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.