- 介绍
- /api/n9e 接口
- 告警规则
- 订阅规则
- 屏蔽规则
- 告警事件
- 通知规则
- 机器列表
- 团队管理
- 业务组管理
- 用户管理
- 权限管理
- 采集配置
- 网络设备
- 告警管理
- 指标视图
- 告警自愈
- 采集配置
- 网络设备
- pingmesh
- pingmesh-idc网络规则注册
- pingmesh-idc网络规则修改
- pingmesh-idc网络规则查询
- pingmesh-idc网络规则删除
- pingmesh-idc间ping规则配置注册
- pingmesh-idc间ping规则配置查看
- pingmesh-idc间ping规则配置修改
- pingmesh-idc间ping规则配置删除
- pingmesh-ping动作开关设置
- pingmesh-ping动作开关查询
- pingmesh-idc之间拓扑图
- pingmesh-idc内netident拓扑
- pingmesh-netident内server之间拓扑
- pingmesh-查询指标历史数据
- pingmesh-idc网络规则注册(From CMDB)
- pingmesh-报警规则导出
- 数据查询
- 仪表盘
- 模板中心
- 拨测任务API
- 集成仪表盘
- 审计管理
- 数据源
- 全局屏蔽
- 仪表盘标注
- 通知媒介
- 消息模板
- auth认证
- metricsDesc
- 通知配置-待下线
- 快捷视图(指标)
- 变量设置
- 单点登陆
- 用户信息--待删除(与用户管理重复)
- /v1/n9e 接口
更新内置模板
PUT
https://api.flashcat.cloud/api/n9e/builtin-payloads
最后修改时间:2024-09-18 03:44:24
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
id
integer
必需
type
string
类型,alert|dashbaord|collect|metric
component
string
组件 Linux|MySQL
cate
string
分类,categraf,telegraf
name
string
名称
content
string
模板内容
created_at
integer
必需
created_by
string
必需
updated_at
integer
必需
updated_by
string
必需
示例
{
"id": 1,
"type": "alert",
"component": "Ceph",
"cate": "ceph_by_categraf.json",
"name": "CephErrorState",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"CephErrorState\",\"note\":\"Ceph is in Error state longer than 5m, please check status of pools and OSDs\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":1,\"severities\":[1],\"disabled\":1,\"prom_for_duration\":300,\"prom_ql\":\"ceph_health_status \> 1\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"ceph_health_status \> 1\",\"severity\":1}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872185,
"created_by": "system",
"updated_at": 1713872185,
"updated_by": ""
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.flashcat.cloud/api/n9e/builtin-payloads' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"type": "alert",
"component": "Ceph",
"cate": "ceph_by_categraf.json",
"name": "CephErrorState",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"CephErrorState\",\"note\":\"Ceph is in Error state longer than 5m, please check status of pools and OSDs\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":1,\"severities\":[1],\"disabled\":1,\"prom_for_duration\":300,\"prom_ql\":\"ceph_health_status \> 1\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"ceph_health_status \> 1\",\"severity\":1}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872185,
"created_by": "system",
"updated_at": 1713872185,
"updated_by": ""
}'
返回响应
🟢200成功
application/json
Body
dat
array [object {10}]
必需
id
integer
必需
type
string
必需
component
string
必需
cate
string
必需
name
string
必需
content
string
必需
created_at
integer
必需
created_by
string
必需
updated_at
integer
必需
updated_by
string
必需
err
string
必需
示例
{
"dat": [
{
"id": 185,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "Hard disk - expected to be written full in 4 hours - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"Hard disk - expected to be written full in 4 hours - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":1,\"severities\":[1],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"predict_linear(disk_free[1h], 4*3600) \< 0\",\"severity\":1}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 186,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "Hard disk - IO is a bit busy - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"Hard disk - IO is a bit busy - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":2,\"severities\":[2],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"rate(diskio_io_time[1m])/10 \> 99\",\"severity\":2}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 187,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "Lost connection with monitoring target - categraf",
"content": "{\"id\":0,\"group_id\":0,\"cate\":\"host\",\"datasource_ids\":null,\"cluster\":\"\",\"name\":\"Lost connection with monitoring target - categraf\",\"note\":\"\",\"prod\":\"host\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":0,\"severities\":[2],\"disabled\":1,\"prom_for_duration\":0,\"prom_ql\":\"\",\"rule_config\":{\"inhibit\":false,\"queries\":[{\"key\":\"all_hosts\",\"op\":\"==\",\"values\":[]}],\"triggers\":[{\"duration\":60,\"severity\":2,\"type\":\"target_miss\"}]},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":{},\"extra_config\":{\"escalation\":{},\"notify_aggregation\":{}},\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 188,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "Machine load - high memory, please pay attention - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"Machine load - high memory, please pay attention - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":0,\"severities\":[3,2,1],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"inhibit\":true,\"queries\":[{\"prom_ql\":\"mem_available_percent \< 25\",\"severity\":3},{\"prom_ql\":\"mem_available_percent \< 15\",\"severity\":2},{\"prom_ql\":\"mem_available_percent \< 5\",\"severity\":1}]},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":{},\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 189,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "number of TME_WAIT exceeds 20,000 - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"number of TME_WAIT exceeds 20,000 - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":2,\"severities\":[2],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"netstat_tcp_time_wait \> 20000\",\"severity\":2}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 190,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "packet loss in the inbound direction - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"packet loss in the inbound direction - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":3,\"severities\":[3],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"increase(net_drop_in[1m]) \> 0\",\"severity\":3}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 191,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "packet loss in the outbound direction - categraf",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"packet loss in the outbound direction - categraf\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":3,\"severities\":[3],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"algo_params\":null,\"inhibit\":false,\"prom_ql\":\"\",\"queries\":[{\"prom_ql\":\"increase(net_drop_out[1m]) \> 0\",\"severity\":3}],\"severity\":0},\"prom_eval_interval\":15,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"],\"enable_days_of_weeks\":[[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"0\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[\"email\",\"dingtalk\",\"wecom\"],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":null,\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 192,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "大于200G的盘,空间不足了",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"大于200G的盘,空间不足了\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":0,\"severities\":[3,2,1],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"inhibit\":true,\"queries\":[{\"prom_ql\":\"disk_free/1024/1024/1024 \< 20 and disk_total/1024/1024/1024 \>= 200\",\"severity\":3},{\"prom_ql\":\"disk_free/1024/1024/1024 \< 10 and disk_total/1024/1024/1024 \>= 200\",\"severity\":2},{\"prom_ql\":\"disk_free/1024/1024/1024 \< 2 and disk_total/1024/1024/1024 \>= 200\",\"severity\":1}]},\"prom_eval_interval\":30,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"],\"enable_days_of_weeks\":[[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":{},\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
},
{
"id": 193,
"type": "alert",
"component": "Linux",
"cate": "linux_by_categraf.json",
"name": "小于200G的盘,空间不足了",
"content":"{\"id\":0,\"group_id\":0,\"cate\":\"prometheus\",\"datasource_ids\":[0],\"cluster\":\"\",\"name\":\"小于200G的盘,空间不足了\",\"note\":\"\",\"prod\":\"metric\",\"algorithm\":\"\",\"algo_params\":null,\"delay\":0,\"severity\":0,\"severities\":[2,1,3],\"disabled\":1,\"prom_for_duration\":60,\"prom_ql\":\"\",\"rule_config\":{\"inhibit\":true,\"queries\":[{\"prom_ql\":\"disk_used_percent \> 90 and disk_total/1024/1024/1024 \< 200\",\"severity\":3},{\"prom_ql\":\"disk_used_percent \> 95 and disk_total/1024/1024/1024 \< 200\",\"severity\":2},{\"prom_ql\":\"disk_used_percent \> 99 and disk_total/1024/1024/1024 \< 200\",\"severity\":1}]},\"prom_eval_interval\":30,\"enable_stime\":\"00:00\",\"enable_stimes\":[\"00:00\"],\"enable_etime\":\"23:59\",\"enable_etimes\":[\"23:59\"],\"enable_days_of_week\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"],\"enable_days_of_weeks\":[[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]],\"enable_in_bg\":0,\"notify_recovered\":1,\"notify_channels\":[],\"notify_groups_obj\":null,\"notify_groups\":null,\"notify_repeat_step\":60,\"notify_max_number\":0,\"recover_duration\":0,\"callbacks\":[],\"runbook_url\":\"\",\"append_tags\":[],\"annotations\":{},\"extra_config\":null,\"create_at\":0,\"create_by\":\"\",\"update_at\":0,\"update_by\":\"\"}",
"created_at": 1713872186,
"created_by": "system",
"updated_at": 1713872186,
"updated_by": ""
}
],
"err": ""
}

添加官方技术人员微信
在这里,获得使用上的任何帮助,快速上手企业告警一站式响应平台FlashDuty


修改于 2024-09-18 03:44:24