Compare commits

...

562 Commits

Author SHA1 Message Date
Yonas Habteab
cfca8909ae
Merge pull request #10403 from Icinga/drop-superfluous-cmake-modules
Drop superfluous cmake modules
2025-04-08 10:48:18 +02:00
Silas
8ab859d828
itl/ssl_cert: Add --ignore-maximum-validity option (#10396)
* Update web.conf - Include "--ignore-maximum-validity"

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md
2025-04-08 09:18:38 +02:00
Silas
9ecf7714e3
Update command-plugins.conf to ensure compatibility with nagios-plugins' check_disk (#10395)
* Update command-plugins.conf to ensure compatibility with nagios-plugins' check_disk

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md
2025-04-08 09:02:02 +02:00
Yonas Habteab
5a30554db9 Drop superfluous CMake modules
These modules are already provided by CMake itself, so we don't need to
ship them by ourselves.
2025-04-07 10:27:13 +02:00
Yonas Habteab
9abf482708
Merge pull request #10402 from Icinga/raise-minimum-cmake-version
Raise cmake minimum required version to `3.8...3.17`
2025-04-07 10:25:59 +02:00
Julian Brost
5a6b2044b1
Merge pull request #10290 from Icinga/icingadb-dependencies-sync
Sync dependencies to Redis
2025-04-04 15:13:05 +02:00
Yonas Habteab
cff8c60ba9 Drop superfluous MACOSX_RPATH definition
It's on by default since CMake version `3.0`
2025-04-04 14:04:47 +02:00
Yonas Habteab
28c61c904a Fix CMake doesn't export symbols of executables anymore
CMake 3.4 introduced a new policy [^1] which prevents from automatically
adding the compiler flags needed for exporting the symbols of the
executables and libraries without the `ENABLE_EXPORTS` property. So, by
defining this variable, CMake will restore the previous behaviour by
automatically adding the `ENABLE_EXPORTS` properties to all targets.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
2025-04-04 14:04:47 +02:00
Yonas Habteab
7f164bda96 Raise cmake minimum required version to 3.8...3.17
CMake version `< 3.5` is no longer supported, so the new CMake minimum
policy version is set to `3.8` to support C++17 unconditionally. After
checking all the policies that might affect Icinga 2 in any way, CMake
`3.17` is used as a max supported CMake policy. Anything above that may
work but we didn't explicitly verify the policies introduced with CMake
3.18 and later and may or may not affect Icinga 2.
2025-04-04 13:56:51 +02:00
Julian Brost
d1d649ff33
Merge pull request #10401 from Icinga/gha-fix-alpine-cmake
GHA: Fix Alpine After CMAKE_OPTS Refactoring
2025-04-03 12:17:54 +02:00
Alvar Penning
33838a620a
GHA: Fix Alpine After CMAKE_OPTS Refactoring
The just merged Alpine CI run for LibreSSL from #9949 failed since it
missed the changes of the refactoring PR #10369. This change applied the
refactoring for Alpine as well, hopefully making the CI happy.
2025-04-03 09:33:42 +02:00
Yonas Habteab
0673dfa644
Merge pull request #9949 from Icinga/libressl
GHA: also build on Alpine to test LibreSSL which is used on OpenBSD
2025-04-03 09:17:33 +02:00
Julian Brost
27e1850381
Merge pull request #10399 from Icinga/severity-reachability
`Checkable::GetSeverity()`: consider reachability
2025-04-02 09:39:40 +02:00
Julian Brost
31a224c509 Checkable::GetSeverity(): always take reachability into account
So far, Service::GetSeverity() only considered the state of its own host, i.e.
the implicit service to its own host dependency, and treated it similar to
acknowledgements and downtimes. In contrast, Host::GetSeverity() considered
reachability and treated it like a state, i.e. for the severity calculation,
the host was either up, down, or unreachable.

This commit changes the following things:
1. Make the service severity also consider explicitly configured dependencies
   by using IsReachable().
2. Prefer acknowledgements and downtimes over unreachability in the severity
   calculation so that if an already acknowledged or in-downtime services (i.e.
   already handled service) becomes unreachable, it shouln't become more
   severe.
3. To unify host and service severities a bit, hosts now use the same logic
   that treats reachability more like acknowledgements/downtimes instead of
   like a state (changing the other way around would the state from the check
   plugin would not affect the severity for unrachable services anymore).
2025-03-31 15:23:51 +02:00
Julian Brost
1e05a166f1 Host::GetSeverity(): remove empty line at end of method 2025-03-31 15:23:51 +02:00
Julian Brost
d8271c6568 Host::GetSeverity(): remove explicit unlocking
No change in functionality. The ObjectLock destructor will implicitly release
the locks when returning from the function.
2025-03-31 15:23:51 +02:00
Julian Brost
2ebee010f0 Host::GetHost(): return early to remove a nesting level
No change in functionality. The first two branches actually set the final
return value for the method, so they can just return directly, removing the
need to have the rest of the function inside an else block.
2025-03-31 15:23:51 +02:00
Julian Brost
6443f8997f Host::GetSeverity(): add braces to if statements
No change in functionality, just makes the code a bit nicer.
2025-03-31 15:23:51 +02:00
Julian Brost
c899d52e2f Service::GetSeverity(): remove explicit unlocking
No change in functionality. The ObjectLock destructor will implicitly release
the locks when returning from the function.
2025-03-31 15:23:50 +02:00
Julian Brost
01acfb47a9 Service::GetHost(): return early to remove a nesting level
No change in functionality. The first two branches actually set the final
return value for the method, so they can just return directly, removing the
need to have the rest of the function inside an else block.
2025-03-31 15:23:50 +02:00
Julian Brost
5ca6047b35 Service::GetSeverity(): replace switch with if
No change in functionality, just making the code a bit more compact.
2025-03-31 15:23:50 +02:00
Julian Brost
a1865e1b43 Service::GetSeverity(): simplify nested if, add braces
No change in functionality, just making the code a bit nicer and more compact.
2025-03-31 15:23:50 +02:00
Yonas Habteab
bc2c750551 IcingaDB: Don't stream runtime state updates to Redis 2025-03-26 10:48:37 +01:00
Julian Brost
061338156c
Merge pull request #10345 from Icinga/remove-child-downtimes
ApiActions: Remove child downtimes recursively
2025-03-21 16:37:43 +01:00
Alexander Aleksandrovič Klimov
adde9cc53b
Merge pull request #10222 from Icinga/Registry-cleanup
Clean up Registry class
2025-03-21 11:00:49 +01:00
Alexander Aleksandrovič Klimov
469f94e549
Merge pull request #10369 from Icinga/cflags
GHA: Linux: use the C(++) flags recommended by each respective distro
2025-03-20 16:57:21 +01:00
Julian Brost
065118bc22 Make DependencyGroup::State an enum
The previous struct used two bools to represent three useful states. Make this
more explicit by having these three states as an enum.
2025-03-19 16:28:00 +01:00
Yonas Habteab
864e2aaae0 Drop superfluous mutex lock & don't manually unpack std::tuple 2025-03-19 16:28:00 +01:00
Julian Brost
693d094ebc DependencyGroup: don't change the keys of m_Members after construction
This prevents the use of DependencyGroup for storing the dependencies during
the early registration (m_DependencyGroupsPushedToRegistry = false),
m_PendingDependencies is introduced as a replacement to store the dependencies
at that time.
2025-03-19 16:28:00 +01:00
Yonas Habteab
945a79e37f IcingaDB: Don't send useless dependencies state updates 2025-03-19 16:28:00 +01:00
Yonas Habteab
da637c3741 IcingaDB: Always send dependencies state HSET updates to Redis 2025-03-19 16:28:00 +01:00
Yonas Habteab
21cd5e00fa Dependency: Don't allow to update {period,states,ignore_soft_states} at runtime 2025-03-19 16:28:00 +01:00
Yonas Habteab
a9bb11b16d (Un)register dependencies from parent prior to child Checkable 2025-03-19 16:28:00 +01:00
Yonas Habteab
7fbb8f7452 Evaluate dependency group state only for a specific child
Previously the dependency state was evaluated by picking the first
dependency object from the batched members. However, since the
dependency `disable_{checks,notifications` attributes aren't taken into
account when batching the members, the evaluated state may yield a wrong
result for some Checkables due to some random dependency from other
Checkable of that group that has the `disable_{checks,notifications`
attrs set. This commit forces the callers to always provide the child
Checkable the state is evaluated for and picks only the dependency
objects of that child Checkable.
2025-03-19 16:28:00 +01:00
Julian Brost
ce1ed8556c Simplify DependencyGroup::GetState() implementation
The new implementation just counts reachable and available parents and
determines the overall result by comparing numbers, see inline comments for
more information.

This also fixes an issue in the previous implementation: if it didn't return
early from the loop, it would just return the state of the last parent
considered which may not actually represent the group state accurately.
2025-03-19 16:28:00 +01:00
Yonas Habteab
0ab50fd82d IcingaDB: Process dependencies runtime updates 2025-03-19 16:28:00 +01:00
Yonas Habteab
915ea6427e Use GetParents() in FireSppressedNotifications()
It's way efficient than accessing them through the dependency objects,
plus we won't have any duplicates.
2025-03-19 16:28:00 +01:00
Yonas Habteab
8640a3f84e Checkable: Extract parents directly from dependency groups 2025-03-19 16:28:00 +01:00
Yonas Habteab
806fff950c Checkable: Emit boost signals when changing dependency groups at runtime 2025-03-19 16:28:00 +01:00
Yonas Habteab
b462028b4f Add basic unittests for bulk group registration 2025-03-19 16:28:00 +01:00
Yonas Habteab
6a0ec70131 Fix & adjust dependencies unittests 2025-03-19 16:28:00 +01:00
Yonas Habteab
67a4889945 Checkable: Delay dependency group global registration on startup 2025-03-19 16:28:00 +01:00
Julian Brost
26f46fe021 Simplify dependency group registration
Co-Authored-By: Yonas Habteab <yonas.habteab@icinga.com>
2025-03-19 16:28:00 +01:00
Yonas Habteab
aed1bb6294 IcingaDB: Introduce ExecuteRedisTransaction() helper method 2025-03-19 16:28:00 +01:00
Yonas Habteab
db3f8dec27 IcingaDB: Sync dependencies initial states on config dump 2025-03-19 16:28:00 +01:00
Yonas Habteab
f502993eb4 IcingaDB: Sync dependencies states to Redis 2025-03-19 16:28:00 +01:00
Yonas Habteab
c6466ee0ea IcingaDB: Dump checkables dependencies config to redis correctly 2025-03-19 15:28:31 +01:00
Richard Mortimer
63926c6e0d
Process: Clean up process table entry even when kill(2) fails with ESRCH (#10375)
* Icinga daemon leaves zombie processes on very busy system

On a very heavily loaded system the process group kill can
be delayed until after the regular TERM signal has caused
the process to exit. In this situation the waitpid call
is valid and reaps the zombie process that would otherwise
be left behind.

* Update AUTHORS file
2025-03-18 11:29:00 +01:00
Alexander A. Klimov
a9e9e14fce Remove unused Registry#Clear() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
4d7361527c Remove unused Registry#RegisterIfNew() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
07b274ec45 Remove unused Registry#Unregister() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
402a6bbf40 Remove unused EventQueue::Unregister() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
d19c0637ee Remove unused EventQueue::UnregisterIfUnused() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
41f61ccba4 Remove unused ApiFunction::Unregister() 2025-03-18 11:22:56 +01:00
Alexander A. Klimov
cce03c5903 Remove unused ApiAction::Unregister() 2025-03-18 11:22:56 +01:00
Alvar Penning
b521a9742e GHA: Fix Alpine LibreSSL
First, the icinga_legacytimeperiod/dst test was excluded, as it fails on
Alpine most likely due to some differences between musl and glibc. After
some debugging, I disabled the test as the Alpine packages does.

More build dependencies were added from the Alpine package, allowing to
only disable MySQL and PostgreSQL support as these libraries have fixed
dependencies on OpenSSL, conflicting with LibreSSL.

In addition, I have added comments where I was first puzzled.
2025-03-18 11:21:53 +01:00
Alexander A. Klimov
d387f0cd18 GHA: also build on Alpine to test LibreSSL which is used on OpenBSD 2025-03-18 11:21:53 +01:00
Yonas Habteab
5e902fe4a7
Merge pull request #10380 from Icinga/sync-notified-problem-users-correctly
ClusterEvents: Sync & process notification `notified_problem_users`
2025-03-18 10:27:28 +01:00
Yonas Habteab
3083a32bc6
Merge pull request #10301 from Icinga/ssl-shutdown-new-client-handler
ApiListener: Simplify deferred SSL shutdown in `NewClientHandlerInter…
2025-03-17 13:12:03 +01:00
Yonas Habteab
a904f4bf4b
Merge pull request #10381 from Icinga/enable-dependabot
Enable dependabot for GitHub Actions
2025-03-17 12:16:30 +01:00
Yonas Habteab
55885e0cd9 Enable dependabot for GitHub Actions 2025-03-17 10:09:37 +01:00
Yonas Habteab
66cc6a4d8a ClusterEvents: Sync & process notification notified_problem_users 2025-03-14 14:13:55 +01:00
Yonas Habteab
3d761c0296 ApiActions: Remove child downtimes recursively
Services downtimes scheduled via the `all_services` flag get already
removed automatically when removing their parent downtimes (introduced
with #8913). Now, this commit makes it possible to perform the same actions
for all child downtimes, i.e. not only for those of service objects, but
for all child objects represented in the dependency tree.
2025-03-13 12:13:45 +01:00
Yonas Habteab
fa63fda75b ApiListener: Simplify deferred SSL shutdown in NewClientHandlerInternal() 2025-03-13 12:12:28 +01:00
Yonas Habteab
4bfaefadfa IcingaDB: Bump expected redis version to 6 2025-03-12 16:32:01 +01:00
Yonas Habteab
2616c99891 tests: Add unittests for the redundancy groups registry 2025-03-12 16:32:01 +01:00
Yonas Habteab
d094581b4b Checkable: Use redundancy groups state in IsReachable 2025-03-12 16:32:01 +01:00
Yonas Habteab
27f11a0955 Checkable: Introduce HasAnyDependencies() method 2025-03-12 16:32:01 +01:00
Yonas Habteab
ff0dabe287 Checkable: Store dependencies grouped by their redundancy group 2025-03-12 16:31:59 +01:00
Yonas Habteab
1820955993 Add DependencyGroup::GetState() helper method 2025-03-12 16:31:14 +01:00
Yonas Habteab
d7c9e6687e Introduce DependencyGroup helper class 2025-03-12 16:31:12 +01:00
Yonas Habteab
93d9fad565 Checkable: Drop unused failedDependency argument from IsReachable() 2025-03-12 16:19:22 +01:00
Julian Brost
67664ad7b7 Checkable::GetAllChildrenInternal: remove redundant emplace call
`checkable` is already added to the set by the insert call above, so calling
emplace for the same checkable doesn't do anything useful and can be removed.
2025-03-12 16:19:22 +01:00
Yonas Habteab
c465f45200 Rewrite Checkable::GetAllChildrenInternal() method
The previous wasn't per-se wrong, but it was way too inefficient. With
this commit each and every Checkable is going to be visited only once,
and we won't traverse the same Checkable's children multiple times
somewhere in the dependency chain.
2025-03-12 16:19:22 +01:00
Yonas Habteab
e0ce0ccff6 Activate Dependency objects before their parent objects 2025-03-12 16:19:22 +01:00
Yonas Habteab
c02b9d74a9 IcingaDB: Send reachablity state updates for all children 2025-03-12 16:19:22 +01:00
Yonas Habteab
772420a438 Checkable: Don't always trigger reachablity changed signal
But only when the current check result being processed affects the child
Checkables in any way.
2025-03-12 16:19:22 +01:00
Yonas Habteab
c64ae1af0f Dependency: Don't allow to change redundancy_group at runtime
Otherwise, it would require too much code changes to properly handle
redundancy group runtime modification in Icinga DB for no real benefit.
2025-03-12 16:19:22 +01:00
Yonas Habteab
6321606671 IcingaDB: Sync affects_children as part of runtime state updates 2025-03-12 16:19:22 +01:00
Yonas Habteab
297b62d841 IcingaDB: Add affected_children to Host/Service Redis updates 2025-03-12 16:19:22 +01:00
Yonas Habteab
d6b289e1cd Checkable: Introduce GetAllChildrenCount() method
The previous limit (32) doesn't seem to make sense, and appears to be some random number.
So, this limit is set to 256 to match the limit in IsReachable().
2025-03-12 16:19:22 +01:00
Alvar Penning
ef93f945a2 IcingaDB: Start keeping track of Host/Service to Dependency relationship
This does not work in this state!
Trying to refresh Dependency if a Host or Service being member
of this Dependency has a state change.
2025-03-12 16:19:22 +01:00
Yonas Habteab
8714f72d65
Merge pull request #10368 from Icinga/GHAdeb32
GitHub actions: also test the still packaged 32-bit Debian
2025-03-12 16:03:39 +01:00
Julian Brost
e6ad2199fc
Merge pull request #10360 from Icinga/dependency-cycle-detection
Rework dependency cycle detection
2025-03-12 15:58:44 +01:00
Alexander A. Klimov
f418d29379 GHA: Linux: use the C(++) flags recommended by each respective distro 2025-03-12 14:22:04 +01:00
Alexander A. Klimov
4227d427da .github/workflows/linux.bash: make $CMAKE_OPTS an array
to have less to care about quoting.
2025-03-12 12:00:30 +01:00
Yonas Habteab
84f719ee4f
Merge pull request #10373 from Icinga/Al2Klimov-patch-8
GitHub actions: run ninja with -v
2025-03-12 11:57:40 +01:00
Julian Brost
8e7e687b96 Unify depependency cycle check code.
This commit removes a distinction in how dependency objects are checked for
cycles in the resulting graph depending on whether they are part of the
initially loaded configuration during process startup or as part of a runtime
update.

The DependencyCycleChecker helper class is extended with a mechanism that
allows additional dependencies to be considered during the cycle search. This
allows using it to check for cycles before actually registering the
dependencies with the checkables.

The aforementioned case-distinction for initial/runtime-update config is
removed by making use of the newly added BeforeOnAllConfigLoaded signal to
perform the cycle check at once for each batch of dependencies inside
ConfigItem::CommitNewItems() for both cases now. During the initial config
loading, there can be multiple batches of dependencies as objects from apply
rules are created separately, so parts of the dependency graph might be visited
multiple times now, however that is limited to a minimum as only parts of the
graph that are reachable from the newly added dependencies are searched.
2025-03-12 11:53:30 +01:00
Julian Brost
c1b270f39f Rework dependency cycle check
This commit groups a bunch of structs and static functions inside
dependency.cpp into a new DependencyCycleChecker helper class. In the process,
the implementation was changed a bit, the behavior should be unchanged except
for a more user-friendly error message in the exception.
2025-03-12 11:53:30 +01:00
Julian Brost
500ad70b8c Implement std::hash<boost::intrusive_ptr<T>> for old Boost versions
Boost only implements it iself starting from version 1.74, but a specialization
of std::hash<> can be added trivially to allow the use of
std::unordered_set<boost::intrusive_ptr<T>> and
std::unordered_map<boost::intrusive_ptr<K>, V>.

Being unable to use such types already came up a few types in the past, often
resulting in the use of raw pointer instead which always involves an additional
"is this safe?"/"could the object go out of scope?" discussion. This commit
simply solves this for the future by simply allowing the use of intrusive_ptr
in unordered containers.
2025-03-12 11:53:30 +01:00
Julian Brost
4b18f62a11 Add ConfigType::BeforeOnAllConfigLoaded signal
Allows to hook into the config loading process just before OnAllConfigLoaded()
is called on a bunch of individual config objects. Allows doing some operations
more efficiently at once for all objects.

Intended use: when adding a number of dependencies, it has to be checked
whether this uses any cycles. This can be done more efficiently if all
dependencies are checked at once. So far, this is with a case-distinction for
initially loaded files in DaemonUtility::LoadConfigFiles() and for dependencies
created by runtime updates in Dependency::OnAllConfigLoaded(). The mechanism
added by this commit allows to unify the handling of both cases (done in a
following commit).
2025-03-12 11:53:30 +01:00
Alexander Aleksandrovič Klimov
cc5f01d47f
GitHub actions: run ninja with -v
to show all compiler flags.
2025-03-12 09:57:16 +01:00
Alexander A. Klimov
7962121faa GitHub actions: also test the still packaged 32-bit Debian 2025-03-11 16:11:05 +01:00
Julian Brost
cefe1bc27a
Merge pull request #10365 from Icinga/string-vector-move-test
Avoid undefined behavior in string/vector_move test
2025-03-10 14:51:20 +01:00
Julian Brost
784867b3f7 Avoid undefined behavior in string/vector_move test
vec[1] is equivalent to vec[vec.size()] at that point and thus not a valid
element of the vector, making the use of operator[] undefined behavior here.
With some compiler flags (like those used in package builds on RHEL and
similar), the compiler (rightfully) aborts the program on this out of bounds
access:

     68/178 Test  #68: base-base_string/vector_move ............................................***Failed    0.01 sec
    /usr/include/c++/14/bits/stl_vector.h:1130: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = icinga::String; _Alloc = std::allocator<icinga::String>; reference = icinga::String&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
    Running 1 test case...
    unknown location(0): fatal error: in "base_string/vector_move": signal: SIGABRT (application abort requested)
    /builds/packages/icinga2/packaging/fedora/41/BUILD/icinga2-2.14.5+467.g206d7cda1-build/icinga2-2.14.5+467.g206d7cda1/test/base-string.cpp(120): last checkpoint
    *** 1 failure is detected in the test module "icinga2"

This commit fixes this by taking the indirection through .data() and using
plain pointer arithmetic instead.
2025-03-10 09:28:33 +01:00
Yonas Habteab
206d7cda1b
Merge pull request #10359 from Icinga/do-not-publish-useless-stats
IcingaDB: Don't publish useless data to Redis
2025-03-07 12:51:10 +01:00
Yonas Habteab
35520b59f0
Merge pull request #10353 from Icinga/fix-string-move-constructor-and-assignment-operator
Fix string move constructor and assignment operator
2025-03-07 12:50:47 +01:00
Yonas Habteab
3e9292a349 Value: Add a specialized rvalue reference of Get()
The move `String(Value&&)` constructor tries to partially move `String`
values from a `Value` type. However, since there was no an appropriate
`Value::Get<T>()` implementation that binds to the requested move
operation, the compiler will actually not move the value but copy it
instead as the only available implementation of `Value::Get<T>()`
returns a const reference `const T&`. This commit adds a new overload
that returns a non-const reference and allows to optionally move the string
value of a Value type.
2025-03-07 10:16:31 +01:00
Julian Brost
e308552ecc Add test that std::vector<icinga::String> uses move overloads 2025-03-06 13:02:40 +01:00
Yonas Habteab
6a888e1494 String: Mark move constructor & assignment op as noexcept
The Icinga DB code performs intensive operations on certain STL containers,
primarily on `std::vector<String>`. Specifically, it inserts 2-3 new elements
at the beginning of a vector containing thousands of elements. Without this commit,
all the existing elements would be unnecessarily copied just to accommodate the new
elements at the front. By making this change, the compiler is able to optimize STL
operations like `push_back`, `emplace_back`, and `insert`, enabling it to prefer the
move constructor over copy operations, provided it is guaranteed that no exceptions
will be thrown.
2025-03-06 13:02:40 +01:00
Yonas Habteab
6ca0611f3d IcingaDB: Don't publish useless data to Redis
The Icinga DB daemon processes the data from the `IcingaApplication`
type only and Icinga DB Web also uses only those stats. However, before
this commit, Icinga DB published all kinds of useless stats to Redis
each second, like the number of (un)reachable hosts, services, and so
on, which is waste of CPU and some other resources. This commit reduces
the published data drastically to only those simple stats coming from
the `IcingaApplication` type.
2025-03-04 17:34:38 +01:00
Alexander Aleksandrovič Klimov
5c651e45a3
Merge pull request #10356 from Icinga/fix-mixed-compiler-args
Don't mix C and C++ compiler flags
2025-03-03 18:56:04 +01:00
Yonas Habteab
3fcc909cdc Don't mix C and C++ compiler flags 2025-03-03 16:52:58 +01:00
Julian Brost
f308bb154a
Merge pull request #8010 from netphantm/feature/itl-enable-extra-opts-7630
ITL: add --extra-opts to plugins supporting it
2025-02-10 10:03:04 +01:00
Julian Brost
1df7f3f7c7 ITL docs: add missing nscp_extra_opts 2025-02-06 17:09:18 +01:00
Julian Brost
988ba18be0 ITL docs: list curl_extra_opts as last variable
Other plugins list --extra-opts last as it's often some kind of feature of last
resort as it provides an option that can't be set in another way. For
consistency, this also moves it to the end for the curl check command.
2025-02-06 16:49:42 +01:00
Julian Brost
b4baf1cbdd
Merge pull request #10342 from Icinga/test-formatdatetime-32bit
tests: fix FormatDateTime with 32-bit time_t
2025-02-05 13:41:29 +01:00
Julian Brost
f1f10fdd9e tests: fix FormatDateTime with 32-bit time_t
With a 32-bit time_t, two checks in the FormatDateTime test case didn't work
properly so far:

1. Every time_t value can be represented by struct tm, hence the test makes no
   sense on such platforms and is now disabled there similar to how it's
   already done with other checks in the same function.
2. std::nextafter(2147483647, +double_limit::infinity())) results in something
   like 2147483647.000000238 which simply results in the limit when cast back
   to an integer type, so it didn't actually test the overflow. This is fixed
   by an additional std::ceil()/std::floor().
2025-02-05 11:21:15 +01:00
Julian Brost
21c9ad5323
Merge pull request #10332 from Icinga/do-not-close-connection-in-request-cert-handler
Don't abruptly close anonymous connections
2025-02-04 10:58:17 +01:00
Alexander Aleksandrovič Klimov
25d9fb51a2
Merge pull request #10225 from Icinga/Wsuggest-override
Always compile with -Wsuggest-override not to forget `override`
2025-02-04 10:35:02 +01:00
Alexander Aleksandrovič Klimov
065dfe4c40
Merge pull request #9928 from Icinga/no-data-received-on-new-api-connection
API: also log error behind "No data received on new API connection"
2025-02-03 15:39:26 +01:00
Angel Roman
dda0da6bf8
Merge pull request #10317 from legna-namor/patch-1
Remove RHEL 7 from installation instructions
2025-01-31 10:50:41 +00:00
Yonas Habteab
25bbac1677 Don't abruptly close anonymous connections
This was mistakenly introduced with PR #7686 due to too many open
connections (#7680). This was wrong in the sense that closing the
connection is simply out of place here and should have been handled
differently. After we revised the RPC connection disconnect procedure
with `v2.14.4`, it becomes clear why it is wrong, because the connection
is closed abruptly before the corresponding response (`result`) has
even been written. Now if you remove the disconnect here, shouldn't the
issue #7680 occur again, you ask? The answer is no, because we now also
have a maximum timeout of `10s` for anonymous connections, after which
they are automatically closed. Thanks to the introduction of this
timeout by @julianbrost in #8479, this `Disconnect()` call has become
superfluous.
2025-01-30 17:45:27 +01:00
Julian Brost
51c6a58657
Merge pull request #9943 from Icinga/renegotiation-openbsd
Disable TLS renegotiation and fix compile error on OpenBSD
2025-01-30 15:50:07 +01:00
Alexander A. Klimov
e1a4390b9c Fix compile error on OpenBSD which has no SSL_OP_NO_RENEGOTIATION 2025-01-29 17:42:10 +01:00
Julian Brost
fe85bf1295
Merge pull request #10318 from Icinga/update-migration-docs
Include Nagios in the migration docs
2025-01-24 13:55:06 +01:00
Yonas Habteab
8f12831a61
Merge pull request #10322 from Icinga/missing-x-for-mail-notification
docs: Document `mail-{host,service}-notification` `-X` option
2025-01-24 13:36:16 +01:00
Yonas Habteab
275753e49b docs: Document mail-{host,service}-notification -X option 2025-01-24 11:33:10 +01:00
Alexander A. Klimov
411c57aac5 API: also log error behind "No data received on new API connection" 2025-01-24 11:28:16 +01:00
Julian Brost
78883669d3
Merge pull request #8169 from Icinga/bugfix/object-query-all-attrs-8167
GET /v1/objects/*: handle "attrs":[] as expected
2025-01-24 09:14:17 +01:00
Blerim Sheqa
2639579374 Include Nagios in the migration docs 2025-01-23 09:27:17 +01:00
Alexander Aleksandrovič Klimov
d55c3644a2
Merge pull request #10312 from Icinga/win-configure-cmake-opts
tools/win32/configure*.ps1: allow custom $CMAKE_ARGS (JSON array)
2025-01-22 10:09:55 +01:00
Alexander A. Klimov
4175a47314 tools/win32/configure*.ps1: allow custom $CMAKE_ARGS (JSON array) 2025-01-21 18:17:05 +01:00
Alexander A. Klimov
e18c923abb GET /v1/objects/*: handle "attrs":[] as expected
... i.e. yield no attrs and not all.

refs #8167
2025-01-21 11:36:55 +01:00
Bruno Lingner
daf36ae362 add _extra_opts argument to plugins that support it 2025-01-20 14:13:28 +01:00
Alexander Aleksandrovič Klimov
866db3ba3c
Merge pull request #10137 from Icinga/win-progfiles-icinga2-var
On Windows, don't create C:\Program Files\Icinga2\var during MSI build
2025-01-16 12:02:33 +01:00
Julian Brost
4ffe88e263
Merge pull request #9732 from Icinga/silence-compiler-warnings-in-code-we-don-t-maintain
Silence compiler warnings in code we don't maintain
2025-01-15 16:33:24 +01:00
Alexander A. Klimov
1c5dfc58ea Always compile with -Wsuggest-override not to forget override
`override` indicates an override of a virtual method and refuses to compile in case of a signature mismatch across the inheritence hierarchy.

This is especially useful when signatures change not to forget anything. Hence, we shall always use `override` whereever applicable.
2025-01-14 15:35:51 +01:00
Alexander Aleksandrovič Klimov
cddb3ca868
Merge pull request #10279 from Icinga/Al2Klimov-patch-3
release.md: don't update doc/21-development.md
2025-01-14 12:53:21 +01:00
Alexander A. Klimov
6195a457a7 Silence compiler warnings in code we don't maintain 2025-01-14 11:48:33 +01:00
Julian Brost
1f047ebbf5
Merge pull request #10058 from Icinga/error-timestamp-out-of-range-53323
Ido*sqlConnection#FieldToEscapedString(): don't write out of range time
2025-01-14 09:43:37 +01:00
Alexander Aleksandrovič Klimov
cd7bf428b0
Merge pull request #10287 from Icinga/Al2Klimov-patch-7
21-development.md: support Windows Server
2025-01-13 18:43:11 +01:00
Julian Brost
55829c4f55
Merge pull request #10077 from RincewindsHat/reject_invalid_perfdata
Reject infinite performance data values
2025-01-13 12:00:12 +01:00
Julian Brost
fb50e4b1f1
Merge pull request #10188 from Icinga/icingadb-heartbeat-both-responsible
IcingaDB Check: Multiple Responsible Instances
2025-01-13 11:56:19 +01:00
Alexander A. Klimov
ab0f20d8d6 21-development.md: support Windows Server
That OS need NetFx3ServerFeatures to be enabled before NetFx3.
2025-01-13 11:29:38 +01:00
Julian Brost
ea789f85ec
Merge pull request #10282 from Icinga/fix-broken-links
Fix and cleanup broken and obsolete links
2025-01-10 14:34:53 +01:00
Lorenz Kästle
e7381193c8
Reject infinite performance data values
Some fault monitoring plugins may return "inf" or "-inf" as
values due to a failure to initialize or other errors.

This patch introduces a check on whether the parse value is infinite
(or negative infinite) and rejects the data point if that is the case.

The reasoning here is: There is no possible way a value of "inf" is ever
a true measuring or even useful. Furthermore, when passed to the
performance data writers, it may be rejected by the backend and lead
to further complications.
2025-01-09 11:46:34 +01:00
Julian Brost
b96dc39ea2
Merge pull request #10210 from Icinga/endpoint-client-dropped-early
JsonRpcConnection: Don't drop client from cache prematurely
2025-01-09 10:29:27 +01:00
Alexander Aleksandrovič Klimov
1065d3bb2d
Merge pull request #10284 from Icinga/Al2Klimov-patch-7
21-development.md: fix indentation
2025-01-08 18:33:13 +01:00
Yonas Habteab
1425641931 Don't endlessly wait on writer coroutine on disconnect 2025-01-08 16:30:36 +01:00
Yonas Habteab
41373ad0e5 Log before & after an RPC client is disconnected 2025-01-08 16:30:36 +01:00
Yonas Habteab
3af7cfe2ec JsonRpcConnection: Don't drop client from cache prematurely
PR #7445 incorrectly assumed that a peer that had already disconnected
and never reconnected was due to the endpoint client being dropped after
a successful socket shutdown. However, the issue at that time was that
there was not a single timeout guards that could cancel the `async_shutdown`
call, petentially blocking indefinetely. Although removing the client from
cache early might have allowed the endpoint to reconnect, it did not
resolve the underlying problem. Now that we have a proper cancellation
timeout, we can wait until the currently used socket is fully closed
before dropping the client from our cache. When our socket termination
works reliably, the `ApiListener` reconnect timer should attempt to
reconnect this endpoint after the next tick. Additionally, we now have
logs both for before and after socket termination, which may help
identify if it is hanging somewhere in between.
2025-01-08 16:30:36 +01:00
Julian Brost
fba56f0e61
Merge pull request #10254 from Icinga/Timeout-Cancel
Timeout: use less resources, clean them up better and make cancellation deterministic
2025-01-08 16:28:54 +01:00
Blerim Sheqa
339ee7b125 Fix and cleanup broken and obsolete links 2025-01-08 13:42:20 +01:00
Alexander Aleksandrovič Klimov
9bc9d14e7e
Merge pull request #10283 from Icinga/itl-check_ssh-remote-pr9923
Update ITL for check_ssh
2025-01-08 12:22:44 +01:00
Alexander Aleksandrovič Klimov
d4b0e08c80
Merge pull request #10281 from Icinga/gha-sles
GHA: also test SLES, not just openSUSE
2025-01-08 12:04:01 +01:00
Alexander Aleksandrovič Klimov
b088d981ff
21-development.md: fix indentation
The last two points need to be children of the second one, but currently GitHub weights them equally.
2025-01-08 11:50:11 +01:00
Peter Eckel
920ba0b2db
Added the --dane option to the command definition ssl_cert (#10196) 2025-01-08 10:47:37 +00:00
MarcusCaepio
a662cb1a6b
Update ITL for check_ssh
Adds parameters for check_ssh (-r and -P) based on
nagios-plugins 2.3.3 / monitoring-plugins 2.3
Fixes #9922
2025-01-08 10:31:25 +01:00
alvar
c5963712fa
Merge pull request #10261 from n-rodriguez/wip/unplugged_nics_state
ITL vmware-esx-soap-host-net{,-nic}: Add missing option "--unplugged_nics_state"
2025-01-08 09:03:33 +00:00
Alexander A. Klimov
8f72891228 Document Timeout 2025-01-07 18:20:54 +01:00
Alexander A. Klimov
3ca7ff7bf4 Timeout: explicitly delete #Timeout(const Timeout&), #Timeout(Timeout&&), #operator=(const Timeout&), #operator=(Timeout&&) 2025-01-07 18:20:52 +01:00
Alexander A. Klimov
27e0e236cb Move Timeout instances from heap to stack 2025-01-07 18:20:50 +01:00
Alexander A. Klimov
d77d7506f1 Don't call Timeout#Cancel() where Timeout#~Timeout() is called 2025-01-07 18:20:14 +01:00
Alexander A. Klimov
959b162913 Timeout#~Timeout(), #Cancel(): support boost::asio::io_context running on multiple threads 2025-01-07 18:19:42 +01:00
Alexander A. Klimov
cb51649363 Timeout#Timeout(): drop unnecessary template parameters 2025-01-07 18:19:39 +01:00
Alexander A. Klimov
d2285bcf0e While using Timeout, don't unnecessarily keep the strand alive via smart pointer 2025-01-07 18:18:46 +01:00
Alexander A. Klimov
8cdbea303b Test Timeout 2025-01-07 18:18:39 +01:00
Alexander A. Klimov
faaeb4eb2e Timeout: use a plain callback, not an unnecessary coroutine 2025-01-07 18:18:24 +01:00
Alexander A. Klimov
92ab913226 Timeout#Timeout(): don't pass yield_context to callback
It's not used. Also, the callback shall run completely at once. This ensures that it won't (continue to) run once another coroutine on the strand calls Timeout#Cancel().
2025-01-07 18:18:18 +01:00
Julian Brost
880632b93a
Merge pull request #9861 from ymartin-ovh/issue-9752
icinga2: address comment loading where host reference is not found
2025-01-07 14:12:03 +01:00
Julian Brost
9a000f3d45
Merge pull request #10000 from Icinga/broken-downtime-comment-sync
Fix broken downtime comment sync
2025-01-07 13:32:49 +01:00
Alexander Aleksandrovič Klimov
120c89af55
release.md: don't update doc/21-development.md
The exact Boost version noted there for Windows doesn't matter.
2025-01-07 13:06:58 +01:00
Julian Brost
cf125dd8d5 Simplify DependencyGraph:RemoveDependency() method 2025-01-07 11:07:46 +01:00
Yonas Habteab
ff0e12e6ac ApiListener: Sync runtime configs in order 2025-01-07 11:07:46 +01:00
Yonas Habteab
015374e69d DependencyGraph: Allow lookups by parent & child dependencies 2025-01-07 11:07:46 +01:00
Julian Brost
8ae2659aa7
Merge pull request #10275 from Icinga/Al2Klimov-patch-3
GHA: drop EOL SUSE versions
2025-01-07 10:38:42 +01:00
Julian Brost
aa249d84f7
Merge pull request #10277 from Icinga/Al2Klimov-patch-6
GHA: Amazon Linux: fix broken link to Boost tarball
2025-01-07 10:35:53 +01:00
Alexander Aleksandrovič Klimov
7ea0f5969f
GHA: Amazon Linux: fix broken link to Boost tarball 2025-01-02 15:35:29 +01:00
Alexander Aleksandrovič Klimov
b2288d2925
GHA: also test SLES, not just openSUSE
They may be similar, but SLES isn't that hard to deploy.
2025-01-02 15:26:31 +01:00
Alexander Aleksandrovič Klimov
f098810892
GHA: drop EOL SUSE 15.4 2024-12-18 15:32:37 +01:00
Alexander Aleksandrovič Klimov
929deffb4b
GHA: drop EOL SLES 15.3 2024-12-18 15:31:56 +01:00
Alexander Aleksandrovič Klimov
d9cbed439a
GHA: drop EOL SLES 12.5 2024-12-18 15:30:40 +01:00
Alexander Aleksandrovič Klimov
383773eb2b
Merge pull request #10264 from Icinga/DependencyGraph-ConfigObject
DependencyGraph: use ConfigObject*, not Object*
2024-12-18 13:36:56 +01:00
Alexander A. Klimov
3a09cf72d6 DependencyGraph: use ConfigObject*, not Object*
This saves dynamic_cast<ConfigObject*> + if() on every item of GetChildren().
2024-12-17 18:33:05 +01:00
Julian Brost
452386cdb6
Merge pull request #10005 from Icinga/graceful-tls-disconnect
Add a dedicated method for disconnecting TLS connections
2024-12-12 16:20:14 +01:00
Julian Brost
3642ca3369
Merge pull request #10263 from Icinga/DependencyGraph-parent-child
DependencyGraph: switch "parent" and "child" terminology
2024-12-12 15:13:08 +01:00
Julian Brost
a506d562ae Add comment for remaining uses of async_shutdown() why it's safe
The reason for introducing AsioTlsStream::GracefulDisconnect() was to handle
the TLS shutdown properly with a timeout since it involves a timeout. However,
the implementation of this timeout involves spwaning coroutines which are
redundant in some cases. This commit adds comments to the remaining calls of
async_shutdown() stating why calling it is safe in these places.
2024-12-12 12:10:59 +01:00
Julian Brost
e6d103d0dd HttpServerConnection: use AsioTlsStream::GracefulDisconnect()
This new helper function has proper timeout handling which was missing here.
2024-12-12 12:10:59 +01:00
Julian Brost
007e3fbe7e JsonRpcConnection: use AsioTlsStream::GracefulDisconnect()
This new helper functions allows deduplicating the timeout handling for
`async_shutdown()`.
2024-12-12 12:10:59 +01:00
Julian Brost
56d5811283 AsioTlsStream: add GracefulDisconnect() and ForceDisconnect()
Calling `AsioTlsStream::async_shutdown()` performs a TLS shutdown which
exchanges messages (that's why it takes a `yield_context`) and thus has the
potential to block the coroutine. Therefore, it should be protected with a
timeout. As `async_shutdown()` doesn't simply take a timeout, this has to be
implemented using a timer. So far, these timers are scattered throughout the
codebase with some places missing them entirely. This commit adds helper
functions to properly shutdown a TLS connection with a single function call.
2024-12-12 12:10:59 +01:00
Alexander A. Klimov
188ba53b74 DependencyGraph: switch "parent" and "child" terminology
The .ti files call `DependencyGraph::AddDependency(this, service.get())`. Obviously, `service.get()` is the parent and `this` (Downtime, Notification, ...) is the child. The DependencyGraph terminology should reflect this not to confuse its future users.
2024-12-04 10:57:30 +01:00
Nicolas Rodriguez
e881898ce0 Add missing option "--unplugged_nics_state" to vmware-esx-soap-host-net and vmware-esx-soap-host-net-nic 2024-12-03 15:23:46 +01:00
Julian Brost
e50eb52291
Merge pull request #9825 from Icinga/Al2Klimov-patch-8
Doc: Distributed Monitoring: add section "External CA/PKI"
2024-12-02 10:00:55 +01:00
Alexander Aleksandrovič Klimov
8f51f54f19
Merge pull request #10221 from Icinga/Al2Klimov-patch-7
JsonRpcConnection: don't write new messages on shutdown
2024-11-29 09:24:10 +01:00
Julian Brost
b8f6d7344d
Merge pull request #10258 from Icinga/Al2Klimov-patch-11
GHA: Linux: don't track all supported distro versions
2024-11-27 17:20:25 +01:00
Julian Brost
57df92fa51
Merge pull request #10141 from Icinga/log-slow-http-rpc-processing
Log HTTP/RPC message processing stats
2024-11-27 17:15:36 +01:00
Alexander A. Klimov
cca5f6603b GHA: Linux: don't track all supported distro versions
Instead just give a generic explanation per distro.
2024-11-27 15:20:28 +01:00
Alexander A. Klimov
501175229c Doc: Distributed Monitoring: add section "External CA/PKI"
The following already works:

* Custom key sizes, e.g. 2048 bits
* Custom key types, e.g. ECC
* Multiple trusted root CAs in `/var/lib/icinga2/certs/ca.crt`
* Different root CAs per cluster subtree, as long as each node trusts the
  issuers of the certificates of all nodes it's directly connected to
* Any number of intermediate CAs
2024-11-27 14:49:06 +01:00
Yonas Habteab
4564c068fe JsonRpcConnection: Log message processing time stats
Co-Authored-By: Julian Brost <julian.brost@icinga.com>
2024-11-27 09:57:38 +01:00
Yonas Habteab
e0b053cbe1 HttpServerConnection: Log noticable CPU semaphore wait time 2024-11-27 09:57:38 +01:00
Julian Brost
4b884ea953
Merge pull request #10253 from Icinga/Al2Klimov-patch-11
GHA: update supported Fedora versions
2024-11-27 09:54:30 +01:00
Julian Brost
5c7bbf17c5
Merge pull request #10251 from Icinga/drop-ubuntu-23-10
GHA: Drop ubuntu 23.{04,10} (EOL)
2024-11-26 16:19:05 +01:00
Alexander Aleksandrovič Klimov
22b36b7cfb
GHA: update supported Fedora versions
Add v41, drop EOL v37, v38.
2024-11-26 11:15:53 +01:00
Christian Lauf
b7335841a3
Enhance documentation regarding internal icinga config sync check (#10101)
* Update 10-icinga-template-library.md

Explicitly name the config-sync check feature of the icinga check, as before this was a little bit too undocumented making it unknown to me.
Also mention where the check has to executed in order to bring the desired results.

* Update 15-troubleshooting.md

Add 4h typical error point for configuration stored outside of /etc/icinga2/zones.d. For when a non-distributed setup was migrated to a distributed setup.
Also link to the internal icinga CheckCommand to promote its existance.

* Update 15-troubleshooting.md

Remove "-" from link

* Revert "Update 15-troubleshooting.md"

This reverts commit bb25ba3ff5d2797b95cc6c6d5d4fc64e342164f1.

* Update AUTHORS

Add myself to AUTHORS

* Update doc/15-troubleshooting.md

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* Update doc/10-icinga-template-library.md

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* Update doc/15-troubleshooting.md

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

---------

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>
2024-11-26 10:52:05 +01:00
Yonas Habteab
a19246aca7 GHA: Drop ubuntu 23.{04,10} (EOL) 2024-11-25 17:10:08 +01:00
Yonas Habteab
3218908595
Merge pull request #10214 from Icinga/useless-http-coroutines
HttpServerConnection: Don't spawn useless coroutines
2024-11-19 15:53:54 +01:00
Yonas Habteab
2931aea9bb
Merge pull request #7818 from Icinga/bugfix/no_more_notifications-7758
Don't set Notification#no_more_notifications on custom notifications
2024-11-15 14:43:12 +01:00
Alexander A. Klimov
35a705752f Don't set Notification#no_more_notifications on custom notifications 2024-11-15 13:03:22 +01:00
Alvar Penning
0bbe7a9b2f
IcingaDB Check: Multiple Responsible Instances
By design, only one Icinga 2 instance should be responsible in the HA
context. If this promise is broken, the Icinga 2 IcingaDB check should
report it.

The code did not check for invalid data in icingadb:telemetry:heartbeat.
With this change, it will go CRITICAL with a descriptive message and
report the actual number of icingadb_responsible_instances in the
performance data.
2024-11-15 12:56:45 +01:00
Alexander Aleksandrovič Klimov
211bae87b5
Merge pull request #10205 from Icinga/Al2Klimov-patch-11
openSUSE install docs: remove false info
2024-11-15 11:30:03 +01:00
Yonas Habteab
f3e7f193c2
Merge pull request #10232 from Icinga/itl-check_procs-exclude-process
ITL: Add --exclude-process to check_procs
2024-11-15 10:19:58 +01:00
Yonas Habteab
5c0f9bfdaa HttpServerConnection: Don't spawn useless coroutines
Currently, for each `Disconnect()` call, we spawn a coroutine, but every
one of them is just usesless, except the first one. However, since all
`Disconnect()` usages share the same asio strand and cannot interfere
with each other, spawning another coroutine within `Disconnect()` isn't
even necessary. When a coroutine calls `Disconnect()` now, it will
immediately initiate an async shutdown of the socket, potentially causing
the coroutine to yield and allowing the others to resume. Therefore, the
`m_ShuttingDown` flag is still required by the coroutines to be checked
regularly.
2024-11-14 16:47:01 +01:00
Yonas Habteab
d68ee3fcf8
Merge pull request #10224 from Icinga/Empty-constant
Make icinga::Empty constant to prevent accidental changes
2024-11-14 10:35:36 +01:00
Alvar Penning
e620f9515b
ITL: Add --exclude-process to check_procs
For check_procs, both the Monitoring Plugins' implementation[0] and the
Nagios Plugin[1] are supporting the "-X" or "--exclude-process" flag to
exclude one or many processes by name. However, this flag is missing
here in the Icinga Template Library.

The Nagios Plugin implementation also comes with "-j" and "-g" for
FreeBSD jails and Linux cgroups, respectively. But, to keep it
compatible, I would ignore these for the moment.

Closes #10226.

[0]: https://www.monitoring-plugins.org/doc/man/check_procs.html
[1]: https://nagios-plugins.org/doc/man/check_procs.html
2024-11-13 09:36:06 +01:00
Alexander Aleksandrovič Klimov
7a20d987f6
Merge pull request #10231 from Icinga/probot/sync-changelog/master/cf162e85d013a95fa31107284bdc969410de4bd7 2024-11-12 22:00:09 +01:00
Alexander A. Klimov
dfa2912983 CHANGELOG.md: add v2.14.3 2024-11-12 19:21:36 +00:00
Alexander Aleksandrovič Klimov
cf162e85d0
Merge pull request #10230 from Icinga/probot/sync-changelog/master/1d37a60d1b6d62875bb0c2d4c7151157123bb48a 2024-11-12 20:21:25 +01:00
Alexander A. Klimov
fa480f225a CHANGELOG.md: add v2.13.10 2024-11-12 17:46:17 +00:00
Alexander Aleksandrovič Klimov
1d37a60d1b
Merge pull request #10229 from Icinga/probot/sync-changelog/master/67175c43c0c09dfba50bed8eff33a66c4b37062d
CHANGELOG.md: add v2.11.12
2024-11-12 18:46:05 +01:00
Alexander A. Klimov
d9b280be7b CHANGELOG.md: add v2.11.12 2024-11-12 16:04:47 +00:00
Julian Brost
67175c43c0
Merge pull request #10102 from Icinga/icingadb-redis-username
Icinga DB: Config no_user_modify and Support Redis username authentication
2024-11-12 17:04:20 +01:00
Julian Brost
5817e7666b
Merge commit from fork
Security: fix TLS certificate validation bypass
2024-11-12 15:01:57 +01:00
Alexander A. Klimov
09160ea9eb Make icinga::Empty constant to prevent accidental changes 2024-11-11 16:31:04 +01:00
Alexander Aleksandrovič Klimov
aa7f159a0f
JsonRpcConnection: don't write new messages on shutdown
In fact, this is already done for the outer loop (for each bulk), just not yet for the inner one (for each message of a bulk). So once the remote signals EOF, don't try to process the remaining queue until write error (which can't be associated with a particular message anyway, due to buffering), but just let the peer go. Flush already half-written messages, though, if possible.
2024-11-07 17:32:12 +01:00
Alexander Aleksandrovič Klimov
9a8620d923
Merge pull request #10213 from Icinga/do-not-read-data-on-disconnect
JsonRpcConnection: Don't read any data on shutdown
2024-11-07 12:32:02 +01:00
Alexander Aleksandrovič Klimov
0fde1ef632
Merge pull request #10215 from Icinga/Al2Klimov-patch-3
Atomic<T>#Atomic(T): fix C++ compliance
2024-11-06 13:33:46 +01:00
Alexander Aleksandrovič Klimov
fb64c4f057
Atomic#Atomic(): remove superfluous atomic write 2024-11-06 11:37:02 +01:00
Alexander Aleksandrovič Klimov
a77259adc1
Atomic<T>#Atomic(T): fix C++ compliance
by not calling `std::atomic<T>::atomic(void)`.

After the latter the instance "does not contain a T object, and its only valid uses are destruction and initialization by std::atomic_init" which we don't call. So the only safe option is `std::atomic<T>::atomic(T)`.

https://en.cppreference.com/w/cpp/atomic/atomic/atomic
2024-11-05 13:15:22 +01:00
Yonas Habteab
1c34610a78 JsonRpcConnection: Don't read any data on shutdown
When the `Desconnect()` method is called, clients are not disconnected
immediately. Instead, a new coroutine is spawned using the same strand
as the other coroutines. This coroutine calls `async_shutdown` on the
TCP socket, which might be blocking. However, in order not to block
indefintely, the `Timeout` class cancels all operations on the socket
after `10` seconds. Though, the timeout does not trigger the handler
immediately; it creates spawns another coroutine using the same strand
as in the `JsonRpcConnection` class. This can cause unexpected delays if
e.g. `HandleIncomingMessages` gets resumed before the coroutine from the
timeout class. Apart from that, the coroutine for writing messages uses
the same condition, making the two symmetrical.
2024-10-31 17:09:13 +01:00
Yonas Habteab
d894792c36
Merge pull request #10209 from Icinga/log-error-context-only-once
ApiListener: Log error context only once
2024-10-31 13:14:42 +01:00
Alexander Aleksandrovič Klimov
5f487aff1b
Merge pull request #10201 from Icinga/Validation-failed
Remove redundant "Validation failed" prefix from ValidationError exceptions
2024-10-31 12:30:39 +01:00
Yonas Habteab
8574357443 ApiListener: Log error context only once
When logging at the warning level, the logger will automatically look up
for registered context and append them to the log entry accordingly.
2024-10-30 16:55:13 +01:00
Yonas Habteab
92399a9d9c
Merge pull request #10208 from Icinga/unused-variables
JsonRpcConnection: Drop unused `m_NextHeartbeat` variable
2024-10-30 16:34:46 +01:00
Alexander Aleksandrovič Klimov
65a642dbee
Merge pull request #9981 from Icinga/Al2Klimov-patch-3
Document how to enable/disable Debug Output on the fly
2024-10-30 16:18:45 +01:00
Yonas Habteab
e8b7baa298 JsonRpcConnection: Drop unused m_NextHeartbeat variable 2024-10-30 14:31:48 +01:00
Yonas Habteab
10775f4481
Merge pull request #10207 from Icinga/log-connected-endpoint-connection-attempts
ApiListener: Log connection attempts from an already connected client prominently
2024-10-30 13:31:44 +01:00
Yonas Habteab
9d4625e1ec ApiListener: Log connection attempts from an already connected client
Something is definitely going wrong if a client tries to reconnect to
this endpoint while it still has an active connection to that client. So
we shouldn't hide this, but at least log it at info level. Apart from
that, I've added some additional information about the currently active
client, such as when the last message was sent and received.
2024-10-30 11:26:21 +01:00
Alexander Aleksandrovič Klimov
73e992da81
openSUSE install docs: remove false info
No packages to be installed according to these instructions require the given repo.
2024-10-28 12:12:35 +01:00
Alexander Aleksandrovič Klimov
4ca68e444e
Merge pull request #10204 from Icinga/an-HA
doc/: fix "a HA" -> "an HA"
2024-10-24 11:30:24 +02:00
Alexander Aleksandrovič Klimov
fb8badfd2e
Merge pull request #10187 from Icinga/state-before-suppression
Fix lost recovery notifications after recovery outside of notification time period
2024-10-24 10:07:59 +02:00
Alexander Aleksandrovič Klimov
7df6baf146
Merge pull request #10176 from Icinga/ICINGA2_UNITY_BUILD=OFF-ICINGA2_WITH_LIVESTATUS=ON
Fix build on Mac with -DICINGA2_UNITY_BUILD=OFF -DICINGA2_WITH_LIVESTATUS=ON
2024-10-24 10:03:57 +02:00
Alexander A. Klimov
e889528b14 Document how to enable/disable Debug Output on the fly
This is a good alternative to `icinga2 feature enable debuglog`:

* Object creation/deletion via API happens immediately and requires no restart
* Hence, the debug log is enabled exactly as long as desired

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>
2024-10-24 09:49:55 +02:00
Alexander A. Klimov
095e5982f4 doc/: fix "a HA" -> "an HA" 2024-10-24 09:44:36 +02:00
Alvar Penning
98f60fd78e
Icinga DB: Support Redis username authentication
The Redis ACL system was introduced with Redis 6.0. It introduced users
with precisely granular permissions. This change allows Icinga 2 to use
the Icinga DB feature against a Redis with an ACL user.

This was reflected in the documentation, next to the already
implemented, but undocumented Redis database.

Closes #9536.
2024-10-24 09:18:19 +02:00
Alvar Penning
57fab7f39e
Icinga DB: Config no_user_modify
Each configuration field of an IcingaDB Object was marked with
no_user_modify as modifications via the API would not result in an
actual change. While the Object would be updated, the internal Redis
connection would not be restarted, resulting in an unexpected behavior.

The missing db_index was added to the documentation.
2024-10-24 09:18:09 +02:00
Yonas Habteab
09d102aeed
Merge pull request #10200 from Icinga/Al2Klimov-patch-11
GHA: Linux: include Ubuntu 24.10
2024-10-23 16:34:50 +02:00
Yonas Habteab
a7bc5ee29c
Merge pull request #10198 from Icinga/wingha-gitlab
GHA: Windows: don't require git.icinga.com/packaging/windows-icinga2
2024-10-23 14:48:47 +02:00
Alexander Aleksandrovič Klimov
8db62744cf
GHA: Linux: include Ubuntu 24.10 2024-10-23 14:42:15 +02:00
Alexander A. Klimov
7a4ba59961 Remove redundant "Validation failed" prefix from ValidationError exceptions
ValidationError#ValidationError() already prefixes #m_What,
which #what() returns, with "Validation failed for object".
2024-10-23 13:06:12 +02:00
Alexander A. Klimov
b95858d4d1 GHA: Windows: don't require git.icinga.com/packaging/windows-icinga2
"A little copying is better than a little dependency."
- https://www.youtube.com/watch?v=PAAkCSZUG1c&t=9m28s
(Gopherfest 2015 | Go Proverbs with Rob Pike)
2024-10-23 10:33:23 +02:00
Julian Brost
869a7d6f0f Security: fix TLS certificate validation bypass
The previous validation in set_verify_callback() could be bypassed, tricking
Icinga 2 into treating invalid certificates as valid. To fix this, the
validation checks were moved into the IsVerifyOK() function.

This is tracked as CVE-2024-49369, more details will be published at a later time.
2024-10-22 10:36:58 +02:00
Yonas Habteab
c6de69cfe4
Merge pull request #10194 from Icinga/docs-extend-ecape-characters
docs: Add $ to the escape sequences section
2024-10-21 14:19:35 +02:00
Yonas Habteab
9fa438c956 docs: Add missing space 2024-10-21 12:41:32 +02:00
Yonas Habteab
39337fbeae docs: Add $ to the escape sequences section
feat: Add the `$` character to the escape sequences table.
2024-10-21 12:41:32 +02:00
Yonas Habteab
f4e61ef9bd
Merge pull request #10177 from Icinga/log-noop-fix
Log: fix some parts of messages not being discarded early
2024-10-21 09:31:19 +02:00
Julian Brost
7d0a43f926 Use Checkable::GetStateBeforeSuppression() only where relevant
This fixes an issue where recovery notifications get lost if they happen
outside of a notification time period.

Not all calls to `Checkable::NotificationReasonApplies()` need
`GetStateBeforeSuppression()` to be checked. In fact, for one caller,
`FireSuppressedNotifications()` in
`lib/notification/notificationcomponent.cpp`, the state before suppression may
not even be initialized properly, so that the default value of OK is used which
can lead to incorrect return values. Note the difference between suppressions
happening on the level of the `Checkable` object level and the `Notification`
object level. Only the first sets the state before suppression in the
`Checkable` object, but so far, also the latter used that value incorrectly.

This commit moves the check of `GetStateBeforeSuppression()` from
`Checkable::NotificationReasonApplies()` to the one place where it's actually
relevant: `Checkable::FireSuppressedNotifications()`. This made the existing
call to `NotificationReasonApplies()` unneccessary as it would always return
true: the `type` argument is computed based on the current check result, so
there's no need to check it against the current check result.
2024-10-11 13:21:10 +02:00
Alexander A. Klimov
c6f9de5933 Ido*sqlConnection#FieldToEscapedString(): don't write out of range time
MySQL's FROM_UNIXTIME() NULLs ts <1970, errors for >2038.
Postgres' TO_TIMESTAMP() errors for all ts not between 4713BC - 294276AD.
2024-10-02 11:52:25 +02:00
Julian Brost
5e9e0bbcdf
Merge pull request #10059 from Icinga/IcingaDB-TimestampToMilliseconds-limit
IcingaDB::TimestampToMilliseconds(): limit output to four year digits
2024-10-02 09:19:03 +02:00
Alexander A. Klimov
ad6fcda6df Ido*sqlConnection#FieldToEscapedString(): don't overflow timestamps > long 2024-10-01 17:38:52 +02:00
Alexander A. Klimov
dc4869c3aa IcingaDB::TimestampToMilliseconds(): limit output to four year digits
Too high timestamps may overflow uint64_t (and the YYYY format) and negative
ones don't fit into uint64_t. Those may crash our Go daemon.
2024-09-30 16:54:40 +02:00
Julian Brost
f0e084d530 Log: fix some parts of messages not being discarded early
`m_IsNoOp` was introduced to avoid building up log messages that will later be
discarded, like debug messages if no debug logging is configured. However, it
looks like the template operator<< implemented in the header file was forgotten
when adding this feature, all other places writing into `m_Buffer` already have
an if guard like added by this commit.
2024-09-27 14:23:05 +02:00
Alexander A. Klimov
2bbeaec916 Fix build on Mac with -DICINGA2_UNITY_BUILD=OFF -DICINGA2_WITH_LIVESTATUS=ON
error: no matching function for call to 'intrusive_ptr_release'
...
candidate function not viable: cannot convert argument of incomplete type 'icinga::Notification *' to 'Object *' for 1st argument
void intrusive_ptr_release(Object *object);
2024-09-27 12:41:11 +02:00
Julian Brost
b6b1506bda
Merge pull request #10140 from Icinga/drop-cpu-bound-work-usage-from-ifwapi
Don't use thread-local var in coroutine & drop superfluous `CpuBoundWork` usage
2024-09-27 11:31:58 +02:00
Yonas Habteab
92df9ef8c3
Merge pull request #10148 from Icinga/enhanced-sort-types-by-load-dependencies
Sort config types by their load dependencies once
2024-09-26 15:27:41 +02:00
Yonas Habteab
0fff4153ef
Merge pull request #10174 from open-i-gmbh/fix/influxdbwriter-validator-add-closing-quotation-marks
Add closing quotationmarks in Validator for influxdb writer config
2024-09-26 11:46:11 +02:00
Sebastian Grund
90c76ad89c
Update Authors 2024-09-26 10:04:02 +02:00
Sebastian Grund
8c68c6e9d8
Add closing quotationmarks in Validator for influxdb writer config 2024-09-25 13:03:00 +02:00
Yonas Habteab
01d3a1d382
Merge pull request #10170 from Icinga/OpenSSL3015
Bump OpenSSL shipped for Windows to v3.0.15
2024-09-24 12:43:56 +02:00
Alexander A. Klimov
7216220de1 Bump OpenSSL shipped for Windows to v3.0.15 2024-09-20 17:39:26 +02:00
Yonas Habteab
eb97676d69 Add basic test cases for Type::GetConfigTypesSortedByLoadDependencies() 2024-09-20 16:18:12 +02:00
Yonas Habteab
467e8b18e7 Type: Simplify sort by load dependencies algorithm 2024-09-20 16:18:12 +02:00
Alexander A. Klimov
31f3acaa13 ConfigItem::CommitNewItems(): pre-sort types by their load dependencies once
to avoid complicated nested loops, iterating over the same types and
checking dependencies over and over, skipping already completed ones.
2024-09-20 16:18:12 +02:00
Alexander A. Klimov
b848934d57 Introduce Type::GetConfigTypesSortedByLoadDependencies() 2024-09-20 16:18:12 +02:00
Yonas Habteab
4f690a6fde
Merge pull request #10169 from Icinga/Type-GetLoadDependencies-ConfigObject
Type#GetLoadDependencies(): VERIFY() that only config object types are returned
2024-09-20 16:11:17 +02:00
Alexander A. Klimov
b6517c6973 Type#GetLoadDependencies(): VERIFY() that only config object types are returned 2024-09-20 14:35:19 +02:00
Alexander A. Klimov
4b20121dcf Type#GetLoadDependencies(): group operations by type 2024-09-20 14:35:19 +02:00
Yonas Habteab
dac747f9d4
Merge pull request #10155 from Icinga/Type-GetLoadDependencies-nullptr
Type#GetLoadDependencies(): VERIFY() that no nullptr is returned
2024-09-20 12:29:48 +02:00
Alexander A. Klimov
c24713ac10 Type#GetLoadDependencies(): VERIFY() that no nullptr is returned 2024-09-19 16:43:00 +02:00
Alexander A. Klimov
36742c27b9 Don't override Type#GetLoadDependencies() if latter is sufficient
If a specific type shall return no deps, the base method already does that.
2024-09-19 15:47:25 +02:00
Yonas Habteab
e678f0977d
Merge pull request #10151 from Icinga/bugfix/do-not-sync-partially-initialised-objects
IcingaDB: Don't sync partially initialised objects
2024-09-18 15:48:42 +02:00
Yonas Habteab
3ffec77ae5
Merge pull request #10135 from Icinga/centos
doc/: don't mention CentOS
2024-09-18 10:22:09 +02:00
Yonas Habteab
7b12a8feeb
Merge pull request #10156 from Icinga/Al2Klimov-patch-7
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
2024-09-16 17:51:34 +02:00
Alexander A. Klimov
6da948c830 doc/: don't mention CentOS
It's EOL.
2024-09-16 17:08:42 +02:00
Alexander Aleksandrovič Klimov
f3ed85171e
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
We instruct the users to build as root and chown just /usr/local/icinga2/var, but at least `icinga2 api setup` also needs to modify /usr/local/icinga2/etc.
2024-09-16 16:13:02 +02:00
Yonas Habteab
0b8f70bbba
Merge pull request #10152 from Josef-Friedrich/remove-trailing-whitespaces
Remove trailing whitespaces in the markdown files of the documentation
2024-09-13 10:06:45 +02:00
Julian Brost
b62326d30c
Merge pull request #10153 from Josef-Friedrich/typo-api-docs
Fix typo in the api documentation
2024-09-12 10:37:06 +02:00
Josef Friedrich
1cd515ef8a
Fix typo in the api documentation 2024-09-12 08:46:27 +02:00
Josef Friedrich
1f31f725f8 Remove trailing whitespaces in the markdown files of the documentation 2024-09-12 08:39:15 +02:00
Yonas Habteab
26f43b0b48 IcingaDB: Don't sync partially initialised objects 2024-09-11 14:08:27 +02:00
Yonas Habteab
8beb0b74ab
Merge pull request #10149 from Icinga/fix-format-datetime-tests-on-darwin
tests: Fix test `FormatDateTime` with invalid formats on macOS/*BSD
2024-09-10 18:48:26 +02:00
Yonas Habteab
b8932e67fc tests: Fix test FormatDateTime with invalid formats on macOS/*BSD 2024-09-10 17:11:20 +02:00
Yonas Habteab
c0b047b1aa
Merge pull request #10035 from Icinga/check_systemd_name_fix
check_systemd: Fix executable name and include latest arguments
2024-09-06 11:57:33 +02:00
Alvar Penning
e7670e9ba9
check_systemd: harmonize ITL w/ upstream
Harmonize the arguments with the upstream CheckCommand[0], including a
patch to use the ITL variables[1].

[0]: https://github.com/Josef-Friedrich/check_systemd/blob/main/contrib/icinga2/command.conf
[1]: https://github.com/Josef-Friedrich/check_systemd/pull/38

Co-Authored-By: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com>
2024-09-06 10:21:30 +02:00
Yonas Habteab
74009f0fcb Don't use thread-local variable in coroutine & process final cr in global thread pool 2024-09-05 17:36:03 +02:00
Yonas Habteab
c9159494c0 HttpServerConnection: Drop yet another superfluous CpuBoundWork usage 2024-09-05 15:10:14 +02:00
Yonas Habteab
5cc034b38f
Merge pull request #10147 from Icinga/Al2Klimov-patch-7
Utility::ReleaseHelper(): remove detection of EOL distros
2024-09-05 09:27:51 +02:00
Alexander Aleksandrovič Klimov
79e3cb2a95 Utility::ReleaseHelper(): remove detection of EOL distros
We only support /etc/os-release owners.
2024-09-04 10:26:50 +02:00
Alexander Aleksandrovič Klimov
0951230ce1
Merge pull request #9991 from Icinga/JsonRpcConnection-9985
JsonRpcConnection#Send*(): discard messages ASAP once shutting down
2024-09-03 15:13:30 +02:00
Julian Brost
4c6b93d617
Merge pull request #10011 from Icinga/next-check-cluster-sync-issue
Checkable: Don't recalculate `next_check` for remotely generated `cr`
2024-08-30 13:37:41 +02:00
Lorenz Kästle
ba200f74e1
Add check_curl to ITL (#9205)
* Add check_curl to ITL

* small fixes and boolean defaults

* Add documentation for check_curl

* Replace dash with underscore in variables

* Add link to documentation

* Change order of argument attributes to adhere to style guide

* Shorten description of  tls option in itl

* Just remove information for check_curl options

* itl - check_curl: document -4 and -6

* itl - check_curl: Add haproxy option for check_curl

* itl - check_curl: add cookie-jar option

* itl - check_curl: add continue_after_certificate option

* itl - check_curl: replace dashes with underscores in macros

* Update itl/command-plugins.conf

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* Update itl/command-plugins.conf

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* itl - check_curl: add missing option documentation and reorder options

* itl - check_curl: Split certificate lifetime in two parameters

* itl - check_curl: replace remaining instances of single parameter for remaining valid time

* check_curl: allow assignements for host without address set

* check_curl: fix typo expext -> expect

* itl - check_curl: add state-regex option and documentation

* Add Tls options with version and without

* itl - check_curl: fix indentation

* itl - check_curl: Set v4/v6 variables

* itl - check_curl: Edit description for --sni

* doc - check_curl: fix singular-plural typo for curl_max_redir(s)

* doc/check_curl: sni description

* itl - check_curl: remove superfluous brace

* itl - check_curl: add extra-opts parameter

---------

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>
2024-08-30 10:25:27 +00:00
Julian Brost
73d3e5b1c7
Merge pull request #10136 from Icinga/icinga-archive-keyring
.deb: let user install icinga-archive-keyring package
2024-08-29 17:36:20 +02:00
Yonas Habteab
9f84c1516e ApiListener: Reorder logging in ApiTimerHandler() 2024-08-28 16:53:53 +02:00
Yonas Habteab
e062ceb901 ApiListener: Catch & supress clients runtime errors 2024-08-28 16:53:53 +02:00
Yonas Habteab
894d6aa290
Merge pull request #9974 from tbauriedel/fix/itl-http-definition
Fix ITL for http CheckCommand definition
2024-08-27 15:45:00 +02:00
Julian Brost
88e79ea41a
Merge pull request #10111 from Icinga/unregister-invalid-objects-properly
Unregister invalid config objects properly
2024-08-27 14:30:38 +02:00
Yonas Habteab
932a53449d JsonRpcConnection: Raise an exception when trying to send to disconnected clients 2024-08-27 14:23:41 +02:00
Julian Brost
9222a63ff7 Make sure log file is reopened when ApiListener::ReplayLog() returns 2024-08-27 14:23:41 +02:00
Yonas Habteab
a5a83e311a Defer: Allow empty initialization & add SetFunc() method 2024-08-27 14:23:41 +02:00
Yonas Habteab
73db30c08b Use Defer class for cleanup in ApiListener::ReplayLog() 2024-08-27 14:23:41 +02:00
Alexander A. Klimov
f074e24d2a ApiListener#ReplayLog(): stop reading files ASAP on send error 2024-08-27 14:23:41 +02:00
Alexander A. Klimov
b538ad2528 JsonRpcConnection#Send*(): discard messages ASAP once shutting down
Especially ApiListener#ReplayLog() enqueued lots of messages into
JsonRpcConnection#{m_IoStrand,m_OutgoingMessagesQueue} (RAM) even if
the connection was shut(ting) down. Now #Disconnect() takes effect ASAP.
2024-08-27 14:23:41 +02:00
Alexander A. Klimov
33f8ea6dcc JsonRpcConnection#Disconnect(): spawn coroutine only if necessary
by checking the now atomic #m_ShuttingDown outside of it.
2024-08-27 14:23:41 +02:00
Tobias Bauriedel
600281bfa0
Fix ITL for http CheckCommand definition
There were some missing arguments.

ref/NC/806131
2024-08-27 14:07:43 +02:00
Yonas Habteab
a51910a19b
Merge pull request #9975 from nicolasberens/bugfix/update-check_snmp-9907
add multiplier option to check_snmp which is available since monitori…
2024-08-26 17:12:09 +02:00
Nicolas Berens
c76cade9ae add new variables to documentation 2024-08-26 15:36:21 +02:00
Nicolas Berens
91b1638a01 add multiplier option to check_snmp which is available since monitoring-plugins v2.3.3, refs #9907 2024-08-26 15:36:21 +02:00
Julian Brost
145bb6109b
Merge pull request #10112 from Icinga/formatdatetime
Overhaul Utility::FormatDateTime()
2024-08-26 14:31:00 +02:00
Julian Brost
585b357c3f
Merge pull request #10090 from Icinga/rpi-os
Clarify that our Debian installation docs also apply to the Raspberry Pi OS
2024-08-26 13:54:30 +02:00
Alexander A. Klimov
f96e7c67ee On Windows, don't create C:\Program Files\Icinga2\var during MSI build 2024-08-23 12:49:09 +02:00
Julian Brost
39ae2e8ca4 Utility::FormatDateTime(): provide an overload for tm*
This allows the function to be used both with a double timestamp or a pointer
to a tm struct. With this, a similar implementation inside the tests can simply
use our regular function.
2024-08-23 12:48:50 +02:00
Julian Brost
d5b3ffaa6d Utility::FormatDateTime(): handle invalid format strings on Windows
On Windows, the strftime() function family invokes an invalid parameter handler
when the format string is invalid (see the "Remarks" section in their
documentation). std::put_time() shows the same behavior as it uses
_wcsftime_l() internally. The default invalid parameter handler may terminate
the process, which can be a problem given that the format string can be
specified by the user from the Icinga DSL.

Thus, temporarily set a thread-local no-op handler to disable the default one
allowing the program to continue. This then simply results in the function
returning an error which then results in an exception as we ask the stream to
throw one.

See also:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=msvc-170
https://learn.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation?view=msvc-170
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler?view=msvc-170
2024-08-23 12:48:50 +02:00
Julian Brost
0285028689 Utility::FormatDateTime(): handle errors from strftime()
So far, the return value of strftime() was simply ignored and the output buffer
passed to the icinga::String constructor. However, there are error conditions
where strftime() returns 0 to signal an error, like if the buffer was too small
for the output. In that case, there's no guarantee on the buffer contents and
reading it can result in undefined behavior. Unfortunately, returning 0 can
also indicate success and strftime() doesn't set errno, so there's no reliable
way to distinguish both situations. Thus, the implementation now returns the
empty string in both cases.

I attempted to use std::put_time() at first as that allows for better error
handling, however, there were problems with the implementation on Windows (see
inline comment), so I put that plan on hold at left strftime() there for the
time being.
2024-08-23 12:42:54 +02:00
Julian Brost
c2c66908f6 Utility::FormatDateTime(): use localtime_s() on Windows
localtime() is not thread-safe as it returns a pointer to a shared tm struct.
Everywhere except on Windows, localtime_r() is used already which avoids the
problem by using a struct allocated by the caller for the output.

Windows actually has a similar function called localtime_s() which has the same
properties, just with a different name and order of arguments.
2024-08-23 12:42:32 +02:00
Julian Brost
704acdc698 Utility::FormatDateTime(): use boost::numeric_cast<>()
The previous implementation actually had undefined behavior when called with a
double that can't be represented as time_t. With boost::numeric_cast, there's a
convenient cast available that avoids this and throws an exceptions on
overflow.

It's undefined behavior ([0], where the implicit conversion rule comes into
play because the C-style cast uses static_cast [1] which in turn uses the
imlicit conversion as per rule 5 of [2]):

> A prvalue of floating-point type can be converted to a prvalue of any integer
> type. The fractional part is truncated, that is, the fractional part is
> discarded.
>
> * If the truncated value cannot fit into the destination type, the behavior
>   is undefined (even when the destination type is unsigned, modulo arithmetic
>   does not apply).

Note that on Linux amd64, the undefined behavior typically manifests itself in
the result being the minimal value of time_t which then results in localtime_r
failing with EOVERFLOW.

[0]: https://en.cppreference.com/w/cpp/language/implicit_conversion#Floating.E2.80.93integral_conversions
[1]: https://en.cppreference.com/w/cpp/language/explicit_cast
[2]: https://en.cppreference.com/w/cpp/language/static_cast
2024-08-23 12:42:30 +02:00
Julian Brost
090dcfd70f Add tests for Utility::FormatDateTime() 2024-08-22 12:23:22 +02:00
Alexander Aleksandrovič Klimov
a8adfeda60
Merge pull request #10120 from Icinga/Al2Klimov-patch-7
doc/02-installation.md: remove outdated info
2024-08-21 14:40:24 +02:00
Alexander A. Klimov
d6bb971c7f doc/02-installation.md: remove Raspbian which is not supported anymore 2024-08-21 13:20:25 +02:00
Alexander A. Klimov
14e269060a Clarify that our Debian installation docs also apply to the Raspberry Pi OS 2024-08-21 13:19:54 +02:00
Alexander Aleksandrovič Klimov
aab0952bb1
doc/02-installation.md: remove outdated info
The Backports Repository is required for Debian 9, but we don't build even v10 anymore.
2024-08-21 12:09:27 +02:00
Alexander A. Klimov
81607426a2 .deb: let user install icinga-archive-keyring package 2024-08-21 11:48:19 +02:00
Julian Brost
914a26ce79
Merge pull request #10118 from Icinga/Al2Klimov-patch-7
doc/21-development.md: fix bad link address
2024-08-21 11:01:10 +02:00
Julian Brost
c4c00537ca
Merge pull request #10114 from Icinga/Boost1.86
Bump Boost shipped for Windows to v1.86
2024-08-21 10:59:51 +02:00
Alexander A. Klimov
584340a203 Bump Boost shipped for Windows to v1.86 2024-08-20 18:18:07 +02:00
Alexander Aleksandrovič Klimov
4fefdd0969
doc/21-development.md: fix bad link address 2024-08-20 18:13:42 +02:00
Julian Brost
be50050d2b
Merge pull request #10115 from Icinga/Al2Klimov-patch-7
doc/03-monitoring-basics.md: fix invalid link address
2024-08-20 16:18:40 +02:00
Julian Brost
ac84405334
Merge pull request #10116 from Icinga/missing-angle-bracket
Docs: Add missing angle bracket
2024-08-20 10:07:43 +02:00
Julian Brost
4c83d793a6
Merge pull request #9983 from Icinga/broken-timeperiod
Fix broken `TimePeriod/ScheduledDowntime`s
2024-08-20 10:05:59 +02:00
Alexander Aleksandrovič Klimov
edb6730858
doc/03-monitoring-basics.md: fix invalid link address 2024-08-19 16:49:12 +02:00
Yonas Habteab
ca7cc54438 Checkable: Don't recalculate next_check while processing remotely genrated check
Currently, when processing a `CheckResult`, it will first trigger an
`OnNextCheckChanged` event, which is sent to all connected endpoints.
Then, when `Checkable::ProcessCheckResult()` returns, an `OnCheckResult`
event is fired, which is of course also sent to all connected endpoints.

Next, the other endpoints receive the `event::SetNextCheck` cluster
event followed by `event::CheckResult`and invoke
`checkable#SetNextCheck()` and `Checkable#CheckResult()` with the newly
received check. So they also try to recalculate the next check
themselves and invalidate the previously received next check timestamp
from the source endpoint. Since each endpoint randomly initialises its
own scheduling offset, the recalculated next check will always differ by
a split second/millisecond on each of them. As a consequence, two Icinga
DB HA instances will generate two different checksums for the same state
and causes the state histories to be fully resynchronised after a
takeover/Icinga 2 reload.
2024-08-16 16:15:56 +02:00
Alexander Aleksandrovič Klimov
02ba5e4101
Merge pull request #10015 from Icinga/malloc_info
/v1/debug/malloc_info: call malloc_info(3) if available
2024-08-12 14:41:09 +02:00
Alexander A. Klimov
f3c7ac11e9 /v1/debug/malloc_info: call malloc_info(3) if available
The GNU libc function malloc_info(3) provides memory allocation and usage
statistics of Icinga 2 itself.
2024-08-09 12:59:25 +02:00
Julian Brost
2bfa1f1649
Merge pull request #10107 from Icinga/timeperiod-nth-day-of-month-off-by-one
Timeperiods: fix off by one when calculating n-th last weekday of the month
2024-08-08 14:40:18 +02:00
Julian Brost
c45829b59f Timeperiods: fix off by one when calculating n-th last weekday of the month
A day specification like "monday -1" refers to the last Monday of the month.
However, there was an off by one if the first day of the next month is the same
day of the week, i.e. a Monday in this example.

LegacyTimePeriod::FindNthWeekday() picks a day to start the search for the day
in question. When given a negative n to search for the n-th last day, it
wrongly used the first day of the following month as the start and counted it
as if it was within the current month. This resulted in a 1/7 chance that the
result was one week too late.

This is fixed by using the last day of the current month instead.
2024-08-07 12:06:05 +02:00
Yonas Habteab
c4edecc1fb Unregister invalid config objects properly 2024-08-06 16:59:30 +02:00
Julian Brost
07d253009a
Merge pull request #10013 from Icinga/broken-runtime-config-sync
Fix broken runtime config sync
2024-08-06 11:57:24 +02:00
Yonas Habteab
4f94891b52 Add advanced timeperiod range,include/exclude test cases 2024-08-02 11:12:51 +02:00
Yonas Habteab
ddf7143777 tests: Add some basic tests cases for LegacyTimePeriod::IsInTimeRange() 2024-08-02 11:12:51 +02:00
Yonas Habteab
86347013a6 Check segemnt start date inclusively in TimePeriod::IsInside() 2024-08-01 16:16:48 +02:00
Yonas Habteab
4daa03dc02 Fix broken timeperiods/scheduleddowntimes 2024-08-01 15:14:34 +02:00
Julian Brost
0463607050
Merge pull request #10104 from Icinga/gha-windows-ctest-fix
GHA: Unbreak Windows Tests
2024-07-31 13:52:03 +02:00
Julian Brost
ce81596ad5
Merge pull request #10096 from Icinga/Al2Klimov-patch-7
GHA: add openSUSE 15.6 and SLES 15.6
2024-07-31 12:19:52 +02:00
Alvar Penning
8db33e5b3c
GHA: Unbreak Windows Tests
As seen in the recent GHA run for #10102, the two Windows Actions have
failed. The output log contains:

> DEBUG:   27+  >>>> ctest.exe -C "${env:CMAKE_BUILD_TYPE}" -T test -O $env:ICINGA2_BUILDPATH/Test.xml
> --output-on-failure --log_level=all
> CMake Error: Unknown argument: --log_level=all
> CMake Error: Run 'ctest --help' for all supported options.

After consulting ctest(1), older versions included, I have never found a
mention of the "--log_level" flag. Since the useful
"--output-on-failure" flag is already set, which will "[o]utput anything
outputted by the test program if the test should fail", I do not see any
further reason for more logging information.

This flag was introduced in 7665143afa500dd589546665124293b9c1206265,
but I have not found any reasoning for the flag in particular.
2024-07-31 11:19:22 +02:00
Julian Brost
414d85571b
Merge pull request #10095 from Icinga/el7
GHA: drop EOL EL7
2024-07-31 10:34:12 +02:00
Alexander Aleksandrovič Klimov
6f28fea5bb
GHA: add openSUSE 15.6 and SLES 15.6 2024-07-01 13:29:01 +02:00
Alexander A. Klimov
ba52e2ed51 GHA: drop EOL EL7 2024-07-01 12:44:43 +02:00
Alexander Aleksandrovič Klimov
bca1a8447a
Merge pull request #10061 from Icinga/strip-cr-in-notification-messages-7510
Strip '\r' in notification messages to avoid 'Content-Type: application/octet-stream'
2024-06-14 11:51:02 +02:00
Yonas Habteab
546dea95a2 Don't allow to modify/create/delete an object concurrently 2024-06-13 11:26:19 +02:00
Yonas Habteab
099f664ce6 ConfigObjectUtility#CreateObject(): Use Defer for config path cleanup 2024-06-13 11:26:19 +02:00
Yonas Habteab
433e2de13a ApiListener: Process cluster config updates sequentially 2024-06-13 11:26:19 +02:00
Yonas Habteab
1a55b68541 Introduce RAII style ObjectNameLock class 2024-06-13 11:26:19 +02:00
Yonas Habteab
2218ebd6b0 ConfigObjectUtility: Use AtomicFile to store object config files 2024-06-13 11:26:19 +02:00
Alexander Aleksandrovič Klimov
f1be9b73ab
Merge pull request #10060 from Icinga/IcingaDB-SerializeState-execution_time-latency
IcingaDB#SerializeState(): limit execution_time and latency to 2^32-1
2024-06-13 09:55:45 +02:00
Alexander Aleksandrovič Klimov
c5c7925d8a
Merge pull request #10071 from Icinga/add-missing-evs-docs
Add missing `Object{created,deleted,modified}` docs
2024-06-12 11:25:24 +02:00
Alexander Aleksandrovič Klimov
1b863337e4
Merge pull request #10079 from Icinga/OpenSSL3014
Bump OpenSSL shipped for Windows to v3.0.14
2024-06-11 11:53:15 +02:00
Yonas Habteab
2432d1a861 Add missing Object{created,deleted,modified} docs 2024-06-11 09:46:18 +02:00
Alexander Aleksandrovič Klimov
4140d8c4e0
Merge pull request #10076 from Icinga/Boost1.85
Bump Boost shipped for Windows to v1.85
2024-06-10 11:00:01 +02:00
Alexander A. Klimov
b1eae017c9 Bump OpenSSL shipped for Windows to v3.0.14 2024-06-07 16:07:42 +02:00
Alexander A. Klimov
561d6a3981 Bump Boost shipped for Windows to v1.85
Note: For doc/21-development.md use:

perl -pi -e 's/(boost[-\w]*?1[-_]?)84/${1}85/g' doc/21-development.md
2024-06-07 16:02:07 +02:00
Alexander Aleksandrovič Klimov
b6b2f72055
Merge pull request #10056 from legioner0/patch-1
Update 06-distributed-monitoring.md
2024-06-04 09:50:43 +02:00
Alexander Aleksandrovič Klimov
d5d59c3b62
Merge pull request #10069 from Icinga/Al2Klimov-patch-7
doc/: ITL: correct ping_timeout default
2024-06-03 10:01:19 +02:00
Alexander Aleksandrovič Klimov
58e1718ca6
Merge pull request #10062 from Icinga/do-not-fail-removing-obsolete-downtimes
Don't fail to remove obsolete downtimes
2024-05-29 09:41:53 +02:00
Alexander Aleksandrovič Klimov
236071596b
Merge pull request #10048 from Icinga/Al2Klimov-patch-13
GHA: Docker: don't run on support/* branches
2024-05-28 09:58:42 +02:00
Pavel Motyrev
1526b191cd
Update AUTHORS 2024-05-28 10:55:16 +07:00
Alexander Aleksandrovič Klimov
c7e4c2af5a
doc/: ITL: correct ping_timeout default
ITL config says it's 10, not 0, and running check_ping itself confirms that.
2024-05-27 10:32:49 +02:00
Christian Gut
7cc8d81d5d
check_ssl_cert: integrate new option to set maximum validity (#9881)
* check_ssl_cert: integrate new option to set maximum validity

check_ssl_cert has a new option with a new default: --maximum-validity. This change allows for services to use that option to override the default of 397 days. It is needed, if you have internal certificates that have a longer duration.

---------

Co-authored-by: Alexander A. Klimov <alexander.klimov@icinga.com>
2024-05-27 09:59:36 +02:00
Alexander Aleksandrovič Klimov
b56839fe18
Merge pull request #9758 from liip-forks/OdyX-fix-ssl-cert-warnings
Fix ssl_cert deprecation warnings
2024-05-24 11:57:34 +02:00
Yonas Habteab
81a94a0759 Don't fail to remove obsolete downtimes 2024-05-23 10:09:41 +02:00
Yonas Habteab
4eeccce36c Don't loose args in recursive Downtime::RemoveDowntime() call 2024-05-23 10:09:41 +02:00
Yonas Habteab
e0fd0d3df4 Introduce & use enum DowntimeRemovalReason 2024-05-23 09:34:15 +02:00
Alexander Aleksandrovič Klimov
cc3965c3ce
Merge pull request #10065 from Icinga/heavy-update-missing-table-relations
Update `object#config_hash` after all relations queries
2024-05-22 15:38:31 +02:00
Yonas Habteab
1019398d55 Update object#config_hash after all relations queries 2024-05-22 13:39:30 +02:00
Alexander Aleksandrovič Klimov
1bdfc6fb89
Merge pull request #9749 from Icinga/Al2Klimov-patch-7
ITL: check_disk: ignore more fuse* filesystems
2024-05-22 10:33:55 +02:00
Yonas Habteab
3d64240ee3
Merge pull request #10066 from Icinga/Checkable-RemoveAllDowntimes
Remove unused Checkable#RemoveAllDowntimes()
2024-05-21 17:13:16 +02:00
Alexander Aleksandrovič Klimov
252b075d0f
Merge pull request #10064 from Icinga/rpm--import
Don't rpm --import https://packages.icinga.com/icinga.key
2024-05-21 14:35:41 +02:00
Alexander A. Klimov
e2bdb8a2f1 Remove unused Checkable#RemoveAllDowntimes() 2024-05-21 14:28:39 +02:00
Alexander A. Klimov
d68b328c9e Don't rpm --import https://packages.icinga.com/icinga.key
just like on packages.icinga.com and for the same security reasons we don't
use apt-key add anymore for: https://blog.cloudflare.com/dont-use-apt-key

Our repos already reference https://packages.icinga.com/icinga.key
and both RPM distro families properly handle that.
2024-05-16 13:13:13 +02:00
Alexander A. Klimov
f9adf18111 IcingaDB#SerializeState(): limit execution_time and latency to 2^32-1
not to write higher values into Redis than the Icinga DB schema can hold.
This fixes yet another potential Go daemon crash.
2024-05-15 12:55:41 +02:00
Robert Scheck
90d08faa9c Strip '\r' in notification messages to avoid 'Content-Type: application/octet-stream'
Without this patch, an accidential `\r` in e.g. `$NOTIFICATIONCOMMENT`
leads to a `Content-Type: application/octet-stream` header in e-mails.
The accidential `\r` might slip in usually using Icinga/Nagios apps...
2024-05-15 11:14:49 +02:00
Pavel Motyrev
397d36f52a
Update 06-distributed-monitoring.md
fix typo
2024-05-13 18:11:15 +07:00
Yonas Habteab
da2b592b77
Merge pull request #9960 from Icinga/doc-02-installation-root-session
Document root user usage in installation
2024-05-08 12:48:38 +02:00
Alvar Penning
a219436708
check_systemd: Fix executable name by dropping .py
The executable name for check_systemd's dropped the `.py` suffix for
version 2.0.3[0], released in April 2019[1]. However, the old name is
still being referenced, both in documentation as well as in the ITL's
CheckCommand's command, making it unusable.

Closes #9547.

[0]: https://github.com/Josef-Friedrich/check_systemd/compare/v2.0.2...v2.0.3#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
[1]: https://github.com/Josef-Friedrich/check_systemd/releases/tag/v2.0.3
2024-05-08 10:53:11 +02:00
Alvar Penning
f03c48c31e
Document root user usage in installation
The installation documentation currently implies that all commands are
being prompted by the root user or an user with root-like privileges.
This is now explicitly stated and, additionally, another if-guard was
added to not include the "Add Icinga Package Repository" section for
Windows, as it does not fit there.

Closes #9959.
2024-05-08 10:51:33 +02:00
Alexander Aleksandrovič Klimov
08eaf71994
Merge pull request #9941 from Icinga/Al2Klimov-patch-11
release.md: Merge docker-icinga2 dependency updates
2024-05-07 18:04:57 +02:00
Yonas Habteab
92e3c8d6b6
Merge pull request #10050 from Icinga/drop-last-in-downtime-from-docs
docs: Drop `last_in_downtime` attrs
2024-05-06 12:57:15 +02:00
Alexander Aleksandrovič Klimov
8c2eb3c1ed
Merge pull request #10049 from Icinga/AddDowntime-trigger_name
Downtime::AddDowntime(): NULL-check pointer before deref not to crash
2024-05-06 10:26:26 +02:00
Yonas Habteab
a12e49cbe4 docs: Drop last_in_downtime attrs 2024-04-26 11:37:56 +02:00
Alexander Aleksandrovič Klimov
d8f8d64f1a
Merge pull request #10027 from macdems/master
Fix missing values in PerfData normalization
2024-04-25 19:38:21 +02:00
Maciej Dems
2bb5cc62e2 Fix missing values in PerfData normalization 2024-04-25 17:41:12 +02:00
Maciej Dems
91789b2888 Correct tests checks for icinga_perfdata 2024-04-25 17:41:12 +02:00
Alexander A. Klimov
5f80ac17aa l_LegacyDowntimesCache: delete removed objects not to leak memory 2024-04-25 12:13:52 +02:00
Alexander A. Klimov
c0f87dd4c9 /v1/actions/schedule-downtime: reject request on invalid trigger_name
For this purpose lookup the specified Downtime. Also pass Downtime objects,
not just names, to Downtime::AddDowntime() not to lookup it twice.
2024-04-25 12:13:52 +02:00
Alexander A. Klimov
f0b5239a15 [Refactor] Downtime::GetDowntimeIDFromLegacyID(): return the Downtime itself
not just its name.
2024-04-25 12:13:52 +02:00
Alexander A. Klimov
28b0f7a48c [Refactor] l_LegacyDowntimesCache: store Downtime objects, not just their names
to avoid names of vanished objects.
2024-04-24 12:33:56 +02:00
Alexander Aleksandrovič Klimov
62512bbe2d
Merge pull request #10021 from Icinga/output-exit-code-52294
Mention plugin exit codes outside [0..3] in the plugin output and warning log
2024-04-23 19:46:05 +02:00
Alexander A. Klimov
bb13e98ca5 PluginCheckTask::ProcessFinishedHandler(): warn about exit codes outside 0..3
in the plugin output as well, in addition to the warning log.
2024-04-23 17:45:31 +02:00
Alexander A. Klimov
e33befabfb Make ProcessResult#ExitStatus and CheckResult#exit_status 64-bit ints
so that they can hold Windows exit codes like 3221225477 (>2147483647).
2024-04-23 17:45:31 +02:00
Alexander Aleksandrovič Klimov
cb945feb19
Merge pull request #10041 from Icinga/Al2Klimov-patch-15
GHA: add upcoming Fedora 40
2024-04-19 16:45:01 +02:00
Alexander Aleksandrovič Klimov
b85fab03bd
Merge pull request #10040 from Icinga/Al2Klimov-patch-14
GHA: add upcoming Ubuntu 24.04
2024-04-19 16:44:45 +02:00
Alexander Aleksandrovič Klimov
4026b5b254
GHA: Docker: don't run on support/* branches
PRs to them are already covered and we don't need support* image tags.
2024-04-19 11:50:13 +02:00
Alexander Aleksandrovič Klimov
7aaaa0b9b4
Merge pull request #7928 from Icinga/bugfix/opentsdb-custom-tag-empty-string-7724
OpenTsdbWriter#CheckResultHandler(): skip custom tags with empty values
2024-04-18 13:32:14 +02:00
Alexander A. Klimov
5c17465a19 OpenTsdbWriter#CheckResultHandler(): skip custom tags with empty values
refs #7724
2024-04-18 11:36:21 +02:00
Yonas Habteab
876a327772
Merge pull request #10043 from Icinga/Al2Klimov-patch-13
GHA: drop Debian 10
2024-04-16 18:02:13 +02:00
Alexander Aleksandrovič Klimov
4fbc276759
GHA: drop Debian 10
which will be EOL in 2.5 months.
2024-04-16 16:09:06 +02:00
Alexander Aleksandrovič Klimov
1010f0bde6
GHA: add upcoming Fedora 40 2024-04-16 10:38:27 +02:00
Alexander Aleksandrovič Klimov
d2543e9715
GHA: add upcoming Ubuntu 24.04 2024-04-16 10:38:17 +02:00
Alexander Aleksandrovič Klimov
a4c2b7820c
Merge pull request #10037 from Icinga/Al2Klimov-patch-13
CMakeLists.txt: set(CPACK_WIX_INSTALL_SCOPE NONE)
2024-04-16 10:37:47 +02:00
Alexander Aleksandrovič Klimov
ba0c712a8d
CMakeLists.txt: set(CPACK_WIX_INSTALL_SCOPE NONE)
to stick to CMake pre-v3.29 behavior. CMake v3.29 introduces CPACK_WIX_INSTALL_SCOPE. Its default conflicts with the ALLUSERS property in our icinga-installer/icinga2.wixpatch.cmake.
2024-04-04 17:53:42 +02:00
Alexander A. Klimov
d86e2556b4 ITL: check_disk: ignore more fuse* filesystems
not to run into permission denials.
Also, ignore fuse.* for the case check_disk already supports it:
https://github.com/monitoring-plugins/monitoring-plugins/pull/1904
2024-04-03 13:02:25 +02:00
Julian Brost
9e31b8b559
Merge pull request #9953 from Josef-Friedrich/patch-1
Fix typo in 12-icinga2-api.md
2024-03-11 15:10:44 +01:00
Josef Friedrich
e9a937c604 Add Josef Friedrich <josef@friedrich.rocks> to AUTHORS 2024-03-11 13:10:58 +01:00
Josef Friedrich
a282df1b96 Fix typo in 12-icinga2-api.md 2024-03-11 13:10:58 +01:00
Alexander A. Klimov
d9e3a9c71b AUTHORS: add Yannick Martin <yannick.martin@ovhcloud.com> 2024-03-11 12:44:06 +01:00
Yannick Martin
5e92450877 icinga2: address comment loading where host reference is not found
address #9752: check if host reference is valid
2024-03-11 12:42:23 +01:00
Julian Brost
31be43ff6c
Merge pull request #10018 from Icinga/revert-9980-config-sync-conflicts
Revert "Process `config::update/delete` cluster events gracefully"
2024-03-08 16:58:28 +01:00
Julian Brost
af97431bfb
Merge pull request #10006 from Icinga/http-error-handling
HttpServerConnection: use exceptions for error handling
2024-03-08 15:06:51 +01:00
Julian Brost
06bf843a95
Merge pull request #9967 from nicolasberens/bugfix/doc_typos
Fix typo in API Doc example
2024-03-08 14:25:53 +01:00
Alexander A. Klimov
df6c2c0da1 AUTHORS: add Nicolas Berens <nicolas.berens@planet.com> 2024-03-08 11:28:08 +01:00
Yonas Habteab
a924a49cd8
Revert "Process config::update/delete cluster events gracefully" 2024-03-07 17:17:17 +01:00
Julian Brost
097ba00a9c
Merge pull request #10008 from Icinga/Al2Klimov-patch-12
Don't unnecessarily shuffle items before config validation
2024-03-07 16:44:38 +01:00
Alexander Aleksandrovič Klimov
d551eaea27
Merge pull request #10009 from Icinga/Al2Klimov-patch-13
OpenTsdbWriter#CheckResultHandler(): clarify log messages
2024-02-22 12:31:09 +01:00
Alexander Aleksandrovič Klimov
629038344b
OpenTsdbWriter#CheckResultHandler(): clarify log messages
Clarify which "host or service" an "Unable to resolve macro" debug log message refers to.
2024-02-22 10:34:35 +01:00
Julian Brost
abea2f270c
Merge pull request #9997 from Icinga/ListenerCoroutineProc-remote_endpoint
ApiListener#ListenerCoroutineProc(): get remote endpoint ASAP for logging
2024-02-20 13:46:02 +01:00
Alexander Aleksandrovič Klimov
51cdd593da
Don't unnecessarily shuffle items before config validation
Before ae693cb7e1df1b885142854cf8a0f8a7600a3fb7 (#9577) we've repeatedly looped over all items in parallel like this:

while not types.done:
  for t in types:
    if not t.done and t.dependencies.done:
      with parallel(all_items, CONCURRENCY) as some_items:
        for i in some_items:
          if i.type is t:
            i.commit()

I.e. all items got distributed over CONCURRENCY threads, but not always equally. E.g. it was the hosts' turn, but only two threads got hosts and did all the work. The others didn't do actual work (due to the lack of hosts in their queue) which reduced the performance. c721c302cd9c96bee25a20b3862dad347345648a (#6581) fixed it by shuffling all_items first. ae693cb7e1df1b885142854cf8a0f8a7600a3fb7 (#9577) made the latter unnecessary by replacing the above algorithm with this:

while not types.done:
  for t in types:
    if not t.done and t.dependencies.done:
      with parallel(all_items[t], CONCURRENCY) as some_items:
        for i in some_items:
          if i.type is t:
            i.commit()

I.e. parallel() gets only items of type t, so all threads get e.g. hosts.
2024-02-19 14:26:06 +01:00
Julian Brost
700c5a13d7 HttpServerConnection: use exceptions for error handling
When a HTTP connection dies prematurely while the response is sent,
`http::async_write()` sets the error code to something like broken pipe for
example. When calling `async_flush()` afterwards, it sometimes happens that
this never returns. This results in a resource leak as the coroutine isn't
cleaned up. This commit makes the individual functions throw exceptions instead
of silently ignoring the errors, resulting in the function terminating early
and also resulting in an error being logged as well.
2024-02-19 14:12:41 +01:00
Julian Brost
04ef105caa
Merge pull request #9980 from Icinga/config-sync-conflicts
Process `config::update/delete` cluster events gracefully
2024-02-19 13:49:41 +01:00
Julian Brost
7d1c887a32
Merge pull request #9999 from Icinga/reset-log-message-count-correctly
ApiListener: Reset `m_LogMessageCount` when rotating
2024-02-15 17:06:16 +01:00
Alexander Aleksandrovič Klimov
9db1c4aca3
Merge pull request #8011 from Icinga/bugfix/reset-sigpipe-6912
Reset all signal handlers of child processes
2024-02-15 12:22:36 +01:00
Yonas Habteab
456144c1dc ApiListener: Process cluster config updates sequentially 2024-02-14 14:25:53 +01:00
Yonas Habteab
40011b0584 Introduce ObjectNamesMutex helper class 2024-02-14 14:25:53 +01:00
Alexander Aleksandrovič Klimov
1a8ce5a90e
Merge pull request #9575 from Icinga/WorkQueue-ParallelFor
WorkQueue#ParallelFor(): allocate lambda once per thread, not once per item
2024-02-14 12:59:50 +01:00
Julian Brost
2be08aa2e0
Merge pull request #9992 from Icinga/remove-redundat-cpu-bound-work
Drop redundant `CpuBoundWork` usage in `JsonRpcConnection::Disconnect()`
2024-02-13 15:51:34 +01:00
Julian Brost
fc6a106345
Merge pull request #9994 from Icinga/redundant-cpu-bound-work-usages
Drop redundant `CpuBoundWork` usages in `lib/remote`
2024-02-13 14:53:59 +01:00
Alexander Aleksandrovič Klimov
48eb563ca0
Merge pull request #9736 from Icinga/stream-read-allow_partial
Stream#Read(): remove de facto unused param allow_partial
2024-02-13 13:04:15 +01:00
Yonas Habteab
008fcd1744 Preserve runtime objects in a tmp file for the entire validation process
Given that the internal `config::Update` cluster events are using this
as well to create received runtime objects, we don't want to persist
first the conf file and the load and validate it with `CompileFile`.
Otherwise, we are forced to remove the newly created file whenever we
can't validate, commit or activate it. This also would also have the
downside that two cluster events for the same object arriving at the
same moment from two different endpoints would result in two different
threads simultaneously creating and loading the same config file -
whereby only one of the surpasses the validation, while the other is
facing an object `re-definition` error and tries to remove that config
file it mistakenly thinks it has created. As a consequence, an object
successfully created by the former is implicitly deleted by the latter
thread, causing the objects to mysteriously disappear.
2024-02-12 15:18:32 +01:00
Julian Brost
e936c43e89
Merge pull request #9993 from Icinga/coroutine-exception-log-diagnostics
IoEngine: Always log coroutine exception diagnostics
2024-02-12 10:39:37 +01:00
Yonas Habteab
6e66cd9aff ApiListener: Reset m_LogMessageCount when rotating
Closing and re-opening that very same log file shouldn't reset the
counter, otherwise some log files may exceed the max limit per file as
their offset indicator is reset each time they are re-opened.
2024-02-09 18:04:20 +01:00
Yonas Habteab
eb813cfb99 HttpServerConnection: Drop superfluous CpuBoundWork usage 2024-02-09 15:17:26 +01:00
Alexander A. Klimov
62e1d7650d ApiListener#ListenerCoroutineProc(): get remote endpoint ASAP for logging
On incoming connection timeout we log the remote endpoint which isn't
available if it was already disconnected - an exception is thrown.  Get it
as long as we're still connected not to lose it, nor to get an exception.
2024-02-09 12:27:25 +01:00
Yonas Habteab
32531fe909 EventsHandler: Drop superfluous CpuBoundWork usage 2024-02-09 12:00:50 +01:00
Eric Lippmann
c7293de91d IoEngine: Always log coroutine exception diagnostics
While analyzing a possible memory leak, we encountered several coroutine
exception messages, which unfortunately do not provide any information
about what exactly went wrong, as exception diagnostics were previously
only logged at the notice level.
2024-02-08 12:09:06 +01:00
Yonas Habteab
72266434df Drop redundant CpuBoundWork usages in lib/remote 2024-02-08 11:30:23 +01:00
Yonas Habteab
e2793f1d88 Drop redundant CpuBoundWork usage in JsonRpcConnection::Disconnect()
Although there is locking involved here, it shoudln't take too long for
the thread to actually acquire it, since there aren't that many threads
dealing with endpoint clients concurrently. It's just wasting pointless
time trying to obtain a CPU slot.
2024-02-08 11:24:55 +01:00
Julian Brost
01a6c4c1ce
Merge pull request #9976 from Al2Klimov/Al2Klimov-patch-42
GHA AUTHORS check: handle PRs from forks
2024-01-22 16:30:18 +01:00
Alexander A. Klimov
82e9c71001 GHA AUTHORS check: handle PRs from forks
where the ref names differ compared to own PRs. Instead refer to the base branch and the head branch via generic HEAD^<parent number> where HEAD is a merge commit.
2024-01-18 17:22:35 +01:00
Alexander Aleksandrovič Klimov
d6a9628f4a
Merge pull request #9972 from Icinga/probot/sync-changelog/master/e9fcbf400fc4df904efbb9ce1fdf40889f07d2ae
CHANGELOG.md: add v2.14.2
2024-01-18 12:41:58 +01:00
Alexander A. Klimov
255e3ddda1 CHANGELOG.md: add v2.14.2 2024-01-18 09:47:06 +00:00
Alexander Aleksandrovič Klimov
e9fcbf400f
Merge pull request #9966 from Icinga/Al2Klimov-patch-3
HttpServerConnection: remove duplicate ")" from a log message
2024-01-18 10:46:51 +01:00
Alexander A. Klimov
d48b369554 Reset all signal handlers of child processes
... not to disturb check plugins.

refs #6912
2024-01-17 12:25:59 +01:00
Alexander Aleksandrovič Klimov
966b46e808
Merge pull request #9965 from Icinga/http-request-time
HttpServerConnection: log request processing time as well
2024-01-17 11:30:33 +01:00
Nicolas Berens
4de722a4ae remove bracket 2024-01-17 09:46:21 +01:00
Julian Brost
b1fe15f694
Merge pull request #9962 from Icinga/influx-disk-9948
Influx DB: truncate timestamps to whole seconds to save disk space
2024-01-17 08:50:16 +01:00
Alexander A. Klimov
b6874cc8d4 HttpServerConnection: log request processing time as well 2024-01-16 17:52:07 +01:00
Julian Brost
f0924a0f4b
Merge pull request #9964 from Icinga/Boost1.84
Bump Boost shipped for Windows to v1.84
2024-01-16 17:48:42 +01:00
Alexander Aleksandrovič Klimov
6a4cb5c12c
HttpServerConnection: remove duplicate ")" from a log message
The commit 5c32a5a7dcd220598d36b2b47e745d14c23edb93, which introduced it, clearly shows that the other ")" already existed legitimately.
2024-01-16 16:31:00 +01:00
Alexander A. Klimov
77313d751c Bump Boost shipped for Windows to v1.84
Note: For doc/21-development.md use:

perl -pi -e 's/(boost[-\w]*?1[-_]?)83/${1}84/g' doc/21-development.md
2024-01-16 12:35:19 +01:00
Alexander A. Klimov
cc9db3756f Revert "Influx DB: don't unneccessarily truncate timestamps to whole seconds"
This reverts commit eaa3cd83adf860732b955a77b8f5fca7e30c65c2.
2024-01-16 12:19:48 +01:00
Alexander A. Klimov
fc5b1178c6 Revert "Remove no-op InfluxDB URL param"
This reverts commit 21f548d3c07189c6a413cf88c2b60cc9ada73497.
2024-01-16 12:19:47 +01:00
Alexander Aleksandrovič Klimov
2c9117b4f7
Merge pull request #9952 from Icinga/probot/sync-changelog/master/9e0dcf2b47e73fa58c9bd72883d380dc4c096aa6
CHANGELOG.md: add v2.14.1
2023-12-22 16:39:05 +01:00
Alexander A. Klimov
cc99fda7f8 CHANGELOG.md: add v2.14.1 2023-12-22 13:44:42 +00:00
Alexander Aleksandrovič Klimov
9e0dcf2b47
Merge pull request #9951 from Icinga/probot/sync-changelog/master/28b2db844654961e756959d0f07588a4fa967aec
CHANGELOG.md: add v2.13.9
2023-12-22 14:44:28 +01:00
Alexander A. Klimov
c2be90a1c9 CHANGELOG.md: add v2.13.9 2023-12-22 11:45:04 +00:00
Alexander Aleksandrovič Klimov
28b2db8446
Merge pull request #9851 from Icinga/Al2Klimov-patch-3
Make ObjectImpl<Logger>#GetSeverity() non-virtual
2023-12-22 12:44:51 +01:00
Alexander Aleksandrovič Klimov
6c03598678
Merge pull request #9896 from Icinga/provide-cancel_time-where-has_been_cancelled-may-be-1
Disallow triggering a cancelled downtime, but provide cancel_time in Icinga DB downtime history where has_been_cancelled may be 1
2023-12-20 10:03:09 +01:00
Alexander Aleksandrovič Klimov
949d983a76
Merge pull request #9895 from Icinga/targeted-api-filter
FilterUtility::GetFilterTargets(): don't run filter for specific object(s) for all objects
2023-12-19 15:18:41 +01:00
Alexander Aleksandrovič Klimov
fa07cd4207
Merge pull request #9931 from Icinga/OpenSSL3012
Bump OpenSSL shipped for Windows to v3.0.12
2023-12-19 15:16:25 +01:00
Alexander Aleksandrovič Klimov
7f1ba96615
Merge pull request #9930 from Icinga/boost183
Bump Boost shipped for Windows to v1.83
2023-12-19 15:15:42 +01:00
Alexander Aleksandrovič Klimov
8b2e28a869
Merge pull request #9891 from Icinga/renew-the-ca-9890
ApiListener#Start(): auto-renew CA on its owner
2023-12-19 14:57:47 +01:00
Alexander Aleksandrovič Klimov
96cfc4abe8
Merge pull request #9887 from Icinga/argument-list-too-long-9340
PluginNotificationTask::ScriptFunc(): on Linux truncate output and comment
2023-12-19 14:36:57 +01:00
Alexander Aleksandrovič Klimov
672a911fc7
release.md: Merge docker-icinga2 dependency updates
so that they're included in the Docker image our release GHA will build.
2023-12-19 12:54:07 +01:00
Alexander A. Klimov
175153ce6a PluginNotificationTask::ScriptFunc(): on Linux truncate output and comment
not to run into an exec(3) error E2BIG due to a too long argument.
This sends a notification with truncated output instead of not sending.
2023-12-19 12:21:03 +01:00
Alexander A. Klimov
4424d57e7a Tests: config_apply/gettargetservices_*: use BOOST_CHECK_EQUAL_COLLECTIONS()
to show the value diff in case of mismatch.

Co-authored-by: Yonas Habteab <yonas.habteab@icinga.com>
2023-12-18 16:01:31 +01:00
Alexander A. Klimov
966216f4ba RequestCertificateHandler(): also renew if CA needs a renewal
and a newer one is available.
2023-12-18 15:28:11 +01:00
Alexander A. Klimov
551c3afa60 CertificateToString(): allow raw pointer input 2023-12-18 15:28:11 +01:00
Alexander A. Klimov
bc778116e9 ApiListener#Start(): auto-renew CA on its owner
otherwise it would expire.
2023-12-18 15:28:11 +01:00
Alexander A. Klimov
36a08b0497 ApiListener#RenewCert(): enable optional CA creation 2023-12-18 15:28:11 +01:00
Alexander A. Klimov
7b55df6f11 CreateCertIcingaCA(EVP_PKEY*, X509_NAME*): enable optional CA creation 2023-12-18 15:28:11 +01:00
Alexander A. Klimov
dc338a406a Test IsCertUptodate() and IsCaUptodate() 2023-12-18 15:28:11 +01:00
Alexander A. Klimov
191bf93f2e Test ApplyRule::GetTarget*s() 2023-12-18 13:07:31 +01:00
Alexander Aleksandrovič Klimov
953eeba061
Merge pull request #9893 from Icinga/do-not-re-notify-if-filtered-states-don-t-change-4503
Discard likely duplicate problem notifications via Notification#last_notified_state_per_user
2023-12-13 16:13:28 +01:00
Alexander A. Klimov
ecfc9033b0 FilterUtility::GetFilterTargets(): don't run filter for specific object(s) for all objects 2023-12-13 16:02:50 +01:00
Alexander A. Klimov
15191bcd74 ApplyRule::GetTarget*s(): support constant strings from variables
in addition to literal strings. This is for sandboxed filters with some
variables pre-set by the caller. They're "constant" in that scope, too.
2023-12-13 16:02:50 +01:00
Alexander A. Klimov
a04cef1890 Introduce DictExpression#GetExpressions() 2023-12-13 16:02:50 +01:00
Alexander A. Klimov
8bcae97ecc Introduce Dictionary#GetRef() 2023-12-13 16:02:50 +01:00
Alexander A. Klimov
97cd05db7a Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
Alexander A. Klimov
44e9c6f40d Notification#BeginExecuteNotification(): discard likely duplicate problem notifications 2023-12-13 13:21:19 +01:00
Alexander A. Klimov
d268acaf20 Bump OpenSSL shipped for Windows to v3.0.12 2023-12-13 12:46:47 +01:00
Alexander A. Klimov
d60859c936 Bump Boost shipped for Windows to v1.83
Note: For doc/21-development.md use:

perl -pi -e 's/(boost[-\w]*?1[-_]?)82/${1}83/g' doc/21-development.md
2023-12-13 12:30:18 +01:00
Alexander A. Klimov
74f52c6fcd Introduce IsCaUptodate() by splitting IsCertUptodate() 2023-12-13 12:08:34 +01:00
Julian Brost
871fa67b52
Merge pull request #9885 from Icinga/renegotiation 2023-12-12 17:38:09 +01:00
Alexander A. Klimov
2cff763295 Cluster-sync Notification#last_notified_state_per_user 2023-12-12 15:29:50 +01:00
Alexander Aleksandrovič Klimov
d05be80fef
Merge pull request #9929 from Icinga/analyze-notification-result
Doc: Troubleshooting: remove obsolete section "Analyze Notification Result"
2023-12-12 15:26:40 +01:00
Alexander A. Klimov
87bb33dd2e Doc: Troubleshooting: remove obsolete section "Analyze Notification Result"
This feature has been reverted and won't be re-introduced anytime soon.
2023-12-12 11:04:51 +01:00
Alexander A. Klimov
b25ba7a316 Notification#BeginExecuteNotification(): track state change notifications 2023-12-07 12:43:30 +01:00
Julian Brost
420db1565b
Merge pull request #9914 from Icinga/Al2Klimov-patch-9 2023-12-06 12:05:33 +01:00
Julian Brost
1c0a13c82b
Merge pull request #9919 from Icinga/Al2Klimov-patch-11 2023-11-27 09:26:21 +01:00
Alexander Aleksandrovič Klimov
46f929cc63
Merge pull request #9917 from Icinga/Al2Klimov-patch-10
GHA: drop EOL Fedora 36
2023-11-24 15:04:07 +01:00
Alexander Aleksandrovič Klimov
9021ed37f8
Remove redundant RincewindsHat from AUTHORS
.mailmap already translates him to Lorenz Kästle who is included in AUTHORS as well.
2023-11-24 15:00:01 +01:00
Alexander Aleksandrovič Klimov
63cf195327
GHA: drop EOL Fedora 36 2023-11-24 12:03:35 +01:00
Alexander Aleksandrovič Klimov
2d167ccd28
Merge pull request #9911 from Icinga/gha-AUTHORS
GHA: complain if PR adds commits from people not yet listed in ./AUTHORS
2023-11-23 12:38:55 +01:00
Alexander A. Klimov
8025e0259a GHA: complain if PR adds commits from people not yet listed in ./AUTHORS
not to have to update ./AUTHORS or .mailmap after merging.
2023-11-21 12:40:16 +01:00
Alexander A. Klimov
d81607d9d8 .mailmap: map al2klimov@gmail.com to myself 2023-11-21 11:19:52 +01:00
Julian Brost
cbb2caf030
Merge pull request #9864 from Icinga/al2023
Docs: change "Amazon Linux 2" to "Amazon Linux" where applicable
2023-11-21 11:09:40 +01:00
Julian Brost
d2a7117007
Merge pull request #9899 from Icinga/icinga2-crashes-silently-9897
IcingaDB#SendConfigDelete(): fix missing nullptr check before deref
2023-11-21 11:03:28 +01:00
Alexander Aleksandrovič Klimov
7fc7d054af
Merge pull request #9841 from WuerthPhoenix/fix-9840-lock-console-api-during-reload 2023-11-21 10:36:26 +01:00
Alexander Aleksandrovič Klimov
b766c54a08
Merge pull request #9908 from Icinga/gha-push-cancel
GHA: cancel runs on PR, but not on push
2023-11-20 10:57:06 +01:00
Alexander A. Klimov
0fe13051b7 GHA: cancel runs on PR, but not on push
In a PR one top commit replaces the previous one.
But the central branches are more like timelines.
It's nice to have red crosses in a such timeline
as clear indicators that something was actually broken.
2023-11-17 15:54:03 +01:00
Alexander A. Klimov
7174dc864d IcingaDB#SendConfigDelete(): fix missing nullptr check before deref 2023-11-10 17:43:33 +01:00
Alexander A. Klimov
9aaa9901bd Icinga DB downtime history: provide cancel_time where has_been_cancelled may be 1
The table sla_history_downtime requires a downtime_end.
The Go daemon takes the cancel_time if has_been_cancelled is 1.
So we must supply a cancel_time whereever has_been_cancelled is 1.
Otherwise the Go daemon can't process some entries.
2023-11-08 15:22:39 +01:00
Alexander A. Klimov
d662ca0ada Docs: change "Amazon Linux 2" to "Amazon Linux" where applicable
We also support Amazon Linux 2023 now.
2023-11-07 11:14:55 +01:00
Alexander A. Klimov
7ce9457a4a Disable TLS renegotiation
The API doesn't need it and a customer's security scanner
is afraid of a potential DoS attack vector.
2023-11-06 18:46:37 +01:00
Julian Brost
3e8752d121
Merge pull request #9883 from Icinga/doc-09-object-types-host-name
Document host Common Runtime Attribute
2023-10-25 17:28:56 +02:00
Alvar Penning
5310063943 Document host Common Runtime Attribute 2023-10-25 14:49:10 +02:00
Julian Brost
641b9afdf0
Merge pull request #9886 from Icinga/probot/update-authors/master/443d97b0fc006dc0b18d2fa42eb0cfe63634ec81
Update AUTHORS
2023-10-24 19:15:01 +02:00
icinga-probot[bot]
b7fd5b60b2
Update AUTHORS 2023-10-24 13:01:36 +00:00
Julian Brost
443d97b0fc
Merge pull request #9884 from Icinga/probot/update-authors/master/31b1294aca949d1d7b3b54b681afa78b4f20b530
Update AUTHORS
2023-10-24 15:01:24 +02:00
Julian Brost
68e56555db
Merge pull request #9882 from botovq/tlsutility/remove-dead-code
Remove dead code in GetSignatureAlgorithm()
2023-10-24 15:00:50 +02:00
icinga-probot[bot]
f18e153760
Update AUTHORS 2023-10-24 09:51:24 +00:00
Alexander Aleksandrovič Klimov
31b1294aca
Merge pull request #9878 from Icinga/doc-12-icinga2-api-fix-downtime
Fix link text for Downtime* Event Stream Types
2023-10-24 11:50:57 +02:00
Theo Buehler
1f06589f7a Remove dead code in GetSignatureAlgorithm()
This code was added in commit 548eb93 and never did anything useful.
Using X509_get_signature_nid() or its expanded version in the pre-1.1
branch is the correct way of retrieving the signature algorithm of a
certificate.

CLA: trivial
2023-10-20 18:55:44 +02:00
Alvar Penning
039dbc02fc Fix link text for Downtime* Event Stream Types
The link text for all Downtime* Event Stream Types contains "Comment"
instead of "Downtime" even when pointing to the correct object.
2023-10-13 16:08:59 +02:00
Alexander Aleksandrovič Klimov
3021385d98
Merge pull request #9875 from Icinga/fix-downtime-docs
Fix downtime host/service name attribute descriptions
2023-10-11 13:28:55 +02:00
Yonas Habteab
6dfedb8e80 Fix downtime host/service name attribute descriptions 2023-10-11 10:34:51 +02:00
Julian Brost
76b460c8ba
Merge pull request #9872 from Icinga/Al2Klimov-patch-5
GHA: add upcoming (already frozen) Ubuntu 23.10
2023-10-06 13:05:29 +02:00
Alexander Aleksandrovič Klimov
bb6cfe94d3
GHA: add upcoming (already frozen) Ubuntu 23.10 2023-10-06 10:34:36 +02:00
Julian Brost
17858eae5b
Merge pull request #9871 from Icinga/Al2Klimov-patch-5
GHA: add upcoming (already frozen) Fedora 39
2023-10-05 12:18:11 +02:00
Alexander Aleksandrovič Klimov
9ebf585ec7
GHA: add upcoming (already frozen) Fedora 39 2023-10-04 16:35:26 +02:00
Julian Brost
bb60110368
Merge pull request #9863 from Icinga/Al2Klimov-patch-5
GHA: drop EOL Ubuntu 22.10
2023-10-04 11:42:12 +02:00
Alexander Aleksandrovič Klimov
a3dfb525c0
GHA: drop EOL Ubuntu 22.10 2023-09-26 11:40:28 +02:00
Julian Brost
bba6a76f4a
Merge pull request #9853 from Icinga/GelfWriter-m_StreamMutex
GelfWriter: protect m_Stream via m_WorkQueue, not ObjectLock(this)
2023-09-07 11:46:38 +02:00
Julian Brost
65dab469b7
Merge pull request #9856 from Icinga/Al2Klimov-patch-5
Doc: ITL: correct $ifw_api_crl$ default
2023-09-05 16:01:13 +02:00
Alexander Aleksandrovič Klimov
08a4aef4df
Doc: ITL: correct $ifw_api_crl$ default
In contrast to cert/key/CA, no CRL means no CRL.
(The behavior of the API is the same.)
2023-08-25 12:26:32 +02:00
Alexander Aleksandrovič Klimov
e5d988a2fe
Merge pull request #7799 from Icinga/bugfix/file-end
Fix file endings
2023-08-25 11:06:19 +02:00
Alexander A. Klimov
4ee10a6c20 GelfWriter: protect m_Stream via m_WorkQueue, not ObjectLock(this)
On shutdown or HA re-connect ConfigObject#SetAuthority(false) is called which
does ObjectLock(this) and ConfigObject#Pause(). GelfWriter#Pause(), with the
above ObjectLock, calls m_WorkQueue.Join(). But items inside that also doing
ObjectLock(this) cause a deadlock.
2023-08-24 17:48:09 +02:00
Alexander Aleksandrovič Klimov
993c9b742d
Make ObjectImpl<Logger>#GetSeverity() non-virtual
After all it's not overridden.
2023-08-15 13:03:31 +02:00
Alexander Aleksandrovič Klimov
66088050b5
Merge pull request #9848 from Icinga/mailmap-mathiasaerts
Update .mailmap
2023-08-14 12:58:47 +02:00
Julian Brost
e94ca5b24e Update .mailmap 2023-08-14 09:45:00 +02:00
Julian Brost
986991ed48
Merge pull request #9802 from mathiasaerts/patch-1
Fix 'healt' typo
2023-08-14 09:38:41 +02:00
Mattia Codato
41e21cb8cf Prevent calls to command API while the configuration is reloading.
Fixes #9840
2023-08-09 08:45:04 +02:00
Julian Brost
7ae91ce504
Merge pull request #9826 from Icinga/Al2Klimov-patch-9
Release issue template: Harden OpenSSL Defaults
2023-08-01 10:31:07 +02:00
Alexander A. Klimov
b84dda1790 .github/ISSUE_TEMPLATE/release.md: Harden global TLS defaults 2023-07-31 16:30:20 +02:00
Julian Brost
756aa18c18
Merge pull request #9828 from Icinga/release.md
Replace `RELEASE.md' with issue template
2023-07-31 16:18:01 +02:00
Alexander A. Klimov
4164bee6c7 Release issue template: restore non-trivial info from removed RELEASE.md
We have dedicated repositories for packages, so this stuff is already
fragmented into visible and invisible. The docs can be fragmented the same
way. But then everything about this repo should be documented in this repo,
too. This just re-adds docs about the publicly visible stuff. Ex. the last
section, but it is easy to miss, so it's here.
2023-07-31 10:46:12 +02:00
Julian Brost
2d6ea43a7b
Merge pull request #9834 from Icinga/probot/update-authors/master/e3cca711ef464505db0cd891239bc66686b641b6
Update AUTHORS
2023-07-24 14:01:04 +02:00
Alexander Aleksandrovič Klimov
d3d74c237c
ITL: ssl_cert: vars.ssl_cert_cn: default to "$ssl_cert_altnames$"
This way vars.ssl_cert_altnames keeps working.
2023-07-17 19:12:52 +02:00
icinga-probot[bot]
7e5dc97ecb
Update AUTHORS 2023-07-14 12:56:21 +00:00
Alexander Aleksandrovič Klimov
e3cca711ef
Merge pull request #9831 from Icinga/probot/update-authors/master/a81f95d6abcbf8b6811b1379badb262abedee46a
Update AUTHORS
2023-07-14 14:55:56 +02:00
Alexander Aleksandrovič Klimov
52a3604680
Merge pull request #9759 from liip-forks/OdyX-sslcert_allow-setting-url
ssl_cert allow HTTP request URL setting
2023-07-14 10:24:23 +02:00
Alexander A. Klimov
1308ad62af Stream#Read(): remove de facto unused param allow_partial
The only caller passes true, so no one forbids partial reads (even implicitly).
All usages in the implementation just assert it being true (allowed).
2023-07-13 16:55:48 +02:00
Alexander Aleksandrovič Klimov
1af5109ad3
Merge pull request #9734 from Icinga/remove-unused-stream-peek-
Remove unused Stream#Peek()
2023-07-13 16:52:29 +02:00
icinga-probot[bot]
b6c5e1663c
Update AUTHORS 2023-07-13 11:57:09 +00:00
Alexander Aleksandrovič Klimov
a81f95d6ab
Merge pull request #9746 from LordHepipud/patch-1
Adds ProgressPreference SilentlyContinue
2023-07-13 13:56:38 +02:00
Eric Lippmann
62d7e2af80 Replace `RELEASE.md' with issue template
Apart from the Windows-related notes, all instructions are common to our
releases and therefore do not need to be explicitly listed here. In
addition, most of the information was severely outdated, especially with
respect to how our packaging works.
2023-07-11 15:40:59 +02:00
Mathias Aerts
006ab1fe70
Fix typo 2023-06-26 09:17:26 +02:00
Alexander A. Klimov
9376a311ea Fix file endings
git ls-files -z \
	|grep -zEe '^lib/' \
	|grep -zEe '\.[ch]pp$' \
	|xargs -0 perl -p0i -e 's/\n*(?!(?:.|\n))/\n/'
2023-05-17 18:05:13 +02:00
Didier 'OdyX' Raboud
0b8f65d562
ssl_cert allow HTTP request URL setting
This is available in check_ssl_cert since 2021-02-18 Version 1.137.0
2023-05-08 17:00:45 +02:00
Didier 'OdyX' Raboud
610ba8d27a
ssl_cert: drop now-unsupported --altnames
Fixes https://github.com/Icinga/icinga2/issues/9661
2023-05-08 16:38:01 +02:00
Didier 'OdyX' Raboud
47d65a191c
ssl_cert: replace deprecated -n with --match
Fixes https://github.com/Icinga/icinga2/issues/9661
2023-05-08 16:37:37 +02:00
Lord Hepipud
e798f64fe3
Adds ProgressPreference SilentlyContinue
We should use `$Global:ProgressPreference = 'SilentlyContinue';` to disable the progress bar during download.
By doing so, information are directly written to the disk instead of written inside the memory and dumped to the disk afterwards
2023-04-17 12:56:33 +02:00
Alexander A. Klimov
78b4dc6509 Remove unused Stream#Peek() 2023-03-24 18:18:13 +01:00
Alexander A. Klimov
ba62c665aa WorkQueue#ParallelFor(): allocate lambda once per thread, not once per item 2022-11-30 11:10:24 +01:00
Bernd Arnold
6f03cfd240 Docs: Add missing angle bracket 2022-06-30 17:42:20 +02:00
240 changed files with 7208 additions and 3738 deletions

48
.github/ISSUE_TEMPLATE/release.md vendored Normal file
View File

@ -0,0 +1,48 @@
---
name: '[INTERNAL] Release'
about: Release a version
title: 'Release Version v$version'
labels: ''
assignees: ''
---
# Release Workflow
- [ ] Update `ICINGA2_VERSION`
- [ ] Update bundled Windows dependencies
- [ ] Harden global TLS defaults (consult https://ssl-config.mozilla.org)
- [ ] Update `CHANGELOG.md`
- [ ] Create and push a signed tag for the version
- [ ] Build and release DEB and RPM packages
- [ ] Build and release Windows packages
- [ ] Merge dependency updates in https://github.com/Icinga/docker-icinga2/pulls
- [ ] Create release on GitHub
- [ ] Update public docs
- [ ] Announce release
## Update Bundled Windows Dependencies
### Update packages.icinga.com
Add the latest Boost and OpenSSL versions to
https://packages.icinga.com/windows/dependencies/, e.g.:
* https://master.dl.sourceforge.net/project/boost/boost-binaries/1.82.0/boost_1_82_0-msvc-14.2-64.exe
* https://master.dl.sourceforge.net/project/boost/boost-binaries/1.82.0/boost_1_82_0-msvc-14.2-32.exe
* https://slproweb.com/download/Win64OpenSSL-3_0_9.exe
* https://slproweb.com/download/Win32OpenSSL-3_0_9.exe
### Update Build Server, CI/CD and Documentation
* [doc/win-dev.ps1](doc/win-dev.ps1) (also affects CI/CD)
* [tools/win32/configure.ps1](tools/win32/configure.ps1)
* [tools/win32/configure-dev.ps1](tools/win32/configure-dev.ps1)
### Re-provision Build Server
Even if there aren't any new releases of dependencies with versions
hardcoded in the repos and files listed above (Boost, OpenSSL).
There may be new build versions of other dependencies (VS, MSVC).
Our GitHub actions (tests) use the latest ones automatically,
but the GitLab runner (release packages) doesn't.

7
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

View File

@ -0,0 +1,8 @@
# This Dockerfile is used in the linux job for Alpine Linux.
#
# As the linux.bash script is, in fact, a bash script and Alpine does not ship
# a bash by default, the "alpine:bash" container will be built using this
# Dockerfile in the GitHub Action.
FROM alpine:3
RUN ["apk", "--no-cache", "add", "bash"]

39
.github/workflows/authors-file.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: AUTHORS file
on:
pull_request: { }
jobs:
authors-file:
name: AUTHORS file
runs-on: ubuntu-latest
steps:
- name: Checkout HEAD
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check whether ./AUTHORS is up-to-date
run: |
set -exo pipefail
sort -uo AUTHORS AUTHORS
git add AUTHORS
git log --format='format:%aN <%aE>' "$(
git merge-base HEAD^1 HEAD^2
)..HEAD^2" >> AUTHORS
sort -uo AUTHORS AUTHORS
git diff AUTHORS >> AUTHORS.diff
- name: Complain if ./AUTHORS isn't up-to-date
run: |
if [ -s AUTHORS.diff ]; then
cat <<'EOF' >&2
There are the following new authors. If the commit author data is correct,
either add them to the AUTHORS file or update .mailmap. See gitmailmap(5) or:
https://git-scm.com/docs/gitmailmap
Don't hesitate to ask us for help if necessary.
EOF
cat AUTHORS.diff
exit 1
fi

View File

@ -5,13 +5,12 @@ on:
push:
branches:
- master
- 'support/*'
release:
types:
- published
concurrency:
group: docker-${{ github.ref }}
group: docker-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs:

View File

@ -1,19 +1,33 @@
#!/bin/bash
set -exo pipefail
export PATH="/usr/lib/ccache:/usr/lib64/ccache:/opt/rh/devtoolset-11/root/usr/bin:$PATH"
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/lib64/ccache:$PATH"
export CCACHE_DIR=/icinga2/ccache
export CTEST_OUTPUT_ON_FAILURE=1
CMAKE_OPTS=''
CMAKE_OPTS=()
case "$DISTRO" in
alpine:*)
# Packages inspired by the Alpine package, just
# - LibreSSL instead of OpenSSL 3 and
# - no MariaDB or libpq as they depend on OpenSSL.
# https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/icinga2/APKBUILD
apk add bison boost-dev ccache cmake flex g++ libedit-dev libressl-dev ninja-build tzdata
ln -vs /usr/lib/ninja-build/bin/ninja /usr/local/bin/ninja
# This test fails due to some glibc/musl mismatch regarding timezone PST/PDT.
# - https://www.openwall.com/lists/musl/2024/03/05/2
# - https://gitlab.alpinelinux.org/alpine/aports/-/blob/b3ea02e2251451f9511086e1970f21eb640097f7/community/icinga2/disable-failing-tests.patch
sed -i '/icinga_legacytimeperiod\/dst$/d' /icinga2/test/CMakeLists.txt
;;
amazonlinux:2)
amazon-linux-extras install -y epel
yum install -y bison ccache cmake3 gcc-c++ flex ninja-build \
yum install -y bison ccache cmake3 gcc-c++ flex ninja-build system-rpm-config \
{libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
yum install -y bzip2 tar wget
wget https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2
wget https://archives.boost.io/release/1.69.0/source/boost_1_69_0.tar.bz2
tar -xjf boost_1_69_0.tar.bz2
(
@ -24,38 +38,30 @@ case "$DISTRO" in
ln -vs /usr/bin/cmake3 /usr/local/bin/cmake
ln -vs /usr/bin/ninja-build /usr/local/bin/ninja
CMAKE_OPTS='-DBOOST_INCLUDEDIR=/boost_1_69_0 -DBOOST_LIBRARYDIR=/boost_1_69_0/stage/lib'
CMAKE_OPTS+=(-DBOOST_{INCLUDEDIR=/boost_1_69_0,LIBRARYDIR=/boost_1_69_0/stage/lib})
export LD_LIBRARY_PATH=/boost_1_69_0/stage/lib
;;
amazonlinux:20*)
dnf install -y bison cmake flex gcc-c++ ninja-build \
dnf install -y amazon-rpm-config bison cmake flex gcc-c++ ninja-build \
{boost,libedit,mariadb1\*,ncurses,openssl,postgresql,systemd}-devel
;;
centos:*)
yum install -y centos-release-scl epel-release
yum install -y bison ccache cmake3 devtoolset-11-gcc-c++ flex ninja-build \
{boost169,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
ln -vs /usr/bin/cmake3 /usr/local/bin/cmake
ln -vs /usr/bin/ccache /usr/lib64/ccache/g++
CMAKE_OPTS='-DBOOST_INCLUDEDIR=/usr/include/boost169 -DBOOST_LIBRARYDIR=/usr/lib64/boost169'
;;
debian:*|ubuntu:*)
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-{recommends,suggests} -y bison \
ccache cmake flex g++ lib{boost-all,edit,mariadb,ncurses,pq,ssl,systemd}-dev ninja-build tzdata
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-{recommends,suggests} -y \
bison ccache cmake dpkg-dev flex g++ ninja-build tzdata \
lib{boost-all,edit,mariadb,ncurses,pq,ssl,systemd}-dev
;;
fedora:*)
dnf install -y bison ccache cmake flex gcc-c++ ninja-build \
dnf install -y bison ccache cmake flex gcc-c++ ninja-build redhat-rpm-config \
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
;;
opensuse/*)
zypper in -y bison ccache cmake flex gcc-c++ ninja {lib{edit,mariadb,openssl},ncurses,postgresql,systemd}-devel \
*suse*)
zypper in -y bison ccache cmake flex gcc-c++ ninja rpm-config-SUSE \
{lib{edit,mariadb,openssl},ncurses,postgresql,systemd}-devel \
libboost_{context,coroutine,filesystem,iostreams,program_options,regex,system,test,thread}-devel
;;
@ -71,24 +77,38 @@ case "$DISTRO" in
;;
esac
dnf install -y bison ccache cmake gcc-c++ flex ninja-build \
dnf install -y bison ccache cmake gcc-c++ flex ninja-build redhat-rpm-config \
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
;;
esac
case "$DISTRO" in
alpine:*)
CMAKE_OPTS+=(-DUSE_SYSTEMD=OFF -DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF)
;;
debian:*|ubuntu:*)
CMAKE_OPTS+=(-DICINGA2_LTO_BUILD=ON)
source <(dpkg-buildflags --export=sh)
;;
*)
CMAKE_OPTS+=(-DCMAKE_{C,CXX}_FLAGS="$(rpm -E '%{optflags} %{?march_flag}')")
export LDFLAGS="$(rpm -E '%{?build_ldflags}')"
;;
esac
mkdir /icinga2/build
cd /icinga2/build
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DICINGA2_UNITY_BUILD=ON \
-DUSE_SYSTEMD=ON \
-DICINGA2_USER=$(id -un) \
-DICINGA2_GROUP=$(id -gn) \
$CMAKE_OPTS ..
"${CMAKE_OPTS[@]}" ..
ninja
ninja -v
ninja test
ninja install

View File

@ -8,12 +8,12 @@ on:
pull_request: {}
concurrency:
group: linux-${{ github.ref }}
group: linux-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
linux:
name: ${{ matrix.distro }}
name: ${{ matrix.distro }}${{ matrix.platform != 'linux/amd64' && format(' ({0})', matrix.platform) || '' }}
runs-on: ubuntu-latest
strategy:
@ -21,24 +21,46 @@ jobs:
max-parallel: 2
matrix:
distro:
# Alpine Linux to build Icinga 2 with LibreSSL, OpenBSD's default.
# The "alpine:bash" image will be built below based on "alpine:3".
- alpine:bash
- amazonlinux:2
- amazonlinux:2023
- centos:7 # and RHEL 7
- debian:10
- debian:11 # and Raspbian 11
- debian:12 # and Raspbian 12
- fedora:36
- fedora:37
- fedora:38
- opensuse/leap:15.3 # SLES 15.3
- opensuse/leap:15.4 # and SLES 15.4
- opensuse/leap:15.5 # and SLES 15.5
- rockylinux:8 # RHEL 8
- rockylinux:9 # RHEL 9
# Raspberry Pi OS is close enough to Debian to test just one of them.
# Its architecture is different, though, and covered by the Docker job.
- debian:11
- debian:12
- fedora:39
- fedora:40
- fedora:41
- opensuse/leap:15.5
- opensuse/leap:15.6
# We don't actually support Rocky Linux as such!
# We just use that RHEL clone to test the original.
- rockylinux:8
- rockylinux:9
- registry.suse.com/suse/sle15:15.5
- registry.suse.com/suse/sle15:15.6
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:22.10
- ubuntu:23.04
- ubuntu:24.04
- ubuntu:24.10
platform:
- linux/amd64
include:
- distro: debian:11
platform: linux/386
- distro: debian:12
platform: linux/386
steps:
- name: Checkout HEAD
@ -50,7 +72,13 @@ jobs:
path: ccache
key: ccache/${{ matrix.distro }}
- name: Build
- name: Build Alpine Docker Image
if: "matrix.distro == 'alpine:bash'"
run: >-
docker build --file .github/workflows/alpine-bash.Dockerfile
--tag alpine:bash `mktemp -d`
- name: Build Icinga
run: >-
docker run --rm -v "$(pwd):/icinga2" -e DISTRO=${{ matrix.distro }}
${{ matrix.distro }} /icinga2/.github/workflows/linux.bash
--platform ${{ matrix.platform }} ${{ matrix.distro }} /icinga2/.github/workflows/linux.bash

View File

@ -1,116 +0,0 @@
name: .rpm
on:
push:
branches:
- master
- 'support/*'
pull_request: {}
concurrency:
group: rpm-${{ github.ref }}
cancel-in-progress: true
jobs:
rpm:
name: .rpm (${{ matrix.distro.name }}, ${{ matrix.distro.release }})
strategy:
fail-fast: false
max-parallel: 1
matrix:
distro:
- name: sles
release: '12.5'
subscription: true
runs-on: ubuntu-latest
steps:
- name: Vars
id: vars
env:
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
if [ ${{ matrix.distro.subscription }} = true ]; then
if [ "$(tr -d '\n' <<<"$GITLAB_RO_TOKEN" |wc -c)" -eq 0 ]; then
echo '::set-output name=CAN_BUILD::false'
echo '::set-output name=NEED_LOGIN::false'
else
echo '::set-output name=CAN_BUILD::true'
echo '::set-output name=NEED_LOGIN::true'
fi
else
echo '::set-output name=CAN_BUILD::true'
echo '::set-output name=NEED_LOGIN::false'
fi
- name: Checkout HEAD
if: "steps.vars.outputs.CAN_BUILD == 'true'"
uses: actions/checkout@v1
- name: Login
if: "steps.vars.outputs.NEED_LOGIN == 'true'"
env:
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
docker login registry.icinga.com -u github-actions --password-stdin <<<"$GITLAB_RO_TOKEN"
- name: rpm-icinga2
if: "steps.vars.outputs.CAN_BUILD == 'true' && !matrix.distro.subscription"
run: |
set -exo pipefail
git clone https://git.icinga.com/packaging/rpm-icinga2.git
chmod o+w rpm-icinga2
- name: subscription-rpm-icinga2
if: "steps.vars.outputs.CAN_BUILD == 'true' && matrix.distro.subscription"
env:
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
set -exo pipefail
git config --global credential.helper store
cat <<EOF >~/.git-credentials
https://github-actions:${GITLAB_RO_TOKEN}@git.icinga.com
EOF
git clone https://git.icinga.com/packaging/subscription-rpm-icinga2.git rpm-icinga2
chmod o+w rpm-icinga2
- name: Restore/backup ccache
if: "steps.vars.outputs.CAN_BUILD == 'true'"
id: ccache
uses: actions/cache@v1
with:
path: rpm-icinga2/ccache
key: |-
${{ matrix.distro.name }}/${{ matrix.distro.release }}-ccache-${{ hashFiles('rpm-icinga2/ccache') }}
- name: Binary
if: "steps.vars.outputs.CAN_BUILD == 'true'"
run: |
set -exo pipefail
git checkout -B master
if [ -e rpm-icinga2/ccache ]; then
chmod -R o+w rpm-icinga2/ccache
fi
docker run --rm \
-v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
-v "$(pwd)/.git:/icinga2.git:ro" \
-w /rpm-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
-e UPSTREAM_GIT_URL=file:///icinga2.git \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
icinga-build-package
- name: Test
if: "steps.vars.outputs.CAN_BUILD == 'true'"
run: |
set -exo pipefail
docker run --rm \
-v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
-w /rpm-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
icinga-build-test

View File

@ -8,7 +8,7 @@ on:
pull_request: {}
concurrency:
group: windows-${{ github.ref }}
group: windows-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
@ -25,29 +25,24 @@ jobs:
env:
BITS: '${{ matrix.bits }}'
ICINGA_BUILD_TYPE: snapshot
UPSTREAM_GIT_URL: file://D:/a/icinga2/icinga2/.git
CMAKE_BUILD_TYPE: RelWithDebInfo
steps:
- name: Checkout HEAD
uses: actions/checkout@v1
- name: windows-icinga2
run: |
git clone https://git.icinga.com/packaging/windows-icinga2.git
- name: Build tools
run: |
Set-PSDebug -Trace 1
& .\doc\win-dev.ps1
- name: Source
run: |
git checkout -B master
cd windows-icinga2
& .\source.ps1
- name: Binary
working-directory: windows-icinga2
run: |
New-Item -ItemType Directory -Path 'C:\Program Files\Icinga2\WillBeRemoved' -ErrorAction SilentlyContinue
& .\build.ps1
Set-PSDebug -Trace 1
& .\tools\win32\load-vsenv.ps1
& powershell.exe .\tools\win32\configure.ps1
if ($LastExitCode -ne 0) { throw "Error during configure" }
& powershell.exe .\tools\win32\build.ps1
if ($LastExitCode -ne 0) { throw "Error during build" }
& powershell.exe .\tools\win32\test.ps1
if ($LastExitCode -ne 0) { throw "Error during test" }

View File

@ -1,6 +1,7 @@
<alexander.klimov@icinga.com> <alexander.klimov@netways.de>
Alexander A. Klimov <alexander.klimov@icinga.com> <alexander.klimov@icinga.com>
<alexander.klimov@icinga.com> <grandmaster@al2klimov.de>
Alexander A. Klimov <alexander.klimov@icinga.com> <al2klimov@gmail.com>
<assaf@aikilinux.com> <assaf.flatto@livepopuli.com>
<atj@pulsewidth.org.uk> <adam.james@transitiv.co.uk>
<bernd.erk@icinga.com> <bernd.erk@icinga.org>
@ -23,6 +24,7 @@ Alexander A. Klimov <alexander.klimov@icinga.com> <alexander.klimov@icinga.com>
<marius@graylog.com> <marius@torch.sh>
<markus.frosch@icinga.com> <lazyfrosch@icinga.org>
<markus.frosch@icinga.com> <markus@lazyfrosch.de>
<mathias.aerts@delta.blue> <mathiasaerts@users.noreply.github.com>
<michael.friedrich@icinga.com> <michael.friedrich@gmail.com>
<michael.friedrich@icinga.com> <Michael.Friedrich@netways.de>
<nicole.lang@icinga.com> <nicole.lang@netways.de>

16
AUTHORS
View File

@ -11,6 +11,7 @@ Alexander Fuhr <alexander.fuhr@netways.de>
Alexander Schomburg <script.acc@alex.schomb.org>
Alexander Stoll <astoll@netways.de>
Alexander Wirt <formorer@debian.org>
Alvar Penning <alvar.penning@icinga.com>
Andrea Avancini <andrea.avancini@wuerth-phoenix.com>
Andrea Kao <eirinikos@gmail.com>
Andreas Maus <maus@badphish.ypbind.de>
@ -20,6 +21,7 @@ Andres Ivanov <andres@andres.wtf>
Andrew Jaffie <ajaffie@gmail.com>
Andrew Meyer <ameyer+secure@nodnetwork.org>
Andy Grunwald <andygrunwald@gmail.com>
Angel Roman <angel.r.roman77@gmail.com>
Ant1x <37016240+Ant1x@users.noreply.github.com>
Arnd Hannemann <arnd@arndnet.de>
Assaf Flatto <assaf@aikilinux.com>
@ -51,6 +53,7 @@ Christian Gut <cycloon@is-root.org>
Christian Harke <ch.harke@gmail.com>
Christian Jonak <christian@jonak.org>
Christian Lehmann <christian_lehmann@gmx.de>
Christian Lauf <github.com@christian-lauf.info>
Christian Loos <cloos@netsandbox.de>
Christian Schmidt <github@chsc.dk>
Christopher Peterson <3893680+cspeterson@users.noreply.github.com>
@ -71,6 +74,7 @@ Denis <zaharden@gmail.com>
Dennis Lichtenthäler <dennis.lichtenthaeler@stiftung-tannenhof.de>
dh.harald <dh.harald@gmail.com>
Diana Flach <diana.flach@icinga.com>
Didier 'OdyX' Raboud <didier.raboud@liip.ch>
Dinesh Majrekar <dinesh.majrekar@serverchoice.com>
Dirk Goetz <dirk.goetz@icinga.com>
Dirk Melchers <dirk@dirk-melchers.de>
@ -133,6 +137,7 @@ Jochen Friedrich <j.friedrich@nwe.de>
Johannes Meyer <johannes.meyer@icinga.com>
Jonas Meurer <jonas@freesources.org>
Jordi van Scheijen <jordi.vanscheijen@solvinity.com>
Josef Friedrich <josef@friedrich.rocks>
Joseph L. Casale <jcasale@activenetwerx.com>
jre3brg <jorge.rebelo@pt.bosch.com>
Julian Brost <julian.brost@icinga.com>
@ -153,12 +158,14 @@ Lennart Betz <lennart.betz@icinga.com>
Leon Stringer <leon@priorsvle.com>
lihan <tclh123@gmail.com>
log1-c <24474580+log1-c@users.noreply.github.com>
Lord Hepipud <contact@lordhepipud.de>
Lorenz Kästle <lorenz.kaestle@netways.de>
Louis Sautier <sautier.louis@gmail.com>
Luca Lesinigo <luca@lm-net.it>
Lucas Bremgartner <breml@users.noreply.github.com>
Lucas Fairchild-Madar <lucas.madar@gmail.com>
Luiz Amaral <luiz.amaral@innogames.com>
Maciej Dems <maciej.dems@p.lodz.pl>
Magnus Bäck <magnus@noun.se>
Maik Stuebner <maik@stuebner.info>
Malte Rabenseifner <mail@malte-rabenseifner.de>
@ -205,7 +212,9 @@ mocruz <mocruz@theworkshop.com>
Muhammad Mominul Huque <nahidbinbaten1995@gmail.com>
nemtrif <ntrifunovic@hotmail.com>
Nicolai <nbuchwitz@users.noreply.github.com>
Nicolas Berens <nicolas.berens@planet.com>
Nicolas Limage <github@xephon.org>
Nicolas Rodriguez <nico@nicoladmin.fr>
Nicole Lang <nicole.lang@icinga.com>
Niflou <dubuscyr@gmail.com>
Noah Hilverling <noah.hilverling@icinga.com>
@ -219,6 +228,7 @@ Patrick Dolinic <pdolinic@netways.de>
Patrick Huy <frz@frz.cc>
Paul Denning <paul.denning@dimensiondata.com>
Paul Richards <paul@minimoo.org>
Pavel Motyrev <legioner.r@gmail.com>
Pawel Szafer <pszafer@gmail.com>
Per von Zweigbergk <pvz@itassistans.se>
Peter Eckel <6815386+peteeckel@users.noreply.github.com>
@ -232,7 +242,7 @@ pv2b <pvz@pvz.pp.se>
Ralph Breier <ralph.breier@roedl.com>
Reto Zeder <reto.zeder@arcade.ch>
Ricardo Bartels <ricardo@bitchbrothers.com>
RincewindsHat <12514511+RincewindsHat@users.noreply.github.com>
Richard Mortimer <richm@oldelvet.org.uk>
Rinck H. Sonnenberg <r.sonnenberg@netson.nl>
Robert Lindgren <robert.lindgren@gmail.com>
Robert Scheck <robert@fedoraproject.org>
@ -249,6 +259,7 @@ Sascha Westermann <sascha.westermann@hl-services.de>
Sebastian Brückner <mail@invlid.com>
Sebastian Chrostek <sebastian@chrostek.net>
Sebastian Eikenberg <eikese@mail.uni-paderborn.de>
Sebastian Grund <s.grund@openinfrastructure.de>
Sebastian Marsching <sebastian-git-2016@marsching.com>
Silas <67681686+Tqnsls@users.noreply.github.com>
Simon Murray <spjmurray@yahoo.co.uk>
@ -269,6 +280,7 @@ Sven Wegener <swegener@gentoo.org>
sysadt <sysadt@protonmail.com>
T. Mulyana <nothinux@gmail.com>
teclogi <27726999+teclogi@users.noreply.github.com>
Theo Buehler <tb@openbsd.org>
Thomas Forrer <thomas.forrer@wuerth-phoenix.com>
Thomas Gelf <thomas.gelf@icinga.com>
Thomas Niedermeier <tniedermeier@thomas-krenn.com>
@ -276,6 +288,7 @@ Thomas Widhalm <thomas.widhalm@icinga.com>
Tim Hardeck <thardeck@suse.de>
Tim Weippert <weiti@weiti.eu>
Timo Buhrmester <van.fstd@gmail.com>
Tobias Bauriedel <tobias.bauriedel@netways.de>
Tobias Birnbaum <osterd@gmx.de>
Tobias Deiminger <haxtibal@posteo.de>
Tobias von der Krone <tobias.vonderkrone@profitbricks.com>
@ -290,6 +303,7 @@ Winfried Angele <winfried.angele@gmail.com>
Wolfgang Nieder <wnd@gmx.net>
XnS <git@xns.be>
Yannick Charton <tontonitch-pro@yahoo.fr>
Yannick Martin <yannick.martin@ovhcloud.com>
Yohan Jarosz <yohanjarosz@yahoo.fr>
Yonas Habteab <yonas.habteab@icinga.com>
Zachary McGibbon <zachary.mcgibbon@gmail.com>

View File

@ -7,6 +7,50 @@ documentation before upgrading to a new release.
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga2/milestones?state=closed).
## 2.14.3 (2024-11-12)
This security release fixes a TLS certificate validation bypass.
Given the severity of that issue, users are advised to upgrade all nodes immediately.
* Security: fix TLS certificate validation bypass. CVE-2024-49369
* Security: update OpenSSL shipped on Windows to v3.0.15.
* Windows: sign MSI packages with a certificate the OS trusts by default.
## 2.14.2 (2024-01-18)
Version 2.14.2 is a hotfix release for master nodes that mainly
fixes excessive disk usage caused by the InfluxDB writers.
* InfluxDB: truncate timestamps to whole seconds to save disk space. #9969
* HttpServerConnection: log request processing time as well. #9970
* Update Boost shipped on Windows to v1.84. #9970
## 2.14.1 (2023-12-21)
Version 2.14.1 is a hotfix release for masters and satellites that mainly
prevents permanent disintegration of a whole cluster due to root CA expiry.
### Security
* Automatically renew own root CA and distribute it to all nodes. #9933
* Update OpenSSL shipped on Windows to v3.0.12. #9946
* Disable TLS renegotiation (handshake on existing connection). #9946
### Bugfixes
* Icinga DB feature: fix crash due to missing NULL pointer check. #9946
* Icinga DB feature: fix data written into Redis crashing the Go daemon. #9946
* GelfWriter: fix deadlock on stop/reload caused by busy queue. #9947
* Don't lose notifications due to too long output, truncate it. #9947
### Enhancements
* Discard duplicate problem notifications due to state filtering. #9932
* Speed up API filters targeting specific hosts/services to O(1). #9944
* POST /v1/console/\*: return HTTP 503 while Icinga is reloading. #9947
* Update Boost shipped on Windows to v1.83. #9946
* Documentation: several fixes and improvements. #9921
## 2.14.0 (2023-07-12)
[Issues and PRs](https://github.com/Icinga/icinga2/issues?q=is%3Aclosed+milestone%3A2.14.0)
@ -199,6 +243,35 @@ Add `linux_netdev` check command. #9045
* Several code quality improvements. #8815 #9106 #9250
#9508 #9517 #9537 #9594 #9605 #9606 #9641 #9658 #9702 #9717 #9738
## 2.13.10 (2024-11-12)
This security release fixes a TLS certificate validation bypass.
Given the severity of that issue, users are advised to upgrade all nodes immediately.
* Security: fix TLS certificate validation bypass. CVE-2024-49369
* Security: update OpenSSL shipped on Windows to v3.0.15.
* Windows: sign MSI packages with a certificate the OS trusts by default.
## 2.13.9 (2023-12-21)
Version 2.13.9 is a hotfix release for masters and satellites that mainly
prevents permanent disintegration of a whole cluster due to root CA expiry.
### Security
* Automatically renew own root CA and distribute it to all nodes. #9934
* Update OpenSSL shipped on Windows to v3.0.12. #9945
* Disable TLS renegotiation (handshake on existing connection). #9945
### Bugfixes
* Icinga DB feature: fix crash due to missing NULL pointer check. #9945
* Icinga DB feature: fix data written into Redis crashing the Go daemon. #9945
### Updates
* Update Boost shipped on Windows to v1.83. #9945
## 2.13.8 (2023-07-12)
Version 2.13.8 is a maintenance release that fixes some bugs,
@ -912,6 +985,15 @@ Thanks to all contributors:
* Code quality fixes
* Small documentation fixes
## 2.11.12 (2024-11-12)
This security release fixes a TLS certificate validation bypass.
Given the severity of that issue, users are advised to upgrade all nodes immediately.
* Security: fix TLS certificate validation bypass. CVE-2024-49369
* Security: update OpenSSL shipped on Windows to v3.0.15.
* Windows: sign MSI packages with a certificate the OS trusts by default.
## 2.11.11 (2021-08-19)
The main focus of these versions is a security vulnerability in the TLS certificate verification of our metrics writers ElasticsearchWriter, GelfWriter and InfluxdbWriter.

View File

@ -1,17 +1,12 @@
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
cmake_minimum_required(VERSION 2.8.12)
# CMake 3.8 is required, CMake policy compatibility was verified up to 3.17.
cmake_minimum_required(VERSION 3.8...3.17)
set(BOOST_MIN_VERSION "1.66.0")
if("${CMAKE_VERSION}" VERSION_LESS "3.8") # SLES 12.5
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
endif()
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(icinga2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -23,6 +18,10 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()
# Include symbols in executables so that function names can be printed in stack traces, for example in crash dumps.
set(CMAKE_ENABLE_EXPORTS ON) # Added in CMake 3.4
set(CMAKE_EXECUTABLE_ENABLE_EXPORTS ON) # Added in CMake 3.27 and supersedes the above one.
if(WIN32)
set(ICINGA2_MASTER OFF)
else()
@ -186,21 +185,21 @@ add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
link_directories(${Boost_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
set(base_OBJS $<TARGET_OBJECTS:mmatch> $<TARGET_OBJECTS:socketpair> $<TARGET_OBJECTS:base>)
# JSON
find_package(JSON)
include_directories(${JSON_INCLUDE})
include_directories(SYSTEM ${JSON_INCLUDE})
# UTF8CPP
find_package(UTF8CPP)
include_directories(${UTF8CPP_INCLUDE})
include_directories(SYSTEM ${UTF8CPP_INCLUDE})
find_package(Editline)
set(HAVE_EDITLINE "${EDITLINE_FOUND}")
@ -223,22 +222,23 @@ endif()
if(EDITLINE_FOUND)
list(APPEND base_DEPS ${EDITLINE_LIBRARIES})
include_directories(${EDITLINE_INCLUDE_DIR})
include_directories(SYSTEM ${EDITLINE_INCLUDE_DIR})
endif()
if(TERMCAP_FOUND)
list(APPEND base_DEPS ${TERMCAP_LIBRARIES})
include_directories(${TERMCAP_INCLUDE_DIR})
include_directories(SYSTEM ${TERMCAP_INCLUDE_DIR})
endif()
if(WIN32)
list(APPEND base_DEPS ws2_32 dbghelp shlwapi msi)
endif()
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_FULL_LIBDIR}/icinga2")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winconsistent-missing-override")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics -fno-limit-debug-info")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics -fno-limit-debug-info")
@ -256,6 +256,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
if(CMAKE_SYSTEM_NAME MATCHES AIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -lpthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpthread")
@ -365,6 +367,7 @@ check_function_exists(vfork HAVE_VFORK)
check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
check_function_exists(pipe2 HAVE_PIPE2)
check_function_exists(nice HAVE_NICE)
check_function_exists(malloc_info HAVE_MALLOC_INFO)
check_library_exists(dl dladdr "dlfcn.h" HAVE_DLADDR)
check_library_exists(execinfo backtrace_symbols "" HAVE_LIBEXECINFO)
check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
@ -506,6 +509,7 @@ set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/icinga-installer/dlgbmp.bmp
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch.Debug")
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch")
set(CPACK_WIX_EXTENSIONS "WixUtilExtension" "WixNetFxExtension")
set(CPACK_WIX_INSTALL_SCOPE NONE)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "sbin")
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)

View File

@ -111,6 +111,12 @@ refs #1234
You can add multiple commits during your journey to finish your patch.
Don't worry, you can squash those changes into a single commit later on.
Ensure your name and email address in the commit metadata are correct.
In your first contribution (PR) also add them to [AUTHORS](./AUTHORS).
If those metadata changed since your last successful contribution,
you should update [AUTHORS](./AUTHORS) and [.mailmap](./.mailmap).
For the latter see [gitmailmap(5)](https://git-scm.com/docs/gitmailmap).
## <a id="contributing-pull-requests"></a> Pull Requests
Once you've commited your changes, please update your local master

View File

@ -1,421 +0,0 @@
# Release Workflow <a id="release-workflow"></a>
#### Table of Content
- [1. Preparations](#preparations)
- [1.1. Issues](#issues)
- [1.2. Backport Commits](#backport-commits)
- [1.3. Windows Dependencies](#windows-dependencies)
- [2. Version](#version)
- [3. Changelog](#changelog)
- [4. Git Tag](#git-tag)
- [5. Package Builds](#package-builds)
- [5.1. RPM Packages](#rpm-packages)
- [5.2. DEB Packages](#deb-packages)
- [6. Build Server](#build-infrastructure)
- [7. Release Tests](#release-tests)
- [8. GitHub Release](#github-release)
- [9. Docker](#docker)
- [10. Post Release](#post-release)
- [10.1. Online Documentation](#online-documentation)
- [10.2. Announcement](#announcement)
- [10.3. Project Management](#project-management)
## Preparations <a id="preparations"></a>
Specify the release version.
```bash
VERSION=2.11.0
```
Add your signing key to your Git configuration file, if not already there.
```
vim $HOME/.gitconfig
[user]
email = michael.friedrich@icinga.com
name = Michael Friedrich
signingkey = D14A1F16
```
### Issues <a id="issues"></a>
Check issues at https://github.com/Icinga/icinga2
### Backport Commits <a id="backport-commits"></a>
For minor versions you need to manually backports any and all commits from the
master branch which should be part of this release.
### Windows Dependencies <a id="windows-dependencies"></a>
In contrast to Linux, the bundled Windows dependencies
(at least Boost and OpenSSL) aren't updated automatically.
(Neither by Icinga administrators, nor at package build time.)
To ensure the upcoming Icinga release ships the latest (i.e. most secure) dependencies on Windows:
#### Update packages.icinga.com
Add the latest Boost and OpenSSL versions to
https://packages.icinga.com/windows/dependencies/ like this:
```
localhost:~$ ssh aptly.vm.icinga.com
aptly:~$ sudo -i
aptly:~# cd /var/www/html/aptly/public/windows/dependencies
aptly:dependencies# wget https://master.dl.sourceforge.net/project/boost/boost-binaries/1.76.0/boost_1_76_0-msvc-14.2-64.exe
aptly:dependencies# wget https://master.dl.sourceforge.net/project/boost/boost-binaries/1.76.0/boost_1_76_0-msvc-14.2-32.exe
aptly:dependencies# wget https://slproweb.com/download/Win64OpenSSL-1_1_1k.exe
aptly:dependencies# wget https://slproweb.com/download/Win32OpenSSL-1_1_1k.exe
```
#### Ensure Compatibility
Preferably on a fresh Windows VM (not to accidentally build Icinga
with old dependency versions) setup a dev environment using the new dependency versions:
1. Download [doc/win-dev.ps1](doc/win-dev.ps1)
2. Edit your local copy, adjust the dependency versions
3. Ensure there are 35 GB free space on C:
4. Run the following in an administrative Powershell:
1. `Enable-WindowsOptionalFeature -FeatureName "NetFx3" -Online`
(reboot when asked!)
2. `powershell -NoProfile -ExecutionPolicy Bypass -File "${Env:USERPROFILE}\Downloads\win-dev.ps1"`
(will take some time)
Actually clone and build Icinga using the new dependency versions as described
[here](https://github.com/Icinga/icinga2/blob/master/doc/21-development.md#tldr).
Fix incompatibilities if any.
#### Update Build Server, CI/CD and Documentation
* https://git.icinga.com/infra/ansible-windows-build
(don't forget to provision!)
* [doc/21-development.md](doc/21-development.md)
* [doc/win-dev.ps1](doc/win-dev.ps1)
(also affects CI/CD)
* [tools/win32/configure.ps1](tools/win32/configure.ps1)
* [tools/win32/configure-dev.ps1](tools/win32/configure-dev.ps1)
#### Re-provision Build Server
Even if there aren't any new releases of dependencies with versions
hardcoded in the repos and files listed above (Boost, OpenSSL).
There may be new build versions of other dependencies (VS, MSVC).
Our GitHub actions (tests) use the latest ones automatically,
but the GitLab runner (release packages) doesn't.
## Version <a id="version"></a>
Update the version:
```bash
perl -pi -e "s/Version: .*/Version: $VERSION/g" ICINGA2_VERSION
```
## Changelog <a id="changelog"></a>
Choose the most important issues and summarize them in multiple groups/paragraphs. Provide links to the mentioned
issues/PRs. At the start include a link to the milestone's closed issues.
## Git Tag <a id="git-tag"></a>
```bash
git commit -v -a -m "Release version $VERSION"
```
Create a signed tag (tags/v<VERSION>) on the `master` branch (for major
releases) or the `support` branch (for minor releases).
```bash
git tag -s -m "Version $VERSION" v$VERSION
```
Push the tag:
```bash
git push origin v$VERSION
```
**For major releases:** Create a new `support` branch:
```bash
git checkout master
git push
git checkout -b support/2.12
git push -u origin support/2.12
```
## Package Builds <a id="package-builds"></a>
```bash
mkdir $HOME/dev/icinga/packaging
cd $HOME/dev/icinga/packaging
```
### RPM Packages <a id="rpm-packages"></a>
```bash
git clone git@git.icinga.com:packaging/rpm-icinga2.git && cd rpm-icinga2
```
### DEB Packages <a id="deb-packages"></a>
```bash
git clone git@git.icinga.com:packaging/deb-icinga2.git && cd deb-icinga2
```
### Raspbian Packages
```bash
git clone git@git.icinga.com:packaging/raspbian-icinga2.git && cd raspbian-icinga2
```
### Windows Packages
```bash
git clone git@git.icinga.com:packaging/windows-icinga2.git && cd windows-icinga2
```
### Branch Workflow
For each support branch in this repo (e.g. support/2.12), there exists a corresponding branch in the packaging repos
(e.g. 2.12). Each package revision is a tagged commit on these branches. When doing a major release, create the new
branch, otherweise switch to the existing one.
### Switch Build Type
Ensure that `ICINGA_BUILD_TYPE` is set to `release` in `.gitlab-ci.yml`. This should only be necessary after creating a
new branch.
```yaml
variables:
...
ICINGA_BUILD_TYPE: release
...
```
Commit the change.
```bash
git commit -av -m "Switch build type for 2.13"
```
#### RPM Release Preparations
Set the `Version`, `revision` and `%changelog` inside the spec file:
```
perl -pi -e "s/Version:.*/Version: $VERSION/g" icinga2.spec
vim icinga2.spec
%changelog
* Thu Sep 19 2019 Michael Friedrich <michael.friedrich@icinga.com> 2.11.0-1
- Update to 2.11.0
```
#### DEB and Raspbian Release Preparations
Update file `debian/changelog` and add at the beginning:
```
icinga2 (2.11.0-1) icinga; urgency=medium
* Release 2.11.0
-- Michael Friedrich <michael.friedrich@icinga.com> Thu, 19 Sep 2019 10:50:31 +0200
```
#### Windows Release Preparations
Update the file `.gitlab-ci.yml`:
```
perl -pi -e "s/^ UPSTREAM_GIT_BRANCH: .*/ UPSTREAM_GIT_BRANCH: v$VERSION/g" .gitlab-ci.yml
perl -pi -e "s/^ ICINGA_FORCE_VERSION: .*/ ICINGA_FORCE_VERSION: v$VERSION/g" .gitlab-ci.yml
```
### Release Commit
Commit the changes and push the branch.
```bash
git commit -av -m "Release $VERSION-1"
git push origin 2.11
```
GitLab will now build snapshot packages based on the tag `v2.11.0` of Icinga 2.
### Package Tests
In order to test the created packages you can download a job's artifacts:
Visit [git.icinga.com](https://git.icinga.com/packaging/rpm-icinga2)
and navigate to the respective pipeline under `CI / CD -> Pipelines`.
There click on the job you want to download packages from.
The job's output appears. On the right-hand sidebar you can browse its artifacts.
Once there, navigate to `build/RPMS/noarch` where you'll find the packages.
### Release Packages
To build release packages and upload them to [packages.icinga.com](https://packages.icinga.com)
tag the release commit and push it.
RPM/DEB/Raspbian:
```bash
git tag -s $VERSION-1 -m "Release v$VERSION-1"
git push origin $VERSION-1
```
Windows:
```bash
git tag -s $VERSION -m "Release v$VERSION"
git push origin $VERSION
```
Now cherry pick the release commit to `master` so that the changes are transferred back to it.
**Attention**: Only the release commit. *NOT* the one switching the build type!
## Build Infrastructure <a id="build-infrastructure"></a>
https://git.icinga.com/packaging/rpm-icinga2/pipelines
https://git.icinga.com/packaging/deb-icinga2/pipelines
https://git.icinga.com/packaging/windows-icinga2/pipelines
https://git.icinga.com/packaging/raspbian-icinga2/pipelines
* Verify package build changes for this version.
* Test the snapshot packages for all distributions beforehand.
Once the release repository tags are pushed, release builds
are triggered and automatically published to packages.icinga.com
## Release Tests <a id="release-tests"></a>
* Test DB IDO with MySQL and PostgreSQL.
* Provision the vagrant boxes and test the release packages.
* Test the [setup wizard](https://packages.icinga.com/windows/) inside a Windows VM.
* Start a new docker container and install/run icinga2.
### CentOS
```bash
docker run -ti centos:7 bash
yum -y install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
yum -y install epel-release
yum -y install icinga2
icinga2 daemon -C
```
### Ubuntu
```bash
docker run -ti ubuntu:bionic bash
apt-get update
apt-get -y install apt-transport-https wget gnupg
wget -O - https://packages.icinga.com/icinga.key | apt-key add -
. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; \
echo "deb https://packages.icinga.com/ubuntu icinga-${DIST} main" > \
/etc/apt/sources.list.d/${DIST}-icinga.list
echo "deb-src https://packages.icinga.com/ubuntu icinga-${DIST} main" >> \
/etc/apt/sources.list.d/${DIST}-icinga.list
apt-get update
apt-get -y install icinga2
icinga2 daemon -C
```
## GitHub Release <a id="github-release"></a>
Create a new release for the newly created Git tag: https://github.com/Icinga/icinga2/releases
> Hint: Choose [tags](https://github.com/Icinga/icinga2/tags), pick one to edit and
> make this a release. You can also create a draft release.
The release body should contain a short changelog, with links
into the roadmap, changelog and blogpost.
## Post Release <a id="post-release"></a>
### Online Documentation <a id="online-documentation"></a>
> Only required for major releases.
Navigate to `puppet-customer/icinga.git` and do the following steps:
#### Testing
```bash
git checkout testing && git pull
vim files/var/www/docs/config/icinga2-latest.yml
git commit -av -m "icinga-web: Update docs for Icinga 2"
git push
```
SSH into the webserver and do a manual Puppet dry run with the testing environment.
```bash
puppet agent -t --environment testing --noop
```
Once succeeded, continue with production deployment.
#### Production
```bash
git checkout master && git pull
git merge testing
git push
```
SSH into the webserver and do a manual Puppet run from the production environment (default).
```bash
puppet agent -t
```
#### Manual Generation
SSH into the webserver or ask @bobapple.
```bash
cd /usr/local/icinga-docs-tools && ./build-docs.rb -c /var/www/docs/config/icinga2-latest.yml
```
### Announcement <a id="announcement"></a>
* Create a new blog post on [icinga.com/blog](https://icinga.com/blog) including a featured image
* Create a release topic on [community.icinga.com](https://community.icinga.com)
* Release email to net-tech & team
### Project Management <a id="project-management"></a>
* Add new minor version on [GitHub](https://github.com/Icinga/icinga2/milestones).

View File

@ -8,6 +8,7 @@
#cmakedefine HAVE_LIBEXECINFO
#cmakedefine HAVE_CXXABI_H
#cmakedefine HAVE_NICE
#cmakedefine HAVE_MALLOC_INFO
#cmakedefine HAVE_EDITLINE
#cmakedefine HAVE_SYSTEMD

View File

@ -67,4 +67,3 @@ Read more about development builds in the [development chapter](21-development.m
Icinga 2 and the Icinga 2 documentation are licensed under the terms of the GNU
General Public License Version 2. You will find a copy of this license in the
LICENSE file included in the source package.

View File

@ -14,9 +14,16 @@ In case you are upgrading an existing setup, please ensure to
follow the [upgrade documentation](16-upgrading-icinga-2.md#upgrading-icinga-2).
<!-- {% else %} -->
<!-- {% if not windows %} -->
## Add Icinga Package Repository <a id="add-icinga-package-repository"></a>
We recommend using our official repositories. Here's how to add it to your system:
We recommend using our official repositories.
All the following commands should be executed as the root user.
As pipes and nested commands are used, it is recommended to switch to a root user session, e.g., using `sudo -i`.
Here's how to add it to your system:
<!-- {% endif %} -->
<!-- {% if debian %} -->
@ -24,9 +31,13 @@ We recommend using our official repositories. Here's how to add it to your syste
```bash
apt update
apt -y install apt-transport-https wget gnupg
apt -y install apt-transport-https wget
wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg
wget -O icinga-archive-keyring.deb "https://packages.icinga.com/icinga-archive-keyring_latest+debian$(
. /etc/os-release; echo "$VERSION_ID"
).deb"
apt install ./icinga-archive-keyring.deb
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian icinga-${DIST} main" > \
@ -36,21 +47,6 @@ DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
apt update
```
#### Debian Backports Repository <a id="debian-backports-repository"></a>
This repository is required for Debian Stretch since Icinga v2.11.
Debian Stretch:
```bash
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
echo "deb https://deb.debian.org/debian ${DIST}-backports main" > \
/etc/apt/sources.list.d/${DIST}-backports.list
apt update
```
<!-- {% endif %} -->
<!-- {% if ubuntu %} -->
@ -58,9 +54,13 @@ apt update
```bash
apt update
apt -y install apt-transport-https wget gnupg
apt -y install apt-transport-https wget
wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg
wget -O icinga-archive-keyring.deb "https://packages.icinga.com/icinga-archive-keyring_latest+ubuntu$(
. /etc/os-release; echo "$VERSION_ID"
).deb"
apt install ./icinga-archive-keyring.deb
. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; \
echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/ubuntu icinga-${DIST} main" > \
@ -72,41 +72,6 @@ apt update
```
<!-- {% endif %} -->
<!-- {% if raspbian %} -->
### Raspbian Repository <a id="raspbian-repository"></a>
```bash
apt update
apt -y install apt-transport-https wget gnupg
wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/raspbian icinga-${DIST} main" > \
/etc/apt/sources.list.d/icinga.list
echo "deb-src [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/raspbian icinga-${DIST} main" >> \
/etc/apt/sources.list.d/icinga.list
apt update
```
<!-- {% endif %} -->
<!-- {% if centos %} -->
### CentOS Repository <a id="centos-repository"></a>
```bash
rpm --import https://packages.icinga.com/icinga.key
wget https://packages.icinga.com/centos/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
```
The packages for CentOS depend on other packages which are distributed
as part of the [EPEL repository](https://fedoraproject.org/wiki/EPEL):
```bash
yum install epel-release
```
<!-- {% endif %} -->
<!-- {% if rhel %} -->
### RHEL Repository <a id="rhel-repository"></a>
@ -118,7 +83,6 @@ yum install epel-release
Don't forget to fill in the username and password section with your credentials in the local .repo file.
```bash
rpm --import https://packages.icinga.com/icinga.key
wget https://packages.icinga.com/subscription/rhel/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
```
@ -136,21 +100,12 @@ subscription-manager repos --enable "codeready-builder-for-rhel-${OSVER}-${ARCH}
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OSVER}.noarch.rpm
```
#### RHEL 7
```bash
subscription-manager repos --enable rhel-7-server-optional-rpms
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
```
<!-- {% endif %} -->
<!-- {% if fedora %} -->
### Fedora Repository <a id="fedora-repository"></a>
```bash
rpm --import https://packages.icinga.com/icinga.key
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --add-repo https://packages.icinga.com/fedora/$(. /etc/os-release; echo "$VERSION_ID")/release
```
@ -167,8 +122,6 @@ dnf config-manager --add-repo https://packages.icinga.com/fedora/$(. /etc/os-rel
Don't forget to fill in the username and password section with your credentials in the local .repo file.
```bash
rpm --import https://packages.icinga.com/icinga.key
zypper ar https://packages.icinga.com/subscription/sles/ICINGA-release.repo
zypper ref
```
@ -186,21 +139,13 @@ SUSEConnect -p PackageHub/$VERSION_ID/x86_64
### openSUSE Repository <a id="opensuse-repository"></a>
```bash
rpm --import https://packages.icinga.com/icinga.key
zypper ar https://packages.icinga.com/openSUSE/ICINGA-release.repo
zypper ref
```
You need to additionally add the `server:monitoring` repository to fulfill dependencies:
```bash
zypper ar https://download.opensuse.org/repositories/server:/monitoring/15.3/server:monitoring.repo
```
<!-- {% endif %} -->
<!-- {% if amazon_linux %} -->
### Amazon Linux 2 Repository <a id="amazon-linux-2-repository"></a>
### Amazon Linux Repository <a id="amazon-linux-2-repository"></a>
!!! info
@ -210,16 +155,17 @@ zypper ar https://download.opensuse.org/repositories/server:/monitoring/15.3/ser
Don't forget to fill in the username and password section with your credentials in the local .repo file.
```bash
rpm --import https://packages.icinga.com/icinga.key
wget https://packages.icinga.com/subscription/amazon/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
```
The packages for Amazon Linux 2 depend on other packages which are distributed
The packages for **Amazon Linux 2** depend on other packages which are distributed
as part of the [EPEL repository](https://fedoraproject.org/wiki/EPEL).
```bash
yum install epel-release
```
The packages for newer versions of Amazon Linux don't require additional repositories.
<!-- {% endif %} -->
<!-- {% if windows %} -->
@ -237,36 +183,21 @@ You can install Icinga 2 by using your distribution's package manager
to install the `icinga2` package. The following commands must be executed
with `root` permissions unless noted otherwise.
<!-- {% if centos or rhel or fedora or amazon_linux %} -->
<!-- {% if rhel or fedora or amazon_linux %} -->
!!! tip
If you have [SELinux](22-selinux.md) enabled, the package `icinga2-selinux` is also required.
<!-- {% endif %} -->
<!-- {% if debian or ubuntu or raspbian %} -->
<!-- {% if debian or ubuntu %} -->
<!-- {% if not icingaDocs %} -->
#### Debian / Ubuntu / Raspbian
#### Debian / Ubuntu / Raspberry Pi OS
<!-- {% endif %} -->
```bash
apt install icinga2
```
<!-- {% endif %} -->
<!-- {% if centos %} -->
<!-- {% if not icingaDocs %} -->
#### CentOS
<!-- {% endif %} -->
!!! info
Note that installing Icinga 2 is only supported on CentOS 7 as CentOS 8 is EOL.
```bash
yum install icinga2
systemctl enable icinga2
systemctl start icinga2
```
<!-- {% endif %} -->
<!-- {% if rhel %} -->
#### RHEL 8 or Later
@ -275,14 +206,6 @@ dnf install icinga2
systemctl enable icinga2
systemctl start icinga2
```
#### RHEL 7
```bash
yum install icinga2
systemctl enable icinga2
systemctl start icinga2
```
<!-- {% endif %} -->
<!-- {% if fedora %} -->
@ -307,7 +230,7 @@ zypper install icinga2
<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
#### Amazon Linux 2
#### Amazon Linux
<!-- {% endif %} -->
```bash
yum install icinga2
@ -355,26 +278,15 @@ to determine where to find the plugin binaries.
additional check plugins into your Icinga 2 setup.
<!-- {% if debian or ubuntu or raspbian %} -->
<!-- {% if debian or ubuntu %} -->
<!-- {% if not icingaDocs %} -->
#### Debian / Ubuntu / Raspbian
#### Debian / Ubuntu / Raspberry Pi OS
<!-- {% endif %} -->
```bash
apt install monitoring-plugins
```
<!-- {% endif %} -->
<!-- {% if centos %} -->
<!-- {% if not icingaDocs %} -->
#### CentOS
<!-- {% endif %} -->
The packages for CentOS depend on other packages which are distributed as part of the EPEL repository.
```bash
yum install nagios-plugins-all
```
<!-- {% endif %} -->
<!-- {% if rhel %} -->
<!-- {% if not icingaDocs %} -->
#### RHEL
@ -386,12 +298,6 @@ The packages for RHEL depend on other packages which are distributed as part of
```bash
dnf install nagios-plugins-all
```
#### RHEL 7
```bash
yum install nagios-plugins-all
```
<!-- {% endif %} -->
<!-- {% if fedora %} -->
@ -418,15 +324,17 @@ zypper install --recommends monitoring-plugins-all
<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
#### Amazon Linux 2
#### Amazon Linux
<!-- {% endif %} -->
The packages for Amazon Linux 2 depend on other packages which are distributed as part of the EPEL repository.
The packages for **Amazon Linux 2** depend on other packages which are distributed as part of the EPEL repository.
```bash
amazon-linux-extras install epel
yum install nagios-plugins-all
```
Unfortunately newer versions of Amazon Linux don't provide those plugins, yet.
<!-- {% endif %} -->
## Set up Icinga 2 API <a id="set-up-icinga2-api"></a>
@ -460,7 +368,7 @@ Restart Icinga 2 for these changes to take effect.
systemctl restart icinga2
```
<!-- {% if amazon_linux or centos or debian or rhel or sles or ubuntu %} -->
<!-- {% if amazon_linux or debian or rhel or sles or ubuntu %} -->
## Set up Icinga DB <a id="set-up-icinga-db"></a>
Icinga DB is a set of components for publishing, synchronizing and
@ -505,30 +413,16 @@ Use your distribution's package manager to install the `icingadb-redis` package
<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
##### Amazon Linux 2
##### Amazon Linux
<!-- {% endif %} -->
```bash
yum install icingadb-redis
```
<!-- {% endif %} -->
<!-- {% if centos %} -->
<!-- {% if not icingaDocs %} -->
##### CentOS
<!-- {% endif %} -->
!!! info
Note that installing Icinga DB Redis is only supported on CentOS 7 as CentOS 8 is EOL.
```bash
yum install icingadb-redis
```
<!-- {% endif %} -->
<!-- {% if debian or ubuntu %} -->
<!-- {% if not icingaDocs %} -->
##### Debian / Ubuntu
##### Debian / Ubuntu / Raspberry Pi OS
<!-- {% endif %} -->
```bash
apt install icingadb-redis
@ -541,12 +435,6 @@ apt install icingadb-redis
```bash
dnf install icingadb-redis
```
##### RHEL 7
```bash
yum install icingadb-redis
```
<!-- {% endif %} -->
<!-- {% if sles %} -->
@ -637,22 +525,19 @@ the Icinga DB daemon that synchronizes monitoring data between the Redis server
The Icinga DB daemon package is also included in the Icinga repository, and since it is already set up,
you have completed the instructions here and can proceed to
<!-- {% if amazon_linux %} -->
[install the Icinga DB daemon on Amazon Linux](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/01-Amazon-Linux/#installing-icinga-db-package),
<!-- {% endif %} -->
<!-- {% if centos %} -->
[install the Icinga DB daemon on CentOS](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/02-CentOS/#installing-icinga-db-package),
[install the Icinga DB daemon on Amazon Linux](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/Amazon-Linux/#installing-the-package),
<!-- {% endif %} -->
<!-- {% if debian %} -->
[install the Icinga DB daemon on Debian](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/03-Debian/#installing-icinga-db-package),
[install the Icinga DB daemon on Debian](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/Debian/#installing-the-package),
<!-- {% endif %} -->
<!-- {% if rhel %} -->
[install the Icinga DB daemon on RHEL](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/04-RHEL/#installing-icinga-db-package),
[install the Icinga DB daemon on RHEL](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/RHEL/#installing-the-package),
<!-- {% endif %} -->
<!-- {% if sles %} -->
[install the Icinga DB daemon on SLES](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/05-SLES/#installing-icinga-db-package),
[install the Icinga DB daemon on SLES](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/SLES/#installing-the-package),
<!-- {% endif %} -->
<!-- {% if ubuntu %} -->
[install the Icinga DB daemon on Ubuntu](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/06-Ubuntu/#installing-icinga-db-package),
[install the Icinga DB daemon on Ubuntu](https://icinga.com/docs/icinga-db/latest/doc/02-Installation/Ubuntu/#installing-the-package),
<!-- {% endif %} -->
which will also guide you through the setup of the database and Icinga DB Web.
<!-- {% endif %} -->

View File

@ -0,0 +1,3 @@
# Install Icinga 2 on Raspberry Pi OS
<!-- {% set debian = True %} -->
<!-- {% include "02-installation.md" %} -->

View File

@ -1,3 +0,0 @@
# Install Icinga 2 on Raspbian
<!-- {% set raspbian = True %} -->
<!-- {% include "02-installation.md" %} -->

View File

@ -1,3 +0,0 @@
# Install Icinga 2 on CentOS
<!-- {% set centos = True %} -->
<!-- {% include "02-installation.md" %} -->

View File

@ -1599,7 +1599,7 @@ A common pattern is to store the users and user groups
on the host or service objects instead of the notification
object itself.
The sample configuration provided in [hosts.conf](04-configuration.md#hosts-conf) and [notifications.conf](notifications-conf)
The sample configuration provided in [hosts.conf](04-configuration.md#hosts-conf) and [notifications.conf](04-configuration.md#notifications-conf)
already provides an example for this question.
> **Tip**
@ -2135,7 +2135,7 @@ In order to find out about the command argument, call the plugin's help
or consult the README.
```
./check_systemd.py --help
./check_systemd --help
...
@ -2194,7 +2194,7 @@ With the [example above](03-monitoring-basics.md#command-arguments-value),
inspect the parameter's help text.
```
./check_systemd.py --help
./check_systemd --help
...
@ -2579,6 +2579,7 @@ information.
`notification_useremail` | **Required.** The notification's recipient(s). Defaults to `$user.email$`.
`notification_hoststate` | **Required.** Current state of host. Defaults to `$host.state$`.
`notification_type` | **Required.** Type of notification. Defaults to `$notification.type$`.
`notification_hostnotes` | **Optional.** The host's notes. Defaults to `$host.notes$`.
`notification_address` | **Optional.** The host's IPv4 address. Defaults to `$address$`.
`notification_address6` | **Optional.** The host's IPv6 address. Defaults to `$address6$`.
`notification_author` | **Optional.** Comment author. Defaults to `$notification.author$`.
@ -2607,6 +2608,8 @@ information.
`notification_useremail` | **Required.** The notification's recipient(s). Defaults to `$user.email$`.
`notification_servicestate` | **Required.** Current state of host. Defaults to `$service.state$`.
`notification_type` | **Required.** Type of notification. Defaults to `$notification.type$`.
`notification_hostnotes` | **Optional.** The host's notes. Defaults to `$host.notes$`.
`notification_servicenotes` | **Optional.** The service's notes. Defaults to `$service.notes$`.
`notification_address` | **Optional.** The host's IPv4 address. Defaults to `$address$`.
`notification_address6` | **Optional.** The host's IPv6 address. Defaults to `$address6$`.
`notification_author` | **Optional.** Comment author. Defaults to `$notification.author$`.
@ -2729,7 +2732,7 @@ Requirements:
* Icinga 2 as client on the remote node
* icinga user with sudo permissions to the httpd daemon
Example on CentOS 7:
Example on RHEL:
```
# visudo

View File

@ -593,7 +593,7 @@ Read more on that topic [here](03-monitoring-basics.md#notification-commands).
#### groups.conf <a id="groups-conf"></a>
The example host defined in [hosts.conf](hosts-conf) already has the
The example host defined in [hosts.conf](#hosts-conf) already has the
custom variable `os` set to `Linux` and is therefore automatically
a member of the host group `linux-servers`.

View File

@ -51,7 +51,7 @@ described. Try running the plugin after setup and [ensure it works](05-service-m
Prior to using the check plugin with Icinga 2 you should ensure that it is working properly
by trying to run it on the console using whichever user Icinga 2 is running as:
RHEL/CentOS/Fedora
RHEL/Fedora
```bash
sudo -u icinga /usr/lib64/nagios/plugins/check_mysql_health --help
@ -111,7 +111,7 @@ Can't locate Net/SNMP.pm in @INC (you may need to install the Net::SNMP module)
Prior to installing the Perl module via CPAN, look for a distribution
specific package, e.g. `libnet-snmp-perl` on Debian/Ubuntu or `perl-Net-SNMP`
on RHEL/CentOS.
on RHEL.
#### Optional: Custom Path <a id="service-monitoring-plugins-custom-path"></a>
@ -225,12 +225,12 @@ apply Service "db-size-" for (db_name => config in host.vars.databases) {
check_command = "mysql_health"
if (config.mysql_health_username) {
vars.mysql_healt_username = config.mysql_health_username
vars.mysql_health_username = config.mysql_health_username
} else {
vars.mysql_health_username = "root"
}
if (config.mysql_health_password) {
vars.mysql_healt_password = config.mysql_health_password
vars.mysql_health_password = config.mysql_health_password
} else {
vars.mysql_health_password = "icingar0xx"
}
@ -281,10 +281,10 @@ that [it works](05-service-monitoring.md#service-monitoring-plugins-it-works). T
`--help` parameter to see the actual parameters (docs might be outdated).
```
./check_systemd.py --help
./check_systemd --help
usage: check_systemd.py [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V]
[-w SECONDS]
usage: check_systemd [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V]
[-w SECONDS]
...
@ -319,7 +319,7 @@ Start with the basic plugin call without any parameters.
```
object CheckCommand "systemd" { // Plugin name without 'check_' prefix
command = [ PluginContribDir + "/check_systemd.py" ] // Use the 'PluginContribDir' constant, see the contributed ITL commands
command = [ PluginContribDir + "/check_systemd" ] // Use the 'PluginContribDir' constant, see the contributed ITL commands
}
```

View File

@ -264,7 +264,7 @@ The setup wizard will ensure that the following steps are taken:
* Update the [ApiListener](06-distributed-monitoring.md#distributed-monitoring-apilistener) and [constants](04-configuration.md#constants-conf) configuration.
* Update the [icinga2.conf](04-configuration.md#icinga2-conf) to disable the `conf.d` inclusion, and add the `api-users.conf` file inclusion.
Here is an example of a master setup for the `icinga2-master1.localdomain` node on CentOS 7:
Here is an example of a master setup for the `icinga2-master1.localdomain` node:
```
[root@icinga2-master1.localdomain /]# icinga2 node wizard
@ -1031,9 +1031,7 @@ in `/etc/icinga2/icinga2.conf`.
> Defaults to disabled.
Now it is time to validate the configuration and to restart the Icinga 2 daemon
on both nodes.
Example on CentOS 7:
on both nodes:
```
[root@icinga2-agent1.localdomain /]# icinga2 daemon -C
@ -1112,7 +1110,8 @@ Save the changes and validate the configuration on the master node:
```
[root@icinga2-master1.localdomain /]# icinga2 daemon -C
```
Restart the Icinga 2 daemon (example for CentOS 7):
Restart the Icinga 2 daemon:
```
[root@icinga2-master1.localdomain /]# systemctl restart icinga2
@ -1221,9 +1220,7 @@ object ApiListener "api" {
```
Now it is time to validate the configuration and to restart the Icinga 2 daemon
on both nodes.
Example on CentOS 7:
on both nodes:
```
[root@icinga2-satellite1.localdomain /]# icinga2 daemon -C
@ -1285,7 +1282,7 @@ Save the changes and validate the configuration on the master node:
[root@icinga2-master1.localdomain /]# icinga2 daemon -C
```
Restart the Icinga 2 daemon (example for CentOS 7):
Restart the Icinga 2 daemon:
```
[root@icinga2-master1.localdomain /]# systemctl restart icinga2
@ -3134,7 +3131,7 @@ object Endpoint "icinga2-master2.localdomain" {
> **Note**
>
> This is required if you decide to change an already running single endpoint production
> environment into a HA-enabled cluster zone with two endpoints.
> environment into an HA-enabled cluster zone with two endpoints.
> The [initial setup](06-distributed-monitoring.md#distributed-monitoring-scenarios-ha-master-clients)
> with 2 HA masters doesn't require this step.
@ -3183,7 +3180,7 @@ Create a certificate signing request (CSR) for the local instance:
Sign the CSR with the previously created CA:
```
[root@icinga2-master1.localdomain /root]# icinga2 pki sign-csr --csr icinga2-master1.localdomain.csr --cert icinga2-master1.localdomain
[root@icinga2-master1.localdomain /root]# icinga2 pki sign-csr --csr icinga2-master1.localdomain.csr --cert icinga2-master1.localdomain.crt
```
Repeat the steps for all instances in your setup.
@ -3230,6 +3227,53 @@ information/pki: Writing certificate to file 'icinga2-satellite1.localdomain.crt
Copy and move these certificates to the respective instances e.g. with SSH/SCP.
#### External CA/PKI
Icinga works best with its own certificates.
The commands described above take care of the optimal certificate properties.
Also, Icinga renews them periodically at runtime to avoid expiry.
But you can also provide your own certificates,
just like to any other application which uses TLS.
!!! warning
The only serious reasons to generate own certificates are company policies.
You are responsible for making Icinga working with your certificates,
as well as for [expiry monitoring](10-icinga-template-library.md#plugin-check-command-ssl_cert)
and renewal.
Especially `icinga2 pki` CLI commands do not expect such certificates.
Also, do not provide your custom CA private key to Icinga 2!
Otherwise, it will automatically renew leaf certificates
with our hardcoded properties, not your custom ones.
The CA certificate must be located in `/var/lib/icinga2/certs/ca.crt`.
The basic requirements for all leaf certificates are:
* Located in `/var/lib/icinga2/certs/NODENAME.crt`
and `/var/lib/icinga2/certs/NODENAME.key`
* Subject with CN matching the endpoint name
* A DNS SAN matching the endpoint name
Pretty much everything else is limited only by your company policy
and the OpenSSL versions your Icinga nodes use. E.g. the following works:
* Custom key sizes, e.g. 2048 bits
* Custom key types, e.g. ECC
* Any number of intermediate CAs (but see limitations below)
* Multiple trusted root CAs in `/var/lib/icinga2/certs/ca.crt`
* Different root CAs per cluster subtree, as long as each node trusts the
certificate issuers of all nodes it's directly connected to
Intermediate CA restrictions:
* Each side has to provide its intermediate CAs along with the leaf certificate
in `/var/lib/icinga2/certs/NODENAME.crt`, ordered from leaf to root.
* Intermediate CAs may not be used directly as root CAs. To trust only specific
intermediate CAs, cross-sign them with themselves, so that you get equal
certificates except that they're self-signed. Use them as root CAs in Icinga.
## Automation <a id="distributed-monitoring-automation"></a>
These hints should get you started with your own automation tools (Puppet, Ansible, Chef, Salt, etc.)

View File

@ -484,7 +484,7 @@ host or service is considered flapping until it drops below the low flapping thr
The attribute `flapping_ignore_states` allows to ignore state changes to specified states during the flapping calculation.
`FlappingStart` and `FlappingEnd` notifications will be sent out accordingly, if configured. See the chapter on
[notifications](alert-notifications) for details
[notifications](03-monitoring-basics.md#notifications) for details
> Note: There is no distinctions between hard and soft states with flapping. All state changes count and notifications
> will be sent out regardless of the objects state.

View File

@ -34,6 +34,7 @@ the [Icinga 2 API](12-icinga2-api.md#icinga2-api-config-objects).
templates | Array | Templates imported on object compilation.
package | String | [Configuration package name](12-icinga2-api.md#icinga2-api-config-management) this object belongs to. Local configuration is set to `_etc`, runtime created objects use `_api`.
source\_location | Dictionary | Location information where the configuration files are stored.
name | String | Object name. Might be used in [apply rules](03-monitoring-basics.md#using-apply).
## Monitoring Objects <a id="object-types-monitoring"></a>
@ -392,7 +393,6 @@ Runtime Attributes:
last\_check\_result | CheckResult | The current [check result](08-advanced-topics.md#advanced-value-types-checkresult).
last\_state\_change | Timestamp | When the last state change occurred (as a UNIX timestamp).
last\_hard\_state\_change | Timestamp | When the last hard state change occurred (as a UNIX timestamp).
last\_in\_downtime | Boolean | Whether the host was in a downtime when the last check occurred.
acknowledgement | Number | The acknowledgement type (0 = NONE, 1 = NORMAL, 2 = STICKY).
acknowledgement\_expiry | Timestamp | When the acknowledgement expires (as a UNIX timestamp; 0 = no expiry).
downtime\_depth | Number | Whether the host has one or more active downtimes.
@ -731,7 +731,6 @@ Configuration Attributes:
event\_command | Object name | **Optional.** The name of an event command that should be executed every time the service's state changes or the service is in a `SOFT` state.
volatile | Boolean | **Optional.** Treat all state changes as HARD changes. See [here](08-advanced-topics.md#volatile-services-hosts) for details. Defaults to `false`.
zone | Object name | **Optional.** The zone this object is a member of. Please read the [distributed monitoring](06-distributed-monitoring.md#distributed-monitoring) chapter for details.
name | String | **Required.** The service name. Must be unique on a per-host basis. For advanced usage in [apply rules](03-monitoring-basics.md#using-apply) only.
command\_endpoint | Object name | **Optional.** The endpoint where commands are executed on.
notes | String | **Optional.** Notes for the service.
notes\_url | String | **Optional.** URL for notes for the service (for example, in notification commands).
@ -758,7 +757,6 @@ Runtime Attributes:
last\_check\_result | CheckResult | The current [check result](08-advanced-topics.md#advanced-value-types-checkresult).
last\_state\_change | Timestamp | When the last state change occurred (as a UNIX timestamp).
last\_hard\_state\_change | Timestamp | When the last hard state change occurred (as a UNIX timestamp).
last\_in\_downtime | Boolean | Whether the service was in a downtime when the last check occurred.
acknowledgement | Number | The acknowledgement type (0 = NONE, 1 = NORMAL, 2 = STICKY).
acknowledgement\_expiry | Timestamp | When the acknowledgement expires (as a UNIX timestamp; 0 = no expiry).
acknowledgement\_last\_change | Timestamp | When the acknowledgement has been set/cleared
@ -1046,8 +1044,8 @@ Configuration Attributes:
Name | Type | Description
--------------------------|-----------------------|----------------------------------
host\_name | Object name | **Required.** The name of the host this comment belongs to.
service\_name | Object name | **Optional.** The short name of the service this comment belongs to. If omitted, this comment object is treated as host comment.
host\_name | Object name | **Required.** The name of the host this downtime belongs to.
service\_name | Object name | **Optional.** The short name of the service this downtime belongs to. If omitted, this downtime object is treated as host downtime.
author | String | **Required.** The author's name.
comment | String | **Required.** The comment text.
start\_time | Timestamp | **Required.** The start time as UNIX timestamp.
@ -1389,7 +1387,9 @@ Configuration Attributes:
host | String | **Optional.** Redis host. Defaults to `127.0.0.1`.
port | Number | **Optional.** Redis port. Defaults to `6380` since the Redis server provided by the `icingadb-redis` package listens on that port.
path | String | **Optional.** Redis unix socket path. Can be used instead of `host` and `port` attributes.
username | String | **Optional.** Redis auth username. Only possible if Redis ACLs are used. Requires `password` to be set as well.
password | String | **Optional.** Redis auth password.
db\_index | Number | **Optional.** Redis logical database by its number. Defaults to `0`.
enable\_tls | Boolean | **Optional.** Whether to use TLS.
cert\_path | String | **Optional.** Path to the certificate.
key\_path | String | **Optional.** Path to the private key.

View File

@ -75,8 +75,10 @@ plugin scripts.
### icinga <a id="itl-icinga"></a>
Check command for the built-in `icinga` check. This check returns performance
data for the current Icinga instance, reports as warning if the last reload failed and optionally allows for minimum version checks.
Check command for the built-in `icinga` check. This check returns performance data for the current Icinga instance,
reports as warning if the last reload or config sync failed and optionally allows for minimum version checks.
For the config sync check to work, it must be run on the satellite or agent.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
@ -215,7 +217,7 @@ Optional custom variables passed as [command parameters](03-monitoring-basics.md
| ifw\_api\_cert | null (Icinga PKI) | TLS client certificate path. |
| ifw\_api\_key | null (Icinga PKI) | TLS client private key path. |
| ifw\_api\_ca | null (Icinga PKI) | Peer TLS CA certificate path. |
| ifw\_api\_crl | null (Icinga PKI) | Path to TLS CRL to check peer against. |
| ifw\_api\_crl | null (none) | Path to TLS CRL to check peer against. |
| ifw\_api\_username | null (none) | Basic auth username. |
| ifw\_api\_password | null (none) | Basic auth password. |
@ -268,7 +270,6 @@ Custom variables passed as [command parameters](03-monitoring-basics.md#command-
Name | Description
------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt_extra_opts | **Optional.** Read options from an ini file.
apt_upgrade | **Optional.** [Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default.
apt_dist_upgrade | **Optional.** Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options.
apt_include | **Optional.** Include only packages matching REGEXP. Can be specified multiple times the values will be combined together.
@ -277,6 +278,7 @@ apt_critical | **Optional.** If the full package information of any o
apt_timeout | **Optional.** Seconds before plugin times out (default: 10).
apt_only_critical | **Optional.** Only warn about critical upgrades.
apt_list | **Optional.** List packages available for upgrade.
apt_extra_opts | **Optional.** Read extra plugin options from an ini file.
### breeze <a id="plugin-check-command-breeze"></a>
@ -317,6 +319,7 @@ by_ssh_options | **Optional.** Call ssh with '-o OPTION' (multiple options m
by_ssh_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
by_ssh_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
by_ssh_skip_stderr | **Optional.** Ignore all or (if specified) first n lines on STDERR.
by_ssh_extra_opts | **Optional.** Read extra plugin options from an ini file.
### clamd <a id="plugin-check-command-clamd"></a>
@ -348,6 +351,7 @@ clamd_ctime | **Optional.** Response time to result in critical status
clamd_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
clamd_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
clamd_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
clamd_extra_opts | **Optional.** Read extra plugin options from an ini file.
### dhcp <a id="plugin-check-command-dhcp"></a>
@ -365,6 +369,7 @@ dhcp_timeout | **Optional.** The timeout in seconds.
dhcp_interface | **Optional.** The interface to use.
dhcp_mac | **Optional.** The MAC address to use in the DHCP request.
dhcp_unicast | **Optional.** Whether to use unicast requests. Defaults to false.
dhcp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### dig <a id="plugin-check-command-dig"></a>
@ -388,6 +393,7 @@ dig_critical | **Optional.** Response time to result in critical status
dig_timeout | **Optional.** Seconds before connection times out (default: 10).
dig_ipv4 | **Optional.** Force dig to only use IPv4 query transport. Defaults to false.
dig_ipv6 | **Optional.** Force dig to only use IPv6 query transport. Defaults to false.
dig_extra_opts | **Optional.** Read extra plugin options from an ini file.
### disk <a id="plugin-check-command-disk"></a>
@ -425,9 +431,11 @@ disk\_ignore\_eregi\_path | **Optional.** Regular expression to ignore selected
disk\_ignore\_ereg\_path | **Optional.** Regular expression to ignore selected path or partition. Multiple regular expression strings must be defined as array.
disk\_timeout | **Optional.** Seconds before connection times out (default: 10).
disk\_units | **Optional.** Choose bytes, kB, MB, GB, TB.
disk\_exclude\_type | **Optional.** Ignore all filesystems of indicated type. Multiple regular expression strings must be defined as array. Defaults to "none", "tmpfs", "sysfs", "proc", "configfs", "devtmpfs", "devfs", "mtmfs", "tracefs", "cgroup", "fuse.gvfsd-fuse", "fuse.gvfs-fuse-daemon", "fdescfs", "overlay", "nsfs", "squashfs".
disk\_exclude\_type | **Optional.** Ignore all filesystems of indicated type. Multiple regular expression strings must be defined as array. Defaults to "none", "tmpfs", "sysfs", "proc", "configfs", "devtmpfs", "devfs", "mtmfs", "tracefs", "cgroup", "fuse.\*" (only Monitoring Plugins support this so far), "fuse.gvfsd-fuse", "fuse.gvfs-fuse-daemon", "fuse.sshfs", "fdescfs", "overlay", "nsfs", "squashfs".
disk\_include\_type | **Optional.** Check only filesystems of indicated type. Multiple regular expression strings must be defined as array.
disk\_inode\_perfdata | **Optional.** Display inode usage in perfdata
disk\_np\_inode\_perfdata | **Optional.** Enable performance data for inode-based statistics (Requires: nagios-plugins >= 2.3.0)
disk\_extra\_opts | **Optional.** Read extra plugin options from an ini file.
### disk_smb <a id="plugin-check-command-disk-smb"></a>
@ -469,6 +477,7 @@ dns_accept_cname | **Optional.** Accept cname responses as a valid result to
dns_wtime | **Optional.** Return warning if elapsed time exceeds value.
dns_ctime | **Optional.** Return critical if elapsed time exceeds value.
dns_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
dns_extra_opts | **Optional.** Read extra plugin options from an ini file.
@ -525,6 +534,7 @@ fping_bytes | **Optional.** The size of ICMP packet.
fping_target_timeout | **Optional.** The target timeout in milli-seconds.
fping_source_ip | **Optional.** The name or ip address of the source ip.
fping_source_interface | **Optional.** The source interface name.
fping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### fping6 <a id="plugin-check-command-fping6"></a>
@ -550,6 +560,7 @@ fping_bytes | **Optional.** The size of ICMP packet.
fping_target_timeout | **Optional.** The target timeout in milli-seconds.
fping_source_ip | **Optional.** The name or ip address of the source ip.
fping_source_interface | **Optional.** The source interface name.
fping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ftp <a id="plugin-check-command-ftp"></a>
@ -581,6 +592,7 @@ ftp_ctime | **Optional.** Response time to result in critical status (s
ftp_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
ftp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ftp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
ftp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### game <a id="plugin-check-command-game"></a>
@ -604,6 +616,7 @@ game_mapfield | **Optional.** Field number in raw qstat output that contain
game_pingfield | **Optional.** Field number in raw qstat output that contains ping time.
game_gametime | **Optional.** Field number in raw qstat output that contains game time.
game_hostname | **Optional.** Name of the host running the game.
game_extra_opts | **Optional.** Read extra plugin options from an ini file.
### hostalive <a id="plugin-check-command-hostalive"></a>
@ -622,7 +635,8 @@ ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults
ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 5000.
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 10.
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### hostalive4 <a id="plugin-check-command-hostalive4"></a>
@ -641,6 +655,7 @@ ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defa
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### hostalive6 <a id="plugin-check-command-hostalive6"></a>
@ -659,6 +674,7 @@ ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defa
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### hpjd <a id="plugin-check-command-hpjd"></a>
@ -674,6 +690,7 @@ Name | Description
hpjd_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
hpjd_port | **Optional.** The host's SNMP port. Defaults to 161.
hpjd_community | **Optional.** The SNMP community. Defaults to "public".
hpjd_extra_opts | **Optional.** Read extra plugin options from an ini file.
### http <a id="plugin-check-command-http"></a>
@ -716,6 +733,7 @@ http_warn_time | **Optional.** The warning threshold.
http_critical_time | **Optional.** The critical threshold.
http_expect | **Optional.** Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response. Default: HTTP/1.
http_certificate | **Optional.** Minimum number of days a certificate has to be valid. Port defaults to 443. When this option is used the URL is not checked. The first parameter defines the warning threshold (in days), the second parameter the critical threshold (in days). (Example `http_certificate = "30,20"`).
http_certificate_continue | **Optional.** Allows the HTTP check to continue after performing the certificate check. Does nothing unless http_certificate is used.
http_clientcert | **Optional.** Name of file contains the client certificate (PEM format).
http_privatekey | **Optional.** Name of file contains the private key (PEM format).
http_headerstring | **Optional.** String to expect in the response headers.
@ -735,6 +753,68 @@ http_ipv6 | **Optional.** Use IPv6 connection. Defaults t
http_link | **Optional.** Wrap output in HTML link. Defaults to false.
http_verbose | **Optional.** Show details for command-line debugging. Defaults to false.
http_verify_host | **Optional.** Verify SSL certificate is for the -H hostname (with --sni and -S). Defaults to false. **Only supported by the Nagios plugins version of check\_http, not by the monitoring plugins one.**
http_extra_opts | **Optional.** Read extra plugin options from an ini file.
### curl <a id="plugin-check-command-curl"></a>
The [check_curl](https://www.monitoring-plugins.org/doc/man/check_curl.html) plugin
tests the HTTP service on the specified host. It can test normal (http) and secure
(https) servers, follow redirects, search for strings and regular expressions,
check connection times, and report on certificate expiration times.
The plugin can either test the HTTP response of a server, or if `curl_certificate_valid_days_min_warning`/`curl_certificate_valid_days_min_critical` is set to a non-empty value, the TLS certificate age for a HTTPS host.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
---------------------------------|---------------------------------
curl_vhost | **Optional.** The virtual host that should be sent in the "Host" header.
curl_ip | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
curl_port | **Optional.** The TCP port. Defaults to 80 when not using SSL, 443 otherwise.
curl_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
curl_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
curl_tls | **Optional.** Whether to use SSL. Defaults to false.
curl_tls_version | **Optional.** Connect via SSL. Port defaults to 443. VERSION is optional, and prevents auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1, 1.2 = TLSv1.2, 1.3 = TLSv1.3). With a '+' suffix, newer versions are also accepted. Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl.
curl_sni | **Optional.** Whether to use SNI. This is the default of `check_curl` in *most* cases and this option will not change this behaviour then. For obscure and old setup it might be necessary to manually activate it. The variable itself defaults to false.
curl_certificate_valid_days_min_warning | **Optional.** Minimum number of days a certificate has to be valid. Port defaults to 443. When this option is used, the URL is not checked (by default). This defines the warning threshold (in days).
curl_certificate_valid_days_min_critical | **Optional.** Minimum number of days a certificate has to be valid. This parameter defines the critical threshold (in days). See also `curl_certificate_valid_days_min_warning` above for more information.
curl_continue_after_certificate | **Optional.** Allows the HTTP check to continue after performing the certificate check. Does nothing unless tls certificate check mode is used (`curl_certificate_valid_days_min_warning`/`curl_certificate_valid_days_min_critical`). (available since Monitoring Plugins v2.3.2)
curl_client_certificate_file | **Optional.** Name of file contains the client certificate (PEM format).
curl_client_certificate_key_file | **Optional.** Name of file contains the private key (PEM format).
curl_ca_cert_file | **Optional.** CA certificate file to verify peer against.
curl_verify_peer_cert | **Optional.** Verify that the peers certificate matches against the hostname
curl_expect_string | **Optional.** Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response. Default: HTTP/1.
curl_expect_header_string | **Optional.** String to expect in the response headers.
curl_expect_content_string | **Optional.** String to expect in the content.
curl_url | **Optional.** The request URL for GET or POST. Defaults to `/`.
curl_post_data | **Optional.** URL encoded curl POST data.
curl_http_method | **Optional.** Set curl method (for example: HEAD, OPTIONS, TRACE, PUT, DELETE).
curl_no_body | **Optional.** Don't wait for document body: stop reading after headers. (Note that this stilldoes an HTTP GET or POST, not a HEAD.).
curl_max_age | **Optional.** Warn if document is more than seconds old.
curl_content_type | **Optional.** Specify Content-Type header when POSTing.
curl_linespan | **Optional.** Allow regex to span newline.
curl_ereg | **Optional.** A regular expression which the body must match against. Incompatible with curl_no-body.
curl_eregi | **Optional.** A case-insensitive expression which the body must match against. Incompatible with curl_no-body.
curl_invert_regex | **Optional.** Changes behavior of curl_ereg and curl_eregi to return CRITICAL if found, OK if not.
curl_state_regex | **Optional.** Return STATE if regex is found, OK if not. STATE can be one of "critical","warning"
curl_authorization | **Optional.** Add 'username:password' authorization pair.
curl_proxy_authorization | **Optional.** Add 'username:password' authorization pair for proxy.
curl_user_agent | **Optional.** String to be sent in curl header as User Agent.
curl_header | **Optional.** Any other tags to be sent in curl header. Can be an array if multiple headers should be passed to `check_curl`.
curl_extended_perfdata | **Optional.** Print additional perfdata. Defaults to false.
curl_show_body | **Optional.** Print body content below status line
curl_link | **Optional.** Wrap output in HTML link. Defaults to false.
curl_onredirect | **Optional.** How to handle redirect pages. Possible values: "ok" (default), "warning", "critical", "follow", "sticky" (like follow but stick to address), "stickyport" (like sticky but also to port)
curl_max_redirs | **Optional.** Maximum number of redirects
curl_pagesize | **Optional.** Minimum page size required:Maximum page size required.
curl_http_version | **Optional.** Connect via specific HTTP protocol. 1.0 = HTTP/1.0, 1.1 = HTTP/1.1, 2.0 = HTTP/2 (HTTP/2 will fail without -S)
curl_enable_automatic_decompression | **Optional.** Enable automatic decompression of body (CURLOPT_ACCEPT_ENCODING).
curl_haproxy_protocol | **Optional.** Send HAProxy proxy protocol v1 header (CURLOPT_HAPROXYPROTOCOL) (available since Monitoring Plugins v2.4.0)
curl_cookie_jar_file | **Optional.** Path to a cookie jar file. Store cookies in the cookie jar and send them out when requested. (available since Monitoring Plugins v2.3.4)
curl_warning | **Optional.** The warning threshold.
curl_critical | **Optional.** The critical threshold.
curl_timeout | **Optional.** Seconds before connection times out.
curl_extra_opts | **Optional.** Read options from an ini file.
### icmp <a id="plugin-check-command-icmp"></a>
@ -762,6 +842,7 @@ icmp_hosts_alive | **Optional.** The number of hosts which have to be alive for
icmp_data_bytes | **Optional.** Payload size for each ICMP request. Defaults to 8.
icmp_timeout | **Optional.** The plugin timeout in seconds. Defaults to 10 (seconds).
icmp_ttl | **Optional.** The TTL on outgoing packets.
icmp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### imap <a id="plugin-check-command-imap"></a>
@ -792,6 +873,7 @@ imap_critical | **Optional.** Response time to result in critical status
imap_timeout | **Optional.** Seconds before connection times out (default: 10).
imap_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
imap_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
imap_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ldap <a id="plugin-check-command-ldap"></a>
@ -822,6 +904,7 @@ ldap_warning_entries | **Optional.** Number of found entries to result in warnin
ldap_critical_entries | **Optional.** Number of found entries to result in critical status.
ldap_timeout | **Optional.** Seconds before connection times out (default: 10).
ldap_verbose | **Optional.** Show details for command-line debugging (disabled by default)
ldap_extra_opts | **Optional.** Read extra plugin options from an ini file.
### load <a id="plugin-check-command-load"></a>
@ -839,6 +922,7 @@ load_cload1 | **Optional.** The 1-minute critical threshold. Defaults to 10.
load_cload5 | **Optional.** The 5-minute critical threshold. Defaults to 6.
load_cload15 | **Optional.** The 15-minute critical threshold. Defaults to 4.
load_percpu | **Optional.** Divide the load averages by the number of CPUs (when possible). Defaults to false.
load_extra_opts | **Optional.** Read extra plugin options from an ini file.
### mailq <a id="plugin-check-command-mailq"></a>
@ -885,6 +969,7 @@ mysql_cert | **Optional.** Path to SSL certificate.
mysql_key | **Optional.** Path to private SSL key.
mysql_cadir | **Optional.** Path to CA directory.
mysql_ciphers | **Optional.** List of valid SSL ciphers.
mysql_extra_opts | **Optional.** Read extra plugin options from an ini file.
### mysql_query <a id="plugin-check-command-mysql-query"></a>
@ -910,6 +995,7 @@ mysql_query_password | **Optional.** Use the indicated password to authentica
mysql_query_execute | **Required.** SQL Query to run on the MySQL Server.
mysql_query_warning | **Optional.** Exit with WARNING status if query is outside of the range (format: start:end).
mysql_query_critical | **Optional.** Exit with CRITICAL status if query is outside of the range.
mysql_query_extra_opts | **Optional.** Read extra plugin options from an ini file.
### negate <a id="plugin-check-command-negate"></a>
@ -981,6 +1067,7 @@ nscp_warn | **Optional.** The warning threshold.
nscp_crit | **Optional.** The critical threshold.
nscp_timeout | **Optional.** The query timeout in seconds.
nscp_showall | **Optional.** Use with SERVICESTATE to see working services or PROCSTATE for running processes. Defaults to false.
nscp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ntp_time <a id="plugin-check-command-ntp-time"></a>
@ -1003,6 +1090,7 @@ ntp_timeoffset | **Optional.** Expected offset of the ntp server relative to lo
ntp_timeout | **Optional.** Seconds before connection times out (default: 10).
ntp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ntp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
ntp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ntp_peer <a id="plugin-check-command-ntp-peer"></a>
@ -1030,6 +1118,7 @@ ntp_csource | **Optional.** Critical threshold for number of usable time sou
ntp_timeout | **Optional.** Seconds before connection times out (default: 10).
ntp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ntp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
ntp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### pgsql <a id="plugin-check-command-pgsql"></a>
@ -1057,6 +1146,7 @@ pgsql_timeout | **Optional.** Seconds before connection times out (default: 10)
pgsql_query | **Optional.** SQL query to run. Only first column in first row will be read.
pgsql_query_warning | **Optional.** SQL query value to result in warning status (double).
pgsql_query_critical | **Optional.** SQL query value to result in critical status (double).
pgsql_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ping <a id="plugin-check-command-ping"></a>
@ -1078,6 +1168,7 @@ ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defa
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ping4 <a id="plugin-check-command-ping4"></a>
@ -1100,6 +1191,7 @@ ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defa
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ping6 <a id="plugin-check-command-ping6"></a>
@ -1121,6 +1213,7 @@ ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defa
ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
ping_packets | **Optional.** The number of packets to send. Defaults to 5.
ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
ping_extra_opts | **Optional.** Read extra plugin options from an ini file.
### pop <a id="plugin-check-command-pop"></a>
@ -1151,6 +1244,7 @@ pop_critical | **Optional.** Response time to result in critical status
pop_timeout | **Optional.** Seconds before connection times out (default: 10).
pop_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
pop_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
pop_extra_opts | **Optional.** Read extra plugin options from an ini file.
### procs <a id="plugin-check-command-processes"></a>
@ -1162,23 +1256,25 @@ of processes. Search filters can be applied to limit the processes to check.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
---------------------|--------------
procs_warning | **Optional.** The process count warning threshold. Defaults to 250.
procs_critical | **Optional.** The process count critical threshold. Defaults to 400.
procs_metric | **Optional.** Check thresholds against metric.
procs_timeout | **Optional.** Seconds before plugin times out.
procs_traditional | **Optional.** Filter own process the traditional way by PID instead of /proc/pid/exe. Defaults to false.
procs_state | **Optional.** Only scan for processes that have one or more of the status flags you specify.
procs_ppid | **Optional.** Only scan for children of the parent process ID indicated.
procs_vsz | **Optional.** Only scan for processes with VSZ higher than indicated.
procs_rss | **Optional.** Only scan for processes with RSS higher than indicated.
procs_pcpu | **Optional.** Only scan for processes with PCPU higher than indicated.
procs_user | **Optional.** Only scan for processes with user name or ID indicated.
procs_argument | **Optional.** Only scan for processes with args that contain STRING.
procs_argument_regex | **Optional.** Only scan for processes with args that contain the regex STRING.
procs_command | **Optional.** Only scan for exact matches of COMMAND (without path).
procs_nokthreads | **Optional.** Only scan for non kernel threads. Defaults to false.
Name | Description
----------------------|--------------
procs_warning | **Optional.** The process count warning threshold. Defaults to 250.
procs_critical | **Optional.** The process count critical threshold. Defaults to 400.
procs_metric | **Optional.** Check thresholds against metric.
procs_timeout | **Optional.** Seconds before plugin times out.
procs_traditional | **Optional.** Filter own process the traditional way by PID instead of /proc/pid/exe. Defaults to false.
procs_state | **Optional.** Only scan for processes that have one or more of the status flags you specify.
procs_ppid | **Optional.** Only scan for children of the parent process ID indicated.
procs_vsz | **Optional.** Only scan for processes with VSZ higher than indicated.
procs_rss | **Optional.** Only scan for processes with RSS higher than indicated.
procs_pcpu | **Optional.** Only scan for processes with PCPU higher than indicated.
procs_user | **Optional.** Only scan for processes with user name or ID indicated.
procs_argument | **Optional.** Only scan for processes with args that contain STRING.
procs_argument_regex | **Optional.** Only scan for processes with args that contain the regex STRING.
procs_command | **Optional.** Only scan for exact matches of COMMAND (without path).
procs_exclude_process | **Optional.** Exclude processes which match this comma separated list.
procs_nokthreads | **Optional.** Only scan for non kernel threads. Defaults to false.
procs_extra_opts | **Optional.** Read extra plugin options from an ini file.
### radius <a id="plugin-check-command-radius"></a>
@ -1208,6 +1304,7 @@ radius_nas_address | **Optional.** The NAS IP address.
radius_expect | **Optional.** The response string to expect from the server.
radius_retries | **Optional.** The number of times to retry a failed connection.
radius_timeout | **Optional.** The number of seconds before connection times out (default: 10).
radius_extra_opts | **Optional.** Read extra plugin options from an ini file.
### rpc <a id="plugin-check-command-rpc"></a>
@ -1254,6 +1351,7 @@ simap_critical | **Optional.** Response time to result in critical statu
simap_timeout | **Optional.** Seconds before connection times out (default: 10).
simap_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
simap_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
simap_extra_opts | **Optional.** Read extra plugin options from an ini file.
### smart <a id="plugin-check-command-smart"></a>
@ -1262,9 +1360,10 @@ checks a local hard drive with the (Linux specific) SMART interface. Requires in
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
----------------|--------------
smart_device | **Required.** The name of a local hard drive to monitor.
Name | Description
-----------------|--------------
smart_device | **Required.** The name of a local hard drive to monitor.
smart_extra_opts | **Optional.** Read extra plugin options from an ini file.
### smtp <a id="plugin-check-command-smtp"></a>
@ -1294,6 +1393,7 @@ smtp_critical | **Optional.** Response time to result in critical status
smtp_timeout | **Optional.** Seconds before connection times out (default: 10).
smtp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
smtp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
smtp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### snmp <a id="plugin-check-command-snmp"></a>
@ -1322,6 +1422,7 @@ snmp_invert_search | **Optional.** Invert search result and return CRITICAL sta
snmp_units | **Optional.** Units label(s) for output value (e.g., 'sec.').
snmp_version | **Optional.** Version to use. E.g. 1, 2, 2c or 3.
snmp_miblist | **Optional.** MIB's to use, comma separated. Defaults to "ALL".
snmp_multiplier |**Optional.** Multiplies current value, 0 < n < 1 works as divider, defaults to 1
snmp_rate_multiplier | **Optional.** Converts rate per second. For example, set to 60 to convert to per minute.
snmp_rate | **Optional.** Boolean. Enable rate calculation.
snmp_getnext | **Optional.** Boolean. Use SNMP GETNEXT. Defaults to false.
@ -1329,6 +1430,7 @@ snmp_timeout | **Optional.** The command timeout in seconds. Defaults to
snmp_offset | **Optional.** Add/subtract the specified OFFSET to numeric sensor data.
snmp_output_delimiter | **Optional.** Separates output on multiple OID requests.
snmp_perf_oids | **Optional.** Label performance data with OIDs instead of --label's.
snmp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### snmpv3 <a id="plugin-check-command-snmpv3"></a>
@ -1357,9 +1459,11 @@ snmpv3_eregi | **Optional.** Return OK state (for that OID) if case-inse
snmpv3_invert_search | **Optional.** Invert search result and return CRITICAL if found
snmpv3_label | **Optional.** Prefix label for output value.
snmpv3_units | **Optional.** Units label(s) for output value (e.g., 'sec.').
snmp3_multiplier |**Optional.** Multiplies current value, 0 < n < 1 works as divider, defaults to 1
snmpv3_rate_multiplier | **Optional.** Converts rate per second. For example, set to 60 to convert to per minute.
snmpv3_rate | **Optional.** Boolean. Enable rate calculation.
snmpv3_timeout | **Optional.** The command timeout in seconds. Defaults to 10 seconds.
snmpv3_extra_opts | **Optional.** Read extra plugin options from an ini file.
### snmp-uptime <a id="plugin-check-command-snmp-uptime"></a>
@ -1373,6 +1477,7 @@ Name | Description
snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
snmp_oid | **Optional.** The SNMP OID. Defaults to "1.3.6.1.2.1.1.3.0".
snmp_community | **Optional.** The SNMP community. Defaults to "public".
snmp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### spop <a id="plugin-check-command-spop"></a>
@ -1403,6 +1508,7 @@ spop_critical | **Optional.** Response time to result in critical status
spop_timeout | **Optional.** Seconds before connection times out (default: 10).
spop_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
spop_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
spop_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ssh <a id="plugin-check-command-ssh"></a>
@ -1412,13 +1518,16 @@ connects to an SSH server at a specified host and port.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
----------------|--------------
ssh_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
ssh_port | **Optional.** The port that should be checked. Defaults to 22.
ssh_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
ssh_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ssh_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
Name | Description
--------------------|--------------
ssh_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
ssh_port | **Optional.** The port that should be checked. Defaults to 22.
ssh_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
ssh_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ssh_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
ssh_remote_version | **Optional.** Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1).
ssh_remote_protocol | **Optional.** Alert if protocol doesn't match expected protocol version (ex: 2.0).
ssh_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ssl <a id="plugin-check-command-ssl"></a>
@ -1436,6 +1545,7 @@ ssl_timeout | **Optional.** Timeout in seconds for the connect
ssl_cert_valid_days_warn | **Optional.** Warning threshold for days before the certificate will expire. When used, the default for ssl_cert_valid_days_critical is 0.
ssl_cert_valid_days_critical | **Optional.** Critical threshold for days before the certificate will expire. When used, ssl_cert_valid_days_warn must also be set.
ssl_sni | **Optional.** The `server_name` that is sent to select the SSL certificate to check. Important if SNI is used.
ssl_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ssmtp <a id="plugin-check-command-ssmtp"></a>
@ -1466,6 +1576,7 @@ ssmtp_critical | **Optional.** Response time to result in critical statu
ssmtp_timeout | **Optional.** Seconds before connection times out (default: 10).
ssmtp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
ssmtp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
ssmtp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### swap <a id="plugin-check-command-swap"></a>
@ -1482,6 +1593,7 @@ swap_cfree | **Optional.** The free swap space critical threshold in % (ena
swap_integer | **Optional.** Specifies whether the thresholds are passed as number or percent value. Defaults to false (percent values).
swap_allswaps | **Optional.** Conduct comparisons for all swap partitions, one by one. Defaults to false.
swap_noswap | **Optional.** Resulting state when there is no swap regardless of thresholds. Possible values are "ok", "warning", "critical", "unknown". Defaults to "critical".
swap_extra_opts | **Optional.** Read extra plugin options from an ini file.
### tcp <a id="plugin-check-command-tcp"></a>
@ -1514,6 +1626,7 @@ tcp_ctime | **Optional.** Response time to result in critical status (seco
tcp_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
tcp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
tcp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
tcp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### udp <a id="plugin-check-command-udp"></a>
@ -1532,6 +1645,7 @@ udp_expect | **Required.** The payload to expect in the response datagram.
udp_quit | **Optional.** The payload to send to 'close' the session.
udp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false.
udp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false.
udp_extra_opts | **Optional.** Read extra plugin options from an ini file.
### ups <a id="plugin-check-command-ups"></a>
@ -1552,6 +1666,7 @@ ups_warning | **Optional.** The warning threshold for the selected variable.
ups_critical | **Optional.** The critical threshold for the selected variable.
ups_celsius | **Optional.** Display the temperature in degrees Celsius instead of Fahrenheit. Defaults to `false`.
ups_timeout | **Optional.** The number of seconds before the connection times out. Defaults to 10.
ups_extra_opts | **Optional.** Read extra plugin options from an ini file.
### users <a id="plugin-check-command-users"></a>
@ -1562,10 +1677,11 @@ error if the number exceeds the thresholds specified.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
----------------|--------------
users_wgreater | **Optional.** The user count warning threshold. Defaults to 20.
users_cgreater | **Optional.** The user count critical threshold. Defaults to 50.
Name | Description
-----------------|--------------
users_wgreater | **Optional.** The user count warning threshold. Defaults to 20.
users_cgreater | **Optional.** The user count critical threshold. Defaults to 50.
users_extra_opts | **Optional.** Read extra plugin options from an ini file.
### uptime <a id="plugin-check-command-uptime"></a>
@ -3447,7 +3563,7 @@ thola_identify_discover_timeouts | **Optional.** The number of discover timeou
> **Note**:
>
> One of the variables `thola_identify_model`, `thola_identify_os_version`,
> One of the variables `thola_identify_model`, `thola_identify_os_version`,
> `thola_identify_vendor` or `thola_identify_serial_number` must be set
##### thola-memory-usage <a id="plugin-contrib-command-thola-memory-usage"></a>
@ -3652,22 +3768,33 @@ iostat\_cwrite | **Required.** Critical threshold for KB/s writes (default: 200)
#### systemd <a id="plugin-contrib-command-systemd"></a>
The [check_systemd.py](https://github.com/Josef-Friedrich/check_systemd) plugin
will report a degraded system to your monitoring solution. It requires only the [nagiosplugin](https://nagiosplugin.readthedocs.io/en/stable) library.
The [check_systemd](https://github.com/Josef-Friedrich/check_systemd) plugin
will report a degraded system to your monitoring solution.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------
systemd\_unit | **Optional.** Name of the systemd unit that is being tested.
systemd\_exclude\_unit | **Optional.** Exclude a systemd unit from the checks. This option can be applied multiple times. Also supports regular expressions.
systemd\_no\_startup\_time | **Optional.** Dont check the startup time. Using this option the options `systemd_warning` and `systemd_critical` have no effect. (Default: `false`)
systemd\_warning | **Optional.** Startup time in seconds to result in a warning status. (Default: `60s`)
systemd\_critical | **Optional.** Startup time in seconds to result in a critical status. (Default: `120s`)
systemd\_dead\_timers | **Optional.** Detect dead / inactive timers. (Default: `false`)
systemd\_dead\_timers\_warning | **Optional.** Time ago in seconds for dead / inactive timers to trigger a warning state (by default 6 days).
systemd\_dead\_timers\_critical | **Optional.** Time ago in seconds for dead / inactive timers to trigger a critical state (by default 7 days).
systemd\_verbose\_level | **Optional.** Increase verbosity level (Accepted values: `1`, `2` or `3`). (Defaults to none)
Name | Description
---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------
systemd\_verbose\_level | **Optional.** Increase verbosity level (Accepted values: `1`, `2` or `3`). (Defaults to none)
systemd\_ignore\_inactive\_state | **Optional.** Ignore an inactive state on a specific unit. Only affective if used with `systemd_unit`.
systemd\_include | **Optional.** Include systemd units to the checks, regular expressions are supported. This option can be applied multiple times.
systemd\_unit | **Optional.** Name of the systemd unit that is being tested.
systemd\_include\_type | **Optional.** Unit types to be tested (for example: `service`, `timer`). This option can be applied multiple times.
systemd\_exclude\_unit | **Optional.** Exclude a systemd unit from the checks, regular expressions are supported. This option can be applied multiple times.
systemd\_exclude\_unit\_name | **Optional.** Exclude a systemd unit from the checks. This option can be applied multiple times.
systemd\_exclude\_type | **Optional.** Exclude a systemd unit type (for example: `service`, `timer`)
systemd\_state | **Optional.** Specify the active state that the systemd unit must have (for example: `active`, `inactive`)
systemd\_dead\_timers | **Optional.** Detect dead / inactive timers, see `systemd_dead_timers_{warning,critical}`. (Default `false`)
systemd\_dead\_timers\_warning | **Optional.** Time ago in seconds for dead / inactive timers to trigger a warning state. (Default 6 days)
systemd\_dead\_timers\_critical | **Optional.** Time ago in seconds for dead / inactive timers to trigger a critical state. (Default 7 days)
systemd\_no\_startup\_time | **Optional.** Don't check the startup time. Using this option, the options `systemd_{warning,critical}` have no effect. (Default `false`)
systemd\_warning | **Optional.** Startup time in seconds to result in a warning status. (Default 60 seconds)
systemd\_critical | **Optional.** Startup time in seconds to result in a critical status. (Default 120 seconds)
systemd\_dbus | **Optional.** Use systemd's D-Bus API instead of parsing command output. Only partially implemented!
systemd\_cli | **Optional.** Use text output from parsing command output. (Default)
systemd\_user | **Optional.** Also show user (systemctl --user) units.
#### yum <a id="plugin-contrib-command-yum"></a>
@ -4314,23 +4441,24 @@ Check command object for the `check_vmware_esx` plugin. Shows net info.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
------------------------|--------------
vmware_host | **Required.** ESX or ESXi hostname.
vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host.
vmware_sslport | **Optional.** SSL port connection. Defaults to "443".
vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false".
vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false".
vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90".
vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace.
vmware_sessionfile | **Optional.** Session file name enhancement.
vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp".
vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false".
vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default.
vmware_password | **Optional.** The username's password. No value defined as default.
vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined <br> **Authentication file content:** <br> username=vmuser <br> password=p@ssw0rd
vmware_exclude | **Optional.** Blacklist NICs. No value defined as default.
vmware_isregexp | **Optional.** Treat blacklist expression as regexp.
Name | Description
----------------------------|--------------
vmware_host | **Required.** ESX or ESXi hostname.
vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host.
vmware_sslport | **Optional.** SSL port connection. Defaults to "443".
vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false".
vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false".
vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90".
vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace.
vmware_sessionfile | **Optional.** Session file name enhancement.
vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp".
vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false".
vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default.
vmware_password | **Optional.** The username's password. No value defined as default.
vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined <br> **Authentication file content:** <br> username=vmuser <br> password=p@ssw0rd
vmware_exclude | **Optional.** Blacklist NICs. No value defined as default.
vmware_isregexp | **Optional.** Treat blacklist expression as regexp.
vmware_unplugged_nics_state | **Optional.** Sets status for unplugged nics (Possible values are: [OK | ok] or [CRITICAL | critical | CRIT | crit] or [WARNING | warning | WARN | warn]. Default is WARNING. Values are case insensitive.)
**vmware-esx-soap-host-net-usage**
@ -4414,23 +4542,24 @@ Check command object for the `check_vmware_esx` plugin. Check all active NICs.
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
------------------------|--------------
vmware_host | **Required.** ESX or ESXi hostname.
vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host.
vmware_sslport | **Optional.** SSL port connection. Defaults to "443".
vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false".
vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false".
vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90".
vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace.
vmware_sessionfile | **Optional.** Session file name enhancement.
vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp".
vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false".
vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default.
vmware_password | **Optional.** The username's password. No value defined as default.
vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined <br> **Authentication file content:** <br> username=vmuser <br> password=p@ssw0rd
vmware_exclude | **Optional.** Blacklist NICs. No value defined as default.
vmware_isregexp | **Optional.** Treat blacklist expression as regexp.
Name | Description
----------------------------|--------------
vmware_host | **Required.** ESX or ESXi hostname.
vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host.
vmware_sslport | **Optional.** SSL port connection. Defaults to "443".
vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false".
vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false".
vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90".
vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace.
vmware_sessionfile | **Optional.** Session file name enhancement.
vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp".
vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false".
vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default.
vmware_password | **Optional.** The username's password. No value defined as default.
vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined <br> **Authentication file content:** <br> username=vmuser <br> password=p@ssw0rd
vmware_exclude | **Optional.** Blacklist NICs. No value defined as default.
vmware_isregexp | **Optional.** Treat blacklist expression as regexp.
vmware_unplugged_nics_state | **Optional.** Sets status for unplugged nics (Possible values are: [OK | ok] or [CRITICAL | critical | CRIT | crit] or [WARNING | warning | WARN | warn]. Default is WARNING. Values are case insensitive.)
**vmware-esx-soap-host-volumes**
@ -5828,40 +5957,43 @@ Custom variables passed as [command parameters](03-monitoring-basics.md#command-
Name | Description
--------------------------|--------------
ssl_cert_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
ssl_cert_port | **Optional.** TCP port number (default: 443).
ssl_cert_proxy | **Optional.** Proxy server to use for connecting to the host. Sets http_proxy and the s_client -proxy option.
ssl_cert_file | **Optional.** Local file path. Works only if `ssl_cert_address` is set to "localhost".
ssl_cert_warn | **Optional.** Minimum number of days a certificate has to be valid.
ssl_cert_critical | **Optional.** Minimum number of days a certificate has to be valid to issue a critical status.
ssl_cert_cn | **Optional.** Pattern to match the CN of the certificate.
ssl_cert_altnames | **Optional.** Matches the pattern specified in -n with alternate
ssl_cert_issuer | **Optional.** Pattern to match the issuer of the certificate.
ssl_cert_org | **Optional.** Pattern to match the organization of the certificate.
ssl_cert_email | **Optional.** Pattern to match the email address contained in the certificate.
ssl_cert_serial | **Optional.** Pattern to match the serial number.
ssl_cert_noauth | **Optional.** Ignore authority warnings (expiration only)
ssl_cert_match_host | **Optional.** Match CN with the host name.
ssl_cert_selfsigned | **Optional.** Allow self-signed certificate.
ssl_cert_sni | **Optional.** Sets the TLS SNI (Server Name Indication) extension.
ssl_cert_timeout | **Optional.** Seconds before connection times out (default: 15)
ssl_cert_protocol | **Optional.** Use the specific protocol {http,smtp,pop3,imap,ftp,xmpp,irc,ldap} (default: http).
ssl_cert_clientcert | **Optional.** Use client certificate to authenticate.
ssl_cert_clientpass | **Optional.** Set passphrase for client certificate.
ssl_cert_ssllabs | **Optional.** SSL Labs assessment
ssl_cert_ssllabs_nocache | **Optional.** Forces a new check by SSL Labs
ssl_cert_rootcert | **Optional.** Root certificate or directory to be used for certificate validation.
ssl_cert_ignore_signature | **Optional.** Do not check if the certificate was signed with SHA1 od MD5.
ssl_cert_ssl_version | **Optional.** Force specific SSL version out of {ssl2,ssl3,tls1,tls1_1,tls1_2}.
ssl_cert_disable_ssl_versions | **Optional.** Disable specific SSL versions out of {ssl2,ssl3,tls1,tls1_1,tls1_2}. Multiple versions can be given as array.
ssl_cert_cipher | **Optional.** Cipher selection: force {ecdsa,rsa} authentication.
ssl_cert_ignore_expiration | **Optional.** Ignore expiration date.
ssl_cert_ignore_host_cn | **Optional.** Do not complain if the CN does not match.
ssl_cert_ignore_ocsp | **Optional.** Do not check revocation with OCSP.
ssl_cert_ignore_ocsp_errors | **Optional.** Continue if the OCSP status cannot be checked.
ssl_cert_ignore_ocsp_timeout | **Optional.** Ignore OCSP result when timeout occurs while checking.
ssl_cert_ignore_sct | **Optional.** Do not check for signed certificate timestamps.
ssl_cert_ignore_tls_renegotiation | **Optional.** Do not check for renegotiation.
ssl_cert_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
ssl_cert_port | **Optional.** TCP port number (default: 443).
ssl_cert_proxy | **Optional.** Proxy server to use for connecting to the host. Sets http_proxy and the s_client -proxy option.
ssl_cert_file | **Optional.** Local file path. Works only if `ssl_cert_address` is set to "localhost".
ssl_cert_warn | **Optional.** Minimum number of days a certificate has to be valid.
ssl_cert_critical | **Optional.** Minimum number of days a certificate has to be valid to issue a critical status.
ssl_cert_maximum_validity | **Optional.** Maximum number of days a certificate is allowed to be valid (default: 397)
ssl_cert_ignore_maximum_validity | **Optional.** Ignore the certificate maximum validity
ssl_cert_cn | **Optional.** Pattern to match the CN or AltName of the certificate.
ssl_cert_issuer | **Optional.** Pattern to match the issuer of the certificate.
ssl_cert_org | **Optional.** Pattern to match the organization of the certificate.
ssl_cert_email | **Optional.** Pattern to match the email address contained in the certificate.
ssl_cert_serial | **Optional.** Pattern to match the serial number.
ssl_cert_noauth | **Optional.** Ignore authority warnings (expiration only)
ssl_cert_match_host | **Optional.** Match CN with the host name.
ssl_cert_selfsigned | **Optional.** Allow self-signed certificate.
ssl_cert_sni | **Optional.** Sets the TLS SNI (Server Name Indication) extension.
ssl_cert_timeout | **Optional.** Seconds before connection times out (default: 15)
ssl_cert_protocol | **Optional.** Use the specific protocol {http,smtp,pop3,imap,ftp,xmpp,irc,ldap} (default: http).
ssl_cert_http_url | **Optional.** HTTP Request URL (default: /)
ssl_cert_clientcert | **Optional.** Use client certificate to authenticate.
ssl_cert_clientpass | **Optional.** Set passphrase for client certificate.
ssl_cert_ssllabs | **Optional.** SSL Labs assessment
ssl_cert_ssllabs_nocache | **Optional.** Forces a new check by SSL Labs
ssl_cert_rootcert | **Optional.** Root certificate or directory to be used for certificate validation.
ssl_cert_ignore_signature | **Optional.** Do not check if the certificate was signed with SHA1 od MD5.
ssl_cert_ssl_version | **Optional.** Force specific SSL version out of {ssl2,ssl3,tls1,tls1_1,tls1_2}.
ssl_cert_disable_ssl_versions | **Optional.** Disable specific SSL versions out of {ssl2,ssl3,tls1,tls1_1,tls1_2}. Multiple versions can be given as array.
ssl_cert_cipher | **Optional.** Cipher selection: force {ecdsa,rsa} authentication.
ssl_cert_ignore_expiration | **Optional.** Ignore expiration date.
ssl_cert_ignore_host_cn | **Optional.** Do not complain if the CN does not match.
ssl_cert_ignore_ocsp | **Optional.** Do not check revocation with OCSP.
ssl_cert_ignore_ocsp_errors | **Optional.** Continue if the OCSP status cannot be checked.
ssl_cert_ignore_ocsp_timeout | **Optional.** Ignore OCSP result when timeout occurs while checking.
ssl_cert_ignore_sct | **Optional.** Do not check for signed certificate timestamps.
ssl_cert_ignore_tls_renegotiation | **Optional.** Do not check for renegotiation.
ssl_cert_dane | **Optional.** Verify that valid DANE records exist ({211,301,302,311,312} or empty string).
#### jmx4perl <a id="plugin-contrib-command-jmx4perl"></a>

View File

@ -22,7 +22,7 @@ Supported commands:
* api setup (setup for API)
* ca list (lists all certificate signing requests)
* ca restore (restores a removed certificate request)
* ca remove (removes an outstanding certificate request)
* ca remove (removes an outstanding certificate request)
* ca sign (signs an outstanding certificate request)
* console (Icinga debug console)
* daemon (starts Icinga 2)
@ -73,7 +73,7 @@ RPM and Debian packages install the bash completion files into
You need to install the `bash-completion` package if not already installed.
RHEL/CentOS/Fedora:
RHEL/Fedora:
```bash
yum install bash-completion

View File

@ -115,7 +115,7 @@ You can also use [jq](https://stedolan.github.io/jq/) or `python -m json.tool`
in combination with curl on the CLI.
```bash
curl ... | jq
curl ... | jq
curl ... | python -m json.tool
```
@ -288,6 +288,7 @@ Available permissions for specific URL endpoints:
config/query | /v1/config | No | 1
config/modify | /v1/config | No | 512
console | /v1/console | No | 1
debug | /v1/debug | No | 1
events/&lt;type&gt; | /v1/events | No | 1
objects/query/&lt;type&gt; | /v1/objects | Yes | 1
objects/create/&lt;type&gt; | /v1/objects | No | 1
@ -565,7 +566,7 @@ created by the API.
### Querying Objects <a id="icinga2-api-config-objects-query"></a>
You can request information about configuration objects by sending
a `GET` query to the `/v1/objects/<type>` URL endpoint. `<type` has
a `GET` query to the `/v1/objects/<type>` URL endpoint. `<type>` has
to be replaced with the plural name of the object type you are interested
in:
@ -813,7 +814,7 @@ parameters need to be passed inside the JSON body:
Parameters | Type | Description
------------------|--------------|--------------------------
templates | Array | **Optional.** Import existing configuration templates for this object type. Note: These templates must either be statically configured or provided in [config packages](12-icinga2-api.md#icinga2-api-config-management)-
templates | Array | **Optional.** Import existing configuration templates for this object type. Note: These templates must either be statically configured or provided in [config packages](12-icinga2-api.md#icinga2-api-config-management).
attrs | Dictionary | **Required.** Set specific object attributes for this [object type](09-object-types.md#object-types).
ignore\_on\_error | Boolean | **Optional.** Ignore object creation errors and return an HTTP 200 status instead.
@ -950,7 +951,7 @@ list the latter in the `restore_attrs` parameter. E.g.:
```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X POST 'https://localhost:5665/v1/objects/hosts/example.localdomain' \
-d '{ "restore_attrs": [ "address", "vars.os" ] }, "pretty": true }'
-d '{ "restore_attrs": [ "address", "vars.os" ], "pretty": true }'
```
```json
@ -1008,7 +1009,7 @@ curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
There are several actions available for Icinga 2 provided by the `/v1/actions`
URL endpoint. You can run actions by sending a `POST` request.
The following actions are also used by [Icinga Web 2](https://icinga.com/products/icinga-web-2/):
The following actions are also used by [Icinga Web 2](https://icinga.com/docs/icinga-web/latest/):
* sending check results to Icinga from scripts, remote agents, etc.
* scheduling downtimes from external scripts or cronjobs
@ -1657,14 +1658,14 @@ Send a `POST` request to the URL endpoint `/v1/actions/execute-command`.
--------------|------------|--------------
ttl | Number | **Required.** The time to live of the execution expressed in seconds.
command_type | String | **Optional.** The command type: `CheckCommand` or `EventCommand` or `NotificationCommand`. Default: `EventCommand`
command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it's either `$check_command$`, `$event_command$` or `$notification_command$`
command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it's either `$check_command$`, `$event_command$` or `$notification_command$`
endpoint | String | **Optional.** The endpoint to execute the command on. It can be a macro string. Default: `$command_endpoint$`.
macros | Dictionary | **Optional.** Macro overrides. Default: `{}`
user | String | **Optional.** The user used for the notification command.
user | String | **Optional.** The user used for the notification command.
notification | String | **Optional.** The notification used for the notification command.
Example:
```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X POST 'https://localhost:5665/v1/actions/execute-command' \
@ -1850,7 +1851,7 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeAdded`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.
#### <a id="icinga2-api-event-streams-type-downtimeremoved"></a> Event Stream Type: DowntimeRemoved
@ -1858,7 +1859,7 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeRemoved`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.
#### <a id="icinga2-api-event-streams-type-downtimestarted"></a> Event Stream Type: DowntimeStarted
@ -1867,7 +1868,7 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeStarted`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.
#### <a id="icinga2-api-event-streams-type-downtimetriggered"></a> Event Stream Type: DowntimeTriggered
@ -1876,8 +1877,34 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeTriggered`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.
#### <a id="icinga2-api-event-streams-type-objectcreated"></a> Event Stream Type: ObjectCreated
| Name | Type | Description |
|--------------|-----------|----------------------------------------------------------------|
| type | String | Event type `ObjectCreated`. |
| timestamp | Timestamp | Unix timestamp when the event happened. |
| object\_type | String | Type of the newly created object, such as `Host` or `Service`. |
| object\_name | String | The full name of the object. |
#### <a id="icinga2-api-event-streams-type-objectmodified"></a> Event Stream Type: ObjectModified
| Name | Type | Description |
|--------------|-----------|-----------------------------------------------------------|
| type | String | Event type `ObjectModified`. |
| timestamp | Timestamp | Unix timestamp when the event happened. |
| object\_type | String | Type of the modified object, such as `Host` or `Service`. |
| object\_name | String | The full name of the object. |
#### <a id="icinga2-api-event-streams-type-objectdeleted"></a> Event Stream Type: ObjectDeleted
| Name | Type | Description |
|--------------|-----------|----------------------------------------------------------|
| type | String | Event type `ObjectDeleted`. |
| timestamp | Timestamp | Unix timestamp when the event happened. |
| object\_type | String | Type of the deleted object, such as `Host` or `Service`. |
| object\_name | String | The full name of the object. |
### Event Stream Filter <a id="icinga2-api-event-streams-filter"></a>
@ -2347,7 +2374,7 @@ Creation, modification and deletion of templates at runtime is not supported.
### Querying Templates <a id="icinga2-api-config-templates-query"></a>
You can request information about configuration templates by sending
a `GET` query to the `/v1/templates/<type>` URL endpoint. `<type` has
a `GET` query to the `/v1/templates/<type>` URL endpoint. `<type>` has
to be replaced with the plural name of the object type you are interested
in:
@ -2502,6 +2529,72 @@ curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
}
```
## Memory Usage Analysis <a id="icinga2-api-memory"></a>
The GNU libc function `malloc_info(3)` provides memory allocation and usage
statistics of Icinga 2 itself. You can call it directly by sending a `GET`
request to the URL endpoint `/v1/debug/malloc_info`.
The [API permission](12-icinga2-api.md#icinga2-api-permissions) `debug` is required.
Example:
```bash
curl -k -s -S -i -u root:icinga https://localhost:5665/v1/debug/malloc_info
```
In contrast to other API endpoints, the response is not JSON,
but the raw XML output from `malloc_info(3)`. See also the
[glibc malloc(3) internals](https://sourceware.org/glibc/wiki/MallocInternals).
```xml
<malloc version="1">
<heap nr="0">
<sizes>
<size from="33" to="48" total="96" count="2"/>
<size from="49" to="64" total="192" count="3"/>
<size from="65" to="80" total="80" count="1"/>
<unsorted from="84817" to="84817" total="84817" count="1"/>
</sizes>
<total type="fast" count="6" size="368"/>
<total type="rest" count="2" size="859217"/>
<system type="current" size="7409664"/>
<system type="max" size="7409664"/>
<aspace type="total" size="7409664"/>
<aspace type="mprotect" size="7409664"/>
</heap>
<!-- ... -->
<heap nr="30">
<sizes>
<size from="17" to="32" total="96" count="3"/>
<size from="33" to="48" total="576" count="12"/>
<size from="49" to="64" total="64" count="1"/>
<size from="97" to="112" total="3584" count="32"/>
<size from="49" to="49" total="98" count="2"/>
<size from="81" to="81" total="810" count="10"/>
<size from="257" to="257" total="2827" count="11"/>
<size from="689" to="689" total="689" count="1"/>
<size from="705" to="705" total="705" count="1"/>
<unsorted from="81" to="81" total="81" count="1"/>
</sizes>
<total type="fast" count="48" size="4320"/>
<total type="rest" count="27" size="118618"/>
<system type="current" size="135168"/>
<system type="max" size="135168"/>
<aspace type="total" size="135168"/>
<aspace type="mprotect" size="135168"/>
<aspace type="subheaps" size="1"/>
</heap>
<total type="fast" count="938" size="79392"/>
<total type="rest" count="700" size="4409469"/>
<total type="mmap" count="0" size="0"/>
<system type="current" size="15114240"/>
<system type="max" size="15114240"/>
<aspace type="total" size="15114240"/>
<aspace type="mprotect" size="15114240"/>
</malloc>
```
## API Clients <a id="icinga2-api-clients"></a>
After its initial release in 2015, community members
@ -2545,7 +2638,7 @@ Name | Language | Description
[BitBar for OSX](https://getbitbar.com/plugins/Dev/Icinga2/icinga2.24m.py) | Python | macOS tray app for highlighting the host/service status
[Icinga 2 Multistatus](https://chrome.google.com/webstore/detail/icinga-multi-status/khabbhcojgkibdeipanmiphceeoiijal/related) | - | Chrome Extension
[Naglite4](https://github.com/wftech/icinga2-naglite4) | Python | Naglite3 rewrite using the Icinga 2 REST API.
[icinga-telegram-bot](https://github.com/joni1993/icinga-telegram-bot) | Python | Telegram Bot using the Icinga 2 REST API
[icinga-telegram-bot](https://github.com/joni1993/icinga-telegram-bot) | Python | Telegram Bot using the Icinga 2 REST API
### Manage Objects <a id="icinga2-api-clients-management"></a>
@ -2606,7 +2699,7 @@ The following languages are covered:
* [Golang](12-icinga2-api.md#icinga2-api-clients-programmatic-examples-golang)
* [Powershell](12-icinga2-api.md#icinga2-api-clients-programmatic-examples-powershell)
The [request method](icinga2-api-requests) is `POST` using [X-HTTP-Method-Override: GET](12-icinga2-api.md#icinga2-api-requests-method-override)
The [request method](#icinga2-api-requests) is `POST` using [X-HTTP-Method-Override: GET](12-icinga2-api.md#icinga2-api-requests-method-override)
which allows you to send a JSON request body. The examples request specific service
attributes joined with host attributes. `attrs` and `joins` are therefore specified
as array.

View File

@ -32,7 +32,7 @@ vim /etc/icinga2/conf.d/templates.conf
Install the package `nano-icinga2` with your distribution's package manager.
**Note:** On Debian, Ubuntu and Raspbian, the syntax files are installed with the `icinga2-common` package already.
**Note:** On Debian, Ubuntu and Raspberry Pi OS, the syntax files are installed with the `icinga2-common` package already.
Copy the `/etc/nanorc` sample file to your home directory.
@ -71,9 +71,6 @@ via email.
![Icinga Reporting](images/addons/icinga_reporting.png)
Follow along in this [hands-on blog post](https://icinga.com/2019/06/17/icinga-reporting-hands-on/).
## Graphs and Metrics <a id="addons-graphs-metrics"></a>
### Graphite <a id="addons-graphing-graphite"></a>
@ -185,7 +182,7 @@ in a tree or list overview and can be added to any dashboard.
![Icinga Web 2 Business Process](images/addons/icingaweb2_businessprocess.png)
Read more [here](https://icinga.com/products/icinga-business-process-modelling/).
Read more [here](https://icinga.com/docs/icinga-business-process-modeling/latest/).
### Certificate Monitoring <a id="addons-visualization-certificate-monitoring"></a>
@ -194,8 +191,7 @@ actions and view all details at a glance.
![Icinga Certificate Monitoring](images/addons/icinga_certificate_monitoring.png)
Read more [here](https://icinga.com/products/icinga-certificate-monitoring/)
and [here](https://icinga.com/2019/06/03/monitoring-automation-with-icinga-certificate-monitoring/).
Read more [here](https://icinga.com/products/icinga-certificate-monitoring/).
### Dashing Dashboard <a id="addons-visualization-dashing-dashboard"></a>
@ -204,7 +200,7 @@ on top of Dashing and uses the [REST API](12-icinga2-api.md#icinga2-api) to visu
on with your monitoring. It combines several popular widgets and provides development
instructions for your own implementation.
The dashboard also allows to embed the [Icinga Web 2](https://icinga.com/products/icinga-web-2/)
The dashboard also allows to embed the [Icinga Web 2](https://icinga.com/docs/icinga-web/latest/)
host and service problem lists as Iframe.
![Dashing dashboard](images/addons/dashing_icinga2.png)
@ -234,10 +230,6 @@ There's a variety of resources available, for example different notification scr
* Ticket systems
* etc.
Blog posts and howtos:
* [Environmental Monitoring and Alerting](https://icinga.com/2019/09/02/environmental-monitoring-and-alerting-via-text-message/)
Additionally external services can be [integrated with Icinga 2](https://icinga.com/products/integrations/):
* [Pagerduty](https://icinga.com/products/integrations/pagerduty/)

View File

@ -52,7 +52,7 @@ Icinga DB is a set of components for publishing, synchronizing and
visualizing monitoring data in the Icinga ecosystem, consisting of:
* Icinga 2 with its `icingadb` feature enabled,
responsible for publishing monitoring data to a Redis server, i.e. configuration and its runtime updates,
responsible for publishing monitoring data to a Redis server, i.e. configuration and its runtime updates,
check results, state changes, downtimes, acknowledgements, notifications, and other events such as flapping
* The [Icinga DB daemon](https://icinga.com/docs/icinga-db),
which synchronizes the data between the Redis server and a database
@ -106,7 +106,7 @@ The current naming schema is defined as follows. The [Icinga Web 2 Graphite modu
depends on this schema.
The default prefix for hosts and services is configured using
[runtime macros](03-monitoring-basics.md#runtime-macros)like this:
[runtime macros](03-monitoring-basics.md#runtime-macros) like this:
```
icinga2.$host.name$.host.$host.check_command$
@ -815,16 +815,6 @@ apt-get install icinga2-ido-mysql
default. You can skip the automated setup and install/upgrade the
database manually if you prefer.
###### CentOS 7
!!! info
Note that installing `icinga2-ido-mysql` is only supported on CentOS 7 as CentOS 8 is EOL.
```bash
yum install icinga2-ido-mysql
```
###### RHEL 8
```bash
@ -843,7 +833,7 @@ yum install icinga2-ido-mysql
zypper install icinga2-ido-mysql
```
###### Amazon Linux 2
###### Amazon Linux
```bash
yum install icinga2-ido-mysql
@ -914,16 +904,6 @@ apt-get install icinga2-ido-pgsql
You can skip the automated setup and install/upgrade the database manually
if you prefer that.
###### CentOS 7
!!! info
Note that installing `icinga2-ido-pgsql` is only supported on CentOS 7 as CentOS 8 is EOL.
```bash
yum install icinga2-ido-pgsql
```
###### RHEL 8
```bash
@ -942,7 +922,7 @@ yum install icinga2-ido-pgsql
zypper install icinga2-ido-pgsql
```
###### Amazon Linux 2
###### Amazon Linux
```bash
yum install icinga2-ido-pgsql

View File

@ -19,8 +19,8 @@ findings and details please.
* `icinga2 --version`
* `icinga2 feature list`
* `icinga2 daemon -C`
* [Icinga Web 2](https://icinga.com/products/icinga-web-2/) version (screenshot from System - About)
* [Icinga Web 2 modules](https://icinga.com/products/icinga-web-2-modules/) e.g. the Icinga Director (optional)
* [Icinga Web 2](https://icinga.com/docs/icinga-web/latest/) version (screenshot from System - About)
* Icinga Web 2 modules e.g. the Icinga Director (optional)
* Configuration insights:
* Provide complete configuration snippets explaining your problem in detail
* Your [icinga2.conf](04-configuration.md#icinga2-conf) file
@ -176,6 +176,64 @@ C:\> cd C:\ProgramData\icinga2\var\log\icinga2
C:\ProgramData\icinga2\var\log\icinga2> Get-Content .\debug.log -tail 10 -wait
```
### Enable/Disable Debug Output on the fly <a id="troubleshooting-enable-disable-debug-output-api"></a>
The `debuglog` feature can also be created and deleted at runtime without having to restart Icinga 2.
Technically, this is possible because this feature is a [FileLogger](09-object-types.md#objecttype-filelogger)
that can be managed through the [API](12-icinga2-api.md#icinga2-api-config-objects).
This is a good alternative to `icinga2 feature enable debuglog` as object
creation/deletion via API happens immediately and requires no restart.
The above matters in setups large enough for the reload to take a while.
Especially these produce a lot of debug log output until disabled again.
!!! info
In case of [an HA zone](06-distributed-monitoring.md#distributed-monitoring-scenarios-ha-master-agents),
the following API examples toggle the feature on both nodes.
#### Enable Debug Output on the fly <a id="troubleshooting-enable-debug-output-api"></a>
```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X PUT 'https://localhost:5665/v1/objects/fileloggers/on-the-fly-debug-file' \
-d '{ "attrs": { "severity": "debug", "path": "/var/log/icinga2/on-the-fly-debug.log" }, "pretty": true }'
```
```json
{
"results": [
{
"code": 200.0,
"status": "Object was created."
}
]
}
```
#### Disable Debug Output on the fly <a id="troubleshooting-disable-debug-output-api"></a>
This works only for debug loggers enabled on the fly as above!
```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X DELETE 'https://localhost:5665/v1/objects/fileloggers/on-the-fly-debug-file?pretty=1'
```
```json
{
"results": [
{
"code": 200.0,
"name": "on-the-fly-debug-file",
"status": "Object was deleted.",
"type": "FileLogger"
}
]
}
```
## Icinga starts/restarts/reloads very slowly
### Try swapping out the allocator
@ -814,7 +872,7 @@ trying because you probably have a problem that requires manual intervention.
### Late Check Results <a id="late-check-results"></a>
[Icinga Web 2](https://icinga.com/products/icinga-web-2/) provides
[Icinga Web 2](https://icinga.com/docs/icinga-web/latest/) provides
a dashboard overview for `overdue checks`.
The REST API provides the [status](12-icinga2-api.md#icinga2-api-status) URL endpoint with some generic metrics
@ -829,8 +887,7 @@ You can also calculate late check results via the REST API:
* Fetch the `last_check` timestamp from each object
* Compare the timestamp with the current time and add `check_interval` multiple times (change it to see which results are really late, like five times check_interval)
You can use the [icinga2 console](11-cli-commands.md#cli-command-console) to connect to the instance, fetch all data
and calculate the differences. More infos can be found in [this blogpost](https://icinga.com/2016/08/11/analyse-icinga-2-problems-using-the-console-api/).
You can use the [icinga2 console](11-cli-commands.md#cli-command-console) to connect to the instance, fetch all data and calculate the differences.
```
# ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://localhost:5665/'
@ -878,7 +935,7 @@ actively attempts to schedule and execute checks. Otherwise the node does not fe
}
```
You may ask why this analysis is important? Fair enough - if the numbers are not inverted in a HA zone
You may ask why this analysis is important? Fair enough - if the numbers are not inverted in an HA zone
with two members, this may give a hint that the cluster nodes are in a split-brain scenario, or you've
found a bug in the cluster.
@ -950,95 +1007,6 @@ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localho
```
### Analyze Notification Result <a id="troubleshooting-notifications-result"></a>
> **Note**
>
> This feature is available since v2.11 and requires all endpoints
> being updated.
Notifications inside a HA enabled zone are balanced between the endpoints,
just like checks.
Sometimes notifications may fail, and with looking into the (debug) logs
for both masters, you cannot correlate this correctly.
The `last_notification_result` runtime attribute is stored and synced for Notification
objects and can be queried via REST API.
Example for retrieving the notification object and result from all `disk` services using a
[regex match](18-library-reference.md#global-functions-regex) on the name:
```
$ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/notifications' \
-d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_notification_result" ], "pretty": true }'
{
"results": [
{
"attrs": {
"last_notification_result": {
"active": true,
"command": [
"/etc/icinga2/scripts/mail-service-notification.sh",
"-4",
"",
"-6",
"",
"-b",
"",
"-c",
"",
"-d",
"2019-08-02 10:54:16 +0200",
"-e",
"disk",
"-l",
"icinga2-agent1.localdomain",
"-n",
"icinga2-agent1.localdomain",
"-o",
"DISK OK - free space: / 38108 MB (90.84% inode=100%);",
"-r",
"user@localdomain",
"-s",
"OK",
"-t",
"RECOVERY",
"-u",
"disk"
],
"execution_end": 1564736056.186217,
"execution_endpoint": "icinga2-master1.localdomain",
"execution_start": 1564736056.132323,
"exit_status": 0.0,
"output": "",
"type": "NotificationResult"
}
},
"joins": {},
"meta": {},
"name": "icinga2-agent1.localdomain!disk!mail-service-notification",
"type": "Notification"
}
...
]
}
```
Example with the debug console:
```
$ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_object(Notification, "icinga2-agent1.localdomain!disk!mail-service-notification").last_notification_result.execution_endpoint' | jq
"icinga2-agent1.localdomain"
```
Whenever a notification command failed to execute, you can fetch the output as well.
## Feature Troubleshooting <a id="troubleshooting-features"></a>
### Feature is not working <a id="feature-not-working"></a>
@ -1729,6 +1697,9 @@ Typical errors are:
* The api feature doesn't [accept config](06-distributed-monitoring.md#distributed-monitoring-top-down-config-sync). This is logged into `/var/lib/icinga2/icinga2.log`.
* The received configuration zone is not configured in [zones.conf](04-configuration.md#zones-conf) and Icinga denies it. This is logged into `/var/lib/icinga2/icinga2.log`.
* The satellite/agent has local configuration in `/etc/icinga2/zones.d` and thinks it is authoritive for this zone. It then denies the received update. Purge the content from `/etc/icinga2/zones.d`, `/var/lib/icinga2/api/zones/*` and restart Icinga to fix this.
* Configuration parts stored outside of `/etc/icinga2/zones.d` on the master, for example a constant in `/etc/icinga2/constants.conf`, are then missing on the satellite/agent.
Note that if set up, the [built-in icinga CheckCommand](10-icinga-template-library.md#icinga) will notify you in case the config sync wasn't successful.
#### New configuration does not trigger a reload <a id="troubleshooting-cluster-config-sync-no-reload"></a>

View File

@ -97,6 +97,7 @@ Character | Escape sequence
--------------------------|------------------------------------
" | \\"
\\ | \\\\
$ | $$
&lt;TAB&gt; | \\t
&lt;CARRIAGE-RETURN&gt; | \\r
&lt;LINE-FEED&gt; | \\n
@ -107,6 +108,10 @@ In addition to these pre-defined escape sequences you can specify
arbitrary ASCII characters using the backslash character (\\) followed
by an ASCII character in octal encoding.
In Icinga 2, the `$` character is reserved for resolving [runtime macros](03-monitoring-basics.md#runtime-macros).
However, in situations where a string that isn't intended to be used as a runtime macro contains the `$` character,
it is necessary to escape it with another `$` character.
### Multi-line String Literals <a id="multiline-string-literals"></a>
Strings spanning multiple lines can be specified by enclosing them in

View File

@ -1648,9 +1648,9 @@ Example:
function set_x(val) {
this.x = val
}
dict = {}
set_x.call(dict, 7) /* Invokes set_x using `dict` as `this` */
```
@ -1671,7 +1671,7 @@ Example:
function set_x(val) {
this.x = val
}
var dict = {}
var args = [ 7 ]

View File

@ -651,7 +651,7 @@ authority = endpoints[Utility::SDBM(object->GetName()) % endpoints.size()] == my
that by querying the `paused` attribute for all objects via REST API
or debug console on both endpoints.
Endpoints inside a HA zone calculate the object authority independent from each other.
Endpoints inside an HA zone calculate the object authority independent from each other.
This object authority is important for selected features explained below.
Since features are configuration objects too, you must ensure that all nodes
@ -1514,6 +1514,76 @@ Message updates will be dropped when:
* Notification does not exist.
* Origin endpoint's zone is not allowed to access this checkable.
#### event::UpdateLastNotifiedStatePerUser <a id="technical-concepts-json-rpc-messages-event-updatelastnotifiedstateperuser"></a>
> Location: `clusterevents.cpp`
##### Message Body
Key | Value
----------|---------
jsonrpc | 2.0
method | event::UpdateLastNotifiedStatePerUser
params | Dictionary
##### Params
Key | Type | Description
-------------|--------|------------------
notification | String | Notification name
user | String | User name
state | Number | Checkable state the user just got a problem notification for
Used to sync the state of a notification object within the same HA zone.
##### Functions
Event Sender: `Notification::OnLastNotifiedStatePerUserUpdated`
Event Receiver: `LastNotifiedStatePerUserUpdatedAPIHandler`
##### Permissions
The receiver will not process messages from not configured endpoints.
Message updates will be dropped when:
* Notification does not exist.
* Origin endpoint is not within the local zone.
#### event::ClearLastNotifiedStatePerUser <a id="technical-concepts-json-rpc-messages-event-clearlastnotifiedstateperuser"></a>
> Location: `clusterevents.cpp`
##### Message Body
Key | Value
----------|---------
jsonrpc | 2.0
method | event::ClearLastNotifiedStatePerUser
params | Dictionary
##### Params
Key | Type | Description
-------------|--------|------------------
notification | String | Notification name
Used to sync the state of a notification object within the same HA zone.
##### Functions
Event Sender: `Notification::OnLastNotifiedStatePerUserCleared`
Event Receiver: `LastNotifiedStatePerUserClearedAPIHandler`
##### Permissions
The receiver will not process messages from not configured endpoints.
Message updates will be dropped when:
* Notification does not exist.
* Origin endpoint is not within the local zone.
#### event::SetForceNextCheck <a id="technical-concepts-json-rpc-messages-event-setforcenextcheck"></a>
> Location: `clusterevents.cpp`
@ -1817,7 +1887,7 @@ source | String | The execution UUID
Special handling, calls `ClusterEvents::EnqueueCheck()` for command endpoint checks.
This function enqueues check tasks into a queue which is controlled in `RemoteCheckThreadProc()`.
If the `endpoint` parameter is specified and is not equal to the local endpoint then the message is forwarded to the correct endpoint zone.
If the `endpoint` parameter is specified and is not equal to the local endpoint then the message is forwarded to the correct endpoint zone.
##### Permissions
@ -1862,7 +1932,7 @@ executions | Dictionary | Executions to be updated
##### Functions
**Event Sender:** `ClusterEvents::ExecutedCommandAPIHandler`, `ClusterEvents::UpdateExecutionsAPIHandler`, `ApiActions::ExecuteCommand`
**Event Receiver:** `ClusterEvents::UpdateExecutionsAPIHandler`
**Event Receiver:** `ClusterEvents::UpdateExecutionsAPIHandler`
##### Permissions
@ -1892,7 +1962,7 @@ Key | Type | Description
host | String | Host name.
service | String | Service name.
execution | String | The execution ID executed.
exitStatus | Number | The command exit status.
exitStatus | Number | The command exit status.
output | String | The command output.
start | Number | The unix timestamp at the start of the command execution
end | Number | The unix timestamp at the end of the command execution
@ -1900,7 +1970,7 @@ end | Number | The unix timestamp at the end of the command ex
##### Functions
**Event Sender:** `ClusterEvents::ExecuteCheckFromQueue`, `ClusterEvents::ExecuteCommandAPIHandler`
**Event Receiver:** `ClusterEvents::ExecutedCommandAPIHandler`
**Event Receiver:** `ClusterEvents::ExecutedCommandAPIHandler`
##### Permissions

View File

@ -48,7 +48,7 @@ or `icinga2-ido-mysql`.
Distribution | Command
-------------------|------------------------------------------
Debian/Ubuntu | `apt-get install icinga2-dbg`
RHEL/CentOS | `yum install icinga2-debuginfo`
RHEL | `yum install icinga2-debuginfo`
Fedora | `dnf install icinga2-debuginfo icinga2-bin-debuginfo icinga2-ido-mysql-debuginfo`
SLES/openSUSE | `zypper install icinga2-bin-debuginfo icinga2-ido-mysql-debuginfo`
@ -65,7 +65,7 @@ Install GDB in your development environment.
Distribution | Command
-------------------|------------------------------------------
Debian/Ubuntu | `apt-get install gdb`
RHEL/CentOS | `yum install gdb`
RHEL | `yum install gdb`
Fedora | `dnf install gdb`
SLES/openSUSE | `zypper install gdb`
@ -477,18 +477,18 @@ File Type: EXECUTABLE IMAGE
Image has the following dependencies:
boost_coroutine-vc142-mt-gd-x64-1_82.dll
boost_date_time-vc142-mt-gd-x64-1_82.dll
boost_filesystem-vc142-mt-gd-x64-1_82.dll
boost_thread-vc142-mt-gd-x64-1_82.dll
boost_regex-vc142-mt-gd-x64-1_82.dll
boost_coroutine-vc142-mt-gd-x64-1_85.dll
boost_date_time-vc142-mt-gd-x64-1_85.dll
boost_filesystem-vc142-mt-gd-x64-1_85.dll
boost_thread-vc142-mt-gd-x64-1_85.dll
boost_regex-vc142-mt-gd-x64-1_85.dll
libssl-3_0-x64.dll
libcrypto-3_0-x64.dll
WS2_32.dll
dbghelp.dll
SHLWAPI.dll
msi.dll
boost_unit_test_framework-vc142-mt-gd-x64-1_82.dll
boost_unit_test_framework-vc142-mt-gd-x64-1_85.dll
KERNEL32.dll
SHELL32.dll
ADVAPI32.dll
@ -537,7 +537,7 @@ packages.
If you encounter a problem, please [open a new issue](https://github.com/Icinga/icinga2/issues/new/choose)
on GitHub and mention that you're testing the snapshot packages.
#### RHEL/CentOS <a id="development-tests-snapshot-packages-rhel"></a>
#### RHEL <a id="development-tests-snapshot-packages-rhel"></a>
2.11+ requires the EPEL repository for Boost 1.66+.
@ -1332,9 +1332,6 @@ autocmd BufWinLeave * call clearmatches()
### Linux Dev Environment <a id="development-linux-dev-env"></a>
Based on CentOS 7, we have an early draft available inside the Icinga Vagrant boxes:
[centos7-dev](https://github.com/Icinga/icinga-vagrant/tree/master/centos7-dev).
If you're compiling Icinga 2 natively without any virtualization layer in between,
this usually is faster. This is also the reason why developers on macOS prefer native builds
over Linux or Windows VMs. Don't forget to test the actual code on Linux later! Socket specific
@ -1357,21 +1354,20 @@ mkdir -p release debug
Proceed with the specific distribution examples below. Keep in mind that these instructions
are best effort and sometimes out-of-date. Git Master may contain updates.
* [CentOS 7](21-development.md#development-linux-dev-env-centos)
* [Fedora 40](21-development.md#development-linux-dev-env-fedora)
* [Debian 10 Buster](21-development.md#development-linux-dev-env-debian)
* [Ubuntu 18 Bionic](21-development.md#development-linux-dev-env-ubuntu)
#### CentOS 7 <a id="development-linux-dev-env-centos"></a>
#### Fedora 40 <a id="development-linux-dev-env-fedora"></a>
```bash
yum -y install gdb vim git bash-completion htop centos-release-scl
yum -y install gdb vim git bash-completion htop
yum -y install rpmdevtools ccache \
cmake make devtoolset-11-gcc-c++ flex bison \
openssl-devel boost169-devel systemd-devel \
cmake make gcc-c++ flex bison \
openssl-devel boost-devel systemd-devel \
mysql-devel postgresql-devel libedit-devel \
devtoolset-11-libstdc++-devel
libstdc++-devel
groupadd icinga
groupadd icingacmd
@ -1389,47 +1385,42 @@ slower but allows for better debugging insights.
For benchmarks, change `CMAKE_BUILD_TYPE` to `RelWithDebInfo` and
build inside the `release` directory.
First, off export some generics for Boost.
First, override the default prefix path.
```bash
export I2_BOOST="-DBoost_NO_BOOST_CMAKE=TRUE -DBoost_NO_SYSTEM_PATHS=TRUE -DBOOST_LIBRARYDIR=/usr/lib64/boost169 -DBOOST_INCLUDEDIR=/usr/include/boost169 -DBoost_ADDITIONAL_VERSIONS='1.69;1.69.0'"
export I2_GENERIC="-DCMAKE_INSTALL_PREFIX=/usr/local/icinga2"
```
Second, add the prefix path to it.
```bash
export I2_GENERIC="$I2_BOOST -DCMAKE_INSTALL_PREFIX=/usr/local/icinga2"
```
Third, define the two build types with their specific CMake variables.
Second, define the two build types with their specific CMake variables.
```bash
export I2_DEBUG="-DCMAKE_BUILD_TYPE=Debug -DICINGA2_UNITY_BUILD=OFF $I2_GENERIC"
export I2_RELEASE="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DICINGA2_WITH_TESTS=ON -DICINGA2_UNITY_BUILD=ON $I2_GENERIC"
```
Fourth, depending on your likings, you may add a bash alias for building,
Third, depending on your likings, you may use a bash alias for building,
or invoke the commands inside:
```bash
alias i2_debug="cd /root/icinga2; mkdir -p debug; cd debug; scl enable devtoolset-11 -- cmake $I2_DEBUG ..; make -j2; sudo make -j2 install; cd .."
alias i2_release="cd /root/icinga2; mkdir -p release; cd release; scl enable devtoolset-11 -- cmake $I2_RELEASE ..; make -j2; sudo make -j2 install; cd .."
alias i2_debug="cd /root/icinga2; mkdir -p debug; cd debug; cmake $I2_DEBUG ..; make -j2; sudo make -j2 install; cd .."
alias i2_release="cd /root/icinga2; mkdir -p release; cd release; cmake $I2_RELEASE ..; make -j2; sudo make -j2 install; cd .."
```
This is taken from the [centos7-dev](https://github.com/Icinga/icinga-vagrant/tree/master/centos7-dev) Vagrant box.
```bash
i2_debug
```
The source installation doesn't set proper permissions, this is
handled in the package builds which are officially supported.
```bash
chown -R icinga:icinga /usr/local/icinga2/var/
chown -R icinga:icinga /usr/local/icinga2/{etc,var}/
/usr/local/icinga2/lib/icinga2/prepare-dirs /usr/local/icinga2/etc/sysconfig/icinga2
/usr/local/icinga2/sbin/icinga2 api setup
vim /usr/local/icinga2/etc/icinga2/conf.d/api-users.conf
/usr/local/icinga2/lib/icinga2/sbin/icinga2 daemon
/usr/local/icinga2/lib64/icinga2/sbin/icinga2 daemon
```
#### Debian 10 <a id="development-linux-dev-env-debian"></a>
@ -1476,7 +1467,7 @@ The source installation doesn't set proper permissions, this is
handled in the package builds which are officially supported.
```bash
chown -R icinga:icinga /usr/local/icinga2/var/
chown -R icinga:icinga /usr/local/icinga2/{etc,var}/
/usr/local/icinga2/lib/icinga2/prepare-dirs /usr/local/icinga2/etc/sysconfig/icinga2
/usr/local/icinga2/sbin/icinga2 api setup
@ -1540,7 +1531,7 @@ The source installation doesn't set proper permissions, this is
handled in the package builds which are officially supported.
```bash
chown -R icinga:icinga /usr/local/icinga2/var/
chown -R icinga:icinga /usr/local/icinga2/{etc,var}/
/usr/local/icinga2/lib/icinga2/prepare-dirs /usr/local/icinga2/etc/sysconfig/icinga2
/usr/local/icinga2/sbin/icinga2 api setup
@ -1745,10 +1736,12 @@ and don't care for the details,
1. ensure there are 35 GB free space on C:
2. run the following in an administrative Powershell:
1. `Enable-WindowsOptionalFeature -FeatureName "NetFx3" -Online`
(reboot when asked!)
2. `powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-Expression (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Icinga/icinga2/master/doc/win-dev.ps1')"`
(will take some time)
1. Windows Server only:
`Enable-WindowsOptionalFeature -FeatureName NetFx3ServerFeatures -Online`
2. `Enable-WindowsOptionalFeature -FeatureName NetFx3 -Online`
(reboot when asked!)
3. `powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-Expression (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Icinga/icinga2/master/doc/win-dev.ps1')"`
(will take some time)
This installs everything needed for cloning and building Icinga 2
on the command line (Powershell) as follows:
@ -1763,7 +1756,7 @@ mkdir build
cd .\build\
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" `
-DICINGA2_UNITY_BUILD=OFF -DBoost_INCLUDE_DIR=C:\local\boost_1_82_0-Win64 `
-DICINGA2_UNITY_BUILD=OFF -DBoost_INCLUDE_DIR=C:\local\boost_1_85_0-Win64 `
-DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe `
-DFLEX_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe ..
@ -1935,16 +1928,16 @@ Download the [boost-binaries](https://sourceforge.net/projects/boost/files/boost
- 64 for 64 bit builds
```
https://sourceforge.net/projects/boost/files/boost-binaries/1.82.0/boost_1_82_0-msvc-14.2-64.exe/download
https://sourceforge.net/projects/boost/files/boost-binaries/1.85.0/boost_1_85_0-msvc-14.2-64.exe/download
```
Run the installer and leave the default installation path in `C:\local\boost_1_82_0`.
Run the installer and leave the default installation path in `C:\local\boost_1_85_0`.
##### Source & Compile
In order to use the boost development header and library files you need to [download](https://www.boost.org/users/download/)
Boost and then extract it to e.g. `C:\local\boost_1_82_0`.
Boost and then extract it to e.g. `C:\local\boost_1_85_0`.
> **Note**
>
@ -1952,12 +1945,12 @@ Boost and then extract it to e.g. `C:\local\boost_1_82_0`.
> the archive contains more than 70k files.
In order to integrate Boost into Visual Studio, open the `Developer Command Prompt` from the start menu,
and navigate to `C:\local\boost_1_82_0`.
and navigate to `C:\local\boost_1_85_0`.
Execute `bootstrap.bat` first.
```
cd C:\local\boost_1_82_0
cd C:\local\boost_1_85_0
bootstrap.bat
```
@ -2040,8 +2033,8 @@ You need to specify the previously installed component paths.
Variable | Value | Description
----------------------|----------------------------------------------------------------------|-------------------------------------------------------
`BOOST_ROOT` | `C:\local\boost_1_82_0` | Root path where you've extracted and compiled Boost.
`BOOST_LIBRARYDIR` | Binary: `C:\local\boost_1_82_0\lib64-msvc-14.2`, Source: `C:\local\boost_1_82_0\stage` | Path to the static compiled Boost libraries, directory must contain `lib`.
`BOOST_ROOT` | `C:\local\boost_1_85_0` | Root path where you've extracted and compiled Boost.
`BOOST_LIBRARYDIR` | Binary: `C:\local\boost_1_85_0\lib64-msvc-14.2`, Source: `C:\local\boost_1_85_0\stage` | Path to the static compiled Boost libraries, directory must contain `lib`.
`BISON_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe` | Path to the Bison executable.
`FLEX_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_flex.exe` | Path to the Flex executable.
`ICINGA2_UNITY_BUILD` | OFF | Disable unity builds for development environments.
@ -2076,8 +2069,8 @@ $env:ICINGA2_INSTALLPATH = 'C:\Program Files\Icinga2-debug'
$env:ICINGA2_BUILDPATH='debug'
$env:CMAKE_BUILD_TYPE='Debug'
$env:OPENSSL_ROOT_DIR='C:\OpenSSL-Win64'
$env:BOOST_ROOT='C:\local\boost_1_82_0'
$env:BOOST_LIBRARYDIR='C:\local\boost_1_82_0\lib64-msvc-14.2'
$env:BOOST_ROOT='C:\local\boost_1_85_0'
$env:BOOST_LIBRARYDIR='C:\local\boost_1_85_0\lib64-msvc-14.2'
```
#### Icinga 2 in Visual Studio
@ -2203,7 +2196,7 @@ Icinga application using a dist tarball (including notes for distributions):
* Debian/Ubuntu: libpq-dev
* postgresql-dev on Alpine
* libedit (CLI console)
* RHEL/Fedora: libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms)
* RHEL/Fedora: libedit-devel (RHEL requires rhel-7-server-optional-rpms)
* Debian/Ubuntu/Alpine: libedit-dev
* Termcap (only required if libedit doesn't already link against termcap/ncurses)
* RHEL/Fedora: libtermcap-devel
@ -2343,7 +2336,7 @@ for implementation details.
CMake determines the Icinga 2 version number using `git describe` if the
source directory is contained in a Git repository. Otherwise the version number
is extracted from the [ICINGA2_VERSION](ICINGA2_VERSION) file. This behavior can be
is extracted from the `ICINGA2_VERSION` file. This behavior can be
overridden by creating a file called `icinga-version.h.force` in the source
directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake
can be used to disable the usage of `git describe`.
@ -2351,7 +2344,7 @@ can be used to disable the usage of `git describe`.
### Building RPMs <a id="development-package-builds-rpms"></a>
#### Build Environment on RHEL, CentOS, Fedora, Amazon Linux
#### Build Environment on RHEL, Fedora, Amazon Linux
Setup your build environment:
@ -2407,7 +2400,7 @@ spectool -g ../SPECS/icinga2.spec
cd $HOME/rpmbuild
```
Install the build dependencies. Example for CentOS 7:
Install the build dependencies:
```bash
yum -y install libedit-devel ncurses-devel gcc-c++ libstdc++-devel openssl-devel \
@ -2436,21 +2429,9 @@ rpmbuild -ba SPECS/icinga2.spec
The following packages are required to build the SELinux policy module:
* checkpolicy
* selinux-policy (selinux-policy on CentOS 6, selinux-policy-devel on CentOS 7)
* selinux-policy-devel
* selinux-policy-doc
##### RHEL/CentOS 7
The RedHat Developer Toolset is required for building Icinga 2 beforehand.
This contains a C++ compiler which supports C++17 features.
```bash
yum install centos-release-scl
```
Dependencies to devtools-11 are used in the RPM SPEC, so the correct tools
should be used for building.
##### Amazon Linux
If you prefer to build packages offline, a suitable Vagrant box is located
@ -2541,7 +2522,7 @@ chmod +x /etc/init.d/icinga2
Icinga 2 reads a single configuration file which is used to specify all
configuration settings (global settings, hosts, services, etc.). The
configuration format is explained in detail in the [doc/](doc/) directory.
configuration format is explained in detail in the `doc/` directory.
By default `make install` installs example configuration files in
`/usr/local/etc/icinga2` unless you have specified a different prefix or

View File

@ -116,19 +116,19 @@ The policy provides a role `icinga2adm_r` for confining an user which enables an
SELinux is based on the least level of access required for a service to run. Using booleans you can grant more access in a defined way. The Icinga 2 policy package provides the following booleans.
**icinga2_can_connect_all**
**icinga2_can_connect_all**
Having this boolean enabled allows icinga2 to connect to all ports. This can be necessary if you use features which connect to unconfined services, for example the [influxdb writer](14-features.md#influxdb-writer).
**icinga2_run_sudo**
**icinga2_run_sudo**
To allow Icinga 2 executing plugins via sudo you can toogle this boolean. It is disabled by default, resulting in error messages like `execvpe(sudo) failed: Permission denied`.
**httpd_can_write_icinga2_command**
**httpd_can_write_icinga2_command**
To allow httpd to write to the command pipe of icinga2 this boolean has to be enabled. This is enabled by default, if not needed you can disable it for more security.
**httpd_can_connect_icinga2_api**
**httpd_can_connect_icinga2_api**
Enabling this boolean allows httpd to connect to the API of icinga2 (Ports labeled `icinga2_port_t`). This is enabled by default, if not needed you can disable it for more security.

View File

@ -1,4 +1,8 @@
# Migration from Icinga 1.x <a id="migration"></a>
# Migration from Icinga 1.x or Nagios <a id="migration"></a>
!!! note
Icinga 1.x was originally a fork of Nagios. The information provided here also applies to Nagios.
## Configuration Migration <a id="configuration-migration"></a>
@ -804,7 +808,7 @@ define service {
}
```
Icinga 2 supports objects and (global) variables, but does not make a difference
Icinga 2 supports objects and (global) variables, but does not make a difference
between the main configuration file or any other included file.
icinga2.conf:

View File

@ -692,4 +692,3 @@ the [servicegroups](24-appendix.md#schema-livestatus-servicegroups-table-attribu
All [services](24-appendix.md#schema-livestatus-services-table-attributes) table attributes grouped with
the [hostgroups](24-appendix.md#schema-livestatus-hostgroups-table-attributes) table prefixed with `hostgroup_`.

View File

@ -13,8 +13,8 @@ function ThrowOnNativeFailure {
$VsVersion = 2019
$MsvcVersion = '14.2'
$BoostVersion = @(1, 82, 0)
$OpensslVersion = '3_0_9'
$BoostVersion = @(1, 86, 0)
$OpensslVersion = '3_0_15'
switch ($Env:BITS) {
32 { }
@ -91,6 +91,8 @@ if (-not $Env:GITHUB_ACTIONS) {
ThrowOnNativeFailure
}
# Disable the progress bar for downloads from the Web, which will speed up the entire download process
$Global:ProgressPreference = 'SilentlyContinue';
Install-Exe -Url "https://packages.icinga.com/windows/dependencies/boost_$($BoostVersion -join '_')-msvc-${MsvcVersion}-${Env:BITS}.exe" -Dir "C:\local\boost_$($BoostVersion -join '_')-Win${Env:BITS}"

View File

@ -165,13 +165,15 @@ if [ -n "$MAILFROM" ] ; then
## Debian/Ubuntu use mailutils which requires `-a` to append the header
if [ -f /etc/debian_version ]; then
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r`
else
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
fi
else
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -s "$SUBJECT" $USEREMAIL
fi

View File

@ -178,13 +178,15 @@ if [ -n "$MAILFROM" ] ; then
## Debian/Ubuntu use mailutils which requires `-a` to append the header
if [ -f /etc/debian_version ]; then
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r`
else
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
fi
else
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \
/usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
| $MAILBIN -s "$SUBJECT" $USEREMAIL
fi

View File

@ -19,7 +19,7 @@ set_target_properties (
FOLDER Lib
)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(ICINGA2_WITH_CHECKER)
list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:checker>)
@ -95,6 +95,8 @@ install(
RUNTIME DESTINATION ${InstallPath}
)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_INITRUNDIR}\")")
if(NOT WIN32)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_INITRUNDIR}\")")
endif()

View File

@ -24,6 +24,10 @@ template CheckCommand "ping-common" {
value = "$ping_address$"
description = "host to ping"
}
"--extra-opts" = {
value = "$ping_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$ping_wrta$,$ping_wpl$%"
description = "warning threshold pair"
@ -101,6 +105,10 @@ template CheckCommand "fping-common" {
]
arguments = {
"--extra-opts" = {
value = "$fping_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$fping_wrta$,$fping_wpl$%"
description = "warning threshold pair"
@ -169,6 +177,10 @@ object CheckCommand "tcp" {
value = "$tcp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)."
}
"--extra-opts" = {
value = "$tcp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$tcp_port$"
description = "The TCP port number."
@ -276,6 +288,10 @@ object CheckCommand "ssl" {
value = "$ssl_address$"
description = "Host address"
}
"--extra-opts" = {
value = "$ssl_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ssl_port$"
description ="TCP port (default: 443)"
@ -321,6 +337,10 @@ object CheckCommand "udp" {
]
arguments = {
"--extra-opts" = {
value = "$udp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-s" = {
value = "$udp_send$"
required = true
@ -360,6 +380,11 @@ object CheckCommand "http" {
value = "$http_vhost$"
description = "Host name argument for servers using host headers (virtual host)"
}
"--extra-opts" = {
set_if = {{ string(macro("$http_extra_opts$")) != "" }}
value = "$http_extra_opts$"
description = "Read extra plugin options from an ini file"
}
"-I" = {
set_if = {{ string(macro("$http_address$")) != "" }}
value = "$http_address$"
@ -419,12 +444,16 @@ object CheckCommand "http" {
}
"--sni" = {
set_if = "$http_sni$"
description = "Enable SSL/TLS hostname extension support (SNI)"
description = "Enable SSL/TLS hostname extension support (SNI). This is (normally) the default in modern setups"
}
"-C" = {
value = "$http_certificate$"
description = "Minimum number of days a certificate has to be valid. This parameter explicitely sets the port to 443 and ignores the URL if passed."
}
"--continue-after-certificate" = {
set_if = "$http_certificate_continue$"
description = "Allows the HTTP check to continue after performing the certificate check. Does nothing unless -C is used"
}
"-J" = {
value = "$http_clientcert$"
description = "Name of file contains the client certificate (PEM format)"
@ -557,6 +586,212 @@ object CheckCommand "http" {
vars.http_verbose = false
}
object CheckCommand "curl" {
import "ipv4-or-ipv6"
command = [ PluginDir + "/check_curl" ]
arguments += {
"--extra-opts" = {
value = "$curl_extra_opts$"
description = "Read options from an ini file"
}
"-H" = {
value = "$curl_vhost$"
description = "Host name argument for servers using host headers (virtual host). Append a port to include it in the header (eg: example.com:5000)"
}
"-I" = {
value = "$curl_ip$"
set_if = {{ string(macro("$curl_ip$")) != "" }}
description = "IP address or name (use numeric address if possible to bypass DNS lookup)."
}
"-p" = {
value = "$curl_port$"
description = "Port number (default: 80)"
}
"-4" = {
set_if = "$curl_ipv4$"
description = "Force `check_curl` to use IPv4 instead of choosing automatically"
}
"-6" = {
set_if = "$curl_ipv6$"
description = "Force `check_curl` to use IPv6 instead of choosing automatically"
}
"(-S w/ value)" = {
set_if = {{ macro("$curl_tls$") && string(macro("$curl_tls_version$")) != "" }}
key = "-S"
value = "$curl_tls_version$"
description = "Connect via SSL. Port defaults to 443. VERSION is optional, and prevents auto-negotiation"
}
"(-S w/o value)" = {
set_if = {{ macro("$curl_tls$") && string(macro("$curl_tls_version$")) == "" }}
key = "-S"
description = "Connect via SSL. Port defaults to 443. VERSION is optional, and prevents auto-negotiation"
}
"--sni" = {
set_if = "$curl_sni$"
description = "Enable SSL/TLS hostname extension support (SNI). Default if TLS version > 1.0"
}
"-C" = {
value = "$curl_certificate_valid_days_min_warning$,$curl_certificate_valid_days_min_critical$"
description = "Minimum number of days a certificate has to be valid."
}
"--continue-after-certificate" = {
value = "$curl_continue_after_certificate$"
description = "Allows the HTTP check to continue after performing the certificate check. Does nothing unless -C is used."
}
"-J" = {
value = "$curl_client_certificate_file$"
description = "Name of file that contains the client certificate (PEM format) to be used in establishing the SSL session"
}
"-K" = {
value = "$curl_client_certificate_key_file$"
description = "Name of file containing the private key (PEM format) matching the client certificate"
}
"--ca-cert" = {
value = "$curl_ca_cert_file$"
description = "CA certificate file to verify peer against"
}
"-D" = {
set_if = "$curl_verify_peer_cert$"
description = "Verify the peer's SSL certificate and hostname"
}
"-e" = {
value = "$curl_expect_string$"
description = "Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response (default: HTTP/), If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
}
"-d" = {
value = "$curl_expect_header_string$"
description = "String to expect in the response headers"
}
"-s" = {
value = "$curl_expect_content_string$"
description = "String to expect in the content"
}
"-u" = {
value = "$curl_url$"
description = "URL to GET or POST (default: /)"
}
"-P" = {
value = "$curl_post_data$"
description = "URL encoded http POST data"
}
"-j" = {
value = "$curl_http_method$"
description = "Set HTTP method (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT)"
}
"-N" = {
value = "$curl_no_body$"
description = "Don't wait for document body: stop reading after headers. (Note that this still does an HTTP GET or POST, not a HEAD.)"
}
"-M" = {
value = "$curl_max_age$"
description = "Warn if document is more than SECONDS old. the number can also be of the form '10m' for minutes, '10h' for hours, or '10d' for days."
}
"-T" = {
value = "$curl_content_type$"
description = "specify Content-Type header media type when POSTing"
}
"-l" = {
value = "$curl_linespan$"
description = "Allow regex to span newlines (must precede -r or -R)"
}
"-r" = {
value = "$curl_ereg$"
description = "Search page for regex STRING"
}
"-R" = {
value = "$curl_eregi$"
description = "Search page for case-insensitive regex STRING"
}
"--invert-regex" = {
set_if = "$curl_invert_regex$"
description = "When using regex, return CRITICAL if found, OK if not"
}
"--state-regex" = {
value = "$curl_state_regex$"
description = "Return STATE if regex is found, OK if not"
}
"-a" = {
value = "$curl_authorization$"
description = "Username:password on sites with basic authentication"
}
"-b" = {
value = "$curl_proxy_authorization$"
description = "Username:password on proxy-servers with basic authentication"
}
"-A" = {
value = "$curl_user_agent$"
description = "String to be sent in http header as 'User Agent'"
}
"-k" = {
value = "$curl_header$"
repeat_key = true
description = "Any other tags to be sent in http header. Use multiple times for additional headers"
}
"-E" = {
set_if = "$curl_extended_perfdata$"
description = "Print additional performance data"
}
"-B" = {
set_if = "$curl_show_body$"
description = "Print body content below status line"
}
"-L" = {
set_if = "$curl_link$"
description = "Wrap output in HTML link (obsoleted by urlize)"
}
"-f" = {
value = "$curl_onredirect$"
description = "Options: <ok|warning|critical|follow|sticky|stickyport|curl> How to handle redirected pages."
}
"--max-redirs" = {
value = "$curl_max_redirs$"
description = "Maximal number of redirects (default: 15)"
}
"-m" = {
value = "$curl_pagesize$"
description = "Minimum page size required (bytes) : Maximum page size required (bytes)"
}
"--http-version" = {
value = "$curl_http_version$"
description = "Connect via specific HTTP protocol. 1.0 = HTTP/1.0, 1.1 = HTTP/1.1, 2.0 = HTTP/2 (HTTP/2 will fail without -S)"
}
"--enable-automatic-decompression" = {
set_if = "$curl_enable_automatic_decompression$"
description = "Enable automatic decompression of body (CURLOPT_ACCEPT_ENCODING)."
}
"--haproxy-protocol" = {
set_if = "$curl_haproxy_protocol$"
description = "Send HAProxy proxy protocol v1 header (CURLOPT_HAPROXYPROTOCOL)"
}
"--cookie-jar" = {
value = "$curl_cookie_jar_file$"
description = "Store cookies in the cookie jar file and send them out when requested."
}
"-w" = {
value = "$curl_warning$"
description = "Response time to result in warning status (seconds)"
}
"-c" = {
value = "$curl_critical$"
description = "Response time to result in critical status (seconds)"
}
"-t" = {
value = "$curl_timeout$"
description = "Seconds before connection times out (default: 10)"
}
}
vars.curl_ip = "$check_address$"
vars.curl_link = false
vars.curl_invert_regex = false
vars.curl_show_body = false
vars.curl_extended_perfdata = false
vars.check_ipv4 = "$curl_ipv4$"
vars.check_ipv6 = "$curl_ipv6$"
}
object CheckCommand "ftp" {
import "ipv4-or-ipv6"
@ -567,6 +802,10 @@ object CheckCommand "ftp" {
value = "$ftp_address$"
description = "The host's address. Defaults to $address$ or $address6$ if the address attribute is not set."
}
"--extra-opts" = {
value = "$ftp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ftp_port$"
description = "The FTP port number. Defaults to none"
@ -670,6 +909,10 @@ object CheckCommand "smtp" {
value = "$smtp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$smtp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$smtp_port$"
description = "Port number (default: 25)"
@ -755,6 +998,10 @@ object CheckCommand "ssmtp" {
value = "$ssmtp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$ssmtp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ssmtp_port$"
description = "Port number (default: none)"
@ -844,6 +1091,10 @@ object CheckCommand "imap" {
value = "$imap_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$imap_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$imap_port$"
description = "Port number (default: none)"
@ -933,6 +1184,10 @@ object CheckCommand "simap" {
value = "$simap_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$simap_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$simap_port$"
description = "Port number (default: none)"
@ -1022,6 +1277,10 @@ object CheckCommand "pop" {
value = "$pop_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$pop_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$pop_port$"
description = "Port number (default: none)"
@ -1111,6 +1370,10 @@ object CheckCommand "spop" {
value = "$spop_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$spop_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$spop_port$"
description = "Port number (default: none)"
@ -1200,6 +1463,10 @@ object CheckCommand "ntp_time" {
value = "$ntp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$ntp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ntp_port$"
description = "Port number (default: 123)"
@ -1249,6 +1516,10 @@ object CheckCommand "ntp_peer" {
value = "$ntp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$ntp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ntp_port$"
description = "Port number (default: 123)"
@ -1314,6 +1585,10 @@ object CheckCommand "ssh" {
command = [ PluginDir + "/check_ssh" ]
arguments = {
"--extra-opts" = {
value = "$ssh_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ssh_port$"
description = "Port number (default: 22)"
@ -1335,6 +1610,14 @@ object CheckCommand "ssh" {
set_if = "$ssh_ipv6$"
description = "Use IPv6 connection"
}
"-r" = {
value = "$ssh_remote_version$"
description = "Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
}
"-P" = {
value = "$ssh_remote_protocol$"
description = "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
}
}
vars.ssh_address = "$check_address$"
@ -1346,6 +1629,10 @@ object CheckCommand "disk" {
command = [ PluginDir + "/check_disk" ]
arguments = {
"--extra-opts" = {
value = "$disk_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$disk_wfree$"
description = "Exit with WARNING status if less than INTEGER units of disk are free or Exit with WARNING status if less than PERCENT of disk space is free"
@ -1372,6 +1659,10 @@ object CheckCommand "disk" {
description = "Display inode usage in perfdata"
set_if = "$disk_inode_perfdata$"
}
"--inode-perfdata" = {
description = "Enable performance data for inode-based statistics (nagios-plugins)"
set_if = "$disk_np_inode_perfdata$"
}
"-p" = {
value = "$disk_partitions$"
description = "Path or partition (may be repeated)"
@ -1491,9 +1782,11 @@ object CheckCommand "disk" {
"mtmfs",
"tracefs",
"cgroup",
"fuse.*", // only Monitoring Plugins support this so far
"fuse.gvfsd-fuse",
"fuse.gvfs-fuse-daemon",
"fuse.portal",
"fuse.sshfs",
"fdescfs",
"overlay",
"nsfs",
@ -1551,6 +1844,10 @@ object CheckCommand "users" {
command = [ PluginDir + "/check_users" ]
arguments = {
"--extra-opts" = {
value = "$users_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$users_wgreater$"
description = "Set WARNING status if more than INTEGER users are logged in"
@ -1569,6 +1866,10 @@ object CheckCommand "procs" {
command = [ PluginDir + "/check_procs" ]
arguments = {
"--extra-opts" = {
value = "$procs_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$procs_warning$"
description = "Generate warning state if metric is outside this range"
@ -1625,6 +1926,10 @@ object CheckCommand "procs" {
value = "$procs_command$"
description = "Only scan for exact matches of COMMAND (without path)"
}
"-X" = {
value = "$procs_exclude_process$"
description = "Exclude processes which match this comma separated list"
}
"-k" = {
set_if = "$procs_nokthreads$"
description = "Only scan for non kernel threads"
@ -1641,6 +1946,10 @@ object CheckCommand "swap" {
command = [ PluginDir + "/check_swap" ]
arguments = {
"--extra-opts" = {
value = "$swap_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {{
if (macro("$swap_integer$")) {
return macro("$swap_wfree$")
@ -1675,6 +1984,10 @@ object CheckCommand "load" {
command = [ PluginDir + "/check_load" ]
arguments = {
"--extra-opts" = {
value = "$load_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$load_wload1$,$load_wload5$,$load_wload15$"
description = "Exit with WARNING status if load average exceeds WLOADn"
@ -1708,6 +2021,10 @@ object CheckCommand "snmp" {
value = "$snmp_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$snmp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-o" = {
value = "$snmp_oid$"
description = "Object identifier(s) or SNMP variables whose value you wish to query"
@ -1768,6 +2085,10 @@ object CheckCommand "snmp" {
value = "$snmp_miblist$"
description = "List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL' for symbolic OIDs.)"
}
"-M" = {
value = "$snmp_multiplier$"
description = "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
}
"--rate-multiplier" = {
value = "$snmp_rate_multiplier$"
description = "Converts rate per second. For example, set to 60 to convert to per minute"
@ -1820,6 +2141,10 @@ object CheckCommand "snmpv3" {
value = "$snmpv3_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$snmpv3_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$snmpv3_port$"
description = "Port number"
@ -1896,6 +2221,10 @@ object CheckCommand "snmpv3" {
value = "$snmpv3_miblist$"
description = "List of SNMP MIBs for translating OIDs between numeric and textual representation"
}
"-M" = {
value = "$snmpv3_multiplier$"
description = "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
}
"-u" = {
value = "$snmpv3_units$"
description = "Units label(s) for output data (e.g., 'sec.')"
@ -2001,6 +2330,10 @@ object CheckCommand "dhcp" {
command = [ PluginDir + "/check_dhcp" ]
arguments = {
"--extra-opts" = {
value = "$dhcp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-s" = {
value = "$dhcp_serverip$"
description = "IP address of DHCP server that we must hear from"
@ -2040,6 +2373,10 @@ object CheckCommand "dns" {
value = "$dns_lookup$"
description = "The name or address you want to query."
}
"--extra-opts" = {
value = "$dns_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-s" = {
value = "$dns_server$"
description = "Optional DNS server you want to use for the lookup."
@ -2092,6 +2429,10 @@ object CheckCommand "dig" {
value = "$dig_server$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$dig_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$dig_port$"
description = "Port number (default: 53)"
@ -2150,6 +2491,10 @@ object CheckCommand "nscp" {
value = "$nscp_address$"
description = "Name of the host to check"
}
"--extra-opts" = {
value = "$nscp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$nscp_port$"
description = "Optional port number (default: 1248)"
@ -2201,6 +2546,10 @@ object CheckCommand "by_ssh" {
value = "$by_ssh_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$by_ssh_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$by_ssh_port$"
description = "Port number (default: none)"
@ -2278,6 +2627,10 @@ object CheckCommand "ups" {
description = "Address of the upsd server"
required = true
}
"--extra-opts" = {
value = "$ups_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-u" = {
value = "$ups_name$"
description = "Name of the UPS to monitor"
@ -2415,6 +2768,10 @@ object CheckCommand "hpjd" {
value = "$hpjd_address$"
description = "Host address"
}
"--extra-opts" = {
value = "$hpjd_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-C" = {
value = "$hpjd_community$"
description = "The SNMP community name (default=public)"
@ -2438,6 +2795,10 @@ object CheckCommand "icmp" {
order = 1
description = "Host address"
}
"--extra-opts" = {
value = "$icmp_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-w" = {
value = "$icmp_wrta$,$icmp_wpl$%"
description = "warning threshold (currently 200.000ms,10%)"
@ -2497,6 +2858,10 @@ object CheckCommand "ldap" {
value = "$ldap_address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$ldap_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$ldap_port$"
description = "Port number (default: 389)"
@ -2576,6 +2941,10 @@ object CheckCommand "clamd" {
description = "The host's address or unix socket (must be an absolute path)."
required = true
}
"--extra-opts" = {
value = "$clamd_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-p" = {
value = "$clamd_port$"
description = "Port number (default: none)."
@ -2720,6 +3089,10 @@ object CheckCommand "pgsql" {
value = "$pgsql_hostname$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$pgsql_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-P" = {
value = "$pgsql_port$"
description = "Port number (default: 5432)"
@ -2784,6 +3157,10 @@ object CheckCommand "mysql" {
value = "$mysql_hostname$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$mysql_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-P" = {
value = "$mysql_port$"
description = "Port number (default: 3306)"
@ -2945,6 +3322,10 @@ object CheckCommand "smart" {
command = [ PluginDir + "/check_ide_smart" ]
arguments = {
"--extra-opts" = {
value = "$smart_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-d" = {
value = "$smart_device$"
description = "Name of a local hard drive to monitor"
@ -3007,6 +3388,10 @@ object CheckCommand "game" {
command = [ PluginDir + "/check_game" ]
arguments = {
"--extra-opts" = {
value = "$game_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-P" = {
value = "$game_port$"
description = "Port to connect to"
@ -3060,6 +3445,10 @@ object CheckCommand "mysql_query" {
value = "$mysql_query_hostname$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$mysql_query_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-P" = {
value = "$mysql_query_port$"
description = "Port number (default: 3306)"
@ -3113,6 +3502,10 @@ object CheckCommand "radius" {
value = "$radius_address$",
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"--extra-opts" = {
value = "$radius_extra_opts$"
description = "Read extra plugin options from an ini file."
}
"-F" = {
value = "$radius_config_file$",
description = "Configuration file"

View File

@ -1,42 +1,10 @@
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
object CheckCommand "systemd" {
command = [ PluginContribDir + "/check_systemd.py" ]
command = [ PluginContribDir + "/check_systemd" ]
arguments = {
"--unit" = {
value = "$systemd_unit$"
description = "Name of the systemd unit that is being tested."
}
"--exclude" = {
value = "$systemd_exclude_unit$"
description = "Exclude a systemd unit from the checks. This option can be applied multiple times. Also supports regular expressions."
repeat_key = true
}
"--no-startup-time" = {
set_if = "$systemd_no_startup_time$"
description = "Dont check the startup time. Using this option the options `systemd_warning` and `systemd_critical` have no effect. (Default: `false`)"
}
"--warning" = {
value = "$systemd_warning$"
description = "Startup time in seconds to result in a warning status. (Default: `60s`)"
}
"--critical" = {
value = "$systemd_critical$"
description = "Startup time in seconds to result in a critical status. (Default: `120s`)"
}
"--dead-timers" = {
set_if = "$systemd_dead_timers$"
description = "Detect dead / inactive timers. (Default: `false`)"
}
"--dead-timers-warning" = {
value = "$systemd_dead_timers_warning$"
description = "Time ago in seconds for dead / inactive timers to trigger a warning state (by default 6 days)."
}
"--dead-timers-critical" = {
value = "$systemd_dead_timers_critical$"
description = "Time ago in seconds for dead / inactive timers to trigger a critical state (by default 7 days)."
}
/* General options */
"-v" = {
set_if = {{ macro("$systemd_verbose_level$") == 1 }}
description = "Increase verbosity level (Accepted values: `1`, `2` or `3`). Defaults to none."
@ -47,5 +15,85 @@ object CheckCommand "systemd" {
"-vvv" = {
set_if = {{ macro("$systemd_verbose_level$") == 3 }}
}
/* Options related to unit selection */
"--ignore-inactive-state" = {
set_if = "$systemd_ignore_inactive_state$"
description = "Ignore an inactive state on a specific unit. Only affective if used with `systemd_unit`."
}
"--include" = {
value = "$systemd_include$"
description = "Include systemd units to the checks, regular expressions are supported. This option can be applied multiple times."
repeat_key = true
}
"--unit" = {
value = "$systemd_unit$"
description = "Name of the systemd unit that is being tested."
}
"--include-type" = {
value = "$systemd_include_type$"
description = "Unit types to be tested (for example: `service`, `timer`). This option can be applied multiple times."
repeat_key = true
}
"--exclude" = {
value = "$systemd_exclude_unit$"
description = "Exclude a systemd unit from the checks, regular expressions are supported. This option can be applied multiple times."
repeat_key = true
}
"--exclude-unit" = {
value = "$systemd_exclude_unit_name$"
description = "Exclude a systemd unit from the checks. This option can be applied multiple times."
repeat_key = true
}
"--exclude-type" = {
value = "$systemd_exclude_type$"
description = "Exclude a systemd unit type (for example: `service`, `timer`)"
}
"--state" = {
value = "$systemd_state$"
description = "Specify the active state that the systemd unit must have (for example: `active`, `inactive`)"
}
/* Timers related options */
"--dead-timers" = {
set_if = "$systemd_dead_timers$"
description = "Detect dead / inactive timers, see `systemd_dead_timers_{warning,critical}`. (Default `false`)"
}
"--dead-timers-warning" = {
value = "$systemd_dead_timers_warning$"
description = "Time ago in seconds for dead / inactive timers to trigger a warning state. (Default 6 days)"
}
"--dead-timers-critical" = {
value = "$systemd_dead_timers_critical$"
description = "Time ago in seconds for dead / inactive timers to trigger a critical state. (Default 7 days)"
}
/* Startup time related options */
"--no-startup-time" = {
set_if = "$systemd_no_startup_time$"
description = "Don't check the startup time. Using this option, the options `systemd_{warning,critical}` have no effect. (Default `false`)"
}
"--warning" = {
value = "$systemd_warning$"
description = "Startup time in seconds to result in a warning status. (Default 60 seconds)"
}
"--critical" = {
value = "$systemd_critical$"
description = "Startup time in seconds to result in a critical status. (Default 120 seconds)"
}
/* Monitoring data acquisition */
"--dbus" = {
set_if = "$systemd_dbus$"
description = "Use systemd's D-Bus API instead of parsing command output. Only partially implemented!"
}
"--cli" = {
set_if = "$systemd_cli$"
description = "Use text output from parsing command output. (Default)"
}
"--user" = {
set_if = "$systemd_user$"
description = "Also show user (systemctl --user) units."
}
}
}

View File

@ -421,6 +421,10 @@ object CheckCommand "vmware-esx-soap-host-net" {
"--isregexp" = {
set_if = "$vmware_isregexp$"
}
"--unplugged_nics_state" = {
value = "$vmware_unplugged_nics_state$"
description = "Sets status for unplugged nics (Possible values are: [OK | ok] or [CRITICAL | critical | CRIT | crit] or [WARNING | warning | WARN | warn]. Default is WARNING. Values are case insensitive.)"
}
}
}
@ -467,6 +471,10 @@ object CheckCommand "vmware-esx-soap-host-net-nic" {
"--isregexp" = {
set_if = "$vmware_isregexp$"
}
"--unplugged_nics_state" = {
value = "$vmware_unplugged_nics_state$"
description = "Sets status for unplugged nics (Possible values are: [OK | ok] or [CRITICAL | critical | CRIT | crit] or [WARNING | warning | WARN | warn]. Default is WARNING. Values are case insensitive.)"
}
}
}

View File

@ -396,13 +396,9 @@ object CheckCommand "ssl_cert" {
value = "$ssl_cert_critical$"
description = "Minimum number of days a certificate has to be valid to issue a critical status"
}
"-n" = {
"--match" = {
value = "$ssl_cert_cn$"
description = "Pattern to match the CN of the certificate"
}
"--altnames" = {
set_if = "$ssl_cert_altnames$"
description = "Matches the pattern specified in -n with alternate"
description = "Pattern to match the CN or AltNames of the certificate"
}
"-i" = {
value = "$ssl_cert_issuer$"
@ -444,6 +440,10 @@ object CheckCommand "ssl_cert" {
value = "$ssl_cert_protocol$"
description = "Use the specific protocol {http|smtp|pop3|imap|ftp|xmpp|irc|ldap} (default: http)"
}
"--url" = {
value = "$ssl_cert_http_url$"
description = "HTTP request URL (default: /)"
}
"-C" = {
value = "$ssl_cert_clientssl_cert$"
description = "Use client certificate to authenticate"
@ -578,11 +578,25 @@ object CheckCommand "ssl_cert" {
set_if = "$ssl_cert_ignore_tls_renegotiation$"
description = "Do not check for renegotiation"
}
"--maximum-validity" = {
value = "$ssl_cert_maximum_validity$"
description = "The maximum validity of the certificate in days (default: 397)"
}
"--dane" = {
value = "$ssl_cert_dane$"
description = "verify that valid DANE records exist (since OpenSSL 1.1.0)"
repeat_key = false
}
"--ignore-maximum-validity" = {
description = "Ignore the certificate maximum validity"
set_if = "$ssl_cert_ignore_maximum_validity$"
}
}
vars.ssl_cert_address = "$check_address$"
vars.ssl_cert_port = 443
vars.ssl_cert_cn = "$ssl_cert_altnames$"
}
object CheckCommand "varnish" {

View File

@ -38,6 +38,7 @@ set(base_SOURCES
filelogger.cpp filelogger.hpp filelogger-ti.hpp
function.cpp function.hpp function-ti.hpp function-script.cpp functionwrapper.hpp
initialize.cpp initialize.hpp
intrusive-ptr.hpp
io-engine.cpp io-engine.hpp
journaldlogger.cpp journaldlogger.hpp journaldlogger-ti.hpp
json.cpp json.hpp json-script.cpp
@ -130,7 +131,7 @@ if(HAVE_SYSTEMD)
find_path(SYSTEMD_INCLUDE_DIR
NAMES systemd/sd-daemon.h
HINTS ${SYSTEMD_ROOT_DIR})
include_directories(${SYSTEMD_INCLUDE_DIR})
include_directories(SYSTEM ${SYSTEMD_INCLUDE_DIR})
set_property(
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/journaldlogger.cpp
APPEND PROPERTY COMPILE_DEFINITIONS
@ -140,13 +141,13 @@ endif()
add_library(base OBJECT ${base_SOURCES})
include_directories(${icinga2_SOURCE_DIR}/third-party/execvpe)
include_directories(SYSTEM ${icinga2_SOURCE_DIR}/third-party/execvpe)
link_directories(${icinga2_BINARY_DIR}/third-party/execvpe)
include_directories(${icinga2_SOURCE_DIR}/third-party/mmatch)
include_directories(SYSTEM ${icinga2_SOURCE_DIR}/third-party/mmatch)
link_directories(${icinga2_BINARY_DIR}/third-party/mmatch)
include_directories(${icinga2_SOURCE_DIR}/third-party/socketpair)
include_directories(SYSTEM ${icinga2_SOURCE_DIR}/third-party/socketpair)
link_directories(${icinga2_BINARY_DIR}/third-party/socketpair)
set_target_properties (
@ -154,7 +155,9 @@ set_target_properties (
FOLDER Lib
)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_CACHEDIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}/crash\")")
if(NOT WIN32)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_CACHEDIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}/crash\")")
endif()
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)

View File

@ -12,7 +12,12 @@ namespace icinga
{
/**
* Extends std::atomic with an atomic constructor.
* Like std::atomic, but enforces usage of its only safe constructor.
*
* "The default-initialized std::atomic<T> does not contain a T object,
* and its only valid uses are destruction and
* initialization by std::atomic_init, see LWG issue 2334."
* -- https://en.cppreference.com/w/cpp/atomic/atomic/atomic
*
* @ingroup base
*/
@ -20,24 +25,12 @@ template<class T>
class Atomic : public std::atomic<T> {
public:
/**
* Like std::atomic#atomic, but operates atomically
* The only safe constructor of std::atomic#atomic
*
* @param desired Initial value
*/
inline Atomic(T desired)
inline Atomic(T desired) : std::atomic<T>(desired)
{
this->store(desired);
}
/**
* Like std::atomic#atomic, but operates atomically
*
* @param desired Initial value
* @param order Initial store operation's memory order
*/
inline Atomic(T desired, std::memory_order order)
{
this->store(desired, order);
}
};

View File

@ -23,4 +23,3 @@ Object::Ptr Boolean::GetPrototype()
return prototype;
}

View File

@ -6,4 +6,3 @@
using namespace icinga;
REGISTER_BUILTIN_TYPE(Boolean, Boolean::GetPrototype());

View File

@ -33,4 +33,3 @@ Object::Ptr ConfigObject::GetPrototype()
return prototype;
}

View File

@ -9,11 +9,13 @@
#include "base/dictionary.hpp"
#include <shared_mutex>
#include <unordered_map>
#include <boost/signals2.hpp>
namespace icinga
{
class ConfigObject;
class ConfigItems;
class ConfigType
{
@ -48,6 +50,13 @@ for (const auto& object : objects) {
int GetObjectCount() const;
/**
* Signal that allows hooking into the config loading process just before ConfigObject::OnAllConfigLoaded() is
* called for a bunch of objects. A vector of pointers to these objects is passed as an argument. All elements
* are of the object type the signal is called on.
*/
boost::signals2::signal<void (const ConfigItems&)> BeforeOnAllConfigLoaded;
private:
typedef std::unordered_map<String, intrusive_ptr<ConfigObject> > ObjectMap;
typedef std::vector<intrusive_ptr<ConfigObject> > ObjectVector;

View File

@ -25,4 +25,3 @@ Object::Ptr DateTime::GetPrototype()
return prototype;
}

View File

@ -95,4 +95,3 @@ void icinga::ShowCodeLocation(std::ostream& out, const DebugInfo& di, bool verbo
}
}
}

View File

@ -22,6 +22,8 @@ public:
{
}
Defer() = default;
Defer(const Defer&) = delete;
Defer(Defer&&) = delete;
Defer& operator=(const Defer&) = delete;
@ -39,6 +41,11 @@ public:
}
}
inline void SetFunc(std::function<void()> func)
{
m_Func = std::move(func);
}
inline
void Cancel()
{

View File

@ -5,46 +5,68 @@
using namespace icinga;
std::mutex DependencyGraph::m_Mutex;
std::map<Object *, std::map<Object *, int> > DependencyGraph::m_Dependencies;
DependencyGraph::DependencyMap DependencyGraph::m_Dependencies;
void DependencyGraph::AddDependency(Object *parent, Object *child)
void DependencyGraph::AddDependency(ConfigObject* child, ConfigObject* parent)
{
std::unique_lock<std::mutex> lock(m_Mutex);
m_Dependencies[child][parent]++;
if (auto [it, inserted] = m_Dependencies.insert(Edge(parent, child)); !inserted) {
m_Dependencies.modify(it, [](Edge& e) { e.count++; });
}
}
void DependencyGraph::RemoveDependency(Object *parent, Object *child)
void DependencyGraph::RemoveDependency(ConfigObject* child, ConfigObject* parent)
{
std::unique_lock<std::mutex> lock(m_Mutex);
auto& refs = m_Dependencies[child];
auto it = refs.find(parent);
if (it == refs.end())
return;
it->second--;
if (it->second == 0)
refs.erase(it);
if (refs.empty())
m_Dependencies.erase(child);
}
std::vector<Object::Ptr> DependencyGraph::GetParents(const Object::Ptr& child)
{
std::vector<Object::Ptr> objects;
std::unique_lock<std::mutex> lock(m_Mutex);
auto it = m_Dependencies.find(child.get());
if (it != m_Dependencies.end()) {
typedef std::pair<Object *, int> kv_pair;
for (const kv_pair& kv : it->second) {
objects.emplace_back(kv.first);
if (auto it(m_Dependencies.find(Edge(parent, child))); it != m_Dependencies.end()) {
if (it->count > 1) {
// Remove a duplicate edge from child to node, i.e. decrement the corresponding counter.
m_Dependencies.modify(it, [](Edge& e) { e.count--; });
} else {
// Remove the last edge from child to node (decrementing the counter would set it to 0),
// thus remove that connection from the data structure completely.
m_Dependencies.erase(it);
}
}
}
/**
* Returns all the parent objects of the given child object.
*
* @param child The child object.
*
* @returns A list of the parent objects.
*/
std::vector<ConfigObject::Ptr> DependencyGraph::GetParents(const ConfigObject::Ptr& child)
{
std::vector<ConfigObject::Ptr> objects;
std::unique_lock lock(m_Mutex);
auto [begin, end] = m_Dependencies.get<2>().equal_range(child.get());
std::transform(begin, end, std::back_inserter(objects), [](const Edge& edge) {
return edge.parent;
});
return objects;
}
/**
* Returns all the dependent objects of the given parent object.
*
* @param parent The parent object.
*
* @returns A list of the dependent objects.
*/
std::vector<ConfigObject::Ptr> DependencyGraph::GetChildren(const ConfigObject::Ptr& parent)
{
std::vector<ConfigObject::Ptr> objects;
std::unique_lock lock(m_Mutex);
auto [begin, end] = m_Dependencies.get<1>().equal_range(parent.get());
std::transform(begin, end, std::back_inserter(objects), [](const Edge& edge) {
return edge.child;
});
return objects;
}

View File

@ -4,8 +4,10 @@
#define DEPENDENCYGRAPH_H
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <map>
#include "base/configobject.hpp"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <mutex>
namespace icinga {
@ -18,15 +20,84 @@ namespace icinga {
class DependencyGraph
{
public:
static void AddDependency(Object *parent, Object *child);
static void RemoveDependency(Object *parent, Object *child);
static std::vector<Object::Ptr> GetParents(const Object::Ptr& child);
static void AddDependency(ConfigObject* child, ConfigObject* parent);
static void RemoveDependency(ConfigObject* child, ConfigObject* parent);
static std::vector<ConfigObject::Ptr> GetParents(const ConfigObject::Ptr& child);
static std::vector<ConfigObject::Ptr> GetChildren(const ConfigObject::Ptr& parent);
private:
DependencyGraph();
/**
* Represents an undirected dependency edge between two objects.
*
* It allows to traverse the graph in both directions, i.e. from parent to child and vice versa.
*/
struct Edge
{
ConfigObject* parent; // The parent object of the child one.
ConfigObject* child; // The dependent object of the parent.
// Counter for the number of parent <-> child edges to allow duplicates.
int count;
Edge(ConfigObject* parent, ConfigObject* child, int count = 1): parent(parent), child(child), count(count)
{
}
struct Hash
{
/**
* Generates a unique hash of the given Edge object.
*
* Note, the hash value is generated only by combining the hash values of the parent and child pointers.
*
* @param edge The Edge object to be hashed.
*
* @return size_t The resulting hash value of the given object.
*/
size_t operator()(const Edge& edge) const
{
size_t seed = 0;
boost::hash_combine(seed, edge.parent);
boost::hash_combine(seed, edge.child);
return seed;
}
};
struct Equal
{
/**
* Compares whether the two Edge objects contain the same parent and child pointers.
*
* Note, the member property count is not taken into account for equality checks.
*
* @param a The first Edge object to compare.
* @param b The second Edge object to compare.
*
* @return bool Returns true if the two objects are equal, false otherwise.
*/
bool operator()(const Edge& a, const Edge& b) const
{
return a.parent == b.parent && a.child == b.child;
}
};
};
using DependencyMap = boost::multi_index_container<
Edge, // The value type we want to sore in the container.
boost::multi_index::indexed_by<
// The first indexer is used for lookups by the Edge from child to parent, thus it
// needs its own hash function and comparison predicate.
boost::multi_index::hashed_unique<boost::multi_index::identity<Edge>, Edge::Hash, Edge::Equal>,
// These two indexers are used for lookups by the parent and child pointers.
boost::multi_index::hashed_non_unique<boost::multi_index::member<Edge, ConfigObject*, &Edge::parent>>,
boost::multi_index::hashed_non_unique<boost::multi_index::member<Edge, ConfigObject*, &Edge::child>>
>
>;
static std::mutex m_Mutex;
static std::map<Object *, std::map<Object *, int> > m_Dependencies;
static DependencyMap m_Dependencies;
};
}

View File

@ -116,4 +116,3 @@ Object::Ptr Dictionary::GetPrototype()
return prototype;
}

View File

@ -67,6 +67,20 @@ bool Dictionary::Get(const String& key, Value *result) const
return true;
}
/**
* Retrieves a value's address from a dictionary.
*
* @param key The key whose value's address should be retrieved.
* @returns nullptr if the key was not found.
*/
const Value * Dictionary::GetRef(const String& key) const
{
std::shared_lock<std::shared_timed_mutex> lock (m_DataMutex);
auto it (m_Data.find(key));
return it == m_Data.end() ? nullptr : &it->second;
}
/**
* Sets a value in the dictionary.
*
@ -300,4 +314,3 @@ Dictionary::Iterator icinga::end(const Dictionary::Ptr& x)
{
return x->End();
}

View File

@ -42,6 +42,7 @@ public:
Value Get(const String& key) const;
bool Get(const String& key, Value *result) const;
const Value * GetRef(const String& key) const;
void Set(const String& key, Value value, bool overrideFrozen = false);
bool Contains(const String& key) const;

View File

@ -54,26 +54,11 @@ void FIFO::Optimize()
}
}
size_t FIFO::Peek(void *buffer, size_t count, bool allow_partial)
{
ASSERT(allow_partial);
if (count > m_DataSize)
count = m_DataSize;
if (buffer)
std::memcpy(buffer, m_Buffer + m_Offset, count);
return count;
}
/**
* Implements IOQueue::Read.
*/
size_t FIFO::Read(void *buffer, size_t count, bool allow_partial)
size_t FIFO::Read(void *buffer, size_t count)
{
ASSERT(allow_partial);
if (count > m_DataSize)
count = m_DataSize;

View File

@ -23,8 +23,7 @@ public:
~FIFO() override;
size_t Peek(void *buffer, size_t count, bool allow_partial = false) override;
size_t Read(void *buffer, size_t count, bool allow_partial = false) override;
size_t Read(void *buffer, size_t count) override;
void Write(const void *buffer, size_t count) override;
void Close() override;
bool IsEof() const override;

View File

@ -47,4 +47,3 @@ Object::Ptr Function::GetPrototype()
return prototype;
}

View File

@ -10,4 +10,3 @@ bool icinga::InitializeOnceHelper(const std::function<void()>& func, InitializeP
Loader::AddDeferredInitializer(func, priority);
return true;
}

View File

@ -23,6 +23,7 @@ enum class InitializePriority {
RegisterBuiltinTypes,
RegisterFunctions,
RegisterTypes,
SortTypes,
EvaluateConfigFragments,
Default,
FreezeNamespaces,

View File

@ -0,0 +1,22 @@
/* Icinga 2 | (c) 2025 Icinga GmbH | GPLv2+ */
#pragma once
#include "base/i2-base.hpp"
#include <memory>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/version.hpp>
// std::hash is only implemented starting from Boost 1.74. Implement it ourselves for older version to allow using
// boost::intrusive_ptr inside std::unordered_set<> or as the key of std::unordered_map<>.
// https://github.com/boostorg/smart_ptr/commit/5a18ffdc5609a0e64b63e47cb81c4f0847e0c087
#if BOOST_VERSION < 107400
template<class T>
struct std::hash<boost::intrusive_ptr<T>>
{
std::size_t operator()(const boost::intrusive_ptr<T>& ptr) const noexcept
{
return std::hash<T*>{}(ptr.get());
}
};
#endif /* BOOST_VERSION < 107400 */

View File

@ -146,9 +146,14 @@ void AsioConditionVariable::Wait(boost::asio::yield_context yc)
m_Timer.async_wait(yc[ec]);
}
/**
* Cancels any pending timeout callback.
*
* Must be called in the strand in which the callback was scheduled!
*/
void Timeout::Cancel()
{
m_Cancelled.store(true);
m_Cancelled->store(true);
boost::system::error_code ec;
m_Timer.cancel(ec);

View File

@ -3,10 +3,12 @@
#ifndef IO_ENGINE_H
#define IO_ENGINE_H
#include "base/atomic.hpp"
#include "base/debug.hpp"
#include "base/exception.hpp"
#include "base/lazy-init.hpp"
#include "base/logger.hpp"
#include "base/shared-object.hpp"
#include "base/shared.hpp"
#include <atomic>
#include <exception>
#include <memory>
@ -109,8 +111,7 @@ public:
// https://github.com/boostorg/coroutine/issues/39
throw;
} catch (const std::exception& ex) {
Log(LogCritical, "IoEngine", "Exception in coroutine!");
Log(LogDebug, "IoEngine") << "Exception in coroutine: " << DiagnosticInformation(ex);
Log(LogCritical, "IoEngine") << "Exception in coroutine: " << DiagnosticInformation(ex);
} catch (...) {
Log(LogCritical, "IoEngine", "Exception in coroutine!");
}
@ -164,51 +165,80 @@ private:
/**
* I/O timeout emulator
*
* This class provides a workaround for Boost.ASIO's lack of built-in timeout support.
* While Boost.ASIO handles asynchronous operations, it does not natively support timeouts for these operations.
* This class uses a boost::asio::deadline_timer to emulate a timeout by scheduling a callback to be triggered
* after a specified duration, effectively adding timeout behavior where none exists.
* The callback is executed within the provided strand, ensuring thread-safety.
*
* The constructor returns immediately after scheduling the timeout callback.
* The callback itself is invoked asynchronously when the timeout occurs.
* This allows the caller to continue execution while the timeout is running in the background.
*
* The class provides a Cancel() method to unschedule any pending callback. If the callback has already been run,
* calling Cancel() has no effect. This method can be used to abort the timeout early if the monitored operation
* completes before the callback has been run. The Timeout destructor also automatically cancels any pending callback.
* A callback is considered pending even if the timeout has already expired,
* but the callback has not been executed yet due to a busy strand.
*
* @ingroup base
*/
class Timeout : public SharedObject
class Timeout
{
public:
DECLARE_PTR_TYPEDEFS(Timeout);
using Timer = boost::asio::deadline_timer;
template<class Executor, class TimeoutFromNow, class OnTimeout>
Timeout(boost::asio::io_context& io, Executor& executor, TimeoutFromNow timeoutFromNow, OnTimeout onTimeout)
: m_Timer(io)
/**
* Schedules onTimeout to be triggered after timeoutFromNow on strand.
*
* @param strand The strand in which the callback will be executed.
* The caller must also run in this strand, as well as Cancel() and the destructor!
* @param timeoutFromNow The duration after which the timeout callback will be triggered.
* @param onTimeout The callback to invoke when the timeout occurs.
*/
template<class OnTimeout>
Timeout(boost::asio::io_context::strand& strand, const Timer::duration_type& timeoutFromNow, OnTimeout onTimeout)
: m_Timer(strand.context(), timeoutFromNow), m_Cancelled(Shared<Atomic<bool>>::Make(false))
{
Ptr keepAlive (this);
VERIFY(strand.running_in_this_thread());
m_Cancelled.store(false);
m_Timer.expires_from_now(std::move(timeoutFromNow));
IoEngine::SpawnCoroutine(executor, [this, keepAlive, onTimeout](boost::asio::yield_context yc) {
if (m_Cancelled.load()) {
return;
}
{
boost::system::error_code ec;
m_Timer.async_wait(yc[ec]);
if (ec) {
return;
m_Timer.async_wait(boost::asio::bind_executor(
strand, [cancelled = m_Cancelled, onTimeout = std::move(onTimeout)](boost::system::error_code ec) {
if (!ec && !cancelled->load()) {
onTimeout();
}
}
));
}
if (m_Cancelled.load()) {
return;
}
Timeout(const Timeout&) = delete;
Timeout(Timeout&&) = delete;
Timeout& operator=(const Timeout&) = delete;
Timeout& operator=(Timeout&&) = delete;
auto f (onTimeout);
f(std::move(yc));
});
/**
* Cancels any pending timeout callback.
*
* Must be called in the strand in which the callback was scheduled!
*/
~Timeout()
{
Cancel();
}
void Cancel();
private:
boost::asio::deadline_timer m_Timer;
std::atomic<bool> m_Cancelled;
Timer m_Timer;
/**
* Indicates whether the Timeout has been cancelled.
*
* This must be Shared<> between the lambda in the constructor and Cancel() for the case
* the destructor calls Cancel() while the lambda is already queued in the strand.
* The whole Timeout instance can't be kept alive by the lambda because this would delay the destructor.
*/
Shared<Atomic<bool>>::Ptr m_Cancelled;
};
}

View File

@ -35,4 +35,3 @@ void Loader::AddDeferredInitializer(const std::function<void()>& callback, Initi
initializers->push(DeferredInitializer(callback, priority));
}

View File

@ -121,7 +121,10 @@ public:
template<typename T>
Log& operator<<(const T& val)
{
m_Buffer << val;
if (!m_IsNoOp) {
m_Buffer << val;
}
return *this;
}

View File

@ -9,7 +9,7 @@ namespace icinga
abstract class Logger : ConfigObject
{
[config, virtual] String severity {
[config, set_virtual] String severity {
default {{{ return "information"; }}}
};
};

View File

@ -81,4 +81,3 @@ Object::Ptr Namespace::GetPrototype()
return prototype;
}

View File

@ -186,4 +186,3 @@ Namespace::Iterator icinga::end(const Namespace::Ptr& x)
{
return x->End();
}

View File

@ -23,12 +23,10 @@ void NetworkStream::Close()
* @param count The number of bytes to read from the queue.
* @returns The number of bytes actually read.
*/
size_t NetworkStream::Read(void *buffer, size_t count, bool allow_partial)
size_t NetworkStream::Read(void *buffer, size_t count)
{
size_t rc;
ASSERT(allow_partial);
if (m_Eof)
BOOST_THROW_EXCEPTION(std::invalid_argument("Tried to read from closed socket."));

View File

@ -22,7 +22,7 @@ public:
NetworkStream(Socket::Ptr socket);
size_t Read(void *buffer, size_t count, bool allow_partial = false) override;
size_t Read(void *buffer, size_t count) override;
void Write(const void *buffer, size_t count) override;
void Close() override;

View File

@ -22,4 +22,3 @@ Object::Ptr Number::GetPrototype()
return prototype;
}

View File

@ -6,4 +6,3 @@
using namespace icinga;
REGISTER_BUILTIN_TYPE(Number, Number::GetPrototype());

View File

@ -42,4 +42,3 @@ Object::Ptr Object::GetPrototype()
return prototype;
}

View File

@ -5,6 +5,7 @@
#include "base/i2-base.hpp"
#include "base/debug.hpp"
#include "base/intrusive-ptr.hpp"
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <atomic>
#include <cstddef>
@ -27,7 +28,7 @@ class String;
struct DebugInfo;
class ValidationUtils;
extern Value Empty;
extern const Value Empty;
#define DECLARE_PTR_TYPEDEFS(klass) \
typedef intrusive_ptr<klass> Ptr

View File

@ -54,4 +54,3 @@ ObjectFactory ObjectType::GetFactory() const
{
return DefaultObjectFactory<Object>;
}

View File

@ -259,6 +259,10 @@ PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
double value = Convert::ToDouble(tokens[0].SubStr(0, pos));
if (!std::isfinite(value)) {
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid performance data value: " + perfdata + " is outside of any reasonable range"));
}
bool counter = false;
String unit;
Value warn, crit, min, max;
@ -363,20 +367,27 @@ String PerfdataValue::Format() const
result << unit;
std::string interm(";");
if (!GetWarn().IsEmpty()) {
result << ";" << Convert::ToString(GetWarn());
result << interm << Convert::ToString(GetWarn());
interm.clear();
}
if (!GetCrit().IsEmpty()) {
result << ";" << Convert::ToString(GetCrit());
interm += ";";
if (!GetCrit().IsEmpty()) {
result << interm << Convert::ToString(GetCrit());
interm.clear();
}
if (!GetMin().IsEmpty()) {
result << ";" << Convert::ToString(GetMin());
interm += ";";
if (!GetMin().IsEmpty()) {
result << interm << Convert::ToString(GetMin());
interm.clear();
}
if (!GetMax().IsEmpty()) {
result << ";" << Convert::ToString(GetMax());
}
}
}
interm += ";";
if (!GetMax().IsEmpty()) {
result << interm << Convert::ToString(GetMax());
}
return result.str();

View File

@ -61,4 +61,3 @@ ObjectFactory PrimitiveType::GetFactory() const
{
return m_Factory;
}

View File

@ -19,6 +19,7 @@
#ifndef _WIN32
# include <execvpe.h>
# include <poll.h>
# include <signal.h>
# include <string.h>
# ifndef __APPLE__
@ -170,6 +171,17 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
}
#endif /* HAVE_NICE */
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
for (int sig = 1; sig <= 31; ++sig) {
(void)sigaction(sig, &sa, nullptr);
}
}
sigset_t mask;
sigemptyset(&mask);
sigprocmask(SIG_SETMASK, &mask, nullptr);
@ -1075,7 +1087,9 @@ bool Process::DoEvents()
Log(LogWarning, "Process")
<< "Couldn't kill the process group " << m_PID << " (" << PrettyPrintArguments(m_Arguments)
<< "): [errno " << error << "] " << strerror(error);
could_not_kill = true;
if (error != ESRCH) {
could_not_kill = true;
}
}
#endif /* _WIN32 */

View File

@ -5,6 +5,7 @@
#include "base/i2-base.hpp"
#include "base/dictionary.hpp"
#include <cstdint>
#include <iosfwd>
#include <deque>
#include <vector>
@ -25,7 +26,7 @@ struct ProcessResult
pid_t PID;
double ExecutionStart;
double ExecutionEnd;
long ExitStatus;
int_fast64_t ExitStatus;
String Output;
};

View File

@ -23,16 +23,6 @@ class Registry
public:
typedef std::map<String, T> ItemMap;
void RegisterIfNew(const String& name, const T& item)
{
std::unique_lock<std::mutex> lock(m_Mutex);
if (m_Items.find(name) != m_Items.end())
return;
RegisterInternal(name, item, lock);
}
void Register(const String& name, const T& item)
{
std::unique_lock<std::mutex> lock(m_Mutex);
@ -40,38 +30,6 @@ public:
RegisterInternal(name, item, lock);
}
void Unregister(const String& name)
{
size_t erased;
{
std::unique_lock<std::mutex> lock(m_Mutex);
erased = m_Items.erase(name);
}
if (erased > 0)
OnUnregistered(name);
}
void Clear()
{
typename Registry<U, T>::ItemMap items;
{
std::unique_lock<std::mutex> lock(m_Mutex);
items = m_Items;
}
for (const auto& kv : items) {
OnUnregistered(kv.first);
}
{
std::unique_lock<std::mutex> lock(m_Mutex);
m_Items.clear();
}
}
T GetItem(const String& name) const
{
std::unique_lock<std::mutex> lock(m_Mutex);

View File

@ -107,4 +107,3 @@ void ScriptGlobal::WriteToFile(const String& filename)
sfp->Close();
fp.Commit();
}

View File

@ -520,7 +520,7 @@ String ScriptUtils::MsiGetComponentPathShim(const String& component)
Array::Ptr ScriptUtils::TrackParents(const Object::Ptr& child)
{
return Array::FromVector(DependencyGraph::GetParents(child));
return Array::FromVector(DependencyGraph::GetChildren(dynamic_pointer_cast<ConfigObject>(child)));
}
double ScriptUtils::Ptr(const Object::Ptr& object)

View File

@ -4,6 +4,7 @@
#define SHARED_H
#include "base/atomic.hpp"
#include "base/intrusive-ptr.hpp"
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <cstdint>
#include <utility>

View File

@ -21,7 +21,7 @@ StdioStream::~StdioStream()
Close();
}
size_t StdioStream::Read(void *buffer, size_t size, bool allow_partial)
size_t StdioStream::Read(void *buffer, size_t size)
{
ObjectLock olock(this);

View File

@ -18,7 +18,7 @@ public:
StdioStream(std::iostream *innerStream, bool ownsStream);
~StdioStream() override;
size_t Read(void *buffer, size_t size, bool allow_partial = false) override;
size_t Read(void *buffer, size_t size) override;
void Write(const void *buffer, size_t size) override;
void Close() override;

View File

@ -29,11 +29,6 @@ void Stream::Shutdown()
BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support Shutdown()."));
}
size_t Stream::Peek(void *buffer, size_t count, bool allow_partial)
{
BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support Peek()."));
}
void Stream::SignalDataAvailable()
{
OnDataAvailable(this);
@ -129,7 +124,7 @@ bool StreamReadContext::FillFromStream(const Stream::Ptr& stream, bool may_wait)
if (stream->IsEof())
break;
size_t rc = stream->Read(Buffer + Size, 4096, true);
size_t rc = stream->Read(Buffer + Size, 4096);
Size += rc;
count += rc;

View File

@ -54,27 +54,15 @@ class Stream : public Object
public:
DECLARE_PTR_TYPEDEFS(Stream);
/**
* Reads data from the stream without removing it from the stream buffer.
*
* @param buffer The buffer where data should be stored. May be nullptr if you're
* not actually interested in the data.
* @param count The number of bytes to read from the queue.
* @param allow_partial Whether to allow partial reads.
* @returns The number of bytes actually read.
*/
virtual size_t Peek(void *buffer, size_t count, bool allow_partial = false);
/**
* Reads data from the stream.
*
* @param buffer The buffer where data should be stored. May be nullptr if you're
* not actually interested in the data.
* @param count The number of bytes to read from the queue.
* @param allow_partial Whether to allow partial reads.
* @returns The number of bytes actually read.
*/
virtual size_t Read(void *buffer, size_t count, bool allow_partial = false) = 0;
virtual size_t Read(void *buffer, size_t count) = 0;
/**
* Writes data to the stream.

View File

@ -135,4 +135,3 @@ Object::Ptr String::GetPrototype()
return prototype;
}

View File

@ -33,7 +33,7 @@ String::String(const String& other)
: m_Data(other)
{ }
String::String(String&& other)
String::String(String&& other) noexcept
: m_Data(std::move(other.m_Data))
{ }
@ -47,7 +47,7 @@ String::String(Value&& other)
String& String::operator=(Value&& other)
{
if (other.IsString())
m_Data = std::move(other.Get<String>());
*this = std::move(other.Get<String>()); // Will atomically bind to the move assignment operator below.
else
*this = static_cast<String>(other);
@ -66,7 +66,7 @@ String& String::operator=(const String& rhs)
return *this;
}
String& String::operator=(String&& rhs)
String& String::operator=(String&& rhs) noexcept
{
m_Data = std::move(rhs.m_Data);
return *this;

View File

@ -44,7 +44,7 @@ public:
String(std::string data);
String(String::SizeType n, char c);
String(const String& other);
String(String&& other);
String(String&& other) noexcept;
#ifndef _MSC_VER
String(Value&& other);
@ -56,7 +56,7 @@ public:
{ }
String& operator=(const String& rhs);
String& operator=(String&& rhs);
String& operator=(String&& rhs) noexcept;
String& operator=(Value&& rhs);
String& operator=(const std::string& rhs);
String& operator=(const char *rhs);

View File

@ -7,6 +7,8 @@
#include "base/logger.hpp"
#include "base/configuration.hpp"
#include "base/convert.hpp"
#include "base/defer.hpp"
#include "base/io-engine.hpp"
#include <boost/asio/ssl/context.hpp>
#include <boost/asio/ssl/verify_context.hpp>
#include <boost/asio/ssl/verify_mode.hpp>
@ -18,14 +20,48 @@
using namespace icinga;
bool UnbufferedAsioTlsStream::IsVerifyOK() const
/**
* Checks whether the TLS handshake was completed with a valid peer certificate.
*
* @return true if the peer presented a valid certificate, false otherwise
*/
bool UnbufferedAsioTlsStream::IsVerifyOK()
{
return m_VerifyOK;
if (!SSL_is_init_finished(native_handle())) {
// handshake was not completed
return false;
}
if (GetPeerCertificate() == nullptr) {
// no peer certificate was sent
return false;
}
return SSL_get_verify_result(native_handle()) == X509_V_OK;
}
String UnbufferedAsioTlsStream::GetVerifyError() const
/**
* Returns a human-readable error string for situations where IsVerifyOK() returns false.
*
* If the handshake was completed and a peer certificate was provided,
* the string additionally contains the OpenSSL verification error code.
*
* @return string containing the error message
*/
String UnbufferedAsioTlsStream::GetVerifyError()
{
return m_VerifyError;
if (!SSL_is_init_finished(native_handle())) {
return "handshake not completed";
}
if (GetPeerCertificate() == nullptr) {
return "no peer certificate provided";
}
std::ostringstream buf;
long err = SSL_get_verify_result(native_handle());
buf << "code " << err << ": " << X509_verify_cert_error_string(err);
return buf.str();
}
std::shared_ptr<X509> UnbufferedAsioTlsStream::GetPeerCertificate()
@ -43,17 +79,17 @@ void UnbufferedAsioTlsStream::BeforeHandshake(handshake_type type)
set_verify_mode(ssl::verify_peer | ssl::verify_client_once);
set_verify_callback([this](bool preverified, ssl::verify_context& ctx) {
if (!preverified) {
m_VerifyOK = false;
std::ostringstream msgbuf;
int err = X509_STORE_CTX_get_error(ctx.native_handle());
msgbuf << "code " << err << ": " << X509_verify_cert_error_string(err);
m_VerifyError = msgbuf.str();
}
set_verify_callback([](bool preverified, ssl::verify_context& ctx) {
(void) preverified;
(void) ctx;
/* Continue the handshake even if an invalid peer certificate was presented. The verification result has to be
* checked using the IsVerifyOK() method.
*
* Such connections are used for the initial enrollment of nodes where they use a self-signed certificate to
* send a certificate request and receive their valid certificate after approval (manually by the administrator
* or using a certificate ticket).
*/
return true;
});
@ -69,3 +105,62 @@ void UnbufferedAsioTlsStream::BeforeHandshake(handshake_type type)
}
#endif /* SSL_CTRL_SET_TLSEXT_HOSTNAME */
}
/**
* Forcefully close the connection, typically (details are up to the operating system) using a TCP RST.
*/
void AsioTlsStream::ForceDisconnect()
{
if (!lowest_layer().is_open()) {
// Already disconnected, nothing to do.
return;
}
boost::system::error_code ec;
// Close the socket. In case the connection wasn't shut down cleanly by GracefulDisconnect(), the operating system
// will typically terminate the connection with a TCP RST. Otherwise, this just releases the file descriptor.
lowest_layer().close(ec);
}
/**
* Try to cleanly shut down the connection. This involves sending a TLS close_notify shutdown alert and terminating the
* underlying TCP connection. Sending these additional messages can block, hence the method takes a yield context and
* internally implements a timeout of 10 seconds for the operation after which the connection is forcefully terminated
* using ForceDisconnect().
*
* @param strand Asio strand used for other operations on this connection.
* @param yc Yield context for Asio coroutines
*/
void AsioTlsStream::GracefulDisconnect(boost::asio::io_context::strand& strand, boost::asio::yield_context& yc)
{
if (!lowest_layer().is_open()) {
// Already disconnected, nothing to do.
return;
}
{
Timeout shutdownTimeout (strand, boost::posix_time::seconds(10),
[this] {
// Forcefully terminate the connection if async_shutdown() blocked more than 10 seconds.
ForceDisconnect();
}
);
// Close the TLS connection, effectively uses SSL_shutdown() to send a close_notify shutdown alert to the peer.
boost::system::error_code ec;
next_layer().async_shutdown(yc[ec]);
}
if (!lowest_layer().is_open()) {
// Connection got closed in the meantime, most likely by the timeout, so nothing more to do.
return;
}
// Shut down the TCP connection.
boost::system::error_code ec;
lowest_layer().shutdown(lowest_layer_type::shutdown_both, ec);
// Clean up the connection (closes the file descriptor).
ForceDisconnect();
}

View File

@ -70,12 +70,12 @@ class UnbufferedAsioTlsStream : public AsioTcpTlsStream
public:
inline
UnbufferedAsioTlsStream(UnbufferedAsioTlsStreamParams& init)
: AsioTcpTlsStream(init.IoContext, init.SslContext), m_VerifyOK(true), m_Hostname(init.Hostname)
: AsioTcpTlsStream(init.IoContext, init.SslContext), m_Hostname(init.Hostname)
{
}
bool IsVerifyOK() const;
String GetVerifyError() const;
bool IsVerifyOK();
String GetVerifyError();
std::shared_ptr<X509> GetPeerCertificate();
template<class... Args>
@ -97,8 +97,6 @@ public:
}
private:
bool m_VerifyOK;
String m_VerifyError;
String m_Hostname;
void BeforeHandshake(handshake_type type);
@ -113,6 +111,9 @@ public:
{
}
void ForceDisconnect();
void GracefulDisconnect(boost::asio::io_context::strand& strand, boost::asio::yield_context& yc);
private:
inline
AsioTlsStream(UnbufferedAsioTlsStreamParams init)

View File

@ -11,6 +11,8 @@
#include <boost/asio/ssl/context.hpp>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#include <openssl/ssl.h>
#include <openssl/ssl3.h>
#include <fstream>
namespace icinga
@ -91,6 +93,18 @@ static void InitSslContext(const Shared<boost::asio::ssl::context>::Ptr& context
flags |= SSL_OP_CIPHER_SERVER_PREFERENCE;
#ifdef LIBRESSL_VERSION_NUMBER
flags |= SSL_OP_NO_CLIENT_RENEGOTIATION;
#elif OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_CTX_set_info_callback(sslContext, [](const SSL* ssl, int where, int) {
if (where & SSL_CB_HANDSHAKE_DONE) {
ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
}
});
#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
flags |= SSL_OP_NO_RENEGOTIATION;
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
SSL_CTX_set_options(sslContext, flags);
SSL_CTX_set_mode(sslContext, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
@ -714,7 +728,7 @@ String GetIcingaCADir()
return Configuration::DataDir + "/ca";
}
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca)
{
char errbuf[256];
@ -751,7 +765,7 @@ std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
EVP_PKEY *privkey = EVP_PKEY_new();
EVP_PKEY_assign_RSA(privkey, rsa);
return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, false);
return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, ca);
}
std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert)
@ -760,24 +774,37 @@ std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert)
return CreateCertIcingaCA(pkey.get(), X509_get_subject_name(cert.get()));
}
static inline
bool CertExpiresWithin(X509* cert, int seconds)
{
time_t renewalStart = time(nullptr) + seconds;
return X509_cmp_time(X509_get_notAfter(cert), &renewalStart) < 0;
}
bool IsCertUptodate(const std::shared_ptr<X509>& cert)
{
time_t now;
time(&now);
if (CertExpiresWithin(cert.get(), RENEW_THRESHOLD)) {
return false;
}
/* auto-renew all certificates which were created before 2017 to force an update of the CA,
* because Icinga versions older than 2.4 sometimes create certificates with an invalid
* serial number. */
time_t forceRenewalEnd = 1483228800; /* January 1st, 2017 */
time_t renewalStart = now + RENEW_THRESHOLD;
return X509_cmp_time(X509_get_notBefore(cert.get()), &forceRenewalEnd) != -1 && X509_cmp_time(X509_get_notAfter(cert.get()), &renewalStart) != -1;
return X509_cmp_time(X509_get_notBefore(cert.get()), &forceRenewalEnd) >= 0;
}
String CertificateToString(const std::shared_ptr<X509>& cert)
bool IsCaUptodate(X509* cert)
{
return !CertExpiresWithin(cert, LEAF_VALID_FOR);
}
String CertificateToString(X509* cert)
{
BIO *mem = BIO_new(BIO_s_mem());
PEM_write_bio_X509(mem, cert.get());
PEM_write_bio_X509(mem, cert);
char *data;
long len = BIO_get_mem_data(mem, &data);
@ -1012,16 +1039,7 @@ int GetCertificateVersion(const std::shared_ptr<X509>& cert)
String GetSignatureAlgorithm(const std::shared_ptr<X509>& cert)
{
int alg;
int sign_alg;
X509_PUBKEY *key;
X509_ALGOR *algor;
key = X509_get_X509_PUBKEY(cert.get());
X509_PUBKEY_get0_param(nullptr, nullptr, 0, &algor, key); //TODO: Error handling
alg = OBJ_obj2nid (algor->algorithm);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
sign_alg = OBJ_obj2nid((cert.get())->sig_alg->algorithm);

Some files were not shown because too many files have changed in this diff Show More