Hi there!
I’m trying to figure out, how the CLI works for adding monitored services to a host.
I could not find the right command.
We are very dynamic in creating new servers and also deleting them, so we want icinga more dynamic.
Based on a (sharepoint) list, hosts are created in icinga through
do not use icinga api directly, these objects are not managable by director.
icingacli director <type> create [<name>] [options]
OPTIONS
--<key> <value> Provide all properties as single command line
options
--json Otherwise provide all options as a JSON string
EXAMPLES
icingacli director host create localhost \
--imports generic-host \
--address 127.0.0.1 \
--vars.location 'My datacenter'
icingacli director host create localhost \
--json '{ "address": "127.0.0.1" }'
icingacli director service create specialservice --host hostname
Service 'specialservice' has been created
Sorry to correct you but that is not true.
You may use a customized version of this helper script to create hosts and services in the director.
It took a lot of time to trial and error this, but you may use this command for further inspiration.
Thank you for your reply, here is a follow up for you.
icinga api → port 5665 → the way icinga nodes talk to each other
director api → available via icingaweb → the same result as using icingacli director
if you use this helper script your are using icingaweb2/director api not icinga api