Skip to content

Commit

Permalink
feat: 自定义指标上报配置文件订阅默认开启巡检 #1010158081120578409
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguo367 committed Nov 7, 2024
1 parent fd44dba commit d92e10a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def create_or_update_config(cls, subscription_params, bk_biz_id, plugin_name="bk
try:
logger.info("subscription task already exists.")
sub_config_obj = qs.first()
# 更新订阅巡检开启
api.node_man.switch_subscription(subscription_id=sub_config_obj.subscription_id, action="enable")
subscription_params["subscription_id"] = sub_config_obj.subscription_id
subscription_params["run_immediately"] = True

Expand Down Expand Up @@ -429,7 +431,8 @@ def create_or_update_config(cls, subscription_params, bk_biz_id, plugin_name="bk
subscription_id=subscription_id,
bk_data_id=bk_data_id,
)

# 创建的订阅默认开启巡检
api.node_man.switch_subscription(subscription_id=subscription_id, action="enable")
result = api.node_man.run_subscription(
subscription_id=subscription_id, actions={plugin_name: "INSTALL"}
)
Expand Down

0 comments on commit d92e10a

Please sign in to comment.