Não foi possível encontrar nenhum grupo de host correspondente 'allhosts'

2

Acabei de começar a configurar o Nagios do zero e sou novo nisso.

Recebi este erro depois de adicionar objects/printer.cfg

Error: Could not find any hostgroup matching 'allhosts'
(config file '/etc/nagios3/objects/printer.cfg', starting on line 1)    
Error processing object config files!

E este é o conteúdo do printer.cfg

define host{
        use             generic-host            ; Inherit default values from a template    
        host_name       Printer_klen    ; The name we're giving to this printer    
        alias           Printer_klen    ; A longer name associated with the printer    
        address         10.1.0.45       ; IP address of the printer    
        hostgroups      allhosts        ; Host groups this printer is associated with    
        }

define service{    
        use                     generic-service         ; Inherit values from a template    
        host_name               Printer_klen            ; The name of the host the service is associated with    
        service_description     Printer Status          ; The service description    
        check_command           check_Printer_klen!-C public    ; The command used to monitor the service    
        normal_check_interval   10      ; Check the service every 10 minutes under normal conditions    
        retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined    
        }

define service{    
        use                     generic-service    
        host_name               Printer_klen    
        service_description     PING    
        check_command           check_ping!3000.0,80%!5000.0,100%    
        normal_check_interval   10    
        retry_check_interval    1    
        }
    
por Rene Brakus 09.11.2013 / 11:46

1 resposta

2

O problema

O erro é realmente bastante auto-explicativo.

Error: Could not find any hostgroup matching 'allhosts'

Você tem essa linha no bloco define host{...} :

hostgroups      allhosts        ; Host groups this printer is associated with

Solução

Você precisa criar um hostgroup chamado allhosts .

No arquivo /etc/nagios/hostgroups.cfg , provavelmente, você precisará adicionar uma sub-rotina que defina o hostgroup, allhosts.

Exemplo

define hostgroup{
    hostgroup_name          allhosts
    alias               All Hosts
}
    
por 09.11.2013 / 23:40

Tags