cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1802
Views
20
Helpful
11
Replies

How to get phone port information using AXL

Ken S
Level 1
Level 1

I am utilizing zeep and requests modules to pull and modify phones and lines in Call Manager.  I looked through the AXL schema, but couldn't quite find how to pull port information from a phone.  I am looking to gather LLDP/CDP information.  Any help would be appreciated.  

1 Accepted Solution

Accepted Solutions

Hi Ken! 

The update has been attached. 

I think the second option (XML) is more practical

 

The result looks like this!

 

{
    "10.50.200.146": {
        "PortInformation": {
            "RxtotalPkt": "211984621",       
            "RxcrcErr": "00000000",
            "RxalignErr": "00000000",        
            "Rxmulticast": "85096768",       
            "Rxbroadcast": "74958097",       
            "Rxunicast": "51929756",
            "RxshortErr": "00000000",        
            "RxshortGood": "00000000",       
            "RxlongGood": "00009917",        
            "RxlongErr": "00000000",
            "Rxsize64": "83457972",
            "Rxsize65to127": "98555885",     
            "Rxsize128to255": "08565025",    
            "Rxsize256to511": "03737534",    
            "Rxsize512to1023": "00875376",   
            "Rxsize1024to1518": "16792829",  
            "RxtokenDrop": "00000000",       
            "TxexcessDefer": "00000000",     
            "TxlateCollision": "00000000",   
            "TxtotalGoodPkt": "58532663",    
            "Txcollisions": "00000000",      
            "TxexcessLength": "00000000",    
            "Txbroadcast": "00006463",       
            "Txmulticast": "01311297",       
            "lldpFramesOutTotal": "00000000",
            "lldpAgeoutsTotal": "00000000",  
            "lldpFramesDiscardedTotal": "00000000",
            "lldpFramesInErrorsTotal": "00000000",
            "lldpFramesInTotal": "00000000",
            "lldpTLVDiscardedTotal": "00000000",
            "lldpTLVUnrecognizedTotal": "00000000",
            "CDPNeighborDeviceId": "sw_core",
            "CDPNeighborIPv4": "10.50.x.y",
            "CDPNeighborIPv6": null,
            "CDPNeighborPort": "GigabitEthernet1/0/7",
            "LLDPNeighborDeviceId": null,
            "LLDPNeighborIPv4": null,
            "LLDPNeighborIPv6": null,
            "LLDPNeighborPort": null,
            "PortSpeed": "Full, 1000"
        }
    },
    "10.50.200.147": {
        "PortInformation": {
            "RxtotalPkt": "23908310",
            "RxcrcErr": "00000000",
            "RxalignErr": "00000000",
            "Rxmulticast": "11417382",
            "Rxbroadcast": "11106885",
            "Rxunicast": "01384043",
            "RxshortErr": "00000000",
            "RxshortGood": "00000000",
            "RxlongGood": "00004336",
            "RxlongErr": "00000000",
            "Rxsize64": "11439010",
            "Rxsize65to127": "11772250",
            "Rxsize128to255": "00366174",
            "Rxsize256to511": "00295028",
            "Rxsize512to1023": "00034900",
            "Rxsize1024to1518": "00000948",
            "RxtokenDrop": "00000000",
            "TxexcessDefer": "00000000",
            "TxlateCollision": "00000000",
            "TxtotalGoodPkt": "01271863",
            "Txcollisions": "00000000",
            "TxexcessLength": "00000000",
            "Txbroadcast": "00000148",
            "Txmulticast": "00181527",
            "lldpFramesOutTotal": "00000000",
            "lldpAgeoutsTotal": "00000000",
            "lldpFramesDiscardedTotal": "00000000",
            "lldpFramesInErrorsTotal": "00000000",
            "lldpFramesInTotal": "00000000",
            "lldpTLVDiscardedTotal": "00000000",
            "lldpTLVUnrecognizedTotal": "00000000",
            "CDPNeighborDeviceId": "sw_core_04",
            "CDPNeighborIPv4": "10.50.x.z",
            "CDPNeighborIPv6": null,
            "CDPNeighborPort": "GigabitEthernet1/0/6",
            "LLDPNeighborDeviceId": null,
            "LLDPNeighborIPv4": null,
            "LLDPNeighborIPv6": null,
            "LLDPNeighborPort": null,
            "PortSpeed": "Full, 1000"
        }
    }
}

best regards

View solution in original post

11 Replies 11

npetrele
Cisco Employee
Cisco Employee

getPhone should show that information in the <vendorConfig> section, but my tests don't return that information. So it's possible that you can't access it via AXL. AXL generally only fetches data from the database, but vendorConfig data isn't stored in the database. So while you can get some vendorConfig information, you can't necessarily get it all. 

 

I'll double-check with the engineers, and if it's not possible now, I can file an enhancement request.

Thank you @npetrele.  I can take a look at the vendorConfig returnedTag.  

BjoernMartin
Spotlight
Spotlight

Hi!

I can recommend you the following.


You could read the information from the phone website.


Requirements:     A list of phones ip address,

                           phones must be accessible via ip and web access must be activated.

 

Attached is an example written in Python. The results are stored in a dictionary.

 

{
    "10.50.x.y": {
        "CDP Neighbor Device ID": "sw_core",
        "CDP Neighbor IPv4 Address": "10.50.x.y",
        "CDP Neighbor Port": "GigabitEthernet1/0/7",
        "Port Information": "Full, 1000"
},
    "10.50.x.z": {
        "CDP Neighbor Device ID": "sw_core",
        "CDP Neighbor IPv4 Address": "10.50.x.y",
        "CDP Neighbor Port": "GigabitEthernet1/0/6",
        "Port Information": "Full, 1000"
}
}

Thank you @BjoernMartin.  I was thinking of this solution as well.  

Note, this data is also available in XML format (avoiding the HTML screen scraping)

 

 

Hi dstaudt! 

Thanks for the information.

In XML format, of course, it makes everything easier and the code shorter! 

 

 

 

 

Hi Ken! 

The update has been attached. 

I think the second option (XML) is more practical

 

The result looks like this!

 

{
    "10.50.200.146": {
        "PortInformation": {
            "RxtotalPkt": "211984621",       
            "RxcrcErr": "00000000",
            "RxalignErr": "00000000",        
            "Rxmulticast": "85096768",       
            "Rxbroadcast": "74958097",       
            "Rxunicast": "51929756",
            "RxshortErr": "00000000",        
            "RxshortGood": "00000000",       
            "RxlongGood": "00009917",        
            "RxlongErr": "00000000",
            "Rxsize64": "83457972",
            "Rxsize65to127": "98555885",     
            "Rxsize128to255": "08565025",    
            "Rxsize256to511": "03737534",    
            "Rxsize512to1023": "00875376",   
            "Rxsize1024to1518": "16792829",  
            "RxtokenDrop": "00000000",       
            "TxexcessDefer": "00000000",     
            "TxlateCollision": "00000000",   
            "TxtotalGoodPkt": "58532663",    
            "Txcollisions": "00000000",      
            "TxexcessLength": "00000000",    
            "Txbroadcast": "00006463",       
            "Txmulticast": "01311297",       
            "lldpFramesOutTotal": "00000000",
            "lldpAgeoutsTotal": "00000000",  
            "lldpFramesDiscardedTotal": "00000000",
            "lldpFramesInErrorsTotal": "00000000",
            "lldpFramesInTotal": "00000000",
            "lldpTLVDiscardedTotal": "00000000",
            "lldpTLVUnrecognizedTotal": "00000000",
            "CDPNeighborDeviceId": "sw_core",
            "CDPNeighborIPv4": "10.50.x.y",
            "CDPNeighborIPv6": null,
            "CDPNeighborPort": "GigabitEthernet1/0/7",
            "LLDPNeighborDeviceId": null,
            "LLDPNeighborIPv4": null,
            "LLDPNeighborIPv6": null,
            "LLDPNeighborPort": null,
            "PortSpeed": "Full, 1000"
        }
    },
    "10.50.200.147": {
        "PortInformation": {
            "RxtotalPkt": "23908310",
            "RxcrcErr": "00000000",
            "RxalignErr": "00000000",
            "Rxmulticast": "11417382",
            "Rxbroadcast": "11106885",
            "Rxunicast": "01384043",
            "RxshortErr": "00000000",
            "RxshortGood": "00000000",
            "RxlongGood": "00004336",
            "RxlongErr": "00000000",
            "Rxsize64": "11439010",
            "Rxsize65to127": "11772250",
            "Rxsize128to255": "00366174",
            "Rxsize256to511": "00295028",
            "Rxsize512to1023": "00034900",
            "Rxsize1024to1518": "00000948",
            "RxtokenDrop": "00000000",
            "TxexcessDefer": "00000000",
            "TxlateCollision": "00000000",
            "TxtotalGoodPkt": "01271863",
            "Txcollisions": "00000000",
            "TxexcessLength": "00000000",
            "Txbroadcast": "00000148",
            "Txmulticast": "00181527",
            "lldpFramesOutTotal": "00000000",
            "lldpAgeoutsTotal": "00000000",
            "lldpFramesDiscardedTotal": "00000000",
            "lldpFramesInErrorsTotal": "00000000",
            "lldpFramesInTotal": "00000000",
            "lldpTLVDiscardedTotal": "00000000",
            "lldpTLVUnrecognizedTotal": "00000000",
            "CDPNeighborDeviceId": "sw_core_04",
            "CDPNeighborIPv4": "10.50.x.z",
            "CDPNeighborIPv6": null,
            "CDPNeighborPort": "GigabitEthernet1/0/6",
            "LLDPNeighborDeviceId": null,
            "LLDPNeighborIPv4": null,
            "LLDPNeighborIPv6": null,
            "LLDPNeighborPort": null,
            "PortSpeed": "Full, 1000"
        }
    }
}

best regards

Thank you @BjoernMartin for the example and example output.  

I can't seem to find how to get the IP address of the phones.  I am using getPhone, but I cant' seem to find how to return the IP address.  I have tried the secure...Url and ...Url tags, but they didn't return what I was looking for in my script.  

dstaudt
Cisco Employee
Cisco Employee

Just FYI, selectCMDevice(ext, too) only returns phones that have been registered at least once. If they haven't been registered yet, they won't show up.