更新内置模板
PUT
https://api.flashcat.cloud/api/n9e/builtin-payloads
最后修改时间:2024-09-18 03:44:24
请求示例请求示例
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": ""
}'
响应示例响应示例
{
"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": ""
}
请求参数
Body 参数application/json