Hello,
I have inherited responsibility for a Nagios environment and am trying to resolve a number of configuration issues. My first stumbling block is that I would like to bring the env up to date (currently running Nagios XI 5.4.12) but I have discovered that I am unable to revert to previous snapshots, and I am reluctant to do an upgrade without this functionality.
I've tried numerous snapshots but each time receive an error like so:
"An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
Write host configurations ...
Host configuration files successfully written!
Write service configurations ...
Configuration file: dc2-fab-g-1.cfg successfully written!
Service configuration files successfully written!
Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/dc2-fab-g-1.cfg', starting on line 16)
As suggested in other threads, I've tried moving the file in question aside but the file is just recreated once the config is applied again. The config file in question is:
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.10
# Date: 2018-05-24 15:20:56
# 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 {
host_name dc2-fab-g-1
service_description SNMP Traps
use xiwizard_passive_service
check_command check-host-alive!!!!!!!!
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts adm_tsang
_xiwizard passiveobject
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
Any advice much appreciated!
Unable to Restore to Previous Snapshots
Re: Unable to Restore to Previous Snapshots
Have you tried using the "Write Config Files" as described in the KB article below?
https://support.nagios.com/kb/article/n ... d-144.html
Click on the Delete, Write, and Verify buttons (in the exact same order) and see if there are config errors. You would need to fix the errors first under the CCM before applying configuration. Nagios cannot start/restart with config errors.
Have you done any major changes to the system, e.g. hardening the server, modification of the sudoers, etc.?
https://support.nagios.com/kb/article/n ... d-144.html
Click on the Delete, Write, and Verify buttons (in the exact same order) and see if there are config errors. You would need to fix the errors first under the CCM before applying configuration. Nagios cannot start/restart with config errors.
Have you done any major changes to the system, e.g. hardening the server, modification of the sudoers, etc.?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Unable to Restore to Previous Snapshots
Perfect, that worked. Many thanks!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Unable to Restore to Previous Snapshots
Excellent, glad it is resolved. Locking thread