Error trying to apply configuration
Error trying to apply configuration
I am running into an issue where we are unable to apply configuration. I have been unable to track down the service causing the issue.
This is the error received: Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/LKOISVNAVXSTOR2.cfg', starting on line 33)
And the contents of that config file:
Removed data
This is the error received: Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/LKOISVNAVXSTOR2.cfg', starting on line 33)
And the contents of that config file:
Removed data
Re: Error trying to apply configuration
Do you see the same error if you use the "Config File Management" tool? Go to CCM > Tools > Config File Management, click on "Delete Files", "Write Configs", "Verify Files" (in this exact order), and show the output after each click.
Go to CCM > Configuration Snapshots, download the latest FAILED snapshot, colored in red (both, the tarball and the text output file), and PM it to me or any other member of the Nagios Support team.
Go to CCM > Configuration Snapshots, download the latest FAILED snapshot, colored in red (both, the tarball and the text output file), and PM it to me or any other member of the Nagios Support team.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Error trying to apply configuration
Info you requested is below. On the config snapshots it does not appear to be updating them. I have a successful config on 5-10-2018 but all of the failed ones are from 2 months back. I am not sure if it has any bearing but this server was recently built and had the installation restored from an older server. As part of the process we also switched from using the old Postgres to Marina.
Delete output:
Successfully deleted all Host / Service Config Files
Write Configs: too many to add them all
Configuration file: xxxxxx.cfg successfully written!
Verify:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT04' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT03' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT02' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT01' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT04' (config file '/usr/local/nagios/etc/services/yyyy.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT03' (config file '/usr/local/nagios/etc/services/yyyy.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT02' (config file '/usr/local/nagios/etc/services/zzzz.cfg', starting on line 33)
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 1867 services.
Warning: Host 'xxxxxx' has no default contacts or contactgroups defined!
Checked 248 hosts.
Checked 6 host groups.
Checked 30 service groups.
Checked 19 contacts.
Checked 5 contact groups.
Checked 144 commands.
Checked 30 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 248 hosts
Checked 0 service dependencies
Checked 42 host dependencies
Checked 30 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 1
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Delete output:
Successfully deleted all Host / Service Config Files
Write Configs: too many to add them all
Configuration file: xxxxxx.cfg successfully written!
Verify:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT04' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT03' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT02' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'CLTITVMEDIANT01' (config file '/usr/local/nagios/etc/services/xxxx.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT04' (config file '/usr/local/nagios/etc/services/yyyy.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT03' (config file '/usr/local/nagios/etc/services/yyyy.cfg', starting on line 33)
Warning: Duplicate definition found for service 'SNMP Traps' on host 'ATLITVMEDIANT02' (config file '/usr/local/nagios/etc/services/zzzz.cfg', starting on line 33)
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 1867 services.
Warning: Host 'xxxxxx' has no default contacts or contactgroups defined!
Checked 248 hosts.
Checked 6 host groups.
Checked 30 service groups.
Checked 19 contacts.
Checked 5 contact groups.
Checked 144 commands.
Checked 30 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 248 hosts
Checked 0 service dependencies
Checked 42 host dependencies
Checked 30 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 1
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Error trying to apply configuration
@dshearon, Could you upload the objects.cache file? It can be found in:
Code: Select all
/usr/local/nagios/var/objects.cacheAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Error trying to apply configuration
Can you run this command as root and post the output?
When you migrated the data to the new server, maybe this table did not get restored fully and that could cause the issue you are having as well.
Code: Select all
echo 'desc tbl_lnkServiceToHost;' |mysql -t -u root -pnagiosxi nagiosql Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Error trying to apply configuration
tgriep wrote:Can you run this command as root and post the output?When you migrated the data to the new server, maybe this table did not get restored fully and that could cause the issue you are having as well.Code: Select all
echo 'desc tbl_lnkServiceToHost;' |mysql -t -u root -pnagiosxi nagiosql
Here is the output from that command. Also, thank you for your time and help with this.
nagiosxi nagiosql
+----------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| idMaster | int(11) | NO | PRI | NULL | |
| idSlave | int(11) | NO | PRI | NULL | |
| exclude | tinyint(1) | NO | | NULL | |
+----------+------------+------+-----+---------+-------+
Re: Error trying to apply configuration
Thanks, the table looks correct so that is not it.
Please run these commands on the server and post the output.
Please run these commands on the server and post the output.
Code: Select all
cd /usr/local/nagiosxi/scripts
su - nagios
./reconfigure_nagios.shBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Error trying to apply configuration
I did also confirm that config snapshots are not getting written. I copied the existing snapshots off to another server and deleted everything on the server in question. Tried to apply configuration again and it gave the error but did not write any file to the directory.
Re: Error trying to apply configuration
Here is the ouputtgriep wrote:Thanks, the table looks correct so that is not it.
Please run these commands on the server and post the output.Code: Select all
cd /usr/local/nagiosxi/scripts su - nagios ./reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.login--2018-05-11 13:30:08-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by ‘’:
Unable to locally verify the issuer's authority.
WARNING: no certificate subject alternative name matches
requested host name ‘localhost’.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’
[ <=> ] 28,121 --.-K/s in 0.01s
2018-05-11 13:30:09 (2.57 MB/s) - ‘nagiosql.login’ saved [28121]
LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: https://localhost/nagiosxi/includes/components/ccm/
Array
(
[0] => Internal Log Server Alerts.cfg
[1] => LKOISVNAVXSTOR2.cfg
)
IMPORTING /usr/local/nagios/etc/import/Alerts.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=admin&type=import&importsubmitted=true&chbOverwrite=1&subForm=Import&selImportFile[]=/usr/local/nagios/etc/import/Alerts.cfg' -O nagiosql.import.monitoring
--2018-05-11 13:30:09-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by ‘’:
Unable to locally verify the issuer's authority.
WARNING: no certificate subject alternative name matches
requested host name ‘localhost’.
HTTP request sent, awaiting response... 500 Internal Server Error
2018-05-11 13:30:09 ERROR 500: Internal Server Error.
ERROR: Could not import file /usr/local/nagios/etc/import/Alerts.cfg.
NAGIOSQL IMPORT FAILED!
Re: Error trying to apply configuration
Try this, backup all of the files in the /usr/local/nagios/etc/import folder then delete them.
Run the reconfigure again to see if it passes.
If it does, go in to the XI GUI and see if the Apply Config passes.
If not, try this procedure.
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 the click 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.
Then we would have to see the files that were in the /usr/local/nagios/etc/import folder so we can see why they caused the error.
Run the reconfigure again to see if it passes.
Code: Select all
cd /usr/local/nagiosxi/scripts
su - nagios
./reconfigure_nagios.shIf not, try this procedure.
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 the click 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.
Then we would have to see the files that were in the /usr/local/nagios/etc/import folder so we can see why they caused the error.
Be sure to check out our Knowledgebase for helpful articles and solutions!