|Syntactic Confectionery Delight|
Reminds me of when, at my previous employer, years ago, we had just moved to a new office. The facilities people were complaining about the seating changes we were making. Since we had VOIP-base desk phones, I decided to team-up with one of the IT network techs for an afternoon to create a Perl program to auto-generate a "spreadsheet map" of which cubes people were in based on the location of their desk phones.
Unfortunately, I've lost the copy of the code I had and the company isn't going to give me a copy.
Anyway, it worked by querying the Ethernet switches for the IP and MAC addresses of devices connected to each port, looking for the MAC address prefix of the desk phones. This gave us a mapping of phones to ports. There was already a spreadsheet that had a mapping of port numbers to cube coordinates, giving us a mapping of phone IPs to cube locations. Then, our program queried the VOIP server to get the names assigned to each phone by IP. Finally, our program filled in spreadsheet cells with the names of the people. It also created a simple, 4 column CSV file with the rows alpha-sorted by name and listing the phone numbers and cube locations. We also diff'd the CSV against the previous version and auto-email'd the diff report to HR so they could update the corporate address book.
The code was a mess of (mostly) copy-paste-modify clippings, but worked. And got the facilities people to stop hassling us. Not bad for 4 hours.
(We also joked about using AVR Butterflys as end-of-row name displays that would cycle through the people in the row each Butterfly was located. Would have been fun, but we knew couldn't justify the purchase costs of everything we would need.)
In reply to Re: Script to determine whether the cables are plugged into the correct ports in a EX2200