Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Monitor connections to iTunes4 sharing - method #1 Network
iTunes 4 lets you see how many users are connected to your shared stream, but not what they're listening to. Terminal to the rescue! Use lsof to figure out who's listening to what:
 % lsof | grep mp3
 % lsof | grep m4a
Etcetera, etcetera. This only works if you use filename suffixes, though. Or, if you'd just like to see everything at once, and all your music is in a central music folder, for example, "Music", do this:
 % lsof | grep Music
Woot! Perhaps this will make its way into iTunes as an update at some point.

[robg adds: I chose to run this hint and the next hint separately, as they are two unique methods, and comments on both could go either direction...]
    •    
  • Currently 2.67 / 5
  You rated: 2 / 5 (3 votes cast)
 
[10,290 views]  

Monitor connections to iTunes4 sharing - method #1 | 8 comments | Create New Account
Click here to return to the 'Monitor connections to iTunes4 sharing - method #1' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
man lsof- examples
Authored by: jecwobble on May 02, '03 10:53:10AM

I'm at work and can't try this (I have dial up at home, so I probably can't try it easily, anyway), but the examples section of the lsof man page shows how to isolate files based on internet domain and port number. This might be an alternative to piping GREP.



[ Reply to This | # ]
Additional extension
Authored by: fletcherpenney on May 02, '03 11:30:01AM

Make sure to try out m4p if you want to include files purchased
from the music store.

I use the following to catch it all at once.

lsof | grep "\(mp3\|m4a\|m4p\)"



[ Reply to This | # ]
Additional Extension
Authored by: fletcherpenney on May 02, '03 11:31:41AM

Make sure to try out m4p if you want to include files purchased
from the music store.

I use the following to catch it all at once.

lsof | grep "\(mp3\|m4a\|m4p\)"

(Sorry for listing this twice - i posted to the wrong place the first
time... )



[ Reply to This | # ]
Additional Extension
Authored by: roxeteer on May 07, '03 06:14:23AM

...and better yet: lsof | grep -i "\(mp3\|m4a\|m4p\)"

-i means ignore case, so it matches also if your song file has the suffix written in caps.



[ Reply to This | # ]
Want to see the complete path?
Authored by: memeemeee on May 25, '03 07:34:44PM
This hint is very good, and is what got me on the trail of this modification which will alow you to see All music files in use, (regardless of format) and consistantly shows the complete file path to the song (so If you have 6000 songs, and dont know which song called "baby baby" the person is listening to you can see the folder it's in)

lsof +D /Path/to/tunes

where path/to/tunes is obviously going to say /Users/yourname/etc.. Simple enough? If your collection is on a remote volume, you may need to prefix the command with sudo

sudo lsof +D /Path/to/tunes

the only thing, is to be sure to be very specific about the path to your music files, any active files within the specific path will be listed which can make for some LONG delays if you lsof the entire volume.

This command also works with any other downloads you may want to check up on (hotline, limewire, etc). they shouldnt appear unless they are active. I dont know if they'll stay listed if they are stuck... someone else can take it from here

[ Reply to This | # ]
Who is connected?
Authored by: thinkdifferent on Jul 25, '03 12:44:37PM

I'm more interested in finding out which users are connected, than I am in finding out what they're listening to. Is this information in a log file somewhere on my machine?



[ Reply to This | # ]
Who is connected?
Authored by: JesseW on May 04, '04 12:33:53PM

The one line command for this is:
netstat -a -p tcp | grep daap

It will give you a list of all the connections both in and out using daap (the iTunes protocol). If someone wants, I can post a somewhat niecer(but more complicated) gawk script with a nicer display of the same data.

BTW, I'm working on a program to analyse the DAAP traffic and thereby allow logging and display of who's listening to what. I have more info at: http://www.reediejournals.com/blogs/200/archives/002995.html



[ Reply to This | # ]
Monitor connections to iTunes4 sharing - method #1
Authored by: gunnmjk on Jan 25, '04 07:24:51PM

If i'm listening to music, it's also going to show me in the list. Is there a way to have it not show myself, and only other people? thanks



[ Reply to This | # ]