Hi guys,
I am trying to create a python program to get the "(Cisco Tomcat Web Application (vmrest)" counter from RTMT, I have created a code that gives me most of the instances for the Object, but it is truncated.
Could you please help me to do it a little bit easier, I just need the Instance (vmrest).
This is what I am looking at.
Trying to do my code, but only give me partial return of the AXL.text
import requests
import urllib3
import os
from dotenv import load_dotenv
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Load enviroment variables
BASEDIR = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(BASEDIR, '.env'))
user = os.environ.get('CISCOUSER')
password = os.environ.get('PASS')
soapheaders = {'Content-type':'text/xml', 'SOAPAction':'PerfmonService'}
# Prepare the POST request for
xmlns = """
<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>HOST</soap:Host>
<soap:Object>Cisco Tomcat Web Application</soap:Object>
</soap:perfmonCollectCounterData>
</soapenv:Body>
</soapenv:Envelope>
"""
# uncomment to print the payload
# print(xmlns)
AXLRequest = requests.post('https://HOST:8443/perfmonservice2/services/PerfmonService', data = xmlns, headers = soapheaders, verify = False, auth=(user,password))
# Create the xml tree
# root = xml.dom.minidom.parseString(AXLRequest.text)
print(AXLRequest.text)
This is the result
... output omitted...
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\HOST\Cisco Tomcat Web Application(concerto)\Requests</ns1:Name>
<ns1:Value>0</ns1:Value>
<ns1:CStatus>1</ns1:CStatus>
</ns1:perfmonCollectCounterDataReturn>
<ns1:perfmonCollectCounterDataReturn>
<ns1:Name>\\HOST\Cisco Tomcat Web Application(concert <<--- It truncates in here, no more text
Could you please help me just to get that specific VMREST counter?