Page 1 of 1

Nagios refuses to work - Clean install(s) - VERY frustrated

Posted: Wed Sep 28, 2016 11:03 am
by gryph0n
Nagios Version: XI
Linux Distro: CentOS release 6.8 (final)
64-bit image
Hyper-V install (preconfigured Hyper-V image downloaded from Nagios)
No proxies etc


Bit of backstory (initial problem):
I first installed my own OS (CentOS (core/minimal) / 64 bit / Hyper V). Installed Nagios following the instructions provided to the letter. Was able to open up my web portal and see the dashboard etc. When I was trying to connect to a Windows server, it flat out refused. I banged away at different solutions off and on for a week. I finally threw the towel in and figured I must have dome something wrong that just hosed the entire image. No big, I felt like it was a positive learning experience. I fiddled with the NSClient, the server, firewalls, virtual switches, plugins, etc. Basically everything I could find on the web that may have mentioned a possible issue, I explored. I kept getting the same error over and over:
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/servername.com.local.cfg', starting on line 16)
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.
The odd thing is, no matter the name of the server I was trying to connect to, it kept referring to the same server name (pulling some bad meta-data from somewhere?) If I were trying to connect to a DC, it filled in the print server. WSUS...print server. I looked at the .cfg files and it says that manually editing them will do no good. I tried anyway, for good measure. Same issue (of course). I'm new to this environment and have no documentation on the servers, networking, or hyper v configs. I try to narrow it down between server/client/networking/hyper-v/etc.

Second Fresh Install: Preconfigured Nagios Hyper-V image

I follow the instructions for importing the image to Hyper-V verbatim. No issues. As a test server, I hit the primary DC. Bang! no problems. GREAT! So I though...I hit the print server again, and same exact error as before. Now I try another server, and it refuses to connect again. Same issue as the first time, it pulls the same exact error pointing to the configs for the print server, even though I'm NOT trying to connect to the print server.

I've even renamed the original print server config files to .old and deleted the .cfg and tried to connect to something other than the print server. Same exact error, and pulling the print server name...AGAIN.

So this error has happened in the exact same fashion on two different machines. On my initial install, I did try the DC first, and it did connect. After getting this series of errors (that all seem to stem from trying to connect to the print server) on both instances, I'm at a dead end.

So if you're still with me, and had the patience to read through all this..

Help me Obi Wan...you're my only hope.

Re: Nagios refuses to work - Clean install(s) - VERY frustra

Posted: Wed Sep 28, 2016 11:23 am
by lmiltchev
I've even renamed the original print server config files to .old and deleted the .cfg and tried to connect to something other than the print server. Same exact error, and pulling the print server name...AGAIN.
Are you trying to modify your configs manually, from the command line? This is not going to work. In Nagios XI, you need to manage your objects via the Core Config Manager. When you modify your configs in the CCM, changes are written to the MySQL DB. Only after you apply configuration, they are written to flat files (actual configs). Every change that you make in the CLI would be overwritten with whatever is in the DB next time you apply configuration.

Go to Configure->Core Config Manager->Tools->Write Config Files, click on "Write", then "Verify" buttons, and show the output.

Re: Nagios refuses to work - Clean install(s) - VERY frustra

Posted: Wed Sep 28, 2016 12:37 pm
by gryph0n
In reading the .cfg files, I saw where they say that manually editing them won't do a thing, I only tried it for good measure (since I had tried about everything else!). *I thought I had mentioned that in my original post, but verified that I did not*

Here is the output of a WRITE>VERIFY.

It's the same error I'm seeing over and over. No matter what the server name is that I'm trying to add to monitoring, it keeps populating with my print server name (redacted in this screenshot).

Re: Nagios refuses to work - Clean install(s) - VERY frustra

Posted: Wed Sep 28, 2016 12:45 pm
by lmiltchev
Go to the CCM->Services, find the "problem service" ("PRINT SERVER INFO" or whatever it is called), click on it verify it has a valid service description.

Next, click on "Manage Hosts" (still under the "Common Settings" tab), and make sure this service is added to a host. If it is not, select a host, click on "Add Selected", "Close", and "Save". Don't apply configuration yet!

Go back to the "Write Config Files" tool, and verify your configuration by clicking on "Write" and "Verify" in this particular order.

If you don't see any errors, apply configuration. If you do see errors, post them on the forum.

Re: Nagios refuses to work - Clean install(s) - VERY frustra

Posted: Wed Sep 28, 2016 1:58 pm
by gryph0n
That was it!

I had added the 'Print Spooler' service and it was undefined. THANK YOU so much for the direction. Apparently I was trying to dig way too deep. Doh!

Re: Nagios refuses to work - Clean install(s) - VERY frustra

Posted: Wed Sep 28, 2016 2:07 pm
by avandemore
Awesome! I'm closing this thread since you have resolved your issue. Thanks for being part of the Nagios Community.