Use API pollers to monitor metrics in SAM
If you can access an external REST API, you can use the API Poller feature to collect data from modern application stacks and display it in SAM dashboards. Define your API endpoints, configure authentication, add credentials, select metrics to monitor, and start automated polling at regular intervals without the need for custom scripts.
Similar to tools like Postman, the API Poller feature guides you through building an API poller that can include one or more API requests. You need to know what each API provider requires in requests (for example, tokens), but little coding knowledge is needed. This feature can build request URLs for you.
Some benefits of this feature include:
- Send and receive automated API requests to quickly exchange data with cloud services like Azure and AWS, hardware vendors like Cisco, or any entity that offers data via API.
- Create connections between SAM and remote APIs for wider visibility and improved troubleshooting.
- Monitor data that's not available via standard polling methods, such as SNMP.
- Receive alerts about API data in the SolarWinds Platform Web Console.
New to REST APIs? Watch Intro to APIs for people who hate to program and API Pollers: When SNMP Won't Cut It.
For example, you can use Pi-hole to track incoming spam. Navigate to the URL of the host server in a browser, and log in to see the latest values for DNS Queries Today in the main web interface.
(Screenshots property of © 2021 Pi-hole)
You can access the same data via the Pi-hole API (© 2021 Pi-hole, available at discourse.pi-hole.net/). After using the host server URL to create and send an API request ###.###.###.##/admin/api.php
in your web browser, the response should include the same values displayed in the Pi-hole web interface, as shown in this partial example:
{"domains_being_blocked":131941,"dns_queries_today":279430,"ads_blocked_today":28655,"ads_percentate_today";10.2544805
.
To avoid the need to craft code and enter retrieved data in the SolarWinds Platform Web Console manually, you can add an API poller instead. Besides being easier, you get benefits of the API Poller feature, including automated polling, data integration within SAM, and alerting.
Here is an example of the initial Pi-Hole request on the API Poller page:
Here is an example of the API response:
After deciding which values to monitor, save the API poller. When polling occurs, metrics appear in the SolarWinds Platform Web Console and are saved to the SolarWinds Platform database.
Want to see this example in action? Watch API Pollers: When SNMP Won't Cut It.
Besides ease of use, API pollers provide the following benefits over standard API tools:
-
Select only the metrics you care about, such as those needed for troubleshooting.
-
Set warning and critical thresholds to trigger alerts in the SolarWinds Platform Web Console.
-
Get started quickly with API Poller templates designed for popular APIs, such as Microsoft 365 and Azure.
Some ideas for using the API Poller feature include:
-
Leverage existing requests created in API tools such as Microsoft Graph Explorer SAM. Copy URLs and access tokens from Graph Explorer and use them to build API pollers.
-
Increase visibility into apps already being monitored by application monitor templates by adding API pollers that connect to related external APIs.
-
Tighten connections between SolarWinds products in your environment by creating API pollers to access SolarWinds AppOptics, Loggly, and Pingdom APIs.
-
Provide SolarWinds Platform data to external teams, produce custom dashboards for executives, or automate maps with data from the SolarWinds Platform SDK API.
-
Use the Cisco UCS API to bolster blade server monitoring by adding metrics to what you already collect through hardware health monitoring.
-
Use the Nutanix API to check data resiliency by setting alert thresholds for the number of nodes in monitored Nutanix clusters, or drill into endpoints to find metrics such as cluster Read IOPs.
Get started with your first API poller
If you're familiar with API requests, here is an overview about how to begin monitoring a remote API from within SAM. For more detailed steps, see How the API Poller feature in SAM works.
-
Review API poller requirements.
-
Navigate to the Manage API Pollers page (Settings > All Settings > Manage API Pollers).
-
Add your first API poller. Alternatively, assign an out-of-the-box API poller template to an existing node.
Allow time for API responses — the larger the data set, the longer the response time.
When SAM receives an API response, it parses the JSON payload to glean relevant data, assigns that data to the monitored node, and displays metrics in several areas of the SolarWinds Platform Web Console, including:
- Node Details views: The API Poller widget displays the latest metrics being monitored for the node with their status.
- PerfStack: Navigate directly to a Performance Analysis dashboard from the API Poller widget on the Node Details view to see historic API metrics.
- SolarWinds Platform Maps: Click a node with an assigned API poller to display monitored metrics.