05-17-2017 05:47 AM
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="http://schemas.xmlsoap.org/soap/envelope/"><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():
url="https://CUCM_IP:8443/perfmonservice2/services/PerfmonService?wsdl"
headers = {'content-type': 'text/xml', 'SOAPAction': "http://schemas.cisco.com/ast/soap/action/#PerfmonPort#perfmonCollectCounterData"}
body ="""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:perfmonCollectCounterData>
<soap:Host>CUCM_IP</soap:Host>
<soap:Object>Cisco CallManager</soap:Object>
</soap:perfmonCollectCounterData>
</soapenv:Body>
</soapenv:Envelope> """
response = requests.post(url,data=body,headers=headers,verify=False,auth=HTTPBasicAuth("USER", "PASSWORD" ))
print response
import pdb;pdb.set_trace()
if __name__ == "__main__":
run()
Could you please help me with this issue.
05-30-2017 03:29 AM
Hi Andrii,
Moving your question under UC Manager Serviceability community for getting more visibility of the support engineers.
Thanks and Regards,
Geevarghese
06-26-2017 12:06 PM
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.
07-13-2017 02:26 PM
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
09-16-2022 08:54 AM
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 "cucm1.example.com" configured, but you cannot use the same when you have "cucm1-something-else.example.com". Similarly, you can use IPv4, provided that the address is the same.
Thank you,
Dominic D. Wasserzug
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