Page 1 of 2

NagiosXI does not save changes

Posted: Mon Nov 10, 2014 9:41 am
by RockerMan
I moved to a new server nagiosxi. Upgrade to Nagios XI 2014R1.5 NagiosXI and Nagios Core to 4.0.8. Modify some entries in the host or service, no matter where, anywhere. Then do this after changing - Apply Configuration - and get this result:
-
Applying Configuration
-
Command submitted for processing....... green icon
Waiting for configuration verification....... red icon
Configuration verification failed........ red icon
-
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.
-
View a snapshot of this configuration error
-
Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
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: Invalid max_check_attempts value for host 'coswitch'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/coswitch.cfg', starting on line 16)
---

coswitch.cfg file in the specified path does not exist in the system. Tries to create a file with that name means nagios, it is removed, but this is a mistake.
Please help fix this error, because it is necessary to introduce new hosts and change the old hosts and services, but nothing is saved. All the changes is a mistake on this file coswitch.cfg.

Best Regards,
Valery

Re: NagiosXI does not save changes

Posted: Mon Nov 10, 2014 10:54 am
by slansing
It's probably not being completely created when your apply config fails, you need to make edits in the CCM, look for that object in the CCM and make your corrections there.

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 4:31 am
by RockerMan
I'm the one doing. I go to the CCM: Configure - Core Config Manager - Hosts - Add New (eg add a new host). Fill in the fields - Host Name - Description - Address - Manage Templates (generic host) - Check command(check-host-alive), note "Active" - Save, click on "Apply configuration", added host appears in the list of hosts. Doing the same procedures in the Services, the command is the same - check-host-alive(simple ping). Adding a service to the new host appears in the list of Services. And in the list of hosts and services in the list of new host and service are marked as "Applied". Then add the host to the screen monitor - Configure - Core Config Manager - Host Groups - select groups (eg regional servers) - Edit - Manage Hosts - selected in the newly added host - Add Selected - Close - Save - Apply Configuration. The host appears in the list of hosts-groups, but the screen monitor in this group it is not, and there is no pending. Thus every time I press on "Apply configuration" goes error
-
Error: Invalid host object directive 'address>'.
Error: Could not add object property in file '/usr/local/nagios/etc/hosts/coswitch.cfg' on line 27.
-
although the changes are saved, except for the emergence of a host on the monitoring screen.

As I wrote, this file system is not and never did, and the host with the same name is not in the monitor. Manually create it fails to copy a file with the same name also does not work - every time Nagios deletes the file, but he says that he can not write to this file.

Edit: Hmm, after restart nagios added host appeared on the screen monitor in the selected group, but said the error still remains. Previously, no reboot required after adding nagios host, he will automatically appear in the right place. I'm quite confused now as, after each change restart nagios? Not sure it is correct.

An interesting observation: On the server from which migrated to the new, each press of the "Apply Configuration" restartable nagios in Event log can be seen that process. After moving to a new server, pressing "Apply Configuration" does not lead to a process restart nagios.

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 6:23 am
by Box293
Go into CCM
Tools > Write Config Files
Click the Delete button
It will say "Successfully deleted all Host / Service Config Files"
Click the Write Button
It will show an output of all the files it creates
Click the Verify button
The output should end with "Total Errors: 0"
Quick Tools > Apply Configuration
Click the Apply Configuration button

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 6:57 am
by RockerMan
It did not help, the same error after "Apply Configuration" that the message in the screenshot above. I will continue to dig.

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 7:06 am
by Box293
You may have a corrupt database, follow this document:
http://assets.nagios.com/downloads/nagi ... tabase.pdf

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 7:31 am
by RockerMan
It is unlikely that the database or table is broken. New hosts and services through a manual restart nagios added. Check and reply later.

Re: NagiosXI does not save changes

Posted: Tue Nov 11, 2014 12:38 pm
by lmiltchev
It did not help, the same error after "Apply Configuration" that the message in the screenshot above. I will continue to dig.
Nagios cannot start or restart with config errors. Can you show us the "coswitch.cfg"?
CCM->Hosts->...->View Text Config

Re: NagiosXI does not save changes

Posted: Wed Nov 12, 2014 3:24 am
by RockerMan
Box293 wrote:You may have a corrupt database, follow this document:
http://assets.nagios.com/downloads/nagi ... tabase.pdf
Hi

With bases all right. Launched mysqlcheck got on all tables in all databases OK.
-
# mysqlcheck -A -uroot -p*** | more

Re: NagiosXI does not save changes

Posted: Wed Nov 12, 2014 3:58 am
by RockerMan
lmiltchev wrote:
It did not help, the same error after "Apply Configuration" that the message in the screenshot above. I will continue to dig.
Nagios cannot start or restart with config errors. Can you show us the "coswitch.cfg"?
CCM->Hosts->...->View Text Config
Hi

Ok. Who gives an error on another file. Show file coswitch.cfg I still could not, it is not and was never in the system.
Now there is a bug in an existing file
-
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Sw_Pr8_2Fl_Core.cfg', starting on line 16)

Here are the contents of the file
---
###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.2.3
# Date: 2014-11-12 12:35:02
# 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 host {
host_name Sw_Pr8_2Fl_Core
use generic-sms-host
alias Sw_Pr8_2Fl_Core
address 10.10.31.104
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

Here are the contents of the file on the old server from which the imported database. They are identical.
---
###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-11-12 11:35:39
# 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 host {
host_name Sw_Pr8_2Fl_Core
use generic-sms-host
alias Sw_Pr8_2Fl_Core
address 10.10.31.104
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
-

16th row here this
-
define service {

PS
On the web screen shows an error after "Apply Configuration", but after restart the CLI proceeding normally. See the screenshots.