...for Service Apply rules, given that admin permissions have been granted.
This also fixes the problem that inherited command names haven't been shown.
fixes#1899
The director automatically removes uncollected deployments if they're
older than the running one. Deployments are uncollected if Icinga 2 did
not write a status file or startup log (yet). This happens when you
manage to ship a deployment while Icinga 2 is already preparing to
restart with a deployed configuration. It also removes deployments
which were forgotten by Icinga 2 because of bugs in previous versions.
If there are uncollected deployments, the check whether they are older
than the running one is based on string comparison of the deployments'
start time. While this works for MySQL and MariaDB where the output of
timestamps is always ISO, it may fail for PostgreSQL because there the
output format is configurable. If the output format is set to report
the day first, the string comparison "fails" and removes every first
deployment of a month:
Deployment timestamp: 01-JUN-19 00:03:37 -07:00
Running timestamp: 31-MAY-19 23:54:53 -07:00
The string comparison now reports the deployment as older than the
running one and removes it.
The fix is as easy as to use timestamps for the comparison.
Sample output when there are changes:
icingaweb2@web:~$ icingacli director syncrule check --id 36
There are pending changes for this Sync Rule. You should trigger a new Sync Run.
Expected modifications: 2x create, 0x modify, 0x delete
icingaweb2@web:~$ echo $?
1
...when there are no changes:
icingaweb2@web:~$ icingacli director syncrule check --id 34
This Sync Rule is in sync
icingaweb2@web:~$ echo $?
0
...and when something failes:
icingaweb2@web:~$ icingacli director syncrule check --id 32
This Sync Rule failed: No data has been imported for "Benutzergruppen aus Nagios" yet
icingaweb2@web:~$ echo $?
2
fixes#1849
Available options:
* strict: select box
* suggest_strict: auto-completion, allow only list values
* suggest_optional: Allow for values not on the list
* suggest_extend: Extend the list with new values
fixes#1846