Servicesets apply rule works but service does not appear

(Sascha Bay) #1

I’d created some service sets with traps. This sets should be added with this rule

apply Service “ALARM_TRAP” {
import “Passive Service Template”
assign where host.vars.trap_pool == “traps_juniper_sslgw”
vars.enable_trap_notification = true
vars.passive_service_type = “TRAP”
import DirectorOverrideTemplate
}

object Host “SSLGW1-mydomain.tld” {
import “CCO1 Server mit Traps Vorlage (Ohne ILO)”
display_name = “SSLGW1-mydomain.tld (SSL Gateway 1)”
address = “***.***.***.***”
icon_image = “img/icons/serverOS/juniper.png”
icon_image_alt = “SSLGW1-mydomain.tld (SSL Gateway 1)”
groups = [ “cco-server-dmz” ]
vars.SERVER_ASSIGNMENTGROUP = “”
vars.SERVER_CONFIG_ITEM = “”
vars.SERVER_LOCATION = “”
vars.os = “Juniper OS”
vars.server_hardware = “Juniper”
vars.trap_pool = [ “traps_juniper_sslgw” ]
vars[“virtual-cluster-ip”] = “***.***.***.***”
}

In the Director the Service is assiged but if i apply this the Service does not appear.

I’m using a datalists because i have different vendor traps and i add this to the host.

datalist_2

I remeber that this apply has worked fine. But now i need to add the service sets manually to the host.

Does someone know this problem?

Regards
Sascha

(Kai) #2

I am somewhat familiar with service sets, but mainly from Director perspective (not config. files). When you add the setting “traps_juniper_sslgw” to variable “trap_pool” within the host (via Director) do you get a popup menu with all your data list entries, or do you enter entries as a comma-separated string? I am assuming you want several trap pools per host to be settable! (If this assumption is wrong I have a suggestion regarding your apply rule…)

BTW, if an apply rule does not find anything to apply to, there’s always a corresponding warning during deployments. (The deployment would be okay/green, but the warnings should be looked at nonetheless!)

(Sascha Bay) #3

Hi Kai,
thanks for your answer.
I’d found the problem. The apply rule should be “contains” and not “in”

apply Service “ALARM_TRAP” {
import “Passive Service Template”
assign where “traps_juniper_sslgw” in host.vars.trap_pool
vars.enable_trap_notification = true
vars.passive_service_type = “TRAP”
import DirectorOverrideTemplate
}

After this change the services appaers in the host where i’d add the trap pool