Delete Hosts automatically

Hello all,

I’ve got a SQL Database connected to Icinga, which is imported via the Director.
In the Database is a column called “deleted_at”.
The column is normally “NULL”.

Is there a possibility to check, if the column is not “NULL” and then automatically delete these Hosts?

  • Director version (System - About): 1.8.1
  • Icinga Web 2 version and modules (System - About): 2.9.5
  • Icinga 2 version (icinga2 --version): r2.13.2-1
  • Operating System and version: Debian GNU/Linux 11
  • Webserver, PHP versions: PHP 7.4.25

Yes, you have to add a where clause checking if the column is null or if it could also contain a future date is null or greater than now. By doing so the lines will be filtered out and so they are not imported.
When you now set the sync rule to purge, hosts will be deleted.

1 Like