Unable to Restore to Previous Snapshots

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ginfra
Posts: 4
Joined: Thu May 17, 2018 3:27 am

Unable to Restore to Previous Snapshots

Post by ginfra »

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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to Restore to Previous Snapshots

Post by lmiltchev »

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.?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ginfra
Posts: 4
Joined: Thu May 17, 2018 3:27 am

Re: Unable to Restore to Previous Snapshots

Post by ginfra »

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

Post by scottwilkerson »

Excellent, glad it is resolved. Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked