Error: Unexpected EOF in file

I am receiving this error after making changes to this configh file.  How do I correct this?

Error: Unexpected EOF in file '/usr/local/nagios/etc/objects/hosts.cfg' on line 299 - check for a missing closing bracket.
   Error processing object config files!
280 #define host{
    281 #       use             generic-switch
    282 #       host_name       5094_Switch
    283 #       parents         1059_Switch
    284 #       hostgroups      cisco-switches
    285 #       alias           cs0003
    286 #       address         192.x.x.2
    287 #       hostgroups      cisco-switches
    288 #       }
    289
    290 #define host{
    291 #       use             generic-switch
    292 #       host_name       5102_Switch
    293 #       parents         1059_Switch
    294 #       hostgroups      cisco-switches
    295 #       alias           cs0002
    296 #       address         192.x.x.3
    297 #       hostgroups      cisco-switches
    298 #       }
    299
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:
you may have an extra { or } somewhere in the file. Can you post the entire config file?
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
Daniel HelgenbergerCommented:
Since all the definitions are commented out - it may be really missing in a line way prior the one you posted or get the error on.
0
TintinCommented:
The problem will be that you are missing a closing brace further up in the file.   The reason it says line 299 is that it has searched to the end of the file and hasn't found one.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Gerwin Jansen, EE MVETopic Advisor Commented:
Open your config file in an editor that has syntax highlighting (for example notepad++), hover over the brackets and you should be able to find the missing bracket.
0
gumball60Author Commented:
The error probably was else where in file. I recreated the file and it worked.  Thanks for your help.
0
gumball60Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for gumball60's comment #a39504558

for the following reason:

I created a new file to replace it.
0
TintinCommented:
gumball60, you were given answers as to where the problem was and how to fix it, so not sure why you don't want to accept any of the answers as a solution.
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.