<TCP创建-请求参数>:
参数名称 | 是否必须 | 类型 | 默认值 | 描述 |
task_type | 是 | string | 任务类型 | |
infos | 是 | object[] | 任务批量信息 | |
infos.task_name | 是 | string | 任务名称 | |
infos.host | 是 | string | 任务url | |
infos.tcp_port | 是 | string | 端口 | |
partition_flag | 是 | string | 任务性质,可选值:
| |
network_protocol | 是 | string | 任务使用的网络协议。 可选值:
内网任务只能选择4。 | |
group_id | 是 | int | 监测点分组id。内网使用采集器时id值为0 | |
plugin_task_uselist_id | 否 | number[] | 采集器id,当是内网任务且分组id为0时,该值为必填参数 | |
frequency | 是 | int | 监测频率,单位分钟,可选值:1,2,5,10,15,20,30,60 | |
reminds | 是 | int | 连续告警频率(监控频率的倍数),可选值:0,1,2,3,5,10,20,30 | |
retry | 是 | int | 重试次数,可选值:1,2,3。只有外网任务支持设置,内网次数默认为1。 | |
history | 是 | int | 是否记录快照,可选值:
| |
all_snapshot | 是 | int | 是否记录全量快照,可选值:
| |
task_scope | 是 | object | 公开范围 | |
task_scope.type | 是 | int | 类型,可选值:
| |
task_scope.organization | 否 | number[] | 指定分组id,type=2时使用 | |
task_scope.user | 否 | number[] | 指定用户id,type=4时使用 | |
threshold_setting | 否 | object[] | 自定义告警线,告警线各指标详细描述信息可参考<创建任务的自定义告警规则> | |
threshold_setting.metric | 否 | int | 告警指标 | |
threshold_setting.cond | 否 | string | 条件 | |
threshold_setting.value | 否 | int | 阈值 | |
threshold_setting.unit | 否 | string | 单位 | |
threshold_setting.advanced_strategy_type | 否 | int | 高级策略类型 | |
threshold_setting.advanced_status | 否 | int | 告警策略开关 | |
threshold_setting.status | 否 | int | 告警线开关 | |
threshold_setting.retry | 否 | string | 高级策略重试次数 | |
threshold_setting.monitor_set | 否 | string | 触发的监测点个数类型
| |
threshold_setting.recover_continuous_times | 否 | string | 高级策略判断恢复的连续次数 | |
threshold_setting.trigger_accumulate_times | 否 | string | 高级策略判断触发的连续次数 | |
threshold_setting.monitor_count | 否 | int | 设置触发的任意监测点个数 | |
threshold_setting.type | 否 | string | 告警线类型,要与任务类型task_type一致。 | |
remind_setting | 否 | object | 告警通知设置 | |
remind_setting.email | 否 | number[] | 邮件,item 类型: number | |
remind_setting.push | 否 | string[] | app推送,item 类型: string | |
remind_setting.remind | 否 | number[] | 连续提醒,item 类型: number | |
remind_setting.sms | 否 | string[] | 短信,item 类型: string | |
remind_setting.voice | 否 | string[] | 语音,item 类型: string | |
remind_setting.wechat | 否 | string[] | 企业微信,item 类型: string | |
remind_setting.webhook | 否 | number[] | webhook机器人,item 类型: number |
<HTTP创建-请求示例>:
curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa" https://v6-api.jiankongbao.com/siteapi/tasks/batch/info -d '{"task_type":"tcp","infos":[{"task_name":"batch-http-intranet-test-2222","host":"www.163.com","tcp_port":443}],"partition_flag":"Intranet","network_protocol":"4","group_id":0,"plugin_task_uselist_id":[100000176],"frequency":15,"reminds":3,"retry":1,"history":1,"all_snapshot":1,"task_scope":{"type":4,"user":[2670]},"threshold_setting":[{"metric":4,"cond":"12","value":1000,"unit":"","advanced_strategy_type":0,"advanced_status":2,"status":0,"retry":"1","monitor_set":"1","recover_continuous_times":"1","trigger_accumulate_times":"1","monitor_count":3,"type":"tcp"}],"remind_setting":{"email":[2670,25228255],"push":[],"remind":[2670,25228255],"sms":[],"voice":[],"wechat":[],"webhook":[]}}'