Poll data in OpenNMS using device API


I am trying to see if there a way to poll data using device API. Basically Palo Alto firewalls expose only a small amount of data by SNMP, for comprehensive monitoring I am trying to use their API. Does OpenNMS support this?


Depends on how the data is exposed via API, and what the authentication requirements are. We can do a lot with the XML Collector…

Thanks, I have just started exploring OpenNMS, I will take a look at the XML collector.
Palo Alto has a REST API and uses API key for authentication.

If it’s just an API key in a header, I think that is possible. If there’s oauth or other authorization headers, the collector is limited in what it can do.

(Also, for the record, the “XMLCollector” can be configured to use a JSON parser)

Something like this in the xml-datacollection-config.xml. You can add/remove <header/> tags as needed, and the ssl-verification is optional, but defaults to “not disable”

    <xml-source url="https://{nodelabel}/api/path/to/endpoint">
      <request method="GET">
          <parameter name="disable-ssl-verification" value="true"/>
          <header name="Authorization" value="Bearer static_token_here" />
          <header name="X-Api-Key" value="api-key-gere" />

If the output is JSON, in the collectd service, add:

<parameter key="handler-class" value="org.opennms.protocols.json.collector.DefaultJsonCollectionHandler"/>

I believe it’s just an API key in the header, let me take a shot at it and see how it works out.