Nagios/Configuration

From Segfault
Jump to: navigation, search

Per default, Nagios3 in Debian includes all files in /etc/nagios3/conf.d, i.e.:

  • contacts.cfg, generic-host.cfg, generic-service.cfg, timeperiods.cfg can be left alone for now
  • extinfo.cfg can be used later to add some information to certain hosts or hostgroups

Let's have a look instead at the most important files, to get things going:

hosts.cfg

define host {
       host_name       foo.example.com
       alias           foo
       address         10.0.0.2
       use             generic-host
       }

hostgroups.cfg

define hostgroup {
       hostgroup_name  http-servers
       alias           HTTP servers
       members         foo.example.com,bar.example.com
       }

services.cfg

define service {
       hostgroup_name          http-servers
       service_description     HTTP
       check_command           check_http
       use                     generic-service
       notification_interval   0
       }