Showing results for 
Search instead for 
Did you mean: 

perfmon APi did not work with Python


Hi, community!

I have tried to collect perfmonCollectCounterData info from my Cisco Unified Communication Manager via Perfmon API.

But I have got next error:

'<?xml version=\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>Query counter data failed. Error=9 ErrorMsg=null</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>'

But other operation, for example, perfmonOpenSession works.

This is Python script:

import requests

from requests.auth import HTTPBasicAuth

def run():


    headers = {'content-type': 'text/xml', 'SOAPAction': ""}

    body ="""

<soapenv:Envelope xmlns:soapenv="" xmlns:soap="">





         <soap:Object>Cisco CallManager</soap:Object>



</soapenv:Envelope> """

    response =,data=body,headers=headers,verify=False,auth=HTTPBasicAuth("USER", "PASSWORD" ))

    print response

    import pdb;pdb.set_trace()

if __name__ == "__main__":


Could you please help me with this issue.

4 Replies 4

Geevarghese Cheria
Cisco Employee
Cisco Employee

Hi Andrii,

   Moving your question under UC Manager Serviceability community for getting more visibility of the support engineers.

Thanks and Regards,


Cisco Employee
Cisco Employee

This is a Python and Requests issue.  I suggest you find out who supports Requests and ask them.  You'll need to show them the Perfmon WSDL so they can try to figure out why it's not interpreting your request correctly.

Cisco Employee
Cisco Employee

Your Python code seems to work unchanged against my CUCM 10.5 lab system.

If there is an internal issue with the RIS component (or something else in CUCM), it's possible that restarting the CUCM may correct it (not ideal, of course.)  I would recommend opening a ticket with DevNet developer support for detailed troubleshooting: Cisco DevNet: DevNet Developer Support


Hello zadorojnuiandriu,

I have also encountered this issue. In my case, the "Query counter data failed. Error=9 ErrorMsg=null" was because the element "Host" was incorrect (did not exist) for the "perfmonCollectCounterData" name space. In other words, I had the "<soap:Host>...</soap:Host>" part wrong. I suggest you check your "<soap:Host>CUCM_IP</soap:Host>" as you probably have the same problem.

To find the correct value, go to the Cisco Unified CM Administration and navigate to System -> Server. Find what the IP or hostname is there. FYI, you don't need to use the FQDN. For example you can use "<soap:Host>cucm1</soap:Host>" where you have "" configured, but you cannot use the same when you have "". Similarly, you can use IPv4, provided that the address is the same.

Thank you,

Dominic D. Wasserzug

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:

Recognize Your Peers