09-17-2018 06:18 AM
So i am using this scripts that uses perfmon api to fetch counters/details from call manager.
Some details about the script.
Python 3.x
Libs: suds-jurko, ssl
API: perfmon api
----------------------------------------------------------------------------------------
The script works perfectly fine on my lab cucm. but when i test this with another labs it gives me following errors.
urllib.error.URLError: <urlopen error [SSL: SSL_NEGATIVE_LENGTH] dh key too small (_ssl.c:777)>
Code snippet:
from suds.client import Client
from suds.xsd.doctor import Import
from suds.xsd.doctor import ImportDoctor
import logging
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
wsdl = 'https://10.106.79.98:8443/perfmonservice2/services/PerfmonService?wsdl'
location = 'https://10.106.79.98:8443/perfmonservice2/services/PerfmonService'
username = test
password = test
tns = 'http://schemas.cisco.com/ast/soap/'
imp = Import('http://schemas.xmlsoap.org/soap/encoding/',
'http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add(tns)
client = Client(wsdl, location=location, faults=False, plugins=[ImportDoctor(imp)], username=username,password=password)
perfmon_objects_1 = ['AnnunciatorResourceTotal', 'MOHTotalMulticastResources', 'MTPResourceAvailable',
'SWConferenceResourceAvailable', 'RegisteredHardwarePhones', 'TLSConnectedSIPTrunks', ]
res = client.service.perfmonCollectCounterData(node_name, 'Cisco CallManager')
print('CALL MANAGER Resources')
for node in res[1]:
counter_name=(str(node['Name'].split('\\')[4]))
if(counter_name in perfmon_objects_1):
print(counter_name)
print(str(node['Value']))
12-10-2018 06:27 PM
Did you ever find a solution to this by any chance?
12-10-2018 09:54 PM
hey chris,
The code worked on py 3.4.
I was developing the script on py 2.7 earlier.
As per the understanding py 3.4 implementation of urlopen either ignores those alerts or doesn't use those key sharing algorithms.
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