SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Using mDNS for Mac OS X Client Discovery
Author Message
Post Using mDNS for Mac OS X Client Discovery 
I've had BackupPPC running great in a mixed platform environment for a
while now. I had to tweak things a bit to get the Mac OS X clients
discovered fairly consistently using nmb, but my goal now is to have
the Macs instead discovered via mDNS (multicast DNS, part of Apple's
Rendezvous technology, aka zeroconf).

Apple provides the open source mDNS bits that I've installed on the
Slackware Linux BackupPC server, and using it I'm able to resolve a Mac
Client's "Rendezvous name" to an IP. I've integrated the command into a
script and pointed $Conf{NmbLookupFindHostCmd} to that script. It looks
like I'll be able to get it all working without much more work, but
there are a couple of hangups I'm having, mostly due to my less than
full grasp of BackupPC's complete discovery process. Before I go in and
look some more at the code, I'm wondering if I'm missing something
fundamental that should make this work more easily.

The Macs are set up in hosts like this:

macchris 1 chris

And have this in their config.pl:

$Conf{XferMethod} = 'rsync';

Here are my questions:

1. I'm pointing to my script like this:

$Conf{NmbLookupFindHostCmd} = '/usr/local/backup/bin/mDNSLookupPath.sh
$host';

At first I had the script just return the IP, but BackupPC wouldn't
parse just that; I needed to re-format it to look like an nmblookup
reply. Once I did, I could get this far:

[backuppc < at > gazelle: /]$ /usr/local/backup/bin/BackupPC_dump -v -f
macchris
Name server doesn't know about macchris; trying NetBios
cmdSystemOrEval: about to system
/usr/local/backup/bin/mDNSLookupPath.sh macchris
cmdSystemOrEval: finished: got output 172.24.30.173 macchris<00>

NetBiosHostIPFind: found IP address 172.24.30.173 for host macchris
cmdSystemOrEval: about to system /bin/ping -c 1 -w 3 172.24.30.173
cmdSystemOrEval: finished: got output PING 172.24.30.173
(172.24.30.173) 56(84) bytes of data.
64 bytes from 172.24.30.173: icmp_seq=1 ttl=64 time=0.305 ms


So, it works, but my question is, do I *need* to make my script output
"172.24.30.173 macchris<00>", or is there another way to make it work
with just the bare IP? (aside from modifying the code, which I'll do,
if necessary)

2. This next issue, though, is the show stopper for me so far.

I've got this in the client's config.pl:

$Conf{NmbLookupPath} = '/usr/local/bin/mDNSIdentify';
$Conf{NmbLookupCmd} = '$nmbLookupPath $host';

So, when NetBiosInfoGet is expecting a reply that looks like it came
from nmblookup -A, my lookup (from mDNSIdentify) returns this instead:

CheckHostAlive: returning 0.340
cmdSystemOrEval: about to system /usr/local/bin/mDNSIdentify
172.24.30.173
cmdSystemOrEval: finished: got output 173.30.24.172.in-addr.arpa.
173.30.24.172.in-addr.arpa. PTR Trying multicast
173.30.24.172.in-addr.arpa. PTR MacChris.local.
MacChris.local. ANY Trying multicast
MacChris.local. AAAA FE80:0000:0000:0000:020A:95FF:FE89:063C
MacChris.local. Addr 172.24.30.173
HINFO Hardware: PowerBook5,1
HINFO Software: Mac OS X 10.3.4 (7H63), mDNSResponder-58.8 (Apr 24
2004 20:38:40)

NetBiosInfoGet: failed: can't parse return string
dump failed: host macchris has mismatching netbios name

So, aside from re-formatting the mDNSIdentify reply so that it looks
like it came from nmblookup (which seems kludgy to me), is there
another way to overcome this? My first though is since mDNS discovery
works directly with the client instead of through a DNS or WINS server,
that a reverse lookup isn't really necessary anyway. If that's true, is
there a way to eliminate this lookup? Again, I'll look at the code and
tweak it where necessary, but if there's an easier way, I'm all ears
Wink

Thanks,

--Chris



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Using mDNS for Mac OS X Client Discovery 
Chris Stone writes:

I've had BackupPPC running great in a mixed platform environment for a
while now. I had to tweak things a bit to get the Mac OS X clients
discovered fairly consistently using nmb, but my goal now is to have
the Macs instead discovered via mDNS (multicast DNS, part of Apple's
Rendezvous technology, aka zeroconf).

Apple provides the open source mDNS bits that I've installed on the
Slackware Linux BackupPC server, and using it I'm able to resolve a Mac
Client's "Rendezvous name" to an IP. I've integrated the command into a
script and pointed $Conf{NmbLookupFindHostCmd} to that script. It looks
like I'll be able to get it all working without much more work, but
there are a couple of hangups I'm having, mostly due to my less than
full grasp of BackupPC's complete discovery process. Before I go in and
look some more at the code, I'm wondering if I'm missing something
fundamental that should make this work more easily.

The Macs are set up in hosts like this:

macchris 1 chris

You should set dhcp = 0 for this host. The DHCP flag is somewhat
misnamed in BackupPC: what it means is that these hosts can only be
found by manually searching every IP address in $Conf{DHCPAddressRanges}
and running $Conf{NmbLookupCmd} on each host name. Since you can
find the host's IP address via $Conf{NmbLookupFindHostCmd} you
can set dhcp = 0 for this host.

And have this in their config.pl:

$Conf{XferMethod} = 'rsync';

Here are my questions:

1. I'm pointing to my script like this:

$Conf{NmbLookupFindHostCmd} = '/usr/local/backup/bin/mDNSLookupPath.sh
$host';

At first I had the script just return the IP, but BackupPC wouldn't
parse just that; I needed to re-format it to look like an nmblookup
reply. Once I did, I could get this far:

[backuppc < at > gazelle: /]$ /usr/local/backup/bin/BackupPC_dump -v -f
macchris
Name server doesn't know about macchris; trying NetBios
cmdSystemOrEval: about to system
/usr/local/backup/bin/mDNSLookupPath.sh macchris
cmdSystemOrEval: finished: got output 172.24.30.173 macchris<00>

NetBiosHostIPFind: found IP address 172.24.30.173 for host macchris
cmdSystemOrEval: about to system /bin/ping -c 1 -w 3 172.24.30.173
cmdSystemOrEval: finished: got output PING 172.24.30.173
(172.24.30.173) 56(84) bytes of data.
64 bytes from 172.24.30.173: icmp_seq=1 ttl=64 time=0.305 ms

So, it works, but my question is, do I *need* to make my script output
"172.24.30.173 macchris<00>", or is there another way to make it work
with just the bare IP? (aside from modifying the code, which I'll do,
if necessary)

Yes, you need to make your script output look like nmblookup.

2. This next issue, though, is the show stopper for me so far.

I've got this in the client's config.pl:

$Conf{NmbLookupPath} = '/usr/local/bin/mDNSIdentify';
$Conf{NmbLookupCmd} = '$nmbLookupPath $host';

So, when NetBiosInfoGet is expecting a reply that looks like it came
from nmblookup -A, my lookup (from mDNSIdentify) returns this instead:

CheckHostAlive: returning 0.340
cmdSystemOrEval: about to system /usr/local/bin/mDNSIdentify
172.24.30.173
cmdSystemOrEval: finished: got output 173.30.24.172.in-addr.arpa.
173.30.24.172.in-addr.arpa. PTR Trying multicast
173.30.24.172.in-addr.arpa. PTR MacChris.local.
MacChris.local. ANY Trying multicast
MacChris.local. AAAA FE80:0000:0000:0000:020A:95FF:FE89:063C
MacChris.local. Addr 172.24.30.173
HINFO Hardware: PowerBook5,1
HINFO Software: Mac OS X 10.3.4 (7H63), mDNSResponder-58.8 (Apr 24
2004 20:38:40)

NetBiosInfoGet: failed: can't parse return string
dump failed: host macchris has mismatching netbios name

So, aside from re-formatting the mDNSIdentify reply so that it looks
like it came from nmblookup (which seems kludgy to me), is there
another way to overcome this? My first though is since mDNS discovery
works directly with the client instead of through a DNS or WINS server,
that a reverse lookup isn't really necessary anyway. If that's true, is
there a way to eliminate this lookup? Again, I'll look at the code and
tweak it where necessary, but if there's an easier way, I'm all ears
Wink

Yes, you can eliminate this check.

Once BackupPC has the IP address it usually does:

- a ping to that IP address to make sure it is alive

- an nmblookup of that IP address (nmblookup -A) to make sure the
netbios name matches the host name.

Both of these steps are optional. For example, if your machine is
behind a firewall, the ping will fail. You can disable the ping by
using any command that returns success:

$Conf{PingCmd} = '/bin/true';

Similarly, you can disable the nmblookup -A check by setting:

$Conf{NmbLookupCmd} = '';

or for fixed IP hosts (doesn't apply to your case):

$Conf{FixedIPNetBiosNameCheck} = 0;

After you get things working, it would be great if you could send me
your mDNSLookupPath.sh script and instructions for Mac clients so I can
put it in the FAQ (although my FAQ todo list is pretty long right now).

Craig


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Using mDNS for Mac OS X Client Discovery 
Excellent! Thanks so much, this works great now. It turns out to be
really simple, then, to get BackupPC to find Mac OS X clients via
Rendezvous instead of smb/nmb! I'll outline the steps and get them to
the list soon...

On Jul 28, 2004, at 2:08 PM, Craig Barratt wrote:

Chris Stone writes:


The Macs are set up in hosts like this:

macchris 1 chris

You should set dhcp = 0 for this host. The DHCP flag is somewhat
misnamed in BackupPC: what it means is that these hosts can only be
found by manually searching every IP address in
$Conf{DHCPAddressRanges}
and running $Conf{NmbLookupCmd} on each host name. Since you can
find the host's IP address via $Conf{NmbLookupFindHostCmd} you
can set dhcp = 0 for this host.

Doh! Yeah, I knew that...I was using "0" elsewhere, just pasted in the
one host I was testing with "1". Smile


Similarly, you can disable the nmblookup -A check by setting:

$Conf{NmbLookupCmd} = '';


This is what I did, and what got it all working.

After you get things working, it would be great if you could send me
your mDNSLookupPath.sh script and instructions for Mac clients so I can
put it in the FAQ (although my FAQ todo list is pretty long right now).


Here's the simple shell script I use (Mac hostnames in BackupPC's hosts
file = the Mac's Rendezvous name minus ".local". So I need to add
".local" back to do the lookup.:

#!/bin/sh
/usr/local/bin/mDNSIdentify $1.local | awk '/.local. Addr/ { print $3
, macname"<00>" }' macname=$1



(This is typical output from mDNSIdentify:

[backuppc < at > gazelle: /usr/local/backup/bin]$ /usr/local/bin/mDNSIdentify
macchris.local
MacChris.local. AAAA FE80:0000:0000:0000:020A:95FF:FE89:063C
MacChris.local. Addr 172.24.30.173
HINFO Hardware: PowerBook5,1
HINFO Software: Mac OS X 10.3.4 (7H63), mDNSResponder-58.8 (Apr 24
2004 20:38:40)
_services._dns-sd._udp.local. PTR _workstation._tcp.local.
_services._dns-sd._udp.local. PTR _daap._tcp.local.
_services._dns-sd._udp.local. PTR _presence._tcp.local.
_services._dns-sd._udp.local. PTR _finger._tcp.local.
_services._dns-sd._udp.local. PTR _ssh._tcp.local.

)

Thanks again!

--Chris



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB