【发布时间】:2015-11-27 13:15:34
【问题描述】:
我正在寻找一种使用 groovy 脚本在 icinga2 中安排停机时间的方法。
我已经尝试过创建一个小型的 groovy 脚本。尝试使用 icinga 文档中的示例:
curl -u root:icinga -k -s 'https://localhost:5665/v1/actions/schedule-downtime?type=Host&filter=host.vars.os==%22Linux%22' -d '{ "作者" :“michi”,“comment”:“维护”,“start_time”:1441136260,“end_time”:1441137260,“duration”:1000 }' -X POST | python -m json.tool但将其改编为我的脚本不起作用。我注意到每个属性名称周围的 " 非常重要。
【问题讨论】:
标签: json api groovy downtime icinga