
tcp() {
	RETSTR=""
	#debug "TCP: $HOST, '$ARGS'"
	for PORT in `echo $ARGS|tr "|" " "`; do
		RES=`$PLUGINSDIR/check_tcp -H $HOST -p $PORT -w $WARN -c $CRIT`
		STATUS=$?
		if [ $STATUS -gt 2 ]; then
			RETVAL=3
			RETSTR="$RETSTR $RES"
			ERR=1
			break
		fi
		#RTT=`echo $RES|cut -d "," -f 2|cut -d "=" -f 2|tr  -d " [a-zA-Z]"`
                RT=`echo $RES|awk -F "|" '{print $NF}'|tr -d -c "0-9."`
                RES=`echo $RES|awk -F "|" '{print $1}'`

		#debug "`date` TCP: $HOST, $STATUS, '$RES', $RT"

		DSNAME=${NAMELIST[$N]}
		if [ $RETVAL -lt $STATUS ]; then
			RETVAL=$STATUS
		fi
		TEMPL=`echo "${TEMPL}:$DSNAME"`
		DATA=`echo "${DATA}:$RT"`
		N=`expr $N + 1`
		RETSTR="$RETSTR $RES"
	done
}


	
