Page 1 of 2

NAgios Database error now cannot apply configuration

Posted: Tue Jan 20, 2015 4:06 pm
by FLCUISIT
HI,

We had a VMware failure which brought down several servers including our NagiosXI Server. After repairing the MySQL database with /usr/local/nagiosxi/scripts/repairmysql.sh Nagios then restarting the server,
Nagios was working. However we had a monitored server begin to report services as critical. After a few checks I decided to delete and recreate the Windows host and service in configuration wizard. After which the configuration will nto apply and reports an error on the host that it is missing:
error is
Error: Invalid max_check_attempts value for host 'xxxxxx.xxxx.xxxx'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/xxxxxxx.xxxx.xxxx.cfg', starting on line 16)

Deleted the server completely and checked that it is missing from the \hosts directory I still get the failure to apply the configuration message indicating an invalid setting on the deleted server.

A restore of an older configuration snapshot does not appear to correct this issue


System:
Nagios XI Version : 2014R2.3
localhost.localdomain 2.6.18-164.9.1.el5 i686
CentOS release 5.4 (Final)
Gnome is not installed

Apache Information
PHP Version: 5.1.6
Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Server Port: 80
Thanks
Tom

Re: NAgios Database error now cannot apply configuration

Posted: Tue Jan 20, 2015 4:14 pm
by tmcdonald
Please run the following as root and show us the output:

Code: Select all

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

Re: NAgios Database error now cannot apply configuration

Posted: Tue Jan 20, 2015 4:35 pm
by FLCUISIT
[root@localhost scripts]# ./reconfigure_nagios.sh | tail -20
--2015-01-20 16:34:15-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

[ <=> ] 10,633 --.-K/s in 0.02s

2015-01-20 16:34:16 (659 KB/s) - `nagiosql.login' saved [10633]

--2015-01-20 16:34:18-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

[ <=> ] 10,633 --.-K/s in 0.02s

2015-01-20 16:34:18 (664 KB/s) - `nagiosql.login' saved [10633]

--2015-01-20 16:34:19-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.export.monitoring'

[ <=> ] 13,523 10.2K/s in 1.3s

2015-01-20 16:34:21 (10.2 KB/s) - `nagiosql.export.monitoring' saved [13523]

>>> /etc/sudoers: syntax error near line 97 <<<
>>> /etc/sudoers: syntax error near line 98 <<<
>>> /etc/sudoers: syntax error near line 100 <<<
>>> /etc/sudoers: syntax error near line 102 <<<
sudo: parse error in /etc/sudoers near line 97
sudo: no valid sudoers sources found, quitting
Checked 8 contacts.
Checked 2 contact groups.
Checked 121 commands.
Checked 22 time periods.
Checked 0 host escalations.
Checked 6 service escalations.
Checking for circular paths...
Checked 171 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 22 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0

Re: NAgios Database error now cannot apply configuration

Posted: Tue Jan 20, 2015 4:41 pm
by tgriep
Could you run these commands and post the output?

Code: Select all

cat /etc/sudoers
ll /etc/sudoers.d

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 9:34 am
by FLCUISIT
[root@localhost ~]# ll /etc/sudoers.dls: /etc/sudoers.d: No such file or directory


## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhap using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias FILESERVERS = fs1, fs2

# Host_Alias MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem


## Command Aliases
## These are groups of related commands...

## Networking
Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

## Updating the locate database
Cmnd_Alias LOCATE = /usr/bin/updatedb

## Storage
Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
Cmnd_Alias DRIVERS = /sbin/modprobe

# Defaults specification

#
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
# You have to run "ssh -t hostname sudo <cmd>".
#
###########################Defaults requiretty

Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
_XKB_CHARSET XAUTHORITY"

## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL

## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users localhost=/sbin/shutdown -h now

####################################################################
####################################################################


# Nagios Core

# NDO2DB

# PNP




User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 11:47 am
by lmiltchev
Run the Write Config Tool again, and show us a screenshot in case you have any errors:

CCM->Tools->Write Config Tools->Write (check the output for errors)->Verify (check the output for errors)

Also, run the following commands and show us the output:

Code: Select all

tail -20 /var/log/mysqld.log
df -h
df -i

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 1:12 pm
by FLCUISIT
No errors on this write

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'FC Training Room Fibre Uplink GE' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 898)
Warning: Duplicate definition found for service 'FC Training Rm Wireless Access Point APTR swx-0/40' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 862)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/8' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 808)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/7' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 772)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/6' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 736)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/5' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 700)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/4' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 664)
Warning: Duplicate definition found for service 'FC Training Rm Windows VDI swx-0/3' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 628)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/19' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 538)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/18' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 502)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/17' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 466)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/16' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 430)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/15' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 394)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/14' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 358)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/13' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 322)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI swx-0/11' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 268)
Warning: Duplicate definition found for service 'FC Training Rm Middle VDI' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 232)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen VDI swx-0/27' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 196)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen VDI swx-0/26' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 160)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen VDI swx-0/25' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 124)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen VDI swx-0/23' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 88)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen VDI swx-0/22' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 52)
Warning: Duplicate definition found for service 'FC Training Rm Kitchen Back Wall Polycom swx-0/34' on host 'FC_TrainingRmSwitchA' (config file '/usr/local/nagios/etc/services/FC_TrainingRmSwitchA.cfg', starting on line 16)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1898 services.
Checked 171 hosts.
Checked 8 host groups.
Checked 9 service groups.
Checked 8 contacts.
Checked 2 contact groups.
Checked 121 commands.
Checked 22 time periods.
Checked 0 host escalations.
Checked 6 service escalations.
Checking for circular paths...
Checked 171 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 22 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 1:14 pm
by FLCUISIT
[root@localhost etc]# tail -20 /var/log/mysqld.log
150120 15:26:24 [Note] /usr/libexec/mysqld: Normal shutdown

150120 15:26:26 InnoDB: Starting shutdown...
150120 15:26:27 InnoDB: Shutdown completed; log sequence number 0 43655
150120 15:26:27 [Note] /usr/libexec/mysqld: Shutdown complete

150120 15:26:27 mysqld ended

150120 15:30:38 mysqld started
150120 15:30:38 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
150120 15:30:38 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
150120 15:30:39 InnoDB: Started; log sequence number 0 43655
150120 15:30:39 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
150121 02:51:13 mysqld started
150121 2:51:14 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
150121 2:51:14 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
150121 2:51:14 InnoDB: Started; log sequence number 0 43655
150121 2:51:14 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[root@localhost etc]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
23G 16G 5.5G 74% /
/dev/sda1 99M 18M 76M 20% /boot
tmpfs 1.5G 0 1.5G 0% /dev/shm
[root@localhost etc]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/VolGroup00-LogVol00
5996544 135014 5861530 3% /
/dev/sda1 26104 41 26063 1% /boot
tmpfs 219857 1 219856 1% /dev/shm
[root@localhost etc]#

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 2:05 pm
by tgriep
Lets try this.

Go to the Core Config Manager
Under "Tools", click "Write Config Files"
Click the "Delete" button then click the "Write" button and then the "Verify" button
Click Apply Configuration and click the "Apply Configuration" button

If this still fails, open a support ticket by emailing [email protected] and include your system Profile.

To send us your system profile
Click "Admin"
Under "System Config", click "System Profile"
Click the "Download Profile" button
Save the file and email it back to us.

Re: NAgios Database error now cannot apply configuration

Posted: Wed Jan 21, 2015 3:03 pm
by FLCUISIT
same errors - I will send a support email