Erreur nagios : Could not add object property

Fermé
amel_ouertani - 15 nov. 2007 à 15:56
 amel_ouertani - 25 déc. 2007 à 13:27
Bonjour,
voici mon fichier de contacts.cfg
define contact {
contact_name nagiosadmin
alias Nagios Admin
contactgroup admins (linge 4)
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options u,d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
}
(dans le msg d'erreur il indiqueCould not add object property in file '/usr/local/nagios/etc/contacts.cfg' on line 4)
A voir également:

3 réponses

bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 473
15 nov. 2007 à 17:35
Bonjour,

je connais rien à Nagios mais le message d'erreur indique un "problème" à la ligne 4 du fichier contacts.cfg ce qui correspondrait à :
contactgroup admins (linge 4)

or une petite recherche sur google me donne ce lien :
http://www.commentcamarche.net/forum/affich 3337561 installation complete de nagios

et dès le post<1> une "petit doué" pond un tuto (août 2007) sur Nagios très bien expliqué et qui semble fonctionner.

....et cela ne ressemble en rien à ton fichier contacts.cfg qui est plutôt un mélange de deux fichiers :

le fichier hosts.cfg (d'après le tuto)
 Serveur nagios host definition
define host{
use generic-host ; Name of host template to use

host_name serveur
alias Serveur
address 10.10.10.10
check_command check-host-alive
max_check_attempts 23
contact_groups serveur-admin
notification_interval 60
notification_period 24x7
notification_options d,u,r
}


et du fichier contact (toujours d'après le tuto)
# 'nagios' contact definition
define contact{
contact_name nagios
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands host-notify-by-email,host-notify-by-epager
email nagios-admin@localhost
pager pagenagios-admin@localhost
} 


or dans la igne 4 de ton fichier (si j'ai pas tout faux) il est question de contactgroups admins ...or il est question d'un modification à réaliser sur contact_group .....la suite dans le tuto ...

:-))
1
amel_ouertani
25 déc. 2007 à 13:24
bonjour tout le monde
j'ai un problème au niveau de mon serveur nagios
il affiche que tout les postes down et aussi il affiche localhost down
voici mes fichiers de configuration
services.cfg
# Generic service definition template
define service{
name generic-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
normal_check_interval 5
max_check_attempts 3
retry_check_interval 1
notification_interval 0
notification_period 24x7
notification_options c,r
register 0
}
define service{
use generic-service
host_name linux,virtulRed
service_description PING
contact_groups serveur-admin
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use generic-service
host_name linux,virtulRed
service_description http
contact_groups serveur-admin
check_command check_http
}
define service{
use generic-service
host_name linux,virtulRed
service_description tcp
contact_groups serveur-admin
check_command check_tcp
}
define service{
use generic-service
host_name linux,virtulRed
service_description telnet
contact_groups serveur-admin
check_command check_tcp
}
define service {
host_name virtulWin
use generic-service
service_description charge CPU
contact_groups serveur-admin
check_command check_nrpe!check_load
}
define service {
host_name virtulWin
use generic-service
service_description nt_disk
contact_groups serveur-admin
check_command check_nt
}



hosts.cfg
define host{
name generic-host
check_command check-host-alive
max_check_attempts 2
check_interval 5
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
obsess_over_host 1
check_freshness 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notifications_enabled 1
notification_interval 60
notification_period 24x7
notification_options d,r,u
contact_groups serveur-admin
register 0
}
define host{
use generic-host
host_name virtulWin
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}

define host{
use generic-host
host_name linux
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}
define host{
use generic-host
host_name virtulRed
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}
hostgroups.cfg
define hostgroup{
hostgroup_name serveurs
alias Servers
members linux,virtulRed
}
define hostgroup{
hostgroup_name poste
alias Servers
members virtulWin
}



contacts.cfg
# 'serveur' contact definition
define contact{
contact_name serveur
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands host-notify-by-email,host-notify-by-epager
email nagios-admin@localhost
pager pagenagios-admin@localhost
}


contactgroup.cfg
define contactgroup {
contactgroup_name serveur-admin
alias serveurs
members serveur
}

timeperiods.cfg
define timeperiod {
timeperiod_name 24x7
alias 24 hours a day
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
0
amel_ouertani
25 déc. 2007 à 13:27
bonjour tout le monde
j'ai un problème au niveau de mon serveur nagios
il affiche que tout les postes down et aussi il affiche localhost down
voici mes fichiers de configuration
services.cfg
# Generic service definition template
define service{
name generic-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
normal_check_interval 5
max_check_attempts 3
retry_check_interval 1
notification_interval 0
notification_period 24x7
notification_options c,r
register 0
}
define service{
use generic-service
host_name linux,virtulRed
service_description PING
contact_groups serveur-admin
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use generic-service
host_name linux,virtulRed
service_description http
contact_groups serveur-admin
check_command check_http
}
define service{
use generic-service
host_name linux,virtulRed
service_description tcp
contact_groups serveur-admin
check_command check_tcp
}
define service{
use generic-service
host_name linux,virtulRed
service_description telnet
contact_groups serveur-admin
check_command check_tcp
}
define service {
host_name virtulWin
use generic-service
service_description charge CPU
contact_groups serveur-admin
check_command check_nrpe!check_load
}
define service {
host_name virtulWin
use generic-service
service_description nt_disk
contact_groups serveur-admin
check_command check_nt
}



hosts.cfg
define host{
name generic-host
check_command check-host-alive
max_check_attempts 2
check_interval 5
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
obsess_over_host 1
check_freshness 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notifications_enabled 1
notification_interval 60
notification_period 24x7
notification_options d,r,u
contact_groups serveur-admin
register 0
}
define host{
use generic-host
host_name virtulWin
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}

define host{
use generic-host
host_name linux
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}
define host{
use generic-host
host_name virtulRed
alias Serveur
address xxx.xxx.xxx.xxx
check_command check-host-alive
check_command check_http
check_command check_dns
low_flap_threshold 10.0
high_flap_threshold 30.0
}
hostgroups.cfg
define hostgroup{
hostgroup_name serveurs
alias Servers
members linux,virtulRed
}
define hostgroup{
hostgroup_name poste
alias Servers
members virtulWin
}



contacts.cfg
# 'serveur' contact definition
define contact{
contact_name serveur
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands host-notify-by-email,host-notify-by-epager
email nagios-admin@localhost
pager pagenagios-admin@localhost
}


contactgroup.cfg
define contactgroup {
contactgroup_name serveur-admin
alias serveurs
members serveur
}

timeperiods.cfg
define timeperiod {
timeperiod_name 24x7
alias 24 hours a day
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
0