Skip to main content

In versions 23.04 and earlier, you may encounter an issue when you delete a resource: the host or the service is still appearing in the Resource Status page.

This article explains how to solve these ghost hosts / ghost services issues.

 

Symptom

You have deleted a host or a service and exported the configuration, but the resource is still appearing in the Resource Status page.

 

Solution

Be sure that the Centreon Gorgone process is running:

  • Enter the following command on the central in a terminal:
    systemctl restart gorgoned
  • Now the resource should disappear.

For example, this might be useful if a poller has been taken out of service.

 

Still stuck?

When a poller stops or when you removed a resource, this one should be disabled in the database (enabled = 0). If it is not the case, use the following procedure to turn it to 0 safely.

 

1. Check the resource has been deleted from the configuration menu

  • Depending on the resource type, go to one of the following menus:
    • Configuration > Hosts > Hosts
    • Configuration > Services > Services by host
    • Configuration > Services > Services by host group
  • Use filters to check that the resource is no more present.
  • If the resource is still present, delete it and export the configuration.

 

2. Retrieve the ID of the resource (host or service) from the Resource Status page

 

  1. Click the line of the resource.
    The detail panel opens on the right side.
  2. Hover over the gear icon.
  3. A URL is displaying the ID of the resource. In this example, the ID is 221.

3. Disable resources in the real time database

  • Execute the following SQL command to disable a host:
    UPDATE centreon_storage.resources SET enabled = 0 WHERE parent_id = <ID_OF_HOST>
  • Execute the following SQL command to disable a service:
    UPDATE centreon_storage.resources SET enabled = 0 WHERE id = <ID_OF_SERVICE>

4. Deleted pollers

If you deleted a poller without stopping it before:

  • Go on the poller and stop the centengine process:
    systemctl stop centengine
  • Identify the poller in the real time database:
    SELECT instance_id, name FROM instances;
  • Delete the instance:
    DELETE FROM instances WHERE instance_id = <INSTANCE_ID_OF_THE_POLLER>
  • Delete associated resources in the real time database:
    DELETE FROM resources WHERE poller_id = <INSTANCE_ID_OF_THE_POLLER>


See also

Bonjour,

Dans le paragraphe “3. Disable resources in the real time database”, il ne manque pas une petite modif. dans la table hosts pour la désactivation d’un hote ? champs enabled = 0 ?

 

cordialement,

 

Laurent.

 


Hello ​@l.guenier 

If the host has been deleted from the UI, the enabled should already be = 0, e.g. :

 


Reply