Pinging a netbios name

Michael Stone mstone at itri.loyola.edu
Mon May 11 13:03:13 GMT 1998


salva at umh.es wrote:
> Does know anybody a small, little, beatiful (and cheap) software
> replacement of PING utility for pingins machines with netbios name and with
> ip number and without DNS entry?
> 
> Smbclient and nmblookup work fine, but I thinking in a utilitity like PING
> of windows95. This ping is capable to work in WINS (NETBIOS) and ip and
> name translation.

Why get a new utility? Off the top of my head:

  #!/bin/sh

  if [ "$1" == "" ] 
  then
     echo syntax: $0 destination
     exit
  fi

  DEST=`/usr/local/samba/bin/nmblookup $1 | grep '<00>' | sed -e 's/\([^ ]*\) [a-z]*<00>/\1/'`
  [ "$DEST" != "" ] || DEST=$1

  ping $DEST

This could probably use some cleaning up, but that's the basic idea.

-- 
Michael Stone, Sysadmin, ITRI     PGP: key 1024/76556F95 from mit keyserver,
mstone at itri.loyola.edu            finger, or email with "Subject: get pgp key" 



More information about the samba mailing list