Version 2.3 of monitoring plugins did two things:
- change how multiple addresses are expected; no longer a single
argument, with comma separated values, but repeated "-a" argument;
sadly this is incompatible change, and configs need to be changed
manually; this is commit
monitoring-plugins/monitoring-plugins@a03068743f;
- add a "-L" argument that requires all passed addresses to be
matched, which allows for stronger validation (all vs. at least
one); this is commit
monitoring-plugins/monitoring-plugins@fd9a7d2e00;
Both of these were committed a long while ago (2018), but were only
released very recently, in the 2.3 release (December 2020).
I've tried to make the descriptions as good as I could, but not sure
they're very readable, feedback welcome.
Signed-off-by: Iustin Pop <iustin@k1024.org>
On case-insensitive file systems (i.e. macOS), the VERSION file collides with the Boost-provided version file on #include <version>.
Work around by re-naming VERSION to ICINGA2_VERSION.
There is an assertion that after activating items, all these items are
active, which sounds reasonable at first. However, with concurrent API
queries, some of these could already be deleted and therefore be
deactivated again.
At numerous places in the code, something like this is performed:
String name = Downtime::AddDowntime(...);
Downtime::Ptr downtime = Downtime::GetByName(name);
However, `downtime` can be a `nullptr` after this as it is possible that
the downtime is deleted in between.
This commit changes the return type of `Downtime::AddDowntime` to return
a Downtime::Ptr instead of the full name of the downtime. `AddDowntime`
performs the very same `GetByName()` operation internally, but handles
the `nullptr` case correctly and throws an exception.
Since commit d9010c7b9f, ActivateItems no
longer uses the WorkQueue upq to perform tasks but instead performs
these locally. One instance of `upq.Join()`/`upq.HasExceptions()`
remained in the function, but I believe this was just missed when
removing the `upq.Enqueue()` call just before.
This commit removes the corresponding parameter and updates all call
sites accordingly.
`this` could be deleted after `Notification::BeginExecuteNotification`
exited and before `Notification::ExecuteNotificationHelper` finished.
This is fixed by constructing a `Notification::Ptr` and operate on that
one as it is properly reference-counted.
Only two out of three cases were handled properly by the code: host
downtimes referencing a deleted host and service downtimes referencing a
deleted service worked fine. However, if a service downtime references a
deleted host, `Host::GetByName()` returns `nullptr` which isn't
accounted for. Use `Service::GetByNamePair()` instead as this performs a
check for the host being null internally.
Except for the switch case, the script was written with tab indentation.
With tabstop of 4 spaces, the indentation in the switch case would make
sense, but I assume this is just a glitch of the editor.
When executing `false || (echo bad; exit 1)`, the call to `exit` won't
exit the script, it will only exit the subshell and the exit code will
be stored in the return code `$?`.
Since this is an error, we have to exit the script properly.