New: Try our AI‑powered Search (Ctrl + K) — Read more

How to Provision Sensor Collector in SNMP Alert Forwarding Mode

Prev Next

Overview

In this article, we'll be discussing how to provision a Sensor Collector to operate in Simple Network Management Protocol (SNMP) Alert forwarding mode. Cisco Provider Connectivity Assurance (formerly Skylight performance analytics) currently supports SNMPv2 as a mechanism for delivering alert notifications to northbound systems.

Prerequisites:

Read the following topics before setting up the SNMP trap receiver:

SNMP Trap Sender Configuration

Setting up a Sensor Collector as an SNMP Trap Sender varies depending on your deployment type: Provider Connectivity Assurance cloud deployments, on-prem deployments using Docker Swarm, or on-prem deployments using Kubernetes. Please follow the instructions specific to your deployment type.

OR

Cloud Deployments or On-Prem Docker Swarm Deployments

The connector config REST API can generate a MQTT token and provide a MQTT to the SNMP client. The following example uses Postman to execute the API requests.

Note: Only one trapTargetHost can be configured in the SNMPTrapSenderConfig. Configuring multiple trapTargetHost entries is not supported.

  1. Authenticate with Cisco Provider Connectivity Assurance using your username and password. Record the cookie in the response; this will be used in subsequent requests.
{{protocol}}://{{host}}/api/v1/auth/login

image.png

  1. POST a payload to {{protocol}}://{{host}}/api/v2/connector-configs.
{
    "data": {
        "type": "connectorConfigs",
        "attributes": {
            "name": "<CONNECTOR NAME>",
            "tenantId": "<Tenant Name>",
            "datatype": "connectorConfig",
            "pollingFrequency": 60,
            "type": "FileWatcher",
            "zone": "<ZONE NAME>",
            "username": "<USER NAME>",
            "url": "/var/lib/data/snmp",
            "SNMPTrapSenderConfig": {
                "trapTargetHost": "<SNMP Trap Target HOST/IP>",
                "trapTargetPort": "162",
                "community": "public"
            }
        }
    }
}
  • You may see the error below while sending the above POST call.

image.png

{
    "code": 415,
    "message": "unsupported media type \"application/json\", only [application/vnd.api+json] are allowed"
}
  • To fix this error, add a header called Content-Type application/vnd.api+json, as seen below.

image.png

  • After fixing the error code, execute Step 2. You will see that SNMP connector will be created with response code 201.

image.png

Note: Ensure that you get 201 response code while creating the SNMP Sensor Collector.

  • Replace with your tenant ID (this is not the tenant name).

  • To get your tenant ID, you can CURL the following URL or go to this page in your web browser:

curl 'https://<your tenant URL>/api/v1/onboarding/tenant-info' 
{ 
"data": {
 "attributes": {
 "tenantId": "<< TENANT ID >>",
 "tenantName": "<< TENANT NAME >>" }, "id": "<< TENANT NAME >>",
 "type": "tenant-info"
 }
 }
  • Replace < ZONE NAME > with a unique zone identifier (anything unique, such as 1234).

  • Replace < USER NAME > with the tenant administrator username in Cisco Provider Connectivity Assurance who is responsible for creating the connector configuration. This should be the same username that the administrator uses to log in to Cisco Provider Connectivity Assurance (for example, admin@tenant.com).

Optional: If you will be using this connector for ingesting CSV files, replace < Data Ingestion URI > with the path to your ingestion files (e.g. /var/lib/data/pocs/jyu/cybetron/rr/).

Configure the SNMPTrapSenderConfig with your SNMP Trap Receiver. All alerts from Cisco Provider Connectivity Assurance will be sent to the trap receiver configured here.

  • Replace <SNMP Trap Target HOST/IP> with the Hostname/IP of the SNMP Trap Receiver.
  • Replace trapTargetPort with the SNMP Trap Receiver's port (usually 162).
  • Replace community with the SNMP Trap Receiver's community string.

CAUTION: It is assumed that the Sensor Collector configured here is able to connect to the SNMP Trap Receiver on the customer network. Sensor Collector runs in a Docker container so you may need to configure routing to accommodate. Most likely scenarios do not use 127.0.0.1 for trapTargetHost.

  1. Log in to Cisco Provider Connectivity Assurance and find your Connector Configuration in Settings.

image.png

  1. Download the connector.

image.png

  1. Follow Deploying Sensor Collector in Docker to run your connector.
  • Once the Sensor Collector has successfully connected and been configured, you will see SNMP Sensor Collector logs as below:
$ sudo docker logs -tf <'container id or container name'>

Screen Shot 2021-07-15 at 4.46.12 PM.png

  1. (Optional) Download your connector config using the API call below:
GET {{protocol}}://{{host}}/api/v2/connector-configs

image.png

On-Prem Kubernetes Deployments

  1. Create a new Sensor Collector in the Analytics UI or choose an existing Sensor Collector.

  2. Obtain a Personal Access Token to configure your Sensor Collector for accessing alerts via MQTT.
    Follow the steps outlined in Obtaining a Personal Access Token.

  3. Either configure your API client of choice (Bruno, Postman, etc.) for OAuth2.0 authentication following Configuring OAuth 2.0 Clients for API Access or use the same Personal Access Token obtained in step 1 as your API authentication token by submitting it as a Bearer token in the Authorization header of your requests.

  4. GET {{protocol}}://{{tenant-url}}/api/v2/connector-configs/{{id}} to find your connector configuration for your Sensor Collector. Use its response as the starting point for your payload for updating it to become an SNMP Trap Sender.

  5. PATCH {{protocol}}://{{tenant-url}}/api/v2/connector-configs with a Content-Type header of application//vnd.api+json using your retrieved connector configuration payload with the new SNMPTrapSenderConfig and MQTTConfig options, as specified below:

Content-Type: application/vnd.api+json
Authorization: Bearer <PAT or OAUTH2.0 TOKEN>
{
    "data": {
        "type": "connectorConfigs",
        "attributes": {
            ...
            "SNMPTrapSenderConfig": {
                "trapTargetHost": "<SNMP TRAP TARGET HOST/IP>",
                "trapTargetPort": "162",
                "community": "public"
            },
            "MQTTConfig": {
                "brokerURI": "wss://<TENANT URL>/mqtt",
                "clientID": "<TENANT NAME>",
                "notificationTopic": "<TENANT NAME>/v1/notifications/alert/public/#",
                "user": "<TENANT URL>",
                "token": "<PAT>"
            },
            ...
        }
    }
}
  • You will get a 201 response if created successfully.
  1. Start your Sensor Collector (or restart if using an existing Sensor Collector).

Set Up the SNMP Trap Receiver to See Alerts

You can create an SNMP trap receiver with a docker-snmp tool to see whether or not the SNMP trap is being triggered.

To create an SNMP trap receiver with a Docker container:

  1. Download the SNMP trap receiver from the Docker hub repository.

https://hub.docker.com/r/lidaheemc/docker-snmp

Screen Shot 2021-07-15 at 3.28.05 PM.png

  1. Install the SNMP trap receiver.
sudo docker pull lidaheemc/docker-snmp
  1. Run and Test the SNMP trap receiver.
sudo docker run -d -p 162:162/udp --name snmptrap-receiver -v $PWD/snmp:/var/log/snmp lidaheemc/docker-snmp
  1. Check the Docker SNMP trap container status.
    image.png

  2. Once the server is running, you can view the trap logs by using the following command:

docker logs -tf --tail 100 <container id or container name>

image.png

  1. Check the snmp-trap receiver log:

image.png

Note: This is only for testing purpose; you would have your own SNMP trap receiver to see the alerts.

Now your connector will forward alerts from MQTT to the configured SNMP trap receiver.

ACCEDIAN-SMI.mib

For a quick reference, the following mapping is used:

SNMPID:                 ".1.3.6.1.4.1.22420.3.1", 
ObjectIDOID:            ".1.3.6.1.4.1.22420.3.2", 
ObjectNameOID:          ".1.3.6.1.4.1.22420.3.3", 
ObjectTypeOID:          ".1.3.6.1.4.1.22420.3.4", 
DirectionOID:           ".1.3.6.1.4.1.22420.3.5", 
PolicyIDOID:            ".1.3.6.1.4.1.22420.3.6", 
MetricOID:              ".1.3.6.1.4.1.22420.3.7", 
AlertTypeOID:           ".1.3.6.1.4.1.22420.3.8", 
SourceOID:              ".1.3.6.1.4.1.22420.3.9", 
ProcessedTimestampOID:  ".1.3.6.1.4.1.22420.3.10", 
StartTimestampOID:      ".1.3.6.1.4.1.22420.3.11", 
TimestampOID:           ".1.3.6.1.4.1.22420.3.12", 
PolicyNameOID:          ".1.3.6.1.4.1.22420.3.13", 
AlertStateOID:          ".1.3.6.1.4.1.22420.3.14",

SNMP Trap MIB for Alerts on Capture-Based Metrics

The trap definition is in the PERFORMANCEVISION-MIB.txt file.

PERFORMANCEVISION-MIB.txt

For a quick reference, the following mapping is used:

SNMPID:                           ".1.3.6.1.4.1.36773.3.1", 
CaptureMetaNameOID:               ".1.3.6.1.4.1.36773.3.1.1",
CaptureMetaFiringOID:             ".1.3.6.1.4.1.36773.3.1.2", 
CaptureMetaCertaintyPercentOID:   ".1.3.6.1.4.1.36773.3.1.3", 
CaptureMetaDescOID:               ".1.3.6.1.4.1.36773.3.1.4",

Send Alert Metadata in SNMP Trap

SNMP Traps can retrieve metadata defined on the object. The maximum configuration is set to five for defining the alertMetaDataKey(x) to be returned. When this feature is enabled in the Sensor Collector configuration, it will search for the specified metadata key and retrieve the value if found. A blank string will be returned if the key is not located or if the key was not defined in one of the alertMetaDataKey attributes.

image.png

To configure the connector:

  1. Create the new connector configuration in the UI by going to Settings > Connectors > New.

  2. Select FileWatcher type and fill out the rest of the fields.

image.png

  1. Once the connector is created, retrieve the current configuration via the connector-configs API.
    Note: The connector config ID will be required to perform the update. You can retrieve this in one of the following two ways:

    • Searching for and selecting it in the UI once it is created. When selected, the URL in the browser will display the UID for this connector, as shown below (selection=c22f0050-7070-45cd-a830-d6e1cdacb2d7):

image.png

Or:

  • Using a tool like Postman, you can retrieve all connector configurations by making a GET request to the following API endpoint: {{serverAddress}}/api/v2/connector-configs. Replace {{serverAddress}} with the address of your system. This request returns all connector configurations, which you can then search to find the specific one you need.

Once the connector configuration UID has been obtained, the configuration must be changed to allow for the connection to the MQTT service.

To change the configuration to allow connection to MQTT service:

  1. Retrieve the connector configuration by making a GET request to the following endpoint: {{serverAddress}}/api/v2/connector-configs/{{connectorConfigId}}. Replace {{connectorConfigId}} with the value retrieved above.

  2. Modify the body of the connector configuration to include both the SNMPTrapSenderConfig and the MQTTConfig.
    Note: Both of these sections need the variable keys replaced, represented by the double curly brace:

{
    "data": {
        "attributes": {
            "SNMPTrapSenderConfig": {
                "trapTargetHost": "192.168.1.6",
                "trapTargetPort": "162",
                "community": "public",
                "alertMetaDataEnabled": {{true/false}},
                "alertMetaDataKey1": "{{metaDataKey1}}",
                "alertMetaDataKey2": "{{metaDataKey2}}",
                "alertMetaDataKey3": "{{metaDataKey3}}",
                "alertMetaDataKey4": "{{metaDataKey4}}",
                "alertMetaDataKey5": "{{metaDataKey5}}"
            },
            "MQTTConfig": {
                "brokerURI": "wss://{{serverAddress}}:443/mqtt",
                "clientID": "{{connectorConfigName}}",
                "notificationTopic": "{{tenantName}}/v1/notifications/alert/public/#",
                "user": "{{userName}}"
            }
            .... additional information returned when the configuration was retrieved ....
     }
}
  1. Once the payload has been modified, perform a PATCH to send the required updates to the system: {{serverAddress}}/api/v2/connector-configs/{{connectorConfigId}} Replace {{connectorConfigId}} with the value retrieved above.

  2. Download and install the new connector.

image.png

SNMP Trap Reference

		SNMPID:                ".1.3.6.1.4.1.22420.3.50.1",
		ObjectIDOID:           ".1.3.6.1.4.1.22420.3.2",
		ObjectNameOID:         ".1.3.6.1.4.1.22420.3.3",
		ObjectTypeOID:         ".1.3.6.1.4.1.22420.3.4",
		DirectionOID:          ".1.3.6.1.4.1.22420.3.5",
		PolicyIDOID:           ".1.3.6.1.4.1.22420.3.6",
		MetricOID:             ".1.3.6.1.4.1.22420.3.7",
		AlertTypeOID:          ".1.3.6.1.4.1.22420.3.8",
		SourceOID:             ".1.3.6.1.4.1.22420.3.9",
		ProcessedTimestampOID: ".1.3.6.1.4.1.22420.3.10",
		StartTimestampOID:     ".1.3.6.1.4.1.22420.3.11",
		TimestampOID:          ".1.3.6.1.4.1.22420.3.12",
		PolicyNameOID:         ".1.3.6.1.4.1.22420.3.13",
		AlertStateOID:         ".1.3.6.1.4.1.22420.3.14",
		ThresholdValueOID:     ".1.3.6.1.4.1.22420.3.15",
		MetaDataKey1OID:       ".1.3.6.1.4.1.22420.3.16",
		MetaDataKey2OID:       ".1.3.6.1.4.1.22420.3.17",
		MetaDataKey3OID:       ".1.3.6.1.4.1.22420.3.18",
		MetaDataKey4OID:       ".1.3.6.1.4.1.22420.3.19",
		MetaDataKey5OID:       ".1.3.6.1.4.1.22420.3.20",
		MetaDataVal1OID:       ".1.3.6.1.4.1.22420.3.21",
		MetaDataVal2OID:       ".1.3.6.1.4.1.22420.3.22",
		MetaDataVal3OID:       ".1.3.6.1.4.1.22420.3.23",
		MetaDataVal4OID:       ".1.3.6.1.4.1.22420.3.24",
		MetaDataVal5OID:       ".1.3.6.1.4.1.22420.3.25",
		TriggeredValueOID:     ".1.3.6.1.4.1.22420.3.26",

SNMP Trap Example Payload

If alertMetaDataEnabled in the connectorConfig is set to true, the following values will be returned:

[{Name:.1.3.6.1.6.3.1.1.4.1.0 Type:ObjectIdentifier Value:.1.3.6.1.4.1.22420.3.50.1 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.2 Type:OctetString Value:33761-F648E24B-AB01-4B95-8CC6-1AB6611FCCC0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.3 Type:OctetString Value:E21600_ABC_2_ENB_AF22 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.4 Type:OctetString Value:twamp-sf Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.5 Type:OctetString Value:0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.6 Type:OctetString Value:c79123a7-27d4-472e-a541-789a334f0a94 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.7 Type:OctetString Value:delayP95 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.8 Type:OctetString Value:twamp-sf Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.9 Type:OctetString Value:skylight-spark Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.10 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.11 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.12 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.13 Type:OctetString Value:Test Name SQA_TWAMP_1686775324645909 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.14 Type:OctetString Value:raised Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.15 Type:OctetString Value:15000.0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.16 Type:OctetString Value:region Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.17 Type:OctetString Value:target_city Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.18 Type:OctetString Value:source_city Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.19 Type:OctetString Value:service_class Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.20 Type:OctetString Value:uplink_route Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.21 Type:OctetString Value:north east Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.22 Type:OctetString Value:ottawa Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.23 Type:OctetString Value:montreal Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.24 Type:OctetString Value:af22 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.25 Type:OctetString Value:rtr0121-rtr1447-rtr1847-rtr1848-rtr1849-rtr1851 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.26 Type:OctetString Value:16000.0 Logger:<nil>}]

If alertMetaDataEnabled is either not set or set to false, the following values will be returned. You will notice that items 16 to 25 no longer appear in the returned payload. This change is due to the addition of a new parameter after the metadata as well as to maintain backward compatibility and ensure the numbering sequence was not reordered.

[{Name:.1.3.6.1.6.3.1.1.4.1.0 Type:ObjectIdentifier Value:.1.3.6.1.4.1.22420.3.50.1 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.2 Type:OctetString Value:33761-F648E24B-AB01-4B95-8CC6-1AB6611FCCC0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.3 Type:OctetString Value:E21600_ABC_2_ENB_AF22 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.4 Type:OctetString Value:twamp-sf Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.5 Type:OctetString Value:0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.6 Type:OctetString Value:c79123a7-27d4-472e-a541-789a334f0a94 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.7 Type:OctetString Value:delayP95 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.8 Type:OctetString Value:twamp-sf Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.9 Type:OctetString Value:skylight-spark Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.10 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.11 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.12 Type:OctetString Value:1688834954653 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.13 Type:OctetString Value:Test Name SQA_TWAMP_1686775324645909 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.14 Type:OctetString Value:raised Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.15 Type:OctetString Value:15000.0 Logger:<nil>}
{Name:.1.3.6.1.4.1.22420.3.26 Type:OctetString Value:16000.0 Logger:<nil>}]

© 2026 Cisco and/or its affiliates. All rights reserved.

For more information about trademarks, please visit:
Cisco trademarks 
For more information about legal terms, please visit:
Cisco legal terms
For legal information about Accedian Skylight products, please visit:  Accedian legal terms and trademarks