O'Reilly logo

Nagios, 2nd Edition by Wolfgang Barth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.12 Configuration Aids for Those Too Lazy to Type

2.12.1 Defining services for several computers

You can simplify things a lot in the service definition by defining a service for several hosts, or even host groups, at the same time:

# -- /etc/nagios/mysite/services.cfg
define service{
   host_name         linux01,linux02,linux04,...
   service_description   PING
   ...
}

Specifying several hosts, separated by commas, ensures that Nagios defines multiple services in parallel. You can go one step further by specifying the * character instead of individual computer aliases. This will assign this service to all hosts.

A third possibility is an allocation in parallel via host groups:

# -- /etc/nagios/mysite/services.cfg
define service{
   hostgroup_name linux-servers,windows-servers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required