[cisco-voip] Pulling Phone Serial Numbers from Call Manager

Jim McBurnett jim at tgasolutions.com
Fri Aug 3 22:05:24 EDT 2007


There is a tool at CMreports.com that does this for about $50.
Jim

-----Original Message-----
From: cisco-voip-bounces at puck.nether.net
[mailto:cisco-voip-bounces at puck.nether.net] On Behalf Of Robert
Singleton
Sent: Friday, August 03, 2007 1:23 PM
To: 'cisco-voip at puck-nether.net Voip'
Subject: Re: [cisco-voip] Pulling Phone Serial Numbers from Call Manager

On Fri, 2007-08-03 at 11:34 -0500, tennille.spence at gsa.gov wrote:
> Is anyone aware of a quick way to pull serial and model number of all
> phones from call manager?

So far as I have ever been able to determine, CallManager does not care
about the serial numbers and thus does not have them.

You can, however, get them from the phones themselves.

I do this from my Linux workstation with a collection of command line
tools that are part of most basic Linux installations, most of which are
also available in either packages of *nix utilities for Windows or as
standalone binaries.

For my particular uses, I have a script called 'inv' that contains the
follwoing:

----------
#!/bin/bash

for x in `nmap -sP 172.26,28.$1.2-254 | awk '{if ($1 ~ "^Host") print
$2}'`; do lynx -dump $x;done | egrep 'DN|Serial|Model|Product' | awk
'{printf("%s %s %s\n",$1,$2,$3)}' | sed 's/Phone/\nPhone/g'
-----------

Usage is "inv XX" where XX is the branch number on my WAN.

I will gladly give anyone the details for each of these commands, but
I'll keep it short here.

The "for x .... ; do" loops through a list of IP addresses for
telephones. nmap gets the list of IPs and awk filters out the lines from
nmap that don't matter to us.

lynx is a text based web browswer. The -dump option outputs the text of
the webpages. I prefer this over wget because it's easier for sort and
filter than wget's output, which is raw html.

egrep takes lynx's output and filter any lines that contain any of the
patterns listed between the '' quotes. It is here that clever pattern
choices can make or break the script. These lines were carefully chosen
to match the output of 7940 and 7960 telephones, without matching the
lines returned by ATA-186/8. The web page on the ATA is substantially
different than for the 79XX telephones. In *my* case, I do not want
anything but 79XX phones listed.

The 2nd awk just prints the output pretty. It is at this point where I
could make it output a csv or some other format.

The sed at the end puts an extra blank line to separate phones. Upon
reflection, I could probably do this with the awk line, but I presume I
didn't for some good reason. :)

The final output for my branch 10 looks like this:

[robert at robert ~]$ inv 10

Phone DN 2010550
Serial Number FCH11048ZZK
Model Number CP-7960G

Phone DN 2010763
Serial Number FCH10409JYA
Model Number CP-7960G

Phone DN 2010762
Serial Number FCH1104916A
Model Number CP-7960G

Phone DN 2010500
Serial Number FCH110491ML
Model Number CP-7960G

Phone DN 2010761
Serial Number FCH110491PY
Model Number CP-7960G

Phone DN 2010510
Serial Number FCH11048ZSM
Model Number CP-7960G

Phone DN 2010750
Serial Number FCH11039TQL
Model Number CP-7960G

Phone DN 2010520
Serial Number FCH11049007
Model Number CP-7960G

Phone DN 2010710
Serial Number FCH11048MU9
Model Number CP-7960G

Phone DN 2010701
Serial Number FCH11039RE2
Model Number CP-7960G

Phone DN 2010703
Serial Number FCH11048LQE
Model Number CP-7960G

Phone DN 2010702
Serial Number FCH11048NQD
Model Number CP-7960G

Phone DN 2010501
Serial Number FCH10509SXY
Model Number CP-7960G

Phone DN 2010760
Serial Number FCH11039BQM
Model Number CP-7960G
[robert at robert ~]$


Robert

_______________________________________________
cisco-voip mailing list
cisco-voip at puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-voip


More information about the cisco-voip mailing list