Page 1 of 1

multiple directives that add, rather than replace

Posted: Wed Feb 16, 2011 12:02 pm
by lyle
I checked the docs and did some forum search, but couldn't find the answer to this one.

Is there a way to make multiple directives in an object definition add, rather than only the last one being recognized?

An example would be: In a Service definition, I have a lot of hosts I'd like to include under a "host_name" definition. There must be some line length limit on definitions, but it would also be easier to organize if I could have multiple definitions like:
host_name host1, host2, host3
host_name hostA, hostB

Turns out that only the last directive (hostA and hostB) get included in the Service definition.

Perhaps something like shell, where you can have multiple statements like: PATH=$PATH:/usr/local/bin

Thanks....Lyle

Re: multiple directives that add, rather than replace

Posted: Wed Feb 16, 2011 1:50 pm
by mguthrie
I think you can do that actually, but you need to take out the spaces in-between. Otherwise, apply the service to a hostgroup or servicegroup.