Configuração Nagios 2.9

1. Configuração Nagios 2.9

Renato Pavoni
rpavoni

(usa Slackware)

Enviado em 31/07/2007 - 17:22h

Olá para todos
Configurei um Nagios 2.9 usando Apache 2.0 em um Fedora Core 1. Para realizar a configuração usei o seguinte howto:
http://www.vivaolinux.com.br/artigos/verArtigo.php?codigo=6820

Segue abaixo as configurações dos meus arquivos:

[root@portal1 etc]# vi hostgroups.cfg
define hostgroup{
group_name Servers
alias Servers Pan
members pan-admins

[root@portal1 etc]# vi servicesgroups.cfg
define servicesgroup {
servicegroup_name monit-servers
alias Servico de Monitoramento de Servidores
members pan-admins
}

[root@portal1 etc]# vi contacts.cfg
#'dstec' contact definition
define contact{
contact_name rgalante
alias Sistema de Monitoracao do Panamericano S/a
service_notification_period 24x7
service_notification_options w,c,r
host_notification_options d,u,r
service_notification_commands host-notify-by-email
email
}

[root@portal1 etc]# vi hostextinfo.cfg
define hosttextinfo{
host_name pandb2514
hostgroup_name servers
name test_server
icon_image forecp90.png
icon_image_alt forecp90.png
statusmap_image forecp90.png
2d_coords 100,100
3d_coords 100.0,50.0,75.0
)

[root@portal1 etc]# vi hosts.cfg
#Template

define host{

name 127.0.0.1
notifications_enable 1
event_handler_enable 1
flap_detection_enable 1
process_perf_data 1
retain_status_information 1
register 0
contact_group pan_admins
)

# Criando uma sub-definicao

define host{
use pandb2514
name sub_def_1
check_command check-host-alive
max_check_attepts 10
notification_interval 60
notification_period 24x7
notification_options d,u,r
register 0
)

define host(
use pandb2514
host_name pandb2514
alias Servidor de Banco de Dados
#parents
address 172.17.2.235

[root@portal1 etc]# vi services.cfg
define service {
name generic-service
active_checks_enable 1
passive_checks_enable 1
parallelize_check 1
obsses_over_service 1
check_flashness 0
notifications_enable 1
event_handler_enable 1
flap_detection_enable 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
passive_checks_enable 1
register 0
}


define service{
use generic-service
name is-alive
service_description Tempo de Resposta
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups administrators
notification_interval 30
notification_period 24x7
notification_options c,r
check_command check_ping!30,10%!100,40%
register 0
notifications_enable 1
}

define service{
use is-alive
hostgroup_name servers
host_name pandb2514
service_description Tempo de Resposta
}

As permissões do diretorio /usr/local/nagios estão da seguinte forma:

[root@portal1 nagios]# ls -la
total 112
drwx------ 8 nagios nagios 4096 Jul 31 13:27 .
drwxr-xr-x 12 root root 4096 Jul 30 08:52 ..
-rw-r--r-- 1 nagios nagios 24 Jul 30 08:52 .bash_logout
-rw-r--r-- 1 nagios nagios 191 Jul 30 08:52 .bash_profile
-rw-r--r-- 1 nagios nagios 124 Jul 30 08:52 .bashrc
drwxr--r-- 2 nagios nagios 4096 Jul 30 09:15 bin
-rw-r--r-- 1 nagios nagios 383 Jul 30 08:52 .emacs
drwxr--r-- 2 nagios nagios 4096 Jul 31 15:45 etc
-rw-r--r-- 1 nagios nagios 120 Jul 30 08:52 .gtkrc
drwxr--r-- 2 nagios nagios 4096 Jul 30 09:31 libexec
drwxr--r-- 2 nagios nagios 4096 Jul 30 09:15 sbin
drwxr--r-- 9 nagios nagios 4096 Jul 31 13:12 share
drwxr--r-- 4 nagios nagios 4096 Jul 31 15:30 var
-rw-r--r-- 1 nagios nagios 658 Jul 30 08:52 .zshrc

Quanto tento iniciar o nagios, o seguinte erro é apresentado:

[root@portal1 bin]# ./nagios -v nagios.cfg

Nagios 2.9
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 04-10-2007
License: GPL

Reading configuration data...

Error: Cannot open main configuration file '/usr/local/nagios/bin/nagios.cfg' for reading!

***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

Poderiam me ajudar?

Obrigado!










  


2. Re: Configuração Nagios 2.9

Eduardo de Almeida
edu_as

(usa Debian)

Enviado em 29/01/2008 - 10:59h

Verifica o o aqruivo de conf do nagios.cfg ve se os arquivos cfg estã comentados.






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts