How to create a API poller proxy in Python using Orion API


The native SAM api poller handling  is very static requiring manual handling in SW for changes on the target side.

With a proxy Python script we could handle changes as well as just installing the script for other sites.

Further, the api poller is a SAM function whereas the api data is related to different network elements.

The proxy could then also resolve this mismatch.

 I have envisaged that we should be able to generate a python script which will:

  • Initialize - identify the components from the api response to be monitored and configure SW variables accordingly
  • For each polling it will detect if any configuration changes have been made on the target side and adapt the SW config accordingly
  • For each polling it will update the SW variables and SW actions should be taken if status is down etc as natively handled by SW

My starting point for changing values in SW is to use the Orion api via Python as documented at

One should then be able to add nodes and set custom properties for those.

However, I do not understand how one should be able to apply a “push model” (from the proxy into SW) yielding a SW handling with alarms etc for these variables / custom properties.

The documentation is focused on poller types which is the opposite way of data handling (fetch model).

I would then be pleased to get some guidance on how use the orion api with python for our purposes.


  • I totally get the struggle with SAM's static API poller. Your idea of a dynamic Python proxy script sounds like a game-changer! I had a similar quest with Orion API via Python. It's a great starting point for tweaking SW variables and actions. Also, you can use a Cheap proxy to help you. Good luck!

  • This all depends on what you are looking to change.  If you want to assign or unassign specific Application Templates (you mentioned Server & Application Monitor (SAM)  near the beginning), that can be done with the API.  If you want to assign custom properties to either the assigned application or nodes, this can also be done.

    But most people "shortcut" this by using Groups.  Here's a (simplified) scenario:

    • You have an application template (we'll call it "Custom Application")
    • This application needs to be assigned to a set of nodes.
    • You create a custom property (for Nodes) called "RunsCustomApp" (True/False) and check the box when the server runs the application.
    • You create a Group called "Custom App Servers" and have a Dynamic Query defining membership where "RunsCustomApp" is True.
    • You can then assign the "Custom Application" template to the group.
    • When nodes move in and out of the group, the application is either assigned or unassigned from the device.
  • Thanks for the feedback!
    I am sorry, but I am not able to follow some details in what you are suggesting (as I am not an experienced user), and would be pleased if you could direct me to the associated documentation and to add some details 

    • From your reply my understanding is that my (Python) proxy would be the Custom application to be created. (I have no experience in applying custom applications)
    • I will then have to create a Group of nodes ("Custom App Servers") there the nodes have a specific custom property defined and set. I would name the new property myself e.g. "RunsCustomApp".
    • There should then be a dynamic membership as to add/remove nodes from the Group which should be controlled by the proxy/application

    Thereby the node mapping is achieved and one could then e.g. use maps to present the topology.
    However, it is not clear how the status information shall be updated / pushed into SW by the proxy/application.

  • My understanding is that your proposed approach will not solve the problem as we have to deal with '"virtual nodes" and not regular nodes.

    The background is that we need to model a private mobile network with different equipment types and related status information. The topology of these networks will regularly change as to add/move/remove equipment. Each equipment to be monitored will appear as a separate instance with related properties (status, synchronized ...). Using the SAM API poller one needs to configure individual mappings manually for each parameter to be monitored. These manual handlings are undesired as to handle continuous changes.

    Further, the status information is related to SAM values whereas the real representation is a network topology with different interconnected equipment instances. Thus, a network topology with status indications for map presentation cannot be achieved within SW.

    The idea is then to create "virtual nodes" in SW controlled by the proxy/application (written in Python) which will then handle the REST api. The proxy will then create/modify/delete the virtual nodes as to follow what is presented in the api. One would then create specific custom attributes as to handle additional parameters than the status. 

    These virtual nodes will not have any associated polling functions.
    The status information etc will have to be conveyed (pushed) by the proxy into the nodes.
    The question is then how to continuously update the status info etc in the nodes.

    The approach should provide the basic means as to present the topology in SW. However, the question is how set the relations between the nodes.

  • OK - I think I got it.  Sorry for the roundabout discussion.

    You have elements you want to monitor via the API Poller and you want to use the SolarWinds API to assign them.  Is that correct?

    If that's your question, there are only three verbs in the SolarWinds API that are associated with the APIPoller entity: AssignTemplate, ExportTemplateFromApiPoller, and CreateApiPollerFromTemplate.

    If you already have a template built, you can use this first verb to assign it.  Once it's in there, the settings can be updated with a set SWIS object after you retrieve the Uri for the various elements.

    Fair warning: I don't know as much about the API polling as I'd like.  Hopefully, this is helpful.

  • Actually I am heading away from the API poller approach for the reasons outlined above.
    I want to handle the API polling inside a Python proxy which will create "virtual nodes" via the Orion SDK.
    A virtual node is then a regular SW node object but it does not have IP reachability etc,
    The question is then how to push the status information from the proxy into the nodes.

    To some extent this would relate to the SNMP traps handling as status info would be pushed and not polled into SW.

  • You are building something in Python to do the External API polling work, but you want the SolarWinds Solution to use the data received back to the Python program?

    There are a couple of ways.

    • You could send the SolarWinds Platform a syslog or a trap indicating "bad things." (I wouldn't send it informational or statistical information).
    • You can create a Application Script Component that goes out and reads a flat file on your Python worker every so often and stores it as Application metrics. (How I would do it)
    • You could build an API on the Python machine and then pull the data from the Python-based API. [Lots of maintenance]

    This is very much an edge case, but I get where you are going with it.  It's a cool setup and I applaud the work. Clap

  • Thanks!
    Yes, I want Solarwinds to use the data from the Python program. Essentially we have a remote network with different entities which is reflected in the rest api data. The customers are today using SolarWinds and wants to integrate the mobile network in their SW operations. A critical demand is then to be able to view the topology and locate where a specific problem is located as they would for their LANs etc. Alarms , dashboards ... shoudl then also be similar and handled within SW.

    Thus, I was targeting to use network nodes as to be able to handle the topology as this is not within the SAM context as handling "application metrics".

    Your suggested approaches would then take care of the updating problem as the Python program will adjust to the topology changes and SW "readers" would be able to digest all data exported by the Python program.

  • Hi Kevin,

    I'm hoping you can help me with the Invoke methods mentioned in your comment since you posted it recently and I can't find much documentation or discussion on it.

    Using SWQL studio, I can see the list of templates with this query: SELECT TOP 1000 ID, Guid, Name, Version, DisplayName, Description, Created, Updated, TemplateData, RequestsCount, MetricsCount, IsCustom FROM Orion.APIPoller.Templates

    My goal is to create a script to automate the creation of an API poller using one of these template ID's. The use case is that one of the teams in my organization has been quietly monitoring almost 300 API's via testing using Postman and script automation for the past several years, and I would like to plug in whatever document they give me (.txt or .csv) with all of the necessary details, into a script so that it takes all of the params and builds the API Pollers accordingly so that I don't have to do it manually.
    They are mulesoft API's hosted in the cloud, if that matters.
    My ultimate goal would be to use this functionality for DevOps to automate the monitoring of new API's with "self-service" for dev teams in mind.
    ***The issue is that I can't figure out what to pass with the Orion.APIPoller.Invoke - CreateApiPollerFromTemplate  in SWQL Studio, specifically, the "Configuration" body and the "Parameters" body***
    I've had success with similar invoke methods with SWQL, but this one is giving me a hard time.
    Please help. Thanks.