×


Configuration File Is Out Of Date in Nagios

Sometimes, Website Administrators experiences Nagios error message in CCM "Configuration File Is Out Of Date" in the process of applying configuration changes.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix Windows related errors.
In this context we shall look into how to fix CentOS related issues.

What triggers Nagios error "Configuration File Is Out Of Date"?

As earlier stated, in some cases while applying configuration changes , it completes successfully and the changes are visible in the XI interface. However, you may still see an error message in the CCM that as given below:

Configuration File Is Out Of Date

The most common reason behind this error message is an incorrect configuration of the system time.
For all the features to work as intended, we will need to configure Nagios XI with the correct timezone.

How to fix Nagios error "Configuration File Is Out Of Date"?

To configure Nagios XI with the correct timezone, we will need to navigate to the system configuration option.
For the versions from XI 5 onwards, navigate to Admin > System Config > System Settings.

For the versions Pre XI 5, navigate to Admin > System Config > Manage System Config.

Timezone Configuration Using Nagios XI GUI

Once in the configuration section, find the Timezone Settings section (on the General tab). From the Timezone drop down list select the respective timezone and click the Update Settings button.

Once you click Update Settings the screen will refresh and will display System settings updated at the top of the screen.
Setting the System Timezone

Next step is to set the system time zone correctly. The steps for changing the system timezone are different depending on the operating system and version.

First, establish a terminal session to the Nagios XI server as a user with root privileges.

We shall now have a look at the steps to be followed for each operating system one by one. Note to replace "America/Los_Angeles" in the examples with your respective timezone and country.

For RHEL 6|CentOS 6|Oracle Linux 6

The default timezone files for a Linux Operating System are located at:

/usr/share/zoneinfo/

The current and working system’s time zone file is located at /etc/localtime and must be replaced with our zoneinfo.

# cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

We will also need to set the ZONE directive in /etc/sysconfig/clock. Open the file with any available text editor. Now, change or add the following line within the timezone:

ZONE="America/Los_Angeles"

Save the changes once finished.

RHEL 7|CentOS 7|Oracle Linux 7

We can use the timedatectl command to configure the timezone. To display a list of available timezones use the following command:

# timedatectl list-timezones

The timezones are listed by country/city and include daylight savings time adjustments.

Then, we can use the timedatectl command to configure the timezone:

# timedatectl set-timezone America/Los_Angeles

For Debian|Ubuntu

We can use the dpkg-reconfigure command to configure the timezone. Use the following command to set the timezone:

# dpkg-reconfigure tzdata

Select the appropriate region and this completes the required steps.


Checking The System Date/Time

Now that all the timezone information is set, check the XI system time by executing the following command:

# date

If the timezone is correct, but the date and/or time are incorrect, set the proper time using date:

# date MMDDhhmmCCYY

Where MM is month, DD is day, hh is hour, mm is minute, and CCYY is the year.


How to Sync the system clock with NTP?

NTP (network time protocol) syncs the system clock to a remote server, can help reduce or eliminate clock skew. We can install ntp with the following commands:

For RHEL|CentOS|Oracle Linux:

# yum install ntp -y

For Debian|Ubuntu:

# apt-get install -y ntp ntpdate


Now, configure ntp to start at system boot and update the system clock:

For RHEL 6|CentOS 6|Oracle Linux 6, execute;

# chkconfig ntpd on
# service ntpd stop
# ntpdate pool.ntp.org
# service ntpd start


For RHEL 7|CentOS 7|Oracle Linux 7, execute;

# systemctl enable ntpd
# systemctl stop ntpd
# ntpdate pool.ntp.org
# systemctl start ntpd


For Ubuntu 14, execute;

# update-rc.d ntp defaults
# service ntp stop
# ntpdate pool.ntp.org
# service ntp start


For Debian|Ubuntu 16/18, execute;

# systemctl enable ntp
# systemctl stop ntp
# ntpdate pool.ntp.org
# systemctl start ntp


After executing the commands, the system should now be in sync with an external time source.

[Need urgent support in fixing Nagios errors? – We are available 24*7]


Conclusion

This article will guide you on the different methods to fix Nagios error "Configuration File Is Out Of Date" in CCM after applying configuration changes in Nagios due to incorrect configuration of system time.