このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ IoT Device Access/ Best Practices/ Device Linkage/ Monitoring Device Status Changes and Sending Notifications

Monitoring Device Status Changes and Sending Notifications

Updated on 2025-03-03 GMT+08:00

Introduction

Device administrators need to know connection statuses of IoT devices, such as IoT gateways.

IoTDA provides the rule engine function to meet this requirement. You can easily enable the platform to send a notification when the device status meets a certain condition.

Example Scenario

An enterprise has a batch of gateways under a gateway product. About 400 child devices are mounted to a gateway. Administrators need to check gateway statuses in real time to ensure that child devices report data properly. In addition, the gateways are connected to the IoT platform over the 4G network, frequent alarms are generated due to network jitter. Administrators consider that the scenario where devices go offline and quickly go online is normal and do not want to be notified of this scenario.

The following example shows how to monitor all gateways. When a gateway is offline for 5 minutes, an alarm is reported by IoTDA. When the gateway is back to online for 1 minute, the alarm is cleared and an email or SMS is sent to a specified address or mobile number.

The procedure is as follows:

  1. Configure IoTDA. Create an IoT product and device and create a linkage rule so that alarms can be sent to AOM when device status conditions are met.
  2. Configure SMN. Create an SMS or email subscription.
  3. Configure AOM. Create alarm rules to process alarms reported by IoTDA and send SMS or email notifications using SMN.
Figure 1 Example

Configuring IoTDA

Create a product model, register a device, and configure a device linkage rule on IoTDA. When a device is offline for 5 minutes, an alarm is reported to AOM. This alarm is cleared 1 minute after the device goes online.

NOTE:

The product model and device used are only examples. You can use your own product model and device.

  1. Visit the IoTDA service page and click Access Console. Click the target instance card.
  2. Choose Products in the navigation pane and click Create Product on the left to create an MQTT product. Set the parameters and click OK.

    Table 1 Parameters for creating a product

    Basic Information

    Product Name

    Enter a value, for example, MQTT_Device.

    Protocol

    Select MQTT.

    Data Type

    Select JSON.

    Industry

    Set the parameters as required.

    Device Type

  3. Click here to download a sample product model.
  4. Click the created product. The product details page is displayed.
  5. On the Basic Information tab page, click Import from Local. In the displayed dialog box, load the local product model and click OK.

    Figure 2 Uploading a model file

  6. In the navigation pane, choose Devices > All Devices. On the displayed page, click Register Device. On the displayed page, set device registration parameters. Click OK. Save the device ID and secret returned after the registration is successful.

    Figure 3 Registering a device - gateway
    Table 2 Parameters for registering a device

    Parameter

    Description

    Product

    Select the product created in 4.

    Node ID

    Set this parameter to the IMEI, MAC address, or serial number of the device. If the device is not a physical one, set this parameter to a custom character string that contains letters and digits.

    Device Name

    Customize the value.

    Authentication Type

    Select Secret.

    Secret

    Customize the secret used for device access. If the secret is left blank, the platform automatically generates a secret.

  7. In the navigation pane, choose Rules > Device Linkage, and click Create Rule. (Before creating a rule, select the resource space to which the rule will belong.)
  8. Configure rule parameters based on the table below to create a rule for reporting offline gateway alarms. The following parameter values are only examples. You can create your own rules by referring to User Guide. After setting the parameters, click Create Rule.

    Table 3 Parameters for creating a linkage rule

    Parameter

    Description

    Rule Name

    Customize a value, for example, Gateway_Offline_Monitor.

    Activate upon creation

    Select Activate upon creation.

    Effective Period

    Select Always effective.

    Description

    Describe the rule, for example, This alarm is generated when the gateway is offline for 5 minutes.

    Set Triggers

    1. Click Add Trigger.
    2. Select Device Property.
    3. Select the MQTT_Device product created in 4, select All Devices, and select Offline as the trigger status.
    4. Set Duration to 5 minutes.

    Set Actions

    1. Click Add Action.
    2. Select Report alarms.
    3. Set the alarm severity to Major, alarm isolation level to Device, Alarm Name to GatewayStatusChange, and Description to The gateway is offline. Check the issue and arrange personnel for maintenance in a timely manner., and click OK.
    Figure 4 Creating a linkage rule - GatewayOffline

  9. Create a linkage rule for alarm clearance.

    Figure 5 Creating a linkage rule - GatewayOnline
    NOTICE:
    • The alarm name, alarm severity, and alarm isolation dimension together identify an AOM alarm. The three attributes of the alarm to clear must be the same as those specified during alarm reporting. Otherwise, the alarm clearance will fail.
    • There is a flow control for device status monitoring. If a large number of devices are monitored, flow control is triggered. As a result, alarms cannot be reported. For details, see Limitations.

Configuring SMN

On the SMN console, create a topic and add a subscription for AOM to invoke to send emails or SMS messages.

  1. Log in to Huawei Cloud and access SMN.
  2. Click the button for accessing the console. If you have not subscribed to SMN, subscribe to it first.
  3. Choose Topic Management > Topics, and click Create Topic.
  4. Enter a topic name, for example, Test_1, and click OK.

    Figure 6 Creating a topic - SMN

  5. Choose Topic Management > Subscriptions, and click Add Subscription.
  6. Enter the subscription information. Click OK.

    Figure 7 Adding a subscription - SMN
    Table 4 Parameters for adding a subscription

    Parameter

    Description

    Topic Name

    Select the topic created in 4.

    Protocol

    • To send an email notification, select Email.
    • To send an SMS notification, select SMS.

    Endpoint

    • If Protocol is set to Email, enter the email address for receiving notifications.
    • If Protocol is set to SMS, enter the mobile number for receiving notifications.

    To add multiple endpoints, place one endpoint in a line. A maximum of 10 lines can be entered.

Configuring AOM

Create alarm rules and alarm action rules on AOM. When IoTDA alarms are reported, AOM handles the alarm and sends email or SMS notifications.

  1. Log in to Huawei Cloud and visit AOM.
  2. Click the button for accessing the console. If you have not subscribed to AOM, subscribe to it first.
  3. Choose Alarm Center > Alarm Action Rules and click Create.
  4. Enter an alarm action rule name, for example, Test_1, select the Test_1 topic created in Configuring SMN, and click the button to confirm the setting.

    Figure 8 Creating an action rule - AOM

  5. Choose Alarm Center > Alarm Rules and click Create Alarm Rule.
  6. Enter a rule name, for example, Gateway_Status_Change_Alarm_Rule, select the event alarm and custom event options, enter IoTDA in Alarm Source, set Select Object to event_name=GatewayStatusChange (GatewayStatusChange is the alarm name), set Triggering Policy to Immediate Triggering, set Alarm Mode to Direct Alarm Reporting, set Action Rule to the action rule created in 4, and click Create Now in the lower right corner.

    Figure 9 Creating an alarm rule - AOM

Verifying Configurations

Expected result:

  1. After the device is offline for 5 minutes:
    • In the navigation pane, choose O&M > Device Alarms. Click Application Operations Management (AOM) to go to the AOM console. A major alarm is generated, indicating that the gateway status is changed.
      Figure 10 Current alarms - Going to AOM
    • If the alarm rule and email notification action are configured in AOM, the target email address will receive an email notifying that the gateway is offline.
    • If the alarm rule and SMS notification action are configured in AOM, the target number will receive an SMS notifying that the gateway is offline.
  2. After the device is back online for 1 minute:
    • The major alarm is cleared. You can view the alarm in the historical alarm list.
    • If the alarm rule and email notification action are configured in AOM, the target email address will receive an email notifying that the gateway goes online.
    • If the alarm rule and SMS notification action are configured in AOM, the target number will receive an SMS notifying that the gateway goes online.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback