Page 1 of 1
Configuration changes not reflecting
Posted: Tue May 12, 2020 11:33 am
by ets_user
Hi,
We tried to add a new Host and did Apply configuration in NagiosXI 5.5.6.
It running for longtime but still not completed with below message.
Apply Configuration
Waiting for configuration verification......................................................................................................................
Pls advise.
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 2:12 pm
by tgriep
First, increase the timeout for when the nagios process restarts when an Apply Config is ran.
Edit the file of /etc/init.d/nagios and find this line:
Code: Select all
for i in 1 2 3 4 5 6 7 8 9 10 ; do
Change it to:
This changes the timeout to 90 seconds.
Run these commands to stop the processes, clean and repair the SQL database and to restart the processes. Run them all as root.
Code: Select all
service npcd stop
service nagios stop
service ndo2db stop
service crond stop
pkill -9 -u nagios
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi nagiosxi
mysqlcheck -f -r -u root -pnagiosxi --all-databases --use-frm
service mysqld restart
rm -f /usr/local/nagios/var/rw/nagios.cmd
rm -f /usr/local/nagios/var/nagios.lock
rm -f /var/run/nagios.lock
rm -f /usr/local/nagios/var/ndo.sock
rm -f /usr/local/nagios/var/ndo2db.lock
rm -f /var/lib/mrtg/mrtg_l
rm -f /usr/local/nagiosxi/var/*.lock
for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
pkill python
service httpd restart
service ndo2db start
service nagios start
service npcd start
service crond start
Then follow this procedure to make sure there are not any configuration errors.
Login to the XI GUI and go to the Core Config Manager
Under "Tools", click "Write Config Files" or if you are running a newer versions of XI, The menu is called "Config File Management"
Click on the "Write" button, then the "Delete" button then click the "Write" button and then the "Verify" button.
If you get any errors, resolve them and click on the "Delete" button, "Write", "Verify" until all of the errors are resolved.
Click the Apply Configuration link and click the "Apply Configuration" button after ALL of the errors are resolved.
Let us know if this resolved the Apply Config not finishing.
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 3:15 pm
by ets_user
Still the same issue exists.
But i would like to clarify on the below.
We have used offline installation so it used mariaDB instead of mySQL right?
In that case do we need to start mysqld service?
It means mariaDB internally calls mysqld. Pls clarify.
I am asking this because we are getting below error.
[root@server~]# systemctl start mysqld
Failed to start mysqld.service: Unit not found.
Thanks.
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 3:57 pm
by tgriep
What determines if the server is running mysql or mariadb is on newer releases, like Centos 7 or Redhat 7 or greater, they are running mariadb.
Since we do not know what release you are running, I use the older command but you can replace it with this.
Can you login to the XI server as root and run this command,
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Then login to the XI GUI and Apply the configuration and post the output of the tail command so we can check it for any errors.
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 4:05 pm
by ets_user
Thanks.
Does that mean old versions use mysql and new version of OS uses mariadb?
I was in a thought that online installation with xi-latest.tar will use mysql and offline installation of NagiosXI using rpm tarballs uses mariadb..is that wrong understanding?
I did mariadb restart and its fine.
And below is the logs for your reference while Applying configuration.
Code: Select all
[root@server~]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
.. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
PROCESSED 0 COMMANDS
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
......................PROCESSING COMMAND ID 47...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
No entry for terminal type "unknown";
using dumb terminal settings.
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
No files to import
--------------------------------------
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Finished writing out configuraton
--------------------------------------
--------------------------------------
> Verifying configuration with Nagios Core
> Output:
Nagios Core 4.4.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-08-16
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 2125 services.
Warning: Host 'li-ims1' has no default contacts or contactgroups defined!
Warning: Host 'localhost' has no default contacts or contactgroups defined!
Checked 27 hosts.
Checked 4 host groups.
Checked 4 service groups.
Checked 18 contacts.
Checked 5 contact groups.
Checked 131 commands.
Checked 22 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 27 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: 2
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
> Return Code: 0
--------------------------------------
OUTPUT=--------------------------------------
RETURNCODE=0
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/ccm/ccm.inc.php on line 739
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
.^C
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 4:31 pm
by tgriep
This question
Does that mean old versions use mysql and new version of OS uses mariadb?
Is yes.
The XI offline install does not come with either MYSQL or MariaDB in the file, those are determined by the OS and not how XI is installed.
The output shows that you have an issue with the nagiosxi database.
Open a root shell in the Nagios server and run the following commands. Get the /tmp/info.txt file and upload it to the ticket.
Code: Select all
mysql -u root -pnagiosxi -e "show global status like '%used_connections%'; show variables like 'max_connections';" >/tmp/info.txt
echo "SELECT table_schema as 'Database', table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC;" |mysql -t -u root -pnagiosxi >>/tmp/info.txt
grep dbtype /usr/local/nagiosxi/html/config.inc.php >>/tmp/info.txt
df -h >>/tmp/info.txt
df -i >>/tmp/info.txt
Thanks.
Re: Configuration changes not reflecting
Posted: Tue May 12, 2020 4:36 pm
by ets_user
Thanks for the info.
Please find attached the logs.
Re: Configuration changes not reflecting
Posted: Wed May 13, 2020 12:50 pm
by tgriep
Could you post or PM me your Nagios XI System Profile so we can review it?
To get your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it to the forum post or PM it to me.
Re: Configuration changes not reflecting
Posted: Wed May 13, 2020 3:16 pm
by ets_user
I tried to download but getting below error.
PROFILE BUILD FAILED
Array
(
)
CODE: 1
Re: Configuration changes not reflecting
Posted: Wed May 13, 2020 3:30 pm
by tgriep
The Profile Build Failure is typically caused by a missing or misconfigured entry in the /etc/sudoers file.
The following article has instructions to update the sudoers file and that should fix the Profile download issue.
https://support.nagios.com/kb/article/n ... d-533.html
If the above does not fix the issue, the other cause is the nagios user account may be expired or not in the correct unix group.
Run the following to show the details on the nagios user account. Post it here.
Code: Select all
chage -l nagios
grep nag /etc/group