What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How can I monitor the Sigfox API with PRTG?

Votes:

0

Can I use PRTG to monitor values from the Sigfox API? What steps do I need to take?

api prtg rest-custom sigfox

Created on Jul 9, 2018 10:40:40 AM by  Brandy Greger [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

This article applies as of PRTG 22

Monitoring the Sigfox v2 API with the REST Custom sensor

Important notice: This article was adapted to fit the new Sigfox v2 API, for which we provided new REST configuration files as of PRTG 20.1.55. If you already use REST Custom sensors for monitoring the Sigfox API, please create new sensors with the new REST configuration files respectively.

The Sigfox v2 API uses the HTTP protocol, which follows the REST principles. Using the REST Custom sensor, you can monitor the Sigfox v2 API. This way you can monitor information like the number of messages received from your Sigfox-connected device, for example.

API access

The first step is to get your API Access credentials from the Sigfox backend. You will need these for authentication when setting up your REST Custom sensor in PRTG.

Note: The Sigfox API documentation is tailored depending on user rights. See the API documentation in the Sigfox Portal for more information.

The REST configuration file

Because the REST Custom sensor maps JSON/XML results to sensor values, the mapping rule has to be available as a REST configuration file in JSON template (*.template) format.

PRTG provides three standard templates for monitoring the Sigfox v2 API:

  • sigfox.device.template
  • sigfox.device.message.metric.template
  • sigfox.keepalive.template

The sigfox.device.message.metric.template, for example, looks like this:

{
	"prtg": {
             "description": {
                    "device": "https://api.sigfox.com",
                    "query": "/v2/devices/{DEVICE_ID}/messages/metric",
                    "comment": "Replace {DEVICE_ID} device ID. Get a list of all device IDs by calling https://api.sigfox.com/v2/devices"
              },
		"result": [{
				"channel": "Messages last Day",
				"CustomUnit": "#",
				"value": $.lastDay
			}, {
				"channel": "Messages last Week",
				"CustomUnit": "#",
				"value": $.lastWeek
			}, {
				"channel": "Messages last Month",
				"CustomUnit": "#",
				"value": $.lastMonth
			}
		]
	}
}

You can either use one of these standard templates, or you can create a custom template:

  • In the \Custom Sensors\rest subdirectory of the probe system's PRTG program directory, create a new REST configuration file. Make sure that the template is written in valid JSON according to the PRTG API definition. For details, see PRTG Manual: Custom Sensors.
  • Give the template a descriptive name like sigfox.device.custom.template. You will need this when setting up the sensor.

Create a REST Custom sensor

The next step to montoring the Sigfox v2 API is to add a REST Custom sensor to your PRTG installation.

  1. Create a new device or use an existing device in PRTG and enter api.sigfox.com as IPv4 Address/DNS Name.
  2. Add a REST Custom sensor to the device.
  3. Configure the sensor as follows.
    Sensor settings
    Click to enlarge.
  4. Select HTTPS as Request Protocol.
  5. Select Basic authentication as Authentication Method.
  6. Under User, enter the Login from your Sigfox API Access.
  7. Under Password, enter the Password from your Sigfox API Access.
  8. Under REST Query, enter a valid query for your REST resource. For the standard templates that PRTG provides for the Sigfox v2 API, the queries are as follows:
    • sigfox.device.template
      /v2/devices/{DEVICE_ID}
    • sigfox.device.message.metric.template
      /v2/devices/{DEVICE_ID}/messages/metric
    • sigfox.keepalive.template
      /v2/device-types/{DEVICE_TYPE}
      Note: Replace {DEVICE_ID} with the ID of your device in the Sigfox backend. Replace {DEVICE_TYPE} with the type of your device in the Sigfox backend.
  9. Under REST Configuration, select the template that you want to use.Make sure that template and query match.
  10. Click Create to create the sensor.

The sensor now displays the information from the Sigfox v2 API. REST Custom sensor
Click to enlarge.

More

Created on Jul 9, 2018 1:33:51 PM by  Brandy Greger [Paessler Support]

Last change on Jan 5, 2023 8:00:26 AM by  Brandy Greger [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.