Apply Configuration error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Apply Configuration error

Post by Sbergonzi »

I've entered a new plugin (check_TomcatApplication) and running the command at the command prompt and testing via the Nagios UI works fine. I created a new host and service as well to test.

When I put in the command and "Apply Configuration" an error occurs and there doesn't seem to be any monitoring of the new service.

This is the error log, thoughts?

Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config file '/usr/local/nagios/etc/hosts/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/Dev - User LDAP Store.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/10.192.156.116.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/Dev - Tomcat:ceteramfa.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/dev.auth.ceteraqa.com.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/DEV - PBD SW.cfg'...
Processing object config directory '/usr/local/nagios/etc/services'...
Processing object config file '/usr/local/nagios/etc/services/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/services/Dev-Tomcat:ceteramfa.cfg'...
Processing object config file '/usr/local/nagios/etc/services/Dev - User LDAP Store.cfg'...
Processing object config file '/usr/local/nagios/etc/services/10.192.156.116.cfg'...
Processing object config file '/usr/local/nagios/etc/services/dev.auth.ceteraqa.com.cfg'...
Processing object config file '/usr/local/nagios/etc/services/DEV - PBD SW.cfg'...
Error: Invalid max_check_attempts value for host 'Dev - Tomcat:ceteramfa'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/Dev - Tomcat:ceteramfa.cfg', starting on line 14)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Apply Configuration error

Post by tmcdonald »

It looks like you have an invalid max_check_attempts value for host 'Dev - Tomcat:ceteramfa'

Can you add in a valid max_check_attempts value for host 'Dev - Tomcat:ceteramfa'?

I would use a template like 'generic-host' for these things so nothing critical gets missed.
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Apply Configuration error

Post by Sbergonzi »

Let me start from the beginning... should I have done something different in between? I added max attempts and other errors are noted that I'm cleaning up.

1) uploaded the new plugin - ok
2) test the plugin at the command prompt - ok
3) create a new command - ok
4) Nagios UI notes to "Apply Configuration for new changes to take effect." - failed
Applying Configuration
Command submitted for processing...
Waiting for configuration verification.....
Configuration verification failed.
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.

5) created a service - ok
6) 'Test Check Command' - ok
7) Service --- 'Apply Configuration' - failed
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Apply Configuration error

Post by Sbergonzi »

Got it working. I had created a contact as well and had an error about 'No Service/Host commands'. I don't know what that meant so I removed it for now and that entry for the plugin is now showing.

I see that "Apply Configuration" isn't just for one screen, it's for the total amount of changes.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Apply Configuration error

Post by tmcdonald »

Correct - when you run Apply Config it handles all the changes you have made, and they do not take effect until you run Apply Config.

When you get an error like that, you will want to click the "View Latest Config Snapshot" button and the very top-most entry should be in red. Click the diskette icon and you will be able to review what went wrong so that you can correct it. Unfortunately Nagios only shows the first error, so it may take a few times to get it right. As I suggested before, you may want to look into using a template that handles all the defaults for you so you can avoid this in the future.
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Apply Configuration error

Post by Sbergonzi »

thank you!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Apply Configuration error

Post by tmcdonald »

Shall I lock up this thread now?
Former Nagios employee
Sbergonzi
Posts: 127
Joined: Wed Feb 19, 2014 4:21 pm

Re: Apply Configuration error

Post by Sbergonzi »

ok, thank you -
Locked