• Light theory
  • Outside Doc
  • Steps to set up RHEL 3 netdump client/server
  • You can force a crash with this procedure
  • If you want to use the crash program to analyze your netdump results, be sure you've compiled the crashing computer's kernel with -g in CFLAGS.
  • This patch to /etc/init.d/netdump helped - with it, you don't have to enter the password for the netdump server's netdump account every time you reboot:
    --- netdump.t	2004-09-02 10:54:10.000000000 -0700
    +++ netdump	2004-09-02 11:03:33.000000000 -0700
    @@ -117,72 +117,79 @@
     start ()
     {
         # netdump/netconsole server
    -    NETDUMPOPTS=
    -    if [ -n "$NETDUMPADDR" ]
    +    if [ -f /var/crash/NETDUMPOPTS ]
         then
    -        eval $(print_address_info $NETDUMPADDR)
    -        if [ "$SERVER_ADDRESS_RESOLUTION" = "unresolved" ] ||
    -	   [ "$HOSTNAME" = "?" -a -z "$MAC" ] 
    -        then
    -    	    echo "$prog: can't resolve $NETDUMPADDR MAC address" 1>&2
    -	    netdump_failure "netdump server address resolution"
    -        fi
    -    
    -        [ -z "$NETDUMPMACADDR" ] && NETDUMPMACADDR=$MAC
    -        [ -z "$DEV" ] && DEV=$IFACE
    -        if [ "$DEV" = "$IFACE" -a "$TYPE" != "[ether]" ] 
    -        then
    -    	    echo "$prog: $DEV must be an ethernet interface" 1>&2
    -    	    netdump_failure "netdump $DEV configuration"
    -        fi
    -    
    -        # Now we are ready to tell the netdump server how to talk to us
    -        MAGIC1=$(random_hex_int)
    -        MAGIC2=$(random_hex_int)
    -        LOCALADDR=$(ip_of_device $DEV)
    -    
    -        case "$NETDUMPKEYEXCHANGE" in
    -        none)
    -            # magic can be anything (except 0) if security is disabled
    -    	    NETDUMPOPTS="magic1=0x11111111 magic2=0x11111111 "
    -    	    ;;
    -        *)
    -    	    ssh -x -i /etc/sysconfig/netdump_id_dsa netdump@$NETDUMPADDR echo "$MAGIC2$MAGIC1" \> /var/crash/magic/$LOCALADDR
    -    	    if [ $? -ne 0 ]; then
    -    		echo "$prog: could not ssh to server $NETDUMPADDR"
    -    		netdump_failure "netdump server ssh key exchange"
    -    	    fi
    -    	    NETDUMPOPTS="magic1=0x$MAGIC1 magic2=0x$MAGIC2 "
    -    	    ;;
    -        esac
    -    
    -        IPHEX=`dquad_to_hex $IPADDR`
    -        eval $(echo $NETDUMPMACADDR | sed "s/:/ /g" | ( read M0 M1 M2 M3 M4 M5;
    -               echo M0=$M0\; M1=$M1\; M2=$M2\; M3=$M3\; M4=$M4\; M5=$M5\; ))
    -        TGTMAC="netdump_target_eth_byte0=0x$M0 netdump_target_eth_byte1=0x$M1 \
    -    	    netdump_target_eth_byte2=0x$M2 netdump_target_eth_byte3=0x$M3 \
    -    	    netdump_target_eth_byte4=0x$M4 netdump_target_eth_byte5=0x$M5 \
    -    	    netlog_target_eth_byte0=0x$M0 netlog_target_eth_byte1=0x$M1 \
    -    	    netlog_target_eth_byte2=0x$M2 netlog_target_eth_byte3=0x$M3 \
    -    	    netlog_target_eth_byte4=0x$M4 netlog_target_eth_byte5=0x$M5"
    -        MHZ="mhz=$(awk '/cpu MHz/ { print int($4) ; exit }' < /proc/cpuinfo)"
    -        if [ "$MHZ" == 0 ] ; then
    -    	    # something went wrong; make some reasonable guess
    -    	    MHZ=1000
    -        fi
    -        if [ -n "$IDLETIMEOUT" ] ; then
    -      	    IDLETIMEOUT="idle_timeout=$IDLETIMEOUT"
    -        fi
    -        NETDUMPOPTS=$NETDUMPOPTS"\
    -    	dev=$DEV netdump_target_ip=$IPHEX netlog_target_ip=$IPHEX \
    -    	source_port=$LOCALPORT netdump_target_port=$NETDUMPPORT \
    -    	netlog_target_port=$NETDUMPPORT \
    -    	$TGTMAC $MHZ $IDLETIMEOUT"
    +	NETDUMPOPTS="`cat /var/crash/NETDUMPOPTS`"
         else
    -	# The netdump subsystem of the netconsole module is not configured.
    -	# However, the netconsole module minimally needs the following 
    -        # options in order for the syslog subsystem to run alone.
    -	NETDUMPOPTS="magic1=0x11111111 magic2=0x11111111 dev=$DEV source_port=$LOCALPORT"
    +	NETDUMPOPTS=
    +	if [ -n "$NETDUMPADDR" ]
    +	then
    +	    eval $(print_address_info $NETDUMPADDR)
    +	    if [ "$SERVER_ADDRESS_RESOLUTION" = "unresolved" ] ||
    +	       [ "$HOSTNAME" = "?" -a -z "$MAC" ] 
    +	    then
    +		echo "$prog: can't resolve $NETDUMPADDR MAC address" 1>&2
    +		netdump_failure "netdump server address resolution"
    +	    fi
    +	
    +	    [ -z "$NETDUMPMACADDR" ] && NETDUMPMACADDR=$MAC
    +	    [ -z "$DEV" ] && DEV=$IFACE
    +	    if [ "$DEV" = "$IFACE" -a "$TYPE" != "[ether]" ] 
    +	    then
    +		echo "$prog: $DEV must be an ethernet interface" 1>&2
    +		netdump_failure "netdump $DEV configuration"
    +	    fi
    +	
    +	    # Now we are ready to tell the netdump server how to talk to us
    +	    MAGIC1=$(random_hex_int)
    +	    MAGIC2=$(random_hex_int)
    +	    LOCALADDR=$(ip_of_device $DEV)
    +	
    +	    case "$NETDUMPKEYEXCHANGE" in
    +	    none)
    +		# magic can be anything (except 0) if security is disabled
    +		NETDUMPOPTS="magic1=0x11111111 magic2=0x11111111 "
    +		;;
    +	    *)
    +		ssh -x -i /etc/sysconfig/netdump_id_dsa netdump@$NETDUMPADDR echo "$MAGIC2$MAGIC1" \> /var/crash/magic/$LOCALADDR
    +		if [ $? -ne 0 ]; then
    +		    echo "$prog: could not ssh to server $NETDUMPADDR"
    +		    netdump_failure "netdump server ssh key exchange"
    +		fi
    +		NETDUMPOPTS="magic1=0x$MAGIC1 magic2=0x$MAGIC2 "
    +		;;
    +	    esac
    +	
    +	    IPHEX=`dquad_to_hex $IPADDR`
    +	    eval $(echo $NETDUMPMACADDR | sed "s/:/ /g" | ( read M0 M1 M2 M3 M4 M5;
    +		   echo M0=$M0\; M1=$M1\; M2=$M2\; M3=$M3\; M4=$M4\; M5=$M5\; ))
    +	    TGTMAC="netdump_target_eth_byte0=0x$M0 netdump_target_eth_byte1=0x$M1 \
    +		netdump_target_eth_byte2=0x$M2 netdump_target_eth_byte3=0x$M3 \
    +		netdump_target_eth_byte4=0x$M4 netdump_target_eth_byte5=0x$M5 \
    +		netlog_target_eth_byte0=0x$M0 netlog_target_eth_byte1=0x$M1 \
    +		netlog_target_eth_byte2=0x$M2 netlog_target_eth_byte3=0x$M3 \
    +		netlog_target_eth_byte4=0x$M4 netlog_target_eth_byte5=0x$M5"
    +	    MHZ="mhz=$(awk '/cpu MHz/ { print int($4) ; exit }' < /proc/cpuinfo)"
    +	    if [ "$MHZ" == 0 ] ; then
    +		# something went wrong; make some reasonable guess
    +		MHZ=1000
    +	    fi
    +	    if [ -n "$IDLETIMEOUT" ] ; then
    +		IDLETIMEOUT="idle_timeout=$IDLETIMEOUT"
    +	    fi
    +	    NETDUMPOPTS=$NETDUMPOPTS"\
    +	    dev=$DEV netdump_target_ip=$IPHEX netlog_target_ip=$IPHEX \
    +	    source_port=$LOCALPORT netdump_target_port=$NETDUMPPORT \
    +	    netlog_target_port=$NETDUMPPORT \
    +	    $TGTMAC $MHZ $IDLETIMEOUT"
    +            mkdir -p /var/crash
    +	    echo "$NETDUMPOPTS" > /var/crash/NETDUMPOPTS
    +	else
    +	    # The netdump subsystem of the netconsole module is not configured.
    +	    # However, the netconsole module minimally needs the following 
    +	    # options in order for the syslog subsystem to run alone.
    +	    NETDUMPOPTS="magic1=0x11111111 magic2=0x11111111 dev=$DEV source_port=$LOCALPORT"
    +	fi
         fi
     
         SYSLOGOPTS=