12-01-2022 02:19 PM
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
12-01-2022 11:10 PM
Never heard about the AXL API?
https://developer.cisco.com/docs/axl/#!hello-world-with-php/hello-world-with-php
12-03-2022 05:03 PM
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.
12-05-2022 03:44 PM
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
12-05-2022 03:46 PM
12-08-2022 12:12 AM
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
12-08-2022 09:55 AM
Thank you Nithin. We'll give this a shot later today / tomorrow!
12-07-2022 04:52 AM
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
12-07-2022 08:17 AM
OKay cool - I'll look into this AXL thing. Thank you!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide