Currently I'm writing a cron job to collect statistics about the local network. It also monitors the number of open connections from my torrent/media server and puts everything into a csv that I can do analysis on.
The problem is, I don't have any way to monitor my roommate's XBox 360. He complains of poor ping time while I'm torrenting (which is understandable) but in order to judge how much to adjust my torrents I need to know what type of impact XBox Live actually has on the network.
I'd like to at least know when the XBox is on the network, which I was trying to do via pings before I found out that M$ broke the golden rule and set the XBox to not respond to pings. I know it must respond to some protocols, but I'm not sure which ones or how to implement them from the command line.
Does anyone know how to (given the static IP lease of an XBox) determine if it is turned on and connected to XBox Live?
Network Layout (path traces):
Modem - SwitchA - NATRouterA - SwitchB - XBox(eth)
Modem - SwitchA - NATRouterA - SwitchB - ServerA(eth1)
Modem - SwitchA - ServerA(eth0)
After running some captures with wireshark, it seems that the XBox will occasionally multicast UPnP messages. Using mnc I can get the text from those messages (seems to be HTTP, which plays nice with stream tools).
So now my question shifts to: How can I log the date and time whenever I capture a packet with mnc? Right now I'm doing this:
mnc -i eth1 -l -p 1900 184.108.40.206 | grep 10.0.0.6
//--- EDIT #2
I took a look into the UPnP protocol and from what I understand if I multicast this text to 220.127.116.11:1900 then every device on the network should unicast back the UPnP services they offer, which will achieve my goal of determining if the XBox is on. The Caveat: Everyone response except for the XBox. I get responses from the router and other UPnP media servers, but M$ products don't want to play by the rules... again.
$ cat m-search
M-SEARCH * HTTP/1.1
$cat m-search|emcast -t 10 18.104.22.168:1900 && mnc -l -i eth0 -l -p 1900 22.214.171.124
I know that the request is well formatted because wireshark understands it and I get responses within a second or two from the router and other media servers.
//--- FINAL EDIT:
M$ is very picky about line endings. As soon as I adjusted the above m-search file to use \r\n line endings it worked.
So my original question stands.... How can I use this to check if the XBox is on at one minute intervals and record the date&time to a text file when it is.