TECHZEN Zenoss User Community ARCHIVE  

run_command API output in plain text instead of HTML

Subject: run_command API output in plain text instead of HTML
Author: Jose Sanz
Posted: 2019-10-15 18:29

Hi all,
we have defined a user command to be used to execute a snmpwalk in one device.
The GUI output of this user command is a table similar to this one:

==== CPTB-ESALC-01-0002.dc1.lab.com ====
snmpwalk -${device/zSnmpVer} -l authPriv -a ${device/zSnmpAuthType} -x ${device/zSnmpPrivType} -A ${device/zSnmpAuthPassword} -X ${device/zSnmpPrivPassword} -u ${device/zSnmpSecurityName} ${device/snmpwalkPrefix}${here/manageIp}:${here/zSnmpPort} ifDescr
I1015 22:23:10.628660 13581 main.go:97] waiting for response for zminion-return-34cad79f-41be-b8f9-e0b7-4df58ddc77d9
IF-MIB::ifDescr.1 = STRING: iface1.
IF-MIB::ifDescr.2 = STRING: iface2.
IF-MIB::ifDescr.3 = STRING: iface3.
IF-MIB::ifDescr.4 = STRING: iface4.
IF-MIB::ifDescr.5 = STRING: iface5.

When I execute this user command through the Zenoss API by using the run_command method, the command is correctly executed. However, the output that I received is a HTML page with the table listed with HTML tags. Every element in the list is shown as:

        <div class="streaming-line odd">IF-MIB::ifDescr.1 = STRING: iface1.
        </div>

My question is: How can I configure the API Request in order to receive the answer in raw data (whitout HTML tags)?
Do you have an example?

Thanks in advance, Jose


------------------------------
Jose Sanz
Solution Architect
Ericsson Spain
------------------------------


< Previous
Questions about Docker ZenPack
  Next
Create multiple events from single event.
>