How to Quickly Fix the Configuration Verification Failed Issue in Nagios?

How to Quickly Fix the Configuration Verification Failed Issue in Nagios?

Nagios is a really popular and free IT infrastructure monitoring system. As an admin, you might come across various errors associated with it. One of them is when your configuration verification fails. If you’re facing this error, then here’s the article for you. Find out how to fix this in the quickest time frame possible.

Why Configuration Verfication Fails in Nagios?

Before solving the error, you should know why this error occurs in the first place.

Let’s start with decoding the error message. When you run into this error, you’re going to get the following message:

“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.”

After reading through the message, you’ll realize that the problem has to do with the config files and a few line numbers for the file. But if you inspect the config file in a text editor, the line number doesn’t seem to be associated with the error.

“Error: Service has no hosts and/or service_description (config file ‘/usr/local/nagios/etc/services/centos01.cfg, starting on line 32)”
Here’s how the Apply Configuration works:
  • The new config files are temporarily written to the disk
  • Nagios verification takes place that verify whether the config files are valid
  • The temporary config files are then made permanent
  • Nagios service restarts
The temporary files will be discarded if the verification fails. If you look at the file and notice the line number in it, the temporary files don’t exist.

What to do when Configuration Verification fails?

You can work this error out by following the steps mentioned below:
  • Open the Central Configuration Manager
  • Open the Config File Management by going into Tools
  • Click on the Delete Files button and wait for the “Successfully deleted all Host/Service Config files” message
  • Click on the Write Configs button to see what files are created
  • Finally click on the Verify Files button
Now, connect to your Nagios server using SSH and open the file in any of the text editor you might be using.

Read the error message which includes the problem.

“Service has no hosts and/or service_description (config file ‘/usr/local/nagios/etc/services/centos01.cfg’, starting on line 32)”
You can see that it’s a config of service for centos01.

That’s why there was no host assigned to the service. Update the service in CCM by following the Writer and Verify steps mentioned above. The verification process will succeed after it.

It’s quite a possibility that there will be multiple config errors for different objects. In such cases, you need to repeat the process mentioned above until Verify is successful.

When the verification is successful, go to Quick Tools > Apply Configuration and then click on Apply Configuration button.

So that’s how you fix this error. If problem persists, contact your hosting provider and seek assistance.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma