Creating a Subscription

When you configure static telemetry subscription to the data sampled or a customized event, you need to create a subscription to associate the configured destination group with the configured sampling sensor group so that data can be sent to the collector.

Context

When static subscription is configured, a device functions as a client and a collector functions as a server. To statically subscribe to the data sampled or a customized event, you need to create a subscription to set up a data sending channel. The protocol used to send data can be gRPC or UDP.

Before configuring an SSL policy on the client to establish a secure SSL connection between the client and server, ensure that the SSL policy has been created. For details about how to create an SSL policy, see "Configuring and Binding an SSL Policy" in Configuration - Basic Configuration - Accessing Other Devices Configuration.

Procedure

  • Create a static subscription based on gRPC.
    1. Run system-view

      The system view is displayed.

    2. Run telemetry

      The telemetry view is displayed.

    3. Run subscriptionsubscription-name

      A subscription is created, and the subscription view is displayed.

    4. Run sensor-groupsensor-name [ sample-intervalsample-interval { [ suppress-redundant ] | [ heartbeat-intervalheartbeat-interval ] } * ]

      A sampling sensor group is associated with the subscription, and a sampling interval, a heartbeat interval, and redundancy suppression are configured for the sampling sensor group.

    5. Run destination-group destination-name

      A destination group is associated with the subscription.

    6. (Optional) Run protocol grpc [ no-tls ]

      The protocol and encryption mode are configured for the destination collector that is associated with this subscription.

      Both this command and the ipv6-address command in the destination-group view can configure a protocol and encryption mode for the destination collector. If the destination collector is associated with the subscription, command configurations take effect based on the following rules:
      • If this command has been run, the protocol and encryption mode configured by running this command in the subscription view take effect.

      • If this command is not run, the protocol and encryption mode configured using the ipv6-address command in the destination-group view take effect.

    7. (Optional) Run local-source-address ipv6 ipv6-address

      A source IPv6 address is configured for gRPC-based data sending.

    8. (Optional) Run dscp value

      A DSCP value is set for data packets to be sent.

    9. (Optional) Run encoding { json | gpb }

      An encoding format is configured for data packets to be sent.

    10. (Optional) Configure a maximum usage for the main control board's CPU used when telemetry collects data.

      1. Run quit

        Return to the telemetry view.

      2. Run cpu-usage max-percent usage

        A maximum usage is configured for the main control board's CPU used when telemetry collects data.

      This command is supported only by the admin VS.

    11. (Optional) Configure an SSL policy for the client or enable the client to perform SSL verification on the server.

      The certificate to be loaded must be supported by both the client and server.

      1. Run quit

        Return to the system view.

      2. Run grpc

        The gRPC view is displayed.

      3. Run grpc client

        The gRPC client view is displayed.

      4. Run ssl-policy policy-name [ verify-cn cn-name | verify-san san ]

        An SSL policy is configured for the client during static telemetry subscription.

        If the no-tls parameter is specified in the ipv6-address port or protocol (subscription view) command, the TLS encryption mode is not used. In this case, the client-specific SSL policy configured by running this command does not take effect.

      5. Run ssl-verify peer

        The client is configured to perform SSL verification on a server during static telemetry subscription.

        If the no-tls parameter is specified in the ipv6-address port or protocol (subscription view) command, the TLS encryption mode is not used. In this case, the configuration that enables the client to perform SSL verification on a server does not take effect.

    12. (Optional) Run dscp value

      A DSCP value is set for data packets to be sent.

      This configuration takes effect differently from the dscp command configured in the subscription view. This configuration takes effect on all connections of the gRPC client. If the dscp command is configured in both the gRPC client view and the subscription view, the DSCP value configured in the subscription view takes effect.

    13. Run commit

      The configuration is committed.

  • Create a static subscription based on UDP.
    1. Run system-view

      The system view is displayed.

    2. Run telemetry

      The telemetry view is displayed.

    3. Run subscription subscription-name

      A subscription is created, and the Subscription view is displayed.

    4. Run sensor-group sensor-name [ sample-interval sample-interval { [ suppress-redundant ] | [ heartbeat-interval heartbeat-interval ] } * ]

      A sampling sensor group is associated with the subscription, and a sampling interval, a heartbeat interval, and redundancy suppression are configured for the sampling sensor group.

    5. Run destination-group destination-name

      A destination group is associated with the subscription.

    6. Run protocol udp

      A protocol and encryption mode are configured for the destination collector that is associated with this subscription.

      Both this command and the ipv6-address port command in the destination-group view can configure a protocol and encryption mode for the destination collector. If the destination collector is associated with the subscription, command configurations take effect based on the following rules:
      • If this command has been run, the protocol and encryption mode configured by running this command in the subscription view take effect.

      • If this command is not run, the protocol and encryption mode configured using the ipv6-address port command in the destination-group view take effect.

    7. (Optional) Run local-source-address ipv6 ipv6-address [ port port-value6 ]

      A source IPv6 address and source port number are configured when UDP is used for data sending.

    8. (Optional) Run dscp value

      A DSCP value is set for data packets to be sent.

    9. (Optional) Run encoding { json | gpb }

      An encoding format is configured for data packets to be sent.

    10. (Optional) Configure a maximum usage for the main control board's CPU used when telemetry collects data.

      1. Run quit

        Return to the telemetry view.

      2. Run cpu-usage max-percent usage

        A maximum usage is configured for the main control board's CPU used when telemetry collects data.

    11. Run commit

      The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >