Erro ao testar o mecanismo central depois de criar uma nova definição de host para uma impressora

0

Estou testando o CENTREON para ser usado como a principal ferramenta para monitorar logs na empresa em que trabalho.

Estou tendo problemas para trabalhar com o CENTERON SNMP e uma impressora.

Quando eu testo o mecanismo central, este erro aparece na linha de comando do servidor central:

Erro ao processar um arquivo de configuração: Falha na análise da configuração global: não é possível abrir o arquivo '/etc/centreon-engine/engine.cfg

Um ou mais problemas ocorreram durante o processamento dos arquivos de configuração.

Meu 'centengine.cfg':

################################################## #################
# #
# GENERATED BY CENTREON #
# #
# Developped by : #
# - Julien Mathis #
# - Romain Le Merlus #
# #
# www.centreon.com #
# For information : [email protected] #
################################################## #################
# #
# Last modification 2018-03-16 15:30 #
# By unknown #
# #
################################################## #################

cfg_file=/etc/centreon-engine/hostTemplates.cfg

cfg_file=/etc/centreon-engine/hosts.cfg

cfg_file=/etc/centreon-engine/serviceTemplates.cfg

cfg_file=/etc/centreon-engine/services.cfg

cfg_file=/etc/centreon-engine/commands.cfg

cfg_file=/etc/centreon-engine/contactgroups.cfg

cfg_file=/etc/centreon-engine/contacts.cfg

cfg_file=/etc/centreon-engine/hostgroups.cfg

cfg_file=/etc/centreon-engine/servicegroups.cfg

cfg_file=/etc/centreon-engine/timeperiods.cfg

cfg_file=/etc/centreon-engine/escalations.cfg

cfg_file=/etc/centreon-engine/dependencies.cfg

cfg_file=/etc/centreon-engine/connectors.cfg

cfg_file=/etc/centreon-engine/meta_commands.cfg

cfg_file=/etc/centreon-engine/meta_timeperiod.cfg

cfg_file=/etc/centreon-engine/meta_host.cfg

cfg_file=/etc/centreon-engine/meta_services.cfg

cfg_file=/etc/centreon-engine/objects/printer.cfg

broker_module=/usr/lib64/centreon-engine/externalcmd.so

broker_module=/usr/lib64/nagios/cbmod.so /etc/centreon-broker/central-module.xml

interval_length=60

resource_file=/etc/centreon-engine/resource.cfg

log_file=/var/log/centreon-engine/centengine.log

status_file=/var/log/centreon-engine/status.dat

use_check_result_path=0

command_check_interval=1s

command_file=/var/lib/centreon-engine/rw/centengine.cmd

state_retention_file=/var/log/centreon-engine/retention.dat

retention_update_interval=60

sleep_time=0.2

service_inter_check_delay_method=s

service_interleave_factor=s

max_concurrent_checks=400

max_service_check_spread=5

check_result_reaper_frequency=5

low_service_flap_threshold=25.0

high_service_flap_threshold=50.0

low_host_flap_threshold=25.0

high_host_flap_threshold=50.0

service_check_timeout=60

host_check_timeout=12

event_handler_timeout=30

notification_timeout=30

ocsp_timeout=5

ochp_timeout=5

perfdata_timeout=5

date_format=euro

illegal_object_name_chars=~!$%^&*"|'<>?,()=
illegal_macro_output_chars='~$^&"|'<>

admin_email=admin@localhost

admin_pager=admin

event_broker_options=-1

cached_host_check_horizon=60

debug_file=/var/log/centreon-engine/centengine.debug

debug_level=0

debug_verbosity=2

log_pid=1

enable_notifications=1

execute_service_checks=1

accept_passive_service_checks=1

enable_event_handlers=1

check_external_commands=1

use_retained_program_state=1

use_retained_scheduling_info=1

use_syslog=0

log_notifications=1

log_service_retries=1

log_host_retries=1

log_event_handlers=1

log_initial_states=1

log_external_commands=1

use_aggressive_host_checking=1

soft_state_dependencies=0

obsess_over_services=0

process_performance_data=0

check_for_orphaned_services=0

check_for_orphaned_hosts=0

check_service_freshness=1

enable_flap_detection=0


###end###

Minhas configurações de impressora no 'printer.cfg':

##
## Copyright 1999-2009 Ethan Galstad
## Copyright 2011-2013 Merethis
##
## This file is part of Centreon Engine.
##
## Centreon Engine is free software: you can redistribute it and/or
## modify it under the terms of the GNU General Public License version 2
## as published by the Free Software Foundation.
##
## Centreon Engine is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Centreon Engine. If not, see
## <http://www.gnu.org/licenses/>.
##

# file: printer.cfg
# brief: Sample config file for monitoring a network printer.
#
# notes: This config file assumes that you are using the sample configuration
# files that get installed with the Centreon Engine quickstart guide.


# info: host definitions.
# brief: Define a host for the printer we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{

use generic-printer ; Inherit default values from a template.

host_namH HP_laserJet_400 ; The name we're giving to this printer.

alias HP LaserJet 400 MFP M425dw ; A longer name associated with the printer.

address xxx.xxx.xxx.xxx ; IP address of the printer.

hostgroupl allhosts ; Host groups this printer is associated with.

}

# info: Host group definitions.
# brief: A hostgroup for network printers.

define hostgroup{

hostgroup_name acs-net-printers ; The name of the hostgroup.

alias acs net Printers ; Long name of the group.

}

# info: Service definitions.
# brief: Create a service for monitoring the status of the printer Change the
# host_name to match the name of the host you defined above If the
# printer has an SNMP community string other than "public", change the
# check_command directive to reflect that.

define service{

use generic_service ; Inherit values from a template.

host_name HP_laserJet_400 ; The name of the host the service is associated with.

service_description Printer Status ; The service description.

check_command check_hpjd!-C xxx ; 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.

}

# Create a service for "pinging" the printer occassionally.
# Useful for monitoring RTA, packet loss, etc.

define service{

use generic_service

host_name HP_laserJet_400

service_description PING

check_command check_ping!3000.0,80%!5000.0,100%

normal_check_interval 10

retry_check_interval 1

}

###end###

Nota: Os 'x' são os dados sensitivos codificados.

Estou usando o SNMP para obter outras informações sobre servidores e funciona.

E quando eu tento o comando 'snmpwalk' no meu servidor, a impressora retorna os dados.

Então, qual é o problema em minhas configurações?

    
por Jose Marques 20.03.2018 / 10:59

1 resposta

2

Você forneceu um centengine.cfg O arquivo ausente parece ser engine.cfg - Se você renomear uma cópia do centengine.cfg engine.cfg (para que exista o arquivo que procura), esse erro deverá ser classificado. Você pode precisar fazer outras alterações se houver alterações no formato do arquivo de configuração

OP mencionada nos comentários de que o manual declarou que o nome do arquivo é do manual - portanto, se isso acontecer, talvez valha a pena verificar se há um manual atualizado.

    
por 20.03.2018 / 12:45