10-19-2022 11:43 AM - edited 10-19-2022 11:43 AM
Here is the output of a query for devices from the GUI of CUCM 12.5.
I am trying to find the device IP address in a table from the platform CLI.I can find all the applicable IP addresses for SIP devices with this CLI command.
run sql select name, address from device, sipdevice, siptrunkdestination where tkmodel = 131 and tkdeviceprotocol = 11 and device.pkid = sipdevice.fkdevice and sipdevice.pkid = siptrunkdestination.fksipdevice order by 1, 2
Anybody have any suggestions for how to get that information for the MGCP devices
Solved! Go to Solution.
10-20-2022 08:40 PM
Hi @Elliot Dierksen ,
Please read this topic
They say that MGCP's IPs are not in the SQL table, unfortunately.
My Cisco Unified Communications Blog
10-20-2022 08:40 PM
Hi @Elliot Dierksen ,
Please read this topic
They say that MGCP's IPs are not in the SQL table, unfortunately.
My Cisco Unified Communications Blog
10-21-2022 08:37 AM
Perfect! It doesn't need to be in a table. I just wanted somewhere to see it from the CLI. Thanks!
10-21-2022 11:07 AM
Happy to help!
10-21-2022 02:30 PM
Looking at the output in the link provided by Dmytro, for kicks I pasted the output into Notepad++ and saved it as a .CSV file and it opened in Excel in table format. (You said you didn't care...but it nagged at me. lol)
Maren
10-22-2022 06:42 AM
I am a Unix kind of guy when it comes to crunching text. I have an uber-simple python script that SSH's to all the CM nodes. This customer has 33 of them in 12 different clusters. It sends the risdb commands, and here is my awk script to parse that. I didn't realize it, but it considers ATA's to be a gateway as well. I was trying to gather an inventory for the customer to see what hardware needs to be replaced soon, so all I was really looking for was the gateway name and IP address. Here is my ugly awk script.
awk -F, '
BEGIN { OFS="," }
/^Connected to: / { cmhost = substr($0,length("Connected to: ")+1) ; next }
$1 == "Seq#" { print $2, $3 ; next }
NF > 5 {
n1 = index($2,"@") + 1
n2 = index($2,".")
ipaddr = substr($3,2)
if (ipaddr == "")
ipaddr = "none"
if (n1 == 1 && n2 == 0)
{
phonegwname = substr($2,2)
if (phonegwname ~ /^AN/)
{
gwname = sprintf("SKIGW%s",substr($2,4,10))
if (sccpgw[gwname] == 1)
{
next
} else {
sccpgw[gwname] = 1
}
} else {
gwname = phonegwname
}
} else {
l = n2 - n1
gwname = substr($2,n1,l)
}
print ipaddr, gwname, cmhost
}
' ${1} | sort -u
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