There comes a time in every man's life when he must look up the serial numbers of thousands of Cisco IP phones. For some it's a coming of age ritual, others do not begin the quest until spurred on by some midlife crisis or another. But every man soon must find the serial number.
Ok, maybe not so much. Perhaps it's only the network geeks that need to do this thing. Say, when they need to renew their Cisco maintenance.
But the tech support of the Cisco company, they are not so helpful with the process. They tell you to use Call Manager to look at each phone, which is fine, if you have only one phone. When you have thousands of phones, it becomes a bit of a chore.
Since I didn't find this stuff anywhere online, I figured I'd post it, and let the Google do its magic so that others could find it.
Each phone has it's own web page. Really. Just pop the IP address in a browser and you'll see it. This is where you find the serial number. When you use Call Manager to get the serial number, you're getting it from the phone's web page.
I think, though there is a non-zero chance that I'm wrong, that the information is actually stored in an XML file. So in theory, you could just post an XML query for the fields you're looking for. I tried to do it this way, but was less than successful. Probably because I don't know the name of the XML file in question.
What I did instead (reluctantly) was wrote a script to read the web pages from all of our phones and scan them for the needed information (name, model, serial number, directory number). It's less elegant than the simple XML query business; the advantage is that I could get it work.
Code and comments in the extended section