Well it seemed easier than i thought. I can simply do:

get_service("my_server", "service1").vars.my_var = "my_value"

This is fine for me, but I'm not sure about persistency of this. If the service is created dynamically by apply rule, is it possible to preserve this custom variable somehow?

cheers,
Vaclav

On 3/27/19 9:16 AM, Václav Mach wrote:
Hi,

is is possible to dynamically update some specific service vars for example using icinga2 console?

Let's say i have service1:

$ ICINGA2_API_USERNAME=user ICINGA2_API_PASSWORD=pass icinga2 console --connect 'https://localhost:5665/'

<1> => get_service("my_server", "service1").vars
{
     custom_variable1 = 1.000000
     custom_variable2 = "test"
     ...
}

Can i set some of the shown custom vars interactively in console? If this is possible I'm assuming it's also possible to script it. If it is possible, when do the custom variables take effect? Are they changed/set instantly?

cheers,
Vaclav

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users


--
Václav Mach
tel: +420 234 680 206
CESNET, z.s.p.o.
www.cesnet.cz

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to