Icinga Director’s CLI commands have supported import sources and sync rules for a long time, which includes listing, checking and running them. Before Icinga Director v1.11.6 two things you couldn’t do from the CLI, though, were narrowing a health check down to a single object, or deleting an import source or sync rule without opening the web UI.
I’ll walk through both, using examples.
Checking a Single Sync Rule, Import Source, or Job by Name
Icinga Director’s health check command reports on the overall health of your setup: configuration, sync rules, import sources, jobs, and deployment. Before Icinga Director v1.11.6, running it against sync rules or import sources meant getting a report on all of them at once. That’s fine for a general health dashboard, but not when I’ve just changed one specific sync rule and want to confirm it’s health without scrolling past every other one.
The --name option introduced in Icinga Director v1.11.6 fixes that. The syntax is:
icingacli director health check --check sync|import|jobs --name <object-name>
For example, if you have a sync rule called ldap-hosts-sync. Instead of checking every sync rule I have configured, I can check just this one:
icingacli director health check --check sync --name ldap-hosts-sync
The same works for a single import source or a single job:
icingacli director health check --check import --name active-directory-hosts icingacli director health check --check jobs --name nightly-import-job
Note that --name only makes sense for sync rules, import sources, and jobs, since those are the checks that operate on individual, named objects. --check config and --check deployment, don’t have individual objects to pick from, there’s just one overall configuration state and one overall deployment state, so combining --name with either of those fails.
Credit for this one goes to log1-c, who contributed to the --name option.
Deleting Import Sources and Sync Rules from the CLI
Before Icinga Director v1.11.6, you couldn’t delete an import source or sync rule from the command line at all. If you wanted to remove one, say, while cleaning up after a migration, or as part of an automated script, your only choice was to open the Icinga Director web page and delete it there by hand.
Both importsource and syncrule have had a delete action since v1.11.6:
icingacli director importsource delete --id <id> icingacli director syncrule delete --id <id>
Once I have the IDs, deleting them is a single command each:
icingacli director importsource delete --id 12 icingacli director syncrule delete --id 7
On success, each command prints a short confirmation naming the object that was removed. For now, --id is required, and it has to be the numeric ID, not the name, so if you only know an object by name, run list first to find its ID before deleting it. That extra lookup step won’t be needed for much longer, support for deleting by --name directly is already on its way in an upcoming release.
Conclusion
If you’re automating around Director, --name lets you narrow a health check to exactly the object you care about, and the delete actions mean you no longer have to switch to the web UI just to remove an import source or sync rule.
Both features shipped in Icinga Director v1.11.6, so they’re available today if you’re on that version or later. Run icingacli director health check --help, icingacli director importsource --help, or icingacli director syncrule --help for the full list of options.






