cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
365
Views
25
Helpful
8
Replies

Can CLI be used on CUCM to provide a DN for an entered MAC

enewburn1
Level 1
Level 1

Hi,

  We have a Cisco CUCM deployment in our environment. I'm wondering if there might be a way to use CLI / PowerShell / Whatever to query our CUCM for whatever DN is associated for a provided MAC address. The idea here being this is easier to write into a script and way faster than using the CUCM's GUI. ANy thoughts (or a different way to accomplish the same thing) are appreciated

8 Replies 8

b.winter
VIP
VIP

if its just queries You can use SQL queries to pull the detail from CUCM DB using CLI. Queries can be made referring  the DB table CUCm publish for each version.

You can add modify Delete using AXL api as @b.winter mentioned. 

I use a python script which use SAOP to connect with CUCM and use AXL api to make changes on CUCM. 



Response Signature


There is, I'm sure, a SQL Query that can pull for all MACs and their associated DNs. It would be a simple matter to replace the "All MACs" part of the query for a specific MAC in a text editor and then use the MAC-specific version of the query on the CUCM CLI.

I am not savvy on writing such a SQL query. @Nithin Eluvathingal  - Can you help with that?

Maren

Very cool - thank you

I don't know anything about SQL myself, but I'll betcha our database team does

From CLi Run the below and it gives you all the MAC with extensions by the order of extensions.

run sql select  device.name as DeviceMAC, numplan.dnorpattern as Extension from device ,numplan , devicenumplanmap where devicenumplanmap.fkdevice =device.pkid and devicenumplanmap.fknumplan =nUMPLAN.pkid and tkclass =1 order by Numplan.dnorpattern

 

 

The below gives mac address extensions with CSS.

 

 

run sql select  device.name as DeviceMAC, numplan.dnorpattern as Extension, callingsearchspace.name as CSS from device ,numplan , devicenumplanmap , callingsearchspace where devicenumplanmap.fkdevice =device.pkid and devicenumplanmap.fknumplan =nUMPLAN.pkid and numplan.fkcallingsearchspace_sharedlineappear= callingsearchspace.pkid and tkclass =1  order by callingsearchspace.name


Response Signature


Thank you Nithin. We'll give this a shot later today / tomorrow!

It can be done via AXL, but you can also do it in the CLI like this.

admin:run sql select device.name, device.description from numplan, devicenumplanmap, device where numplan.dnorpattern = '4321' and numplan.pkid = devicenumplanmap.fknumplan and devicenumplanmap.fkdevice = device.pkid
name                             description
================================ ================================
AALN/S0/0@VG204.some.com         AALN/S0/0@VG204.some.com

OKay cool - I'll look into this AXL thing. Thank you!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: