We have a manual install of 5.5.2 running on RHEL6. It is a few years old and we continually keep it up to date. I've been using the bulk cloning wizard to add new hosts over the years and it has worked flawlessly until this month. Recently I went to follow my usual procedure to add a few new hosts (we have about 150) and it fails every single time now when writing/verifying the config at the end.
The failures change. Sometimes it's the service file, sometimes it's the host file:
Nagios Core 4.4.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-06-25
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Invalid max_check_attempts value for host 'host281.fqdn.com'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/host281.fqdn.com.cfg', starting on line 16)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
or
Error: Service description, host name, or check command is NULL
Error: Could not register service (config file '/usr/local/nagios/etc/services/host281.fqdn.com.cfg', starting on line 16)
Error processing object config files!
I went and looked at the config files and I can see it wrote the new ones, but as it mentioned the configs are bare bones and missing most of the options as compared with the hosts that I am copying. Doesn't matter which host I choose.
Any assistance would be appreciated.
Bulk Host Cloning wizard no longer functioning
Re: Bulk Host Cloning wizard no longer functioning
Can you give us an example host definition of the object that you are trying to clone? Do you have any config errors at the moment, other words, can you successfully apply configuration?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Bulk Host Cloning wizard no longer functioning
Applying a config works successfully always. It only breaks after the clone, which I then have to revert back to the previous version to have it apply successfully. In other words, the clone is putting down incomplete configs that do not pass a sanity check. It does NOT matter which host I clone, the same thing happens to all of them.
For example, if I clone usmdclxp00381 from usmdclxu00281 (FQDN removed for this post)
Reading configuration data...
Read main config file okay...
Error: Service description, host name, or check command is NULL
Error: Could not register service (config file '/usr/local/nagios/etc/services/usmdclxu00281.cfg', starting on line 16)
Error processing object config files!
Original usmdclxp00381 service file:
[root@useomlxd00017 dhalik]# cat /usr/local/nagios/etc/services/usmdclxp00381.cfg
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.10
# Date: 2017-11-09 14:30:29
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name usmdclxp00381
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /'
max_check_attempts 5
check_interval 30
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 1440
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts candriescu,dhalik
contact_groups admins
_xiwizard linux-server
register 1
}
define service {
host_name usmdclxp00381
service_description /data Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /data'!!!!!!
max_check_attempts 5
check_interval 30
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 1440
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts candriescu,dhalik
contact_groups admins
_xiwizard linux-server
register 1
}
-----------TRUNCATED------------
Here's what the clone script is putting down and why it fails the check:
[root@useomlxd00017 dhalik]# cat /usr/local/nagios/etc/services/usmdclxu00281.cfg
###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 2.7.0
# Date: 2018-08-27 11:03:45
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name usmdclxu00281
service_description / Disk Usage
register 1
}
define service {
host_name usmdclxu00281
service_description /data Disk Usage
register 1
}
------TRUNCATED------
As you can see it's not filling out ANY of the options.
For example, if I clone usmdclxp00381 from usmdclxu00281 (FQDN removed for this post)
Reading configuration data...
Read main config file okay...
Error: Service description, host name, or check command is NULL
Error: Could not register service (config file '/usr/local/nagios/etc/services/usmdclxu00281.cfg', starting on line 16)
Error processing object config files!
Original usmdclxp00381 service file:
[root@useomlxd00017 dhalik]# cat /usr/local/nagios/etc/services/usmdclxp00381.cfg
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.10
# Date: 2017-11-09 14:30:29
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name usmdclxp00381
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /'
max_check_attempts 5
check_interval 30
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 1440
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts candriescu,dhalik
contact_groups admins
_xiwizard linux-server
register 1
}
define service {
host_name usmdclxp00381
service_description /data Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /data'!!!!!!
max_check_attempts 5
check_interval 30
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 1440
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts candriescu,dhalik
contact_groups admins
_xiwizard linux-server
register 1
}
-----------TRUNCATED------------
Here's what the clone script is putting down and why it fails the check:
[root@useomlxd00017 dhalik]# cat /usr/local/nagios/etc/services/usmdclxu00281.cfg
###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 2.7.0
# Date: 2018-08-27 11:03:45
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name usmdclxu00281
service_description / Disk Usage
register 1
}
define service {
host_name usmdclxu00281
service_description /data Disk Usage
register 1
}
------TRUNCATED------
As you can see it's not filling out ANY of the options.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Bulk Host Cloning wizard no longer functioning
This is a know issue, but here's how to fix it.
Remove any un-applyable items.
Go to CCM -> Tools -> Config File Management
Delete Files
Write Files
Now the Bulk Import Wizard should work properly to add new items.
Remove any un-applyable items.
Go to CCM -> Tools -> Config File Management
Delete Files
Write Files
Now the Bulk Import Wizard should work properly to add new items.
Re: Bulk Host Cloning wizard no longer functioning
The workaround fixed it. Works great now, thank you!