NagiosXI service-hosts setting left empty in file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

I have a strange issue after running an upgrade from 5.2.4 to 5.4.4. For two of my services (and all newly created services) do not get the hosts written to the config files. However the Nagios XI interface seems aware that they are supposed to be there.

First, some facts:
[root@nagios ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
This is an installation and not the pre-built image, x64, with nothing else special or installed.
After the upgrade we had a couple issues, a handful of hosts lost their max_check_attempts for no apparent reason and several host and service templates originating (and named) xi* had to be deactivated (but were unused anyways). Basically, some weird behavior.

We did do an upgrade and then rolled back, but we did so using snapshots on the whole VM so I doubt that caused any issues.

Here is an example:

Image

Image

Using username "root".
Last login: Thu Mar 16 08:20:10 2017 from buffalo-jdix.provident.local
[root@nagios ~]# cat /usr/local/nagios/etc/services/testingService.cfg
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date: 2017-03-16 13:48:53
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
service_description testing a service
check_command check-fast-alive!!!!!!!!
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
[root@nagios ~]#

As a workaround I recreated the problem services in the static config directory.

Thoughts?

I also uploaded my update logs as an attachment. (redacted as it contained host names)
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NagiosXI service-hosts setting left empty in file

Post by dwhitfield »

Unfortunately, there's nothing attached.

I'm a bit confused about your rollback. What version are you on now (for one thing, 5.4.4 doesn't exist!)? Are you just saying you rolled back the configuration?

Regardless, it sounds like you should run through https://assets.nagios.com/downloads/nag ... tabase.pdf
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

Re: NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

Sorry for the confusion, I was mistaken about the version numbers. I think it *was* 5.2.2 and is now 5.4.2 (post update). I was going from memory which is no good :). The attachment I removed because it contains data I don't want to post publicly. Is there a way to get this to support without sharing it with the world?

The "rollback" was a reverted snapshot to before the upgrade, but then we went and applied it again anyways. I probably should have just left that information out. I'll take a look at repairing the nagios database document and let you know how that goes.

Thanks!
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

Re: NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

Following the document did not fix unfortunately, same symptoms persist.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NagiosXI service-hosts setting left empty in file

Post by dwhitfield »

You can PM me the upgrade.log. While you're doing it, might as well PM me your Profile. You can download it by going to Admin > System Config > System Profile and click the Download Profile button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info).

After you PM the profile/upgrade.log, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

EDIT: info received and shared with techs
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

Re: NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

I sent in the info.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NagiosXI service-hosts setting left empty in file

Post by avandemore »

Do you have a configuration snapshot available from before the upgrade and one from immediately afterwards? I'm speaking of an XI Config snapshot, XI > Configure > CCM > Configuration Snapshots.
Previous Nagios employee
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

Re: NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

Yes I do - but I had to make several changes after the upgrade due to various issues. I suppose a roll-back should be able to properly sort it all out though. I also do not know if this would fix the fact this is happening with new services.

In any case, want me to try to revert to the older configuration?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NagiosXI service-hosts setting left empty in file

Post by avandemore »

Please attach or PM me the pre-upgrade snapshot. In the meantime, please try this and report your result:
XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs > Verify Files > Restart Nagios Core
Older Nagios Versions:
XI > Configure > Core Config Manager > Write Config Files > Delete > Write > Verify > Restart
Previous Nagios employee
pf_nagios
Posts: 18
Joined: Mon Jan 25, 2016 4:34 pm

Re: NagiosXI service-hosts setting left empty in file

Post by pf_nagios »

The oldest snapshot I had is pmed though it is post upgrade. I followed your instructions and as I suspected it created services without host entries. I had to revert to a config snapshot to fix.

See below for output of 'verify' step.



Config File Management
Use this tool to manually manage (write, delete, update) Nagios object configurations physical configuration files.
Note: To manually apply configuration, first use Delete Files and then run Write Configs followed by a verification (optional) and restart to fully apply the configuration.
Write Configs Delete Files Verify Files Restart Nagios Core
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/zultyscdrdb.cfg', starting on line 42)

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
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/zultyscdrdb.cfg', starting on line 42)
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.
Last edited by pf_nagios on Thu Mar 23, 2017 9:14 am, edited 1 time in total.
Locked