[icinga-users] Defining multiple services or importing from a single conf file.

Garrett Pye gvpye54 at gmail.com
Tue Jan 31 16:30:12 CET 2017


Thank you.

> Files and file name don't matter. Files are read and contain object
definitions. It doesn't matter how the file is called and what's in there.

> Bear in mind the filenames host.conf, service.conf etc are immaterial -
Icinga
> simply reads all files ending in .conf and processes their contents.

These were key to me to know this. I have been working in a backwards way
with the .conf files and now the interaction is clear.

//Garrett


On Mon, Jan 30, 2017 at 1:48 PM, Antony Stone <
Antony.Stone at icinga.open.source.it> wrote:

> On Monday 30 January 2017 at 21:13:20, Garrett Pye wrote:
>
> > Little confused about the usage of multiple services in a host file.
> Below
> > is a sample from one host file where intent is the automate duplication
> for
> > 308 servers all with different host_names. To invoke each service does
> the
> > host.conf file have to have each service separate?
>
> Bear in mind the filenames host.conf, service.conf etc are immaterial -
> Icinga
> simply reads all files ending in .conf and processes their contents.
>
> > My confusion with working in Icinga2 is defining the services in the
> > services.conf file and importing/calling it in each host file as a single
> > line item. Seems to me the same information is duplicated between the
> > template and service.conf files and each host_name.conf file.
>
> Rather than "assign where host.name == " (which means you do have to have
> one
> assign statement for every host), consider using something like "assign
> where
> host.vars.systemX" and then in each *host* definition simply include
> "vars.systemX = true".
>
> That means you have one more line per host definition, and a single service
> definition, which then works for all hosts of that type.
>
> In place of "serviceX", use some word which means something suitable for
> whatever these things do - an example from my own network is "vars.PBX =
> true", which tells me this machine is running Asterisk, and needs the
> appropriate Asterisk checks to be applied to it.
>
>
> Hope that helps,
>
>
> Antony.
>
> --
> "When you talk about Linux versus Windows, you're talking about which
> operating system is the best value for money and fit for purpose. That's a
> very
> basic decision customers can make if they have the information available to
> them. Quite frankly if we lose to Linux because our customers say it's
> better
> value for money, tough luck for us."
>
>  - Steve Vamos, MD of Microsoft Australia
>
>                                                    Please reply to the
> list;
>                                                          please *don't* CC
> me.
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20170131/593c3d73/attachment.html>


More information about the icinga-users mailing list