Nagios Core config files trouble

I can seem fine the solution for the below error when I run this verify command below....I check/verify the file localhost.cfg with hostgroups.cfg and keep getting this Warning

 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Warning: Duplicate definition found for hostgroup 'linux-servers' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 47)
Error: Could not add object property in file '/usr/local/nagios/etc/objects/localhost.cfg' on line 48.
   Error processing object config files!

Suggestions?
gumball60Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sanga CollinsSystems AdminCommented:
in the localhost.cfg you have defined a hostgroup called 'linux-servers' that is already defined elsewhere.

If you edit the file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 47

you can comment out the linux-servers group or delete the section all together and your nagios config check should succeed
0
dipopoCommented:
As the error states, you have defined the host-group twice.

Should look like this:

###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################

# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               localhost
        alias                   localhost
        address                 127.0.0.1
        }



###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################

# Define an optional hostgroup for Linux machines

define hostgroup{
        hostgroup_name  linux-servers ; The name of the hostgroup
        alias           Linux Servers ; Long name of the group
        members         localhost     ; Comma separated list of hosts that belong to this group
        }
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gumball60Author Commented:
I had duplicate entries
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.