Nagios não starta

1. Nagios não starta

mateus schott
mschott

(usa Debian)

Enviado em 12/07/2011 - 16:06h

Dai pessoal! Estou querendo testar a ferramenta Nagios no meu SUSE Linux Enterprise Server 10, instalei ele da seguinte forma:
yast2 -i nagios
yast2 -i nagios-plugins
yast2 -i nagios-www

se faço o comando rpm -qa | grep nagios ele me retorna
nagios-1.3-16.2
nagios-www-1.3-16.2
nagios-plugins-1.4.2-16.2

mas quando faço o service nagios start ele me retorna o seguinte erro:
Starting nagios - Error in configuration files
- please read /var/log/nagios/config.err failed





  


2. Re: Nagios não starta

mateus schott
mschott

(usa Debian)

Enviado em 12/07/2011 - 16:08h

verificando o arquivo /var/log/nagios/config.err aparece o seguinte:

intranet:/etc/init.d # vim /var/log/nagios/config.err
Last Modified: 11-17-2005
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Checked 38 services.
Checking hosts...
Checked 15 hosts.
Checking host groups...
Checked 6 host groups.
Checking contacts...
Checked 2 contacts.
Checking contact groups...
Checked 6 contact groups.
Checking service escalations...
Checked 2 service escalations.
Checking host group escalations...
Checked 2 host group escalations.
Checking service dependencies...
Error: Dependent service specified in service dependency for service 'Website #2' on host 'nt1' is not defined anywhere!
Error: Service specified in service dependency for service 'Website #2' on host 'nt1' is not defined anywhere!
Error: Service dependency definition for service 'Website #2' on host 'nt1' is circular (it depends on itself)!
Error: Dependent service specified in service dependency for service 'Website #2' on host 'nt1' is not defined anywhere!
Error: Service specified in service dependency for service 'Website #2' on host 'nt1' is not defined anywhere!
Error: Service dependency definition for service 'Website #2' on host 'nt1' is circular (it depends on itself)!
Error: Dependent service specified in service dependency for service 'Website #1' on host 'nt1' is not defined anywhere!
Error: Service specified in service dependency for service 'Website #1' on host 'nt1' is not defined anywhere!
Error: Service dependency definition for service 'Website #1' on host 'nt1' is circular (it depends on itself)!
Error: Dependent service specified in service dependency for service 'Website #1' on host 'nt1' is not defined anywhere!
Error: Service specified in service dependency for service 'Website #1' on host 'nt1' is not defined anywhere!
Error: Service dependency definition for service 'Website #1' on host 'nt1' is circular (it depends on itself)!
Checked 4 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 22 commands.
Checking time periods...
Checked 4 time periods.
Checking for circular paths between hosts...
Checking for circular service execution dependencies...
Checking global event handlers...
Checking obsessive compulsive service processor command...
Checking misc settings...

Total Warnings: 0
Total Errors: 12

"/var/log/nagios/config.err" 64L, 2975C

se alguém puder me ajudar fico grato pois jah não sei mais o que fazer.
Desde já agradeço.


3. Re: Nagios não starta

Ricardo Lino Olonca
ricardoolonca

(usa Debian)

Enviado em 12/07/2011 - 16:27h

Onde você definiu o serviço 'Website #1' ?


4. Re: Nagios não starta

Jairo de Menezes Rodrigues
jairovisks

(usa Debian)

Enviado em 13/07/2011 - 15:43h

Cara posta seu arquivo de hosts.cfg e services.cfg... pela mensagem você está configurando dependências para serviços inexistentes.

abs


5. Re: Nagios não starta

mateus schott
mschott

(usa Debian)

Enviado em 13/07/2011 - 15:59h

hosts.conf


# Generic host definition template
define host{
name generic-host ; The name of this host template - referenced in other host definitions, used for template recursion/resolution
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts

register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

# 'novell1' host definition
define host{
use generic-host ; Name of host template to use

host_name novell1
alias Novell Server #1
address 192.168.1.2
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}


# 'novell2' host definition
define host{
use generic-host ; Name of host template to use

host_name novell2
alias Novell Server #2
address 192.168.1.3
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}


# 'nt1' host definition
define host{
use generic-host ; Name of host template to use

host_name nt1
alias NT Server #1
address 192.168.1.4
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}


# 'nt2' host definition
define host{
use generic-host ; Name of host template to use

host_name nt2
alias NT Server #2
address 192.168.1.5
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}


# 'linux1' host definition
define host{
use generic-host ; Name of host template to use

host_name linux1
alias Linux Server #1
address 192.169.1.6
check_command check-host-alive
max_check_attempts 10
notification_interval 480
notification_period 24x7
notification_options d,u,r
}


# 'linux2' host definition
define host{
use generic-host ; Name of host template to use

host_name linux2
alias Linux Server #2
address 192.168.0.2
parents router1
check_command check-host-alive

max_check_attempts 10
notification_interval 480
notification_period 24x7
notification_options d,u,r
}


# 'switch1' host definition
define host{
use generic-host ; Name of host template to use

host_name switch1
alias Switch #1
address 192.168.1.230
check_command check-host-alive
max_check_attempts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


# 'switch2' host definition
define host{
use generic-host ; Name of host template to use

host_name switch2
alias Switch #2
address 192.168.1.231
check_command check-host-alive
max_check_attempts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


# 'switch3' host definition
define host{
use generic-host ; Name of host template to use

host_name switch3
alias Switch #3
address 192.168.1.232
check_command check-host-alive
max_check_attempts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r

}


# 'switch4' host definition
define host{
use generic-host ; Name of host template to use

host_name switch4
alias Switch #4
address 192.168.1.233
check_command check-host-alive
max_check_attempts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


# 'switch5' host definition
define host{
use generic-host ; Name of host template to use

host_name switch5
alias Switch #5
address 192.168.1.234
check_command check-host-alive
max_check_attempts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


# 'router1' host definition
define host{
use generic-host ; Name of host template to use

host_name router1
alias Router #1
address 192.168.1.254
check_command check-host-alive
max_check_attempts 20
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


# 'printer1' host definition
define host{
use generic-host ; Name of host template to use

host_name printer1
alias Printer #1
address 192.168.1.100
check_command check-host-alive
max_check_attempts 10
notification_interval 480
notification_period workhours
}


# 'printer2' host definition
define host{
use generic-host ; Name of host template to use

host_name printer2
alias Printer #2
address 192.168.1.101
check_command check-host-alive
max_check_attempts 10
notification_interval 480
notification_period workhours
}


# 'printer3' host definition
define host{
use generic-host ; Name of host template to use

host_name printer3
alias Printer #3
address 192.168.1.102
check_command check-host-alive
max_check_attempts 10
notification_interval 480
notification_period workhours
}



6. Re: Nagios não starta

mateus schott
mschott

(usa Debian)

Enviado em 13/07/2011 - 16:05h

services.conf


# Generic service definition template
define service{
name generic-service ; The 'name' of this service template, referenced in other service definitions
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts

register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell1
service_description SMTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell1
service_description FTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7

notification_options w,u,c,r
check_command check_ftp
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell1
service_description POP3
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_pop
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell2
service_description SMTP
is_volatile 0
check_period 24x7

max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell2
service_description FTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ftp
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell2
service_description POP3
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_pop
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name novell2
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups novell-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt1
service_description FTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ftp

}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt1
service_description HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt2
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt2
service_description FTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1

contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ftp
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name nt2
service_description HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 2
retry_check_interval 1
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description Current Users
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 2
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
check_command check_local_users!75!150
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description Total Processes
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 2
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
check_command check_local_procs!150!200!RSZDT
}

# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description /dev/hda1 Free Space
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/dev/hda1
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux1
service_description /dev/hdb2 Free Space
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/dev/hdb2
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux2
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux2
service_description Current Users
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 2
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
check_command check_local_users!75!150
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux2
service_description Total Processes
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 2
contact_groups linux-admins
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
check_command check_local_procs!150!200!RSZDT
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux2
service_description /dev/hda1 Free Space
is_volatile 0
check_period 24x7
notification_interval 240
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/dev/hda1
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name linux2
service_description /dev/hdb1 Free Space
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups linux-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/dev/hdb1
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name switch1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups switch-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use
host_name switch2
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups switch-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name switch3
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups switch-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name switch4
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups switch-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}
# Service definition
define service{
use generic-service ; Name of service template to use

host_name switch5
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups switch-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name router1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups router-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer1
service_description Printer Status
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
notification_options c,r
check_command check_hpjd
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer1
service_description PING
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer2
service_description Printer Status
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
check_command check_hpjd
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer2
service_description PING
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer3
service_description Printer Status
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
check_command check_hpjd
}


# Service definition
define service{
use generic-service ; Name of service template to use

host_name printer3
service_description PING
is_volatile 0
check_period workhours
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups printer-admins
notification_interval 960
notification_period workhours
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}





7. Re: Nagios não starta

mateus schott
mschott

(usa Debian)

Enviado em 13/07/2011 - 16:05h

Desculpem a ignorância, mas o que seria Website #1?


8. Re: Nagios não starta

Jairo de Menezes Rodrigues
jairovisks

(usa Debian)

Enviado em 18/07/2011 - 09:52h

Vamos lá...

Primeiro - Você não precisa ter apenas um host por serviço, ou seja, os serviços não precisam se repetir no arquivo services para cada host, no seu arquivo o serviço PING é repetido uma vez para cada host, na verdade a configuração correta seria uma definição do serviço PING e onde tem hostname você coloca TODOS os hosts separados por vírgula.

Ex:
define service {
use generic-service
host_name nagios-server,mail,Proxy,proxy02
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 5
normal_check_interval 1
retry_check_interval 1
contact_groups grupo_suporte,grupo_gerencia
notification_interval 960
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}

Segundo - plugin check_http (nem o FTP) não é utilizado dessa forma, provavelmente sua mensagem de erro é por causa dele.
A utilização do check_http (segundo o help dele mesmo) é:

check_http -w 5 -c 10 -H www.verisign.com

Onde:
-w = warning
-c = critical
-H = nome do host a verificar

OBS.: Sempre que for utilizar um plugin do nagios você pode executá-lo na linha de comando com a opção --help para verificar o que ele faz e como usá-lo.


Se você está tentando checar se o serviço de http está rodando pode verificar pela resposta na porta, mas eu aconselho a fazer com NRPE no caso se ser uma máquina linux ou com NCClient ou NSClient para uma máquina Windows.

abs






9. Re: Nagios não starta

Jairo de Menezes Rodrigues
jairovisks

(usa Debian)

Enviado em 18/07/2011 - 09:54h

Faz o seguinte:

- primeiro exuga seu arquivo services para refletir apenas serviços únicos, sem repetição.
- Segundo comenta todos os serviços e deixa apenas o ping e roda o nagios, se funcionar decomenta mais um serviço e roda novamente, faça isso até identificar exatamente o serviço que está com problemas e posta aqui pra gente.

abs






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts