Alarm Reporting
This topic is used to report alarms to AOM.
Topic
$hw/alarm/{appname}/add
Parameter |
Type |
Description |
---|---|---|
appname |
String |
Application name, which is user-defined. |
Usage
Use an MQTT client to publish this topic.
Parameter Description
Parameter |
Type |
Description |
---|---|---|
alarmName |
String |
Alarm name. |
alarmId |
String |
Alarm ID, which must be unique. For details, see Generating an alarmId. |
detailedInformation |
String |
Alarm description. |
url |
String |
URL for root cause analysis. If the URL is not available, leave this field blank. |
source |
String |
Alarm source. The value is a character string consisting of uppercase and lowercase letters. |
cleared |
Boolean |
Whether the alarm is cleared.
|
policyID |
String |
ID of an alarm rule. For a threshold rule, set this parameter to ruleId. If no threshold rule is configured, leave this field blank. |
objectInstance |
String |
Location information. If this field is not specified, the value of this parameter is the same as that of alarmId by default. |
perceivedSeverity |
Integer |
Alarm severity.
|
resourceId |
Object |
Alarm information. For details, see Table 1. |
neType |
String |
Type of the resource for which the alarm is generated.
|
eventType |
Integer |
Alarm type.
|
probableCause |
String |
Possible causes. |
proposedRepairActions |
String |
Handling suggestions. |
Parameter |
Type |
Description |
---|---|---|
namespace |
String |
Resource type. The options are as follows:
|
dimension |
Object |
Dimension information, which is associated with the node application information reported by the monitoring module. For details, see Table 2. Currently, alarms are about nodes and applications. Therefore, you only need to pay attention to these two dimensions. The application dimension covers service, instance, container, and process information. You can select one or more types of information to be reported.
|
Parameter |
Type |
Description |
---|---|---|
clusterId |
String |
Project ID. For details on how to obtain a project ID, see Obtaining a Project ID. |
nameSpace |
String |
The default value is default. |
nodeIP |
String |
Node IP address. |
serviceID |
String |
Service ID.
The dimension settings must be consistent with those reported by the monitoring module. Otherwise, the corresponding resources cannot be associated. |
podID |
String |
Instance ID. |
podName |
String |
Instance name. |
containerID |
String |
Container ID. |
containerName |
String |
Container name. |
processID |
String |
Process ID. |
processName |
String |
Process name. |
Application |
String |
Application name. |
Generating an alarmId
You do not need to use this method to generate the alarmId. However, you need to ensure that the alarmId is unique.
Generate the MD5 value of {projectId}_{Service name for which the alarm is generated}_{Dimension information}_{Metric name}_{Alarm type}_{Rule information}.
Where:
- projectId: Project ID. For details on how to obtain a project ID, see Obtaining a Project ID.
- Dimension information:
- Node information: {clusterId}_{namespace}_{ip}
- Container information: {clusterId}_{namespace}_{appName}_{podName}_{containerId}
- Application information: {clusterId}_{namespace}_{appName}
- Alarm type:
- 21: dynamic threshold alarm
- 22: batch threshold alarm
- 23: threshold alarm
- 24: system alarm
- 25: probe added or deleted
- 26: Agent installation alarm
- Rule information: Set this field to a rule name for threshold alarms and to NA for alarms generated by the service itself. For dynamic threshold alarms, set this field to policyId.
Example
- Node alarm
{ "alarmName": "test", "alarmId": "73ccbccce05de74f9d3dda42f6ecfe20", "detailedInformation": "test", "url": "", "source": "IEF", "cleared": false, "policyID": "", "perceivedSeverity": 4, "resourceId": { "namespace": "PAAS.NODE", "dimension": { "clusterId": "e277befa37a64ed1aa25b522e686bc28", "nameSpace": "default", "nodeIP": "192.168.0.164" } }, "neType": "Host", "eventType": 23 }
- Application alarm:
{ "alarmName": "Application restart", "alarmId": "b09076ff565c59d4da0db0c9223781", "detailedInformation": "Application restart test", "url": "", "source": "IEF", "cleared": false, "policyID": "", "perceivedSeverity": 3, "resourceId": { "namespace": "PAAS.CONTAINER", "dimension": { "containerName": "container-e991acd3-864c-4038-8a90-e042eebab496", "containerID": "70b385315c8ac507b3de7dfe1258932cea0b53a850b7d030ce7ed0a55c47877c", "podID": "0e9ce4fd-b732-11e9-8a30-fa163e9b3546", "podName": "hxkapp1-7898f5bd4b-2lj8z" } }, "neType": "Application", "eventType": 23 }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot