Page 1 of 2
Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 9:14 am
by mccrakem
Hi
We cannot apply the system configuration
I get the error
Error: Could not find any host matching 'IP ADDRESS' (config file '/usr/local/nagios/etc/services/SERVERFQDN.cfg', starting on line 42)
Error: Failed to expand host list 'IP ADDRESS' for service 'Wayne-labs_SERVERFQDN_Datalake Job Manager - Webspehere Liberty Servers_api_v1_system_ping URL Status' (/usr/local/nagios/etc/services/SERVERFQDN.cfg:42)
I deleted the Services and the hosts for the server mentioned in the error above but even then when I try and apply the config I get the same error
even thou the cfg files for te mentioned server no longer exist
I tried to restore a good config but I was getting the SQL Error
SQL Error [nagiosxi] : ERROR: syntax error at or near "localhost"
LINE 1: ...ios XI','nagiosadmin',4,'User reconfigured host \'localhost\...
So I edited the /var/lib/pgsql/data/postgresql.conf file and changed the following line
from
#standard_conforming_strings =
to
standard_conforming_strings = off
I tried to do a restore but it says at
Configure snapshot restore has been scheduled
It does not change to complete
Thanks
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 9:41 am
by scottwilkerson
Can you go to
CCM -> Tools -> Config File Management
Click Delete Files
Click Write Configs
Click Verify files
If all goes well, Apply Configuration
If you get an error please post the new error
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 9:42 am
by mccrakem
Hi
One other thing I noticed is that if I goto Config File Management
If I verify files the system reports back Blue and
Total Warnings: 158
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
But if I delete the file and then recreate them the sytsem reports back Red
everything says Successfully written apart from this line
Cannot open/overwrite service configuration files (check the permissions)!
ls -l /usr/local/nagios/etc/
Files show with ownership of apache:nagios
ls -l /usr/local/nagios/etc/hosts/
Files show with ownership of apache:apache
ls -l /usr/local/nagios/etc/services/
Files show with ownership of mixed output
some
apache:apache
The others
nagios:nagios
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 9:46 am
by mccrakem
Sorry should have put this information in here as well
about 2 weeks ago nagios was running on version 5.6.14 on redhat 6
I exported that database and imported it into a CentOS7 Server tested it and it worked ok
Then upgraded the software to 5.7.1
The system has been working fine for the last weeks to be best of my knowledge
Thanks
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:05 am
by scottwilkerson
Can I have you run the following from the CLI and show the output
Code: Select all
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:16 am
by mccrakem
Hi
I am running the script at the moment but the output has been the same since I started running it
I even killed the process and restarted the server but it keeps reporting back the same
So I will let it continue and see if it changes
[root@dwylbopngios02 scripts]# ./reconfigure_nagios.sh
--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting Nagios Core corelog.newobjects 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
--------------------------------------
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Just keeps giving the same information
Another reconfigure process is still running, sleeping...
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:19 am
by mccrakem
Sorry it has just finished
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Write host configurations ...<br /><span class="verify-ok">Host configuration files successfully written!</span><br /><br />Write service configurations ...<br>Configuration file: <strong>[u'dummy1.server.com'.cfg</strong> successfully written!<br><span class='urgent'>Cannot open/overwrite service configuration files (check the permissions)!</span><br><span class='successMessage'>Configuration file: <strong>hostgroups.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>servicegroups.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hosttemplates.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>servicetemplates.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>timeperiods.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>commands.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>contacts.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>contactgroups.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>contacttemplates.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>servicedependencies.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostdependencies.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>serviceescalations.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostescalations.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>serviceextinfo.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostextinfo.cfg</strong> successfully written!</span><br>
Writing CCM configuration failed!\n
[root@dwylbopngios02 scripts]#
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:23 am
by scottwilkerson
Ok, lets run the following
Code: Select all
chown apache:nagios /usr/local/nagios/etc/services /usr/local/nagios/etc/hosts
chmod ug+rw /usr/local/nagios/etc/services /usr/local/nagios/etc/hosts
Then this again
Code: Select all
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:30 am
by scottwilkerson
Sorry, forgot the -R
Code: Select all
chown apache:nagios -R /usr/local/nagios/etc/services /usr/local/nagios/etc/hosts
chmod ug+rw -R /usr/local/nagios/etc/services /usr/local/nagios/etc/hosts
Then this again
Code: Select all
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Re: Cannot Apply System Configuration
Posted: Wed Jul 22, 2020 10:36 am
by mccrakem
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Write host configurations ...<br /><span class="verify-ok">Host configuration files successfully written!</span><br /><br />Write service configurations ...<br>Configuration file: <strong>[u'dummy1.server.om'.cfg</strong> successfully written!<br><span class='urgent'>Cannot open/overwrite service configuration files (check the permissions)!</span><br><span class='successMessage'>Configuration file: <strong>hotgroups.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>servicegroups.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuraion file: <strong>hosttemplates.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>servicetemplates.cfg</strong> successfully written!</span><br><span class'successMessage'>Configuration file: <strong>timeperiods.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>commands.cfg</strong> successfully written!</spa><br><span class='successMessage'>Configuration file: <strong>contacts.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>contactgroups.cfg</strong> successully written!</span><br><span class='successMessage'>Configuration file: <strong>contacttemplates.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>serviceependencies.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostdependencies.cfg</strong> successfully written!</span><br><span class='successMessage'>Cofiguration file: <strong>serviceescalations.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostescalations.cfg</strong> successfully written!</span><br>span class='successMessage'>Configuration file: <strong>serviceextinfo.cfg</strong> successfully written!</span><br><span class='successMessage'>Configuration file: <strong>hostextinfo.cfg</strong> successfuly written!</span><br>
Writing CCM configuration failed!\n