-   Linux - Networking (
-   -   Samba problem: findsmb and nmblookup fail (

Brandon9000 09-19-2012 10:11 AM

Samba problem: findsmb and nmblookup fail
I wrote a program which uses findsmb to get a list of Samba aware resources. It worked fine. It was able to see both my own cluster of virtuals and other company computers too. My company moved to a different location. The network was flakey for awhile, but has seemed okay for months now. I am not sure that moving is the cause of the problem I am about to describe, but it is the only obvious change. Now findsmb only discovers the machine I am running in. I am doing this in a number of VMWare virtuals, and have tried this in several. In every case, findsmb only finds localhost. I should repeat that this was working fine in the past. I did enough research to discover that findsmb relies on nmblookup. So I tried "nmblookup -A <ip address>" for several of the IPs around and it always comes back with "no reply." I have no idea what's wrong. Does anyone have any ideas?

Brandon9000 09-19-2012 12:53 PM

I got a little more information. The log /var/log/messages contains:

Sep 19 13:49:58 linux nmbd[4891]: [2012/09/19 13:49:58, 0] nmbd/nmbd_packets.c:1072(process_browse_packet)
Sep 19 13:49:58 linux nmbd[4891]: process_browse_packet: Discarding datagram from IP Source name LINUX<00> is one of our names !

where I have used x for the IP. Does anyone know what this means or how to fix it?

Brandon9000 09-19-2012 01:38 PM

No, that wasn't it. I defined different NetBIOS names for the computers in smb.conf and it made that error message go away, but I still get "no reply." Nmblookup can only see the local machine. Any ideas?

Brandon9000 09-19-2012 02:55 PM

Okay, I think I have an answer more or less. One of the virtuals I had up to be "seen" from my dev virtual was on a different subnet. The other, just has some problem with Samba. I brought up two additional virtuals and findsmb run from my dev virtual can see both of them. There was no global problem, just problems with the two virtuals I had up to be detected. It is interesting that I can no longer see the few Samba aware resources of other people in my company, but I'll just chalk that up to increased security at our new location.

apjjr 01-17-2013 10:19 PM

I have also been having problems with findsmb seeing only the local machine, so I started looking for a work-around.
Try the following:

echo -e " $(date)\n"; smbtree -SN|grep '\\'|cut -f2|cut -c 3-|sort|while read svr; do echo -ne "$svr\t"; ipname=$(nmblookup $svr|grep '<00>'); cmnt=$(smbclient -NL $svr 2>&1|grep -m 1 'IPC'|cut -c 40-); echo -e "$ipname\t$cmnt"; smbclient -NL $svr 2>&1|grep Disk; done; exit 0
I'm still trying to find out why findsmb fails. I seem to remember it working in years past.

All times are GMT -5. The time now is 12:13 AM.