Duplicate definition found for host



I have configured localhost.cfg in nagios 3.0.6 like this:

define host{
name generic-host
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0

define host{
use generic-host
name my_host
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,r
contact_groups admins
register 0

define host{
use my_host
host_name Server
alias server

When i make nagios -v /etc/nagios/nagios.cfg

i have this error
Reading configuration data…

Warning: Duplicate definition found for host ‘generic-host’ (config file '/etc/nagios/objects/localhost.cfg’
Error: Could not add object property in file ‘/etc/nagios/objects/localhost.cfg’

Ih this guide with nagios 2 they make the same thing:


Maybe somewhere else the generic-host is also defined. Check the cfg_file and cfg_dir variables in nagios.cfg file, maybe there are duplicate definition somewhere within all .cfg files. Comment unnecessary files from nagios.cfg.


Yes, i have found another definition of generic-host…

If i want to check FETCHMAIL how can i make?
Is there a plugin for it?