Highlighted
Valued Contributor.. kda Valued Contributor..
Valued Contributor..
626 views

JMX calls via python scripts

Does anyone know if the JMX methods are still available via script (python) calls? Here is a snippet of our script from 10.22....but 10.32 does not seem to allow it (even after changing the URL to https with 8453.

for hostname,probe in orderedprobes.items():
 url = 'http://' + hostname + ':1977/jmx-console/HtmlAdaptor?action=inspectMBean&name=Probe_' + probe + ':type=GwTaskResultDistributer'
 auth_handler = urllib.request.HTTPBasicAuthHandler()
 auth_handler.add_password(realm='DDMSystemUserRealm',
  uri=url,
        user='sysadmin',
        passwd='****************')
 opener = urllib.request.build_opener(auth_handler)

 urllib.request.install_opener(opener)
 try:
  response = urllib.request.urlopen(url)
  unsentresults = re.search("NumberOfUnsentResults</td><td.+?>(.+?)</td>",str(response.read()))
  logit(st + "," + probe + "," + unsentresults.group(1))
 except urllib.error.URLError as e:
  logit(st + "," + probe + "," + "-1")

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.