Page 1 of 1

Core Config Creating .cfg For Deactivated Services

Posted: Fri Jun 26, 2015 1:47 pm
by sav2880
I'm running into an issue that I can't quite seem to figure out. Running XI 2012R2.9, not looking to upgrade from there right now.

Basically, I have deactivated some hostgroups, hosts, and services that are no longer running, deleted a couple as well. Now, when I go to apply a configuration, I get the always nasty error noting that there was a problem with my configuration.

Upon digging into the config of what went wrong, I saw this was the error:

Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/Drive Z: Under 5GB ETL.cfg', starting on line 14)
Error processing object config files!

The thing is, this particular service check has been deactivated. I went into the shell and verified that this file was created. The .cfg showed that there were two hostgroups tied to this service, but that's not how it appears in CCM. One of the hostgroups had been deleted, and other one was not tied to the service in CCM at all.

So, I guess two questions:

1) How do I tell CCM that these two hostgroups really aren't part of this service anymore so that it will stop trying to write them at config time?
2) If a service is deactivated, should that keep a .cfg file from being written for it?

Thanks!

Re: Core Config Creating .cfg For Deactivated Services

Posted: Fri Jun 26, 2015 2:02 pm
by tmcdonald
Please run the following command as root from the Nagios server command line and post the results:

Code: Select all

cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh | tail -30

Re: Core Config Creating .cfg For Deactivated Services

Posted: Fri Jun 26, 2015 2:16 pm
by sav2880

Code: Select all


--2015-06-26 15:14:20--  http://localhost/nagiosql/index.php
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/nagiosql/admin.php [following]
--2015-06-26 15:14:20--  http://localhost/nagiosql/admin.php
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5286 (5.2K) [text/html]
Saving to: “nagiosql.login”

100%[======================================>] 5,286       --.-K/s   in 0s

2015-06-26 15:14:20 (387 MB/s) - “nagiosql.login” saved [5286/5286]

--2015-06-26 15:14:21--  http://localhost/nagiosql/index.php
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/nagiosql/admin.php [following]
--2015-06-26 15:14:21--  http://localhost/nagiosql/admin.php
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5286 (5.2K) [text/html]
Saving to: “nagiosql.login”

100%[======================================>] 5,286       --.-K/s   in 0s

2015-06-26 15:14:21 (183 MB/s) - “nagiosql.login” saved [5286/5286]

--2015-06-26 15:14:22--  http://localhost/nagiosql/admin/verify.php
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7096 (6.9K) [text/html]
Saving to: “nagiosql.export.monitoring”

100%[======================================>] 7,096       --.-K/s   in 0s

2015-06-26 15:14:32 (242 MB/s) - “nagiosql.export.monitoring” saved [7096/7096]

--2015-06-26 15:14:32--  http://localhost/nagiosql/admin/verify.php
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7400 (7.2K) [text/html]
Saving to: “nagiosql.export.additional”

100%[======================================>] 7,400       --.-K/s   in 0s

2015-06-26 15:14:32 (571 MB/s) - “nagiosql.export.additional” saved [7400/7400]

tar: Removing leading `/' from member names
Processing object config file '/usr/local/nagios/etc/services/MPIO Paths Check.cfg'...
Processing object config file '/usr/local/nagios/etc/services/L-Drive TempDB Mount Point Under 2GB ETL.cfg'...
Processing object config file '/usr/local/nagios/etc/services/GlobalDB - Drive Q: Under 100MB.cfg'...
Processing object config file '/usr/local/nagios/etc/services/D-Drive Logs Percent Free Space.cfg'...
Processing object config file '/usr/local/nagios/etc/services/TCP IP NetBIOS Helper Service.cfg'...
Processing object config file '/usr/local/nagios/etc/services/MSSQL Page Splits Per Sec.cfg'...
Processing object config file '/usr/local/nagios/etc/services/Network Store Interface Service.cfg'...
Processing object config file '/usr/local/nagios/etc/services/F-Drive Logs Mount Point Under 5GB ETL.cfg'...
Processing object config file '/usr/local/nagios/etc/services/MSSQL Lock Requests Per Sec.cfg'...
Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/Drive Z: Under 5GB ETL.cfg', starting on line 14)
   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.
RET: 254
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1435328942.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1435328942.tar.gz
/usr/local/nagiosxi/scripts
RESETTING PERMS
SETUID ROOT OK


Re: Core Config Creating .cfg For Deactivated Services

Posted: Fri Jun 26, 2015 2:18 pm
by sav2880
The .cfg file it creates in question is this:

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2015-06-18 12:31:19
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        service_description             Drive Z: Under 5GB ETL
        use                             etlgroup_oncall,xiwizard_windowsserver_nsclient_service
        hostgroup_name                  sqlprod_textalert,Z-Drive Textalert
        check_command                   check_ntdisk_bysize!Z!5001!5000!!!!!
        contact_groups                  OnCall_Ops
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
The Z-Drive Textalert hostgroup is the one that was deleted which I re-created, and the sqlprod_textalert one is the one that exists but wasn't tied into this service anymore. As a reminder, the active checkbox for this is unchecked as well.

Re: Core Config Creating .cfg For Deactivated Services

Posted: Mon Jun 29, 2015 8:43 am
by lmiltchev
If you deactivated these services (took care of all dependencies), but you are still having config errors, it is possible this is a "ghost" host/service issue. Try running the Write Config Tool:

CCM->Tools->Write Config Files->Delete->Write->Verify

If you don't see any config errors - apply configuration.

Note: I don't remember if 2012R2.9 had a "Delete" button under the "Write Config" tool. If you don't have one, run the following commands:

Code: Select all

mkdir /tmp/hosts /tmp/services
mv /usr/local/nagios/etc/hosts/* /tmp/hosts/
mv /usr/local/nagios/etc/services/* /tmp/services/
CCM->Tools->Write Config Files->Write->Verify->Apply Configuration

Let us know if this fixed your issue.

Re: Core Config Creating .cfg For Deactivated Services

Posted: Mon Jun 29, 2015 9:05 am
by sav2880
Does not appear that it did. I'm getting this message:

Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/HP Smart Array SAS-SATA Event Notification Service.cfg', starting on line 14)

Looking in the CCM, it's pointing to a hostgroup called blade_servers. Now, blade_servers doesn't have any members in it anymore, so it could easily be deactivated. This error does at least make some sense, it's something pointing to an empty hostgroup, and Nagios doesn't ever seem to like that very much.

Let me follow this rabbit hole for a bit and see where it ends up.

Re: Core Config Creating .cfg For Deactivated Services

Posted: Mon Jun 29, 2015 9:39 am
by lmiltchev
Looking in the CCM, it's pointing to a hostgroup called blade_servers. Now, blade_servers doesn't have any members in it anymore, so it could easily be deactivated. This error does at least make some sense, it's something pointing to an empty hostgroup, and Nagios doesn't ever seem to like that very much.

Let me follow this rabbit hole for a bit and see where it ends up.
Let us know what you found out.

If you are still having issues, we can move this to our email ticketing system. Send your profile to [email protected] and reference this forum post in the email.

Admin->System Profile->Download Profile