Disable active check via API

This forum was archived to /woltlab and is now in read-only mode.
  • Hey,


    I checked the API documentation, but I didn't found any "action" to disable active checks from host or service.


    Ok I can use schedule-downtime to block notification, and right now this is what I do. But I really need to disable checks 'cause my checks come with a 120s timeout.


    For the story, every month, I reboot ~2000 hosts. Let's say ~6000 services in timeout from my satellite zone. It will kill them no?^^


    How do you disable check for a host and its services? Without reload.


    Thanks for your help.


    Kevin

  • So obvious... Thanks you very much :)


    Code
    1. curl -k -s -u 'root:icinga' \
    2. -H 'Accept: application/json' \
    3. -X POST 'https://localhost:5665/v1/objects/hosts?filter=host.name==%22server1%22' \
    4. -d '{ "attrs": { "enable_active_checks": false } }' \
    5. | python -m json.tool


    Is it possible to do this for host and its services in only one call? I tried with "joins" but I got a "No objects found." error.


  • No, the object type is a required pre-filter. Each object has different attributes, and the caller must provide the type in the URL endpoint therefore.

  • Thanks you! By the way, it's really really nice to found help here. And I spend more and more time here to read thread from other people.