I know there is no easy way to get serial numbers but I have seen several posts saying to write a script to connect to a phone's webpage and collect the serial number.
Does anyone actually have an example of a script they are using?
this is not very efficient but you can put the serial number as the Description and use BAT to do a report based on description.
How do you put the serial number as a description? will ip phone pass this piece of info to the call manager?
No it won't. CUCM has no knowledge of a phone serial number.
There are some 3rd party apps that do allow you to do this (UnifiedFX from memory is one). I also have a perl script that will do this for you. It's ugly but it works (at least it did last time I tested it).
The perl script looks like:
$argument1 = $ARGV;
$website_content = get($argument1);
open LOGFILE, ">log.file";
print LOGFILE $website_content;
This connects to the web server on the phone, captures the home page, and writes to a file called "log.file". The IP address of the phone is passed to the script. The home page served by the phone contains the serial number.
I then have a wrapper which calls the perl script, which I have written in a language called REXX - simply because my Perl is appalling.
do i = 12 to 41
ping target "-w 1000 -n 3 > DUMMY"
if rc=0 then do
perl_exe perl_file webtarget
do while lines(file_name) > 0
junk = linein(file_name)
parse var junk . "Serial Number" rest
parse var rest . "" Serial_Number "" rest
rc = stream(file_name, "c", "close")
So the attached scans IP Addresses 10.150.108.12 -> 41. It pings them first, and if they respond calls the Perl stub to capture the web page. The REXX wrapper then goes through the file, and looks for the starting "Serial Number" and extracts it.
As I say, ugly, but it works.