How to Delete Zone

i would like to ask for your help on deleting this zone as i mess this one up

hoping for someone to help me.

thanks in advance

You need to delete the corresponding lines in your zones.conf and run kickstart wizard afterwards.

Hi Roland,

thanks for the time on replying but there is nothing on my zones.conf

i have used this command and here are the results.

vim /etc/icinga2/zones.conf

/*

  • Endpoint and Zone configuration for a cluster setup
  • This local example requires NodeName defined in
  • constants.conf.
    */

object Endpoint NodeName {
host = NodeName
}

object Zone ZoneName {
endpoints = [ NodeName ]
}

/*

  • Defines a global zone for distributed setups with masters,
  • satellites and clients.
  • This is required to sync configuration commands,
  • templates, apply rules, etc. to satellite and clients.
  • All nodes require the same configuration and must
  • have accept_config enabled in the api feature.
    */

object Zone “global-templates” {
global = true
}

/*

  • Defines a global zone for the Icinga Director.
  • This is required to sync configuration commands,
  • templates, apply rules, etc. to satellite and clients.
  • All nodes require the same configuration and must
  • have accept_config enabled in the api feature.
    */

object Zone “director-global” {
global = true
}

}

/*

  • Read the documentation on how to configure
  • a cluster setup with multiple zones.
    */

/*
object Endpoint “master.example.org” {
host = “master.example.org
}

object Endpoint “satellite.example.org” {
host = “satellite.example.org
}

object Zone “master” {
endpoints = [ “master.example.org” ]
}

object Zone “satellite” {
parent = “master”
endpoints = [ “satellite.example.org” ]
}

did i look into the correct location?

Yes, that is usually the correct location. Using the director means additional zones for agents, maybe that’s the case here. Figure out where this zone is defined e.g.:

icinga2 object list -n phentel

when i run that command after i hit enter there are no results

image

What is the output of

mysql -u root -p director -e “select * from icinga_zone”

Please adapt DBMS, user name and database name to your needs.

Here is the output.

is there a way i can edit or delete what is on it?

Sure:

update icinga_zone set disabled=‘y’ where id=1;

image

this is what happens when i type the command

You first have to login into MySQL or PostgreSQL.


this is my result

There is something wrong with your setup. It should look like:

MariaDB [director]> update icinga_zone set disabled='y' where id=1;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

i manage to disable it, thanks for your help.

Sorry to necro this thread, but is there really no other way to disable a zone after it’s been removed than performing this raw mysql query? I find this hard to believe.