2

Using Ubuntu 12.10 server. icinga with idoutils and icinga-web. Have ability to see hosts if I add them in the localhost_icinga.cfg

however from my understanding you can create a host.cfg based on systems. example: windows.cfg to monitor all windows machines via NSclient++ (similar to Nagios)

Everytime I create a new host.cfg icinga either gives me a duplicate error or it does not like the define host line. Example: (localhost_icinga.cfg working)

define host{ use generic-host host_name mikedoppdesk alias mikedoppdesk address 192.168.0.56 } However if I create a windows.cfg Example: define host{ use windows host_name mikedoppdesk alias mikedoppdesk address 192.168.0.56 }

and use: /usr/sbin/icinga -v /etc/icinga/icinga.cfg

output error line 1 windows.cfg

I have been chasing the icinga web docs trying to get a straight answer. I know I am missing something critical but cannot find rhyme or reason. Please educate or prove me dumb. Thanks in advance

mikedopp
  • 229
  • 2
  • 7
  • 16

1 Answers1

2

In your main configuration file which is usually /usr/local/icinga/etc/icinga.cfg you should add a line with no spaces at the beginning:

cfg_file=/usr/local/icinga/etc/conf.d/hosts.cfg

(you can see it here as well: http://docs.icinga.org/latest/en/configobject.html).

It means that you define objects (here hosts) in the file specified above. In that file you should define the monitored host itself

Example:

 define host{
        host_name                       bogus-router
        alias                           Bogus Router #1
        address                         192.168.1.254
        parents                         server-backbone
        check_command                   check-host-alive
        check_interval                  5
        retry_interval                  1
        max_check_attempts              5
        check_period                    24x7
        process_perf_data               0
        retain_nonstatus_information    0
        contact_groups                  router-admins
        notification_interval           30
        notification_period             24x7
        notification_options            d,u,r
        }

All possible options and their definitions you can be found here (http://docs.icinga.org/latest/en/objectdefinitions.html#objectdefinitions-host).

Meriadoc Brandybuck
  • 1,300
  • 9
  • 11
  • getting this error while adding hosts in icinga : information/cli: Requesting a signed certificate from the master. critical/cli: Could not fetch valid response. Please check the master log (notice or debug). critical/cli: Failed to request certificate from Icinga 2 master. – Ashish Karpe Dec 15 '15 at 09:54