Confused about Service.cfg inheritance


#1

The way that I am reading it is that you have to specify every service for each individual server, as you can’t have a list of hosts or a host group (or am i wrong on this?).

I’ve gotten my hosts and contacts grouped and templated like i want, but the services file doesn’t make much sense in the way i’m interpreting it.

there has to be a way to associate servers with running services in the hosts file, or grouping servers running the same service in the service definition in services.cfg.


#2

Below are the two ways to do it. I think you can only have one or the other in a single define statement.
define service {
use generic-service
service_description ping
check_command check_ping!100.0,20%!500.0,60%
hostgroup_name Servers
host_name Server

contact_groups admins
}

Or you can


#3

i’ve tried using just hostgroups and it works.

i still don’t like the design of the service system. you should be able to define a service and then have mutations of it using templates. then inside the hosts definition you should have a comma delimited list after a variable like services_used.

i guess one way you’re listing servers over and over inside the services definition (or us hostgroups), then there is the way i wish it was done; list services over and over inside host definitions.

however in large networks you will probably have more hosts than services, and the services would be easier to remember.