Error testing centreon engine after creating a new host definition for a printer

0

I'm testing CENTREON to be used as the main tool to monitor logs in the company that I work for.

I'm having trouble working with CENTERON SNMP and a printer.

When I test the centreon engine this error appears in my centreon server command line:

Error while processing a config file: Parsing of global configuration failed: Can't open file '/etc/centreon-engine/engine.cfg

One or more problems occurred while processing the config files.

My 'centengine.cfg':

################################################## #################
# #
# GENERATED BY CENTREON #
# #
# Developped by : #
# - Julien Mathis #
# - Romain Le Merlus #
# #
# www.centreon.com #
# For information : contact@centreon.com #
################################################## #################
# #
# 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###

My printer configuarations in the '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###

Note: The 'x' are the sensative data codificated.

I'm using the SNMP for geting other servers information and it works.

And when I try the comand 'snmpwalk' in my server the printer return data.

So what is the problem in my configurations?

Jose Marques

Posted 2018-03-20T09:59:06.343

Reputation: 103

Answers

1

You've given a centengine.cfg The missing file seems to be engine.cfg - If you rename a copy of centengine.cfg engine.cfg (so the file its looking for exists), that error should be sorted. You may need to make other changes if there are changes in the config file format

OP mentioned in the comments that the manual stated the name of the file is from the manual - so if this happens, it might be worth checking for an updated manual.

Journeyman Geek

Posted 2018-03-20T09:59:06.343

Reputation: 119 122