Hi,
     we are trying to implement splitting up our monitoring to go to
different groups when we add servers via the api. I have setup 3 distinct
user groups and would like to assign notifications to one based on when I
make the api call, is this possible?

curl -k -s -u apiuser:mypass -H 'Accept: application/json' -X PUT '
https://172.16.13.203:5665/v1/objects/hosts/devopsnotificationtest01.p.dfw.rtr.net'
-d '{ "templates": [ "devops-host" ], "attrs": { "address":
"192.168.1.122", "check_command": "hostalive", "vars.rtrgroup" : "devops",
"vars.contactgroup" : "devops", "vars.notification.mail.groups" :
"devopsadmins" } }'

but I am getting the following error
{"results":[{"code":500.0,"errors":["Error: Error while evaluating
expression: Cannot convert value of type 'String' to an object.\nLocation:
in /etc/icinga2/conf.d/notifications.conf:
23:3-23:50\n/etc/icinga2/conf.d/notifications.conf(21):   import
\"mail-service-notification\"\n/etc/icinga2/conf.d/notifications.conf(22):
\n/etc/icinga2/conf.d/notifications.conf(23):   user_groups =
host.vars.notification.mail.groups\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/notifications.conf(24):
users =
host.vars.notification.mail.users\n/etc/icinga2/conf.d/notifications.conf(25):
\n","Error: Error while evaluating expression: Cannot convert value of type
'String' to an object.\nLocation: in
/etc/icinga2/conf.d/notifications.conf:
23:3-23:50\n/etc/icinga2/conf.d/notifications.conf(21):   import
\"mail-service-notification\"\n/etc/icinga2/conf.d/notifications.conf(22):
\n/etc/icinga2/conf.d/notifications.conf(23):   user_groups =
host.vars.notification.mail.groups\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/notifications.conf(24):
users =
host.vars.notification.mail.users\n/etc/icinga2/conf.d/notifications.conf(25):
\n"],"status":"Object could not be created."}]}j



my notifications.conf:

-- 

This email message, including any attachment(s), is intended only for the 
named recipient(s) and may contain confidential, proprietary or legally 
privileged information. Unauthorized individuals or entities are not 
permitted access to this information. Any dissemination, distribution, 
disclosure, or copying of this information is unauthorized and strictly 
prohibited. If you have received this message in error, please advise the 
sender by reply email, and delete this message and any attachments.
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to