It appears that something is jacked! I try to apply my configuration, and it tells me:
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.
Error: Host 'Switch1_DV3' cannot be a child/parent of itself
Error: Could not add parent host 'Switch1_DV3' to host (config file '/usr/local/nagios/etc/hosts/Switch1_DV3.cfg', starting on line 16)
However, I can't find any such file Switch1_DV3.cfg, nor is there a host configured with that name. I have tried following instructions for Delete Files/Write Configs/Verify Files and that seems to go fine.
But I am still stuck at Apply Configuration. Any help would be greatly appreciated.
Running Nagios XI 5.6.5 according to my GUI
Unable to apply configuration-Host cannot be a child/parent
-
briangmoore
- Posts: 6
- Joined: Fri Aug 16, 2019 9:25 am
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Unable to apply configuration-Host cannot be a child/par
Can you go to CCM -> Hosts
search for Switch1_DV3
Do you see it?
If not, lets run the following from the CLI and post output
search for Switch1_DV3
Do you see it?
If not, lets run the following from the CLI and post output
Code: Select all
ls -al /usr/local/nagios/etc/import
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh-
briangmoore
- Posts: 6
- Joined: Fri Aug 16, 2019 9:25 am
Re: Unable to apply configuration-Host cannot be a child/par
No, I do not see it there. I can find no reference of it anywhere in fact.
-
briangmoore
- Posts: 6
- Joined: Fri Aug 16, 2019 9:25 am
Re: Unable to apply configuration-Host cannot be a child/par
Sorry didn't get the results added. Here they are:
[root@nagios static]# ls -al /usr/local/nagios/etc/import
total 20
drwxrwxr-x 2 apache nagios 4096 Aug 16 09:47 .
drwxrwxr-x 7 apache nagios 4096 Aug 16 09:47 ..
-rw-rw-r-- 1 apache nagios 90 Jun 21 17:26 Maintenance Dept Switch.cfg
-rw-rw-r-- 1 apache nagios 67 Jul 24 09:00 MILESTONE2.cfg
-rw-rw-r-- 1 apache nagios 180 May 27 07:47 Switch_CC1.cfg
[root@nagios static]# /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/MILESTONE2.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>
- Importing: /usr/local/nagios/etc/import/Maintenance Dept Switch.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>
- Importing: /usr/local/nagios/etc/import/Switch_CC1.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>
--------------------------------------
Importing into the CCM failed!
[root@nagios static]# ls -al /usr/local/nagios/etc/import
total 20
drwxrwxr-x 2 apache nagios 4096 Aug 16 09:47 .
drwxrwxr-x 7 apache nagios 4096 Aug 16 09:47 ..
-rw-rw-r-- 1 apache nagios 90 Jun 21 17:26 Maintenance Dept Switch.cfg
-rw-rw-r-- 1 apache nagios 67 Jul 24 09:00 MILESTONE2.cfg
-rw-rw-r-- 1 apache nagios 180 May 27 07:47 Switch_CC1.cfg
[root@nagios static]# /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/MILESTONE2.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>
- Importing: /usr/local/nagios/etc/import/Maintenance Dept Switch.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>
- Importing: /usr/local/nagios/etc/import/Switch_CC1.cfg .. PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice: Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>
--------------------------------------
Importing into the CCM failed!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Unable to apply configuration-Host cannot be a child/par
Ok, the problem is these old files stuck in the import directory
let's run the following
then this again
let's run the following
Code: Select all
rm -f /usr/local/nagios/etc/import/*Code: Select all
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh-
briangmoore
- Posts: 6
- Joined: Fri Aug 16, 2019 9:25 am
Re: Unable to apply configuration-Host cannot be a child/par
That did the trick! Thanks a ton scottwilkerson!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Unable to apply configuration-Host cannot be a child/par
Great!briangmoore wrote:That did the trick! Thanks a ton scottwilkerson!
Locking thread