Warning: Duplicate , but found none.
Posted: Wed Feb 01, 2017 3:19 am
hello
I know this problem with duplicate is very common. I try to read through all the posts and helps. But none seems solve my problem
my nagios is in the directory etc/nagios3 and not in /usr/...
using nagios3 -v /etc/nagios3/nagios.cfg
Folder and rights
cut outs from my nagios.cfg
in conf.d Directory I moved all templates in an extra folder and rename with different ending than .cfg.
The templates that I will use for my other definition I copied to ../objects/templates. I set them all to register 0
The weird thinig is doesnt matter what I do..it seems it doesnt read the cfg at all. It keeps the localhost , the default setting. I can see that in objects.cache.
When I seek for generic-service . I just one with the name as generic-service.. from the templates. Rest of it is just using the template which is alright. Since it should be inherited.
I dont know where I might have configurated it wrong. Much Appreciated!
I know this problem with duplicate is very common. I try to read through all the posts and helps. But none seems solve my problem
my nagios is in the directory etc/nagios3 and not in /usr/...
using nagios3 -v /etc/nagios3/nagios.cfg
Code: Select all
Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/etc/nagios3/objects/commands'...
Processing object config directory '/etc/nagios3/objects'...
Processing object config directory '/etc/nagios3/objects/templates'...
Processing object config file '/etc/nagios3/objects/templates/generic-service-template.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-host-template.cfg'...
Processing object config directory '/etc/nagios3/objects/commands'...
Processing object config directory '/etc/nagios3/objects/services'...
Processing object config file '/etc/nagios3/objects/services/services.cfg'...
Processing object config directory '/etc/nagios3/objects/hosts'...
Processing object config file '/etc/nagios3/objects/hosts/host_pi.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/localhost.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/host_test.cfg'...
Processing object config file '/etc/nagios3/objects/contacts.cfg'...
Processing object config file '/etc/nagios3/objects/timeperiods.cfg'...
Processing object config directory '/etc/nagios3/objects'...
Processing object config directory '/etc/nagios3/objects/templates'...
Processing object config file '/etc/nagios3/objects/templates/generic-service-template.cfg'...
Warning: Duplicate definition found for service 'generic-service' (config file '/etc/nagios3/objects/templates/generic-service-template.cfg', starting on line 2)
Error: Could not add object property in file '/etc/nagios3/objects/templates/generic-service-template.cfg' on line 3.
Error processing object config files!
***> 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.
Code: Select all
drwxr-xr-x 5 root root 4096 Feb 1 08:52 .
drwxr-xr-x 117 root root 4096 Feb 1 00:21 ..
-rw-r--r-- 1 root root 2109 Okt 5 2014 apache2.conf
-rwxrwxr-- 1 root root 12472 Jan 31 09:06 cgi.cfg
-rw-r--r-- 1 root root 2443 Mär 15 2016 commands.cfg
drwxr-xr-x 3 root root 4096 Jan 31 10:05 conf.d
-rw-r--r-- 1 root root 50 Jan 23 15:07 htpasswd.users
-rw-r--r-- 1 root root 44743 Jan 31 15:43 nagios.cfg
drwxrwxrwx 6 root root 4096 Feb 1 08:15 objects
-rw-r--r-- 1 root nagios 1293 Jul 29 2011 resource.cfg
drwxr-xr-x 2 root root 4096 Jan 4 12:01 stylesheets
cut outs from my nagios.cfg
Code: Select all
#
# NAGIOS.CFG - Sample Main Config File for Nagios
#
#
##############################################################################
# LOG FILE
# This is the main log file where service and host events are logged
# for historical purposes. This should be the first option specified
# in the config file!!!
log_file=/var/log/nagios3/nagios.log
# Commands definitions
cfg_dir=/etc/nagios3/objects/commands
# Debian also defaults to using the check commands defined by the debian
# nagios-plugins package
cfg_dir=/etc/nagios3/objects
# Debian uses by default a configuration directory where nagios3-common,
# other packages and the local admin can dump or link configuration
# files into.
cfg_dir=/etc/nagios3/objects
# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
# host groups, contacts, contact groups, services, etc.
# You can split your object definitions across several config files
# if you wish (as shown below), or keep them all in a single config file.
# You can specify individual object config files as shown below:
#cfg_file=/etc/nagios3/objects/commands.cfg
#cfg_file=/etc/nagios3/objects/contacts.cfg
#cfg_file=/etc/nagios3/objects/timeperiods.cfg
#cfg_file=/etc/nagios3/objects/templates.cfg
#cfg_file=/etc/nagios3/objects/hosts.cfg
# Definitions for monitoring a Windows machine
#cfg_file=/etc/nagios3/objects/windows.cfg
# Definitions for monitoring a router/switch
#cfg_file=/etc/nagios3/objects/switch.cfg
# Definitions for monitoring a network printer
#cfg_file=/etc/nagios3/objects/printer.cfg
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
cfg_dir=/etc/nagios3/objects
#cfg_dir=/etc/nagios3/printers
#cfg_dir=/etc/nagios3/switches
#cfg_dir=/etc/nagios3/routers
# OBJECT CACHE FILE
# This option determines where object definitions are cached when
# Nagios starts/restarts. The CGIs read object definitions from
# this cache file (rather than looking at the object config files
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Nagios starts.
object_cache_file=/var/cache/nagios3/objects.cache
in conf.d Directory I moved all templates in an extra folder and rename with different ending than .cfg.
The templates that I will use for my other definition I copied to ../objects/templates. I set them all to register 0
The weird thinig is doesnt matter what I do..it seems it doesnt read the cfg at all. It keeps the localhost , the default setting. I can see that in objects.cache.
When I seek for generic-service . I just one with the name as generic-service.. from the templates. Rest of it is just using the template which is alright. Since it should be inherited.
I dont know where I might have configurated it wrong. Much Appreciated!