multiple directives that add, rather than replace

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
lyle
Posts: 158
Joined: Sun Nov 21, 2010 3:05 am

multiple directives that add, rather than replace

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: multiple directives that add, rather than replace

Post 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.
Locked