I'm trying to import an older Nagios configuration into Nagios XI (core 4.4.3).
I've done the import once, but now I'm trying to overwrite it but I cannot get rid of the old definitions.
From the web interface, I've deleted the hosts, services, host groups and service groups.
But when I try to "apply configuration", I get the error below.
Error: Could not complete object definition in file '/usr/local/nagios/etc/hostgroups.cfg' on line 19. Have you named all your objects?
I would expect host groups to be empty at this point, but it still complains.
If I use config file management / delete files, then write config, I get my old and broken configuration back.
How do I get rid of it?
Also - related to this when I run the import, the "overwrite database" checkbox doesn't seem to have any effect. Old configurations remain behind.
When I run the import, I am deleting all existing configs from
/usr/local/nagios/etc
/usr/local/nagios/etc/hosts
/usr/local/nagios/etc/services
Alternatively, is there some way to re-initialize the Nagios XI database back to an initial state?
Cannot delete hosts/host groups
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Cannot delete hosts/host groups
Go to the CCM -> Host Groups
Click the View Config to the right of one of the groups
on the display is there a group with a blank name next tohostgroup_members just below line 19?
If so go to
Go to the CCM -> Host Groups -> Edit that hostgroup
Click manage hosts
empty anything that is in there (if any)
Click Close
Click Save
Apply Configuration
Click the View Config to the right of one of the groups
on the display is there a group with a blank name next tohostgroup_members just below line 19?
If so go to
Go to the CCM -> Host Groups -> Edit that hostgroup
Click manage hosts
empty anything that is in there (if any)
Click Close
Click Save
Apply Configuration
-
wernerreiche
- Posts: 6
- Joined: Mon Mar 16, 2020 4:00 pm
Re: Cannot delete hosts/host groups
From the web interface, there are no hosts, not services, no host groups, no service groups.
When I look at the file CCM keeps creating in ../etc/hostgroups.cfg, line 19 is the members line.
These members no longer exist.
define hostgroup {
hostgroup_name AMHS_IT_NETWORK
alias AMHS_IT_NETWORK
members AMHS_IT_NETWORK_ROUTER,CADAS_UA15,CADAS_UA25,CADAS_UA26,HQCAA-ITCore-Router,UPS-AIMS
}
Why does the apply config work with a different database than is shown in the web interface?
The basic problem is that the web interface is not showing correctly what is in the database, and I have no way of correcting it.
Is there some way I can go directly to the MySQL database and correct the problem?
When I look at the file CCM keeps creating in ../etc/hostgroups.cfg, line 19 is the members line.
These members no longer exist.
define hostgroup {
hostgroup_name AMHS_IT_NETWORK
alias AMHS_IT_NETWORK
members AMHS_IT_NETWORK_ROUTER,CADAS_UA15,CADAS_UA25,CADAS_UA26,HQCAA-ITCore-Router,UPS-AIMS
}
Why does the apply config work with a different database than is shown in the web interface?
The basic problem is that the web interface is not showing correctly what is in the database, and I have no way of correcting it.
Is there some way I can go directly to the MySQL database and correct the problem?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Cannot delete hosts/host groups
Can you send me a profile.zip via PM from
Admin -> System Profile
Admin -> System Profile
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Cannot delete hosts/host groups
I looked at the profile you sent and nothing stood out, but I have a feeling it isn't actually able to apply configuration and is rolling back to the last know configuration because you have 0 hosts and 0 services, the nagios config cannot apply with none.
We can verify this by running the following
We can verify this by running the following
Code: Select all
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh-
wernerreiche
- Posts: 6
- Joined: Mon Mar 16, 2020 4:00 pm
Re: Cannot delete hosts/host groups
The last suggestion worked.
Thanks.
Werner
Thanks.
Werner
Re: Cannot delete hosts/host groups
Excellent! I'm glad you were able to get this resolved.
Do you mind if we close this topic now?
Do you mind if we close this topic now?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
wernerreiche
- Posts: 6
- Joined: Mon Mar 16, 2020 4:00 pm
Re: Cannot delete hosts/host groups
Okay to close this.