Commit Graph

13363 Commits

Author SHA1 Message Date
Alexander A. Klimov 02df94a46a Repair DSL Namespace values being constant broken in #9627
master before #9627 (a0286e9c6):

<1> => namespace n { x = 42; x = 42 }
                             ^^^^^^
Constant must not be modified.
<2> =>

HEAD of #9627 (24b57f0d3):

<1> => namespace n { x = 42; x = 42 }
null
<2> =>
2023-02-10 15:43:01 +01:00
Julian Brost 14d7ee2777
Merge pull request #9585 from Icinga/apply-doc
Doc: Troubleshooting: Optimise apply rules and group assign conditions
2023-02-03 09:46:35 +01:00
Julian Brost c51037725a
Merge pull request #9466 from Icinga/flush-temp-files
Deduplicate and stabilize fragile filesystem transactions
2023-02-02 16:29:11 +01:00
Julian Brost 3eb85797ce
Merge pull request #9622 from Icinga/9563
Main process: ignore SIGHUP
2023-02-02 11:36:13 +01:00
Julian Brost a0239e44f7
Merge pull request #9598 from Icinga/9596
CheckerComponent#CheckThreadProc(): also propagate next check update …
2023-02-01 20:09:06 +01:00
Alexander Aleksandrovič Klimov 4e021e0105
Merge pull request #9648 from Icinga/frozen-namespace-config-validation
Fix config sync after freezing namespaces
2023-02-01 17:07:57 +01:00
Julian Brost 0bd972ff0c
Merge pull request #9647 from Icinga/Al2Klimov-patch-3
Docs: Windows Dev Environment: TL;DR: disable unity build
2023-02-01 17:02:51 +01:00
Alexander A. Klimov e9b8c67975 CheckerComponent#CheckThreadProc(): also propagate next check update to Icinga DB
if caused by dependency or check period.

Now as long as any of the above causes check skips
next check and next update will be up-to-date in Icinga DB,
so the checkable won't slide into false positive overdue.
2023-02-01 16:25:56 +01:00
Julian Brost 6fc9038e4d
Merge pull request #9620 from Icinga/9526
Document Notification#times being not aware of downtimes
2023-02-01 14:31:27 +01:00
Julian Brost 2b43354080
Merge pull request #8744 from Icinga/bugfix/unnecessary-chown-8743
NodeUtility::WriteNodeConfigObjects(): avoid unneccessary Utility::SetFileOwnership()
2023-02-01 14:27:46 +01:00
Alexander Aleksandrovič Klimov 4c2afb9279
Docs: Windows Dev Environment: TL;DR: disable unity build
This enables the individual C++ files, not just unity ones, in VS project tree.
2023-02-01 13:02:45 +01:00
Julian Brost fd1aa73d25 Fix config sync after freezing namespaces
This was accidentally broken by #9627 because during config sync, a config
validation happens that uses `--define System.ZonesStageVarDir=...` which fails
on the now frozen namespace.

This commit changes this to use `Internal.ZonesStageVarDir` instead. After all,
this is used for internal functionality, users should not directly interact
with this flag.

Additionally, it no longer freezes the `Internal` namespace which actually
allows using `Internal.ZonesStageVarDir` in the first place. This also fixes
`--define Internal.Debug*` which was also broken by said PR. Freezing of the
`Internal` namespace is not necessary for performance reasons as it's not
searched implicitly (for example when accessing `globals.x`) and should users
actually interact with it, they should know by that name that they are on their
own.
2023-02-01 12:29:47 +01:00
Julian Brost d2fb8a9181 Handle errors when evaluating --define
This can be observed when running something like `icinga2 daemon -C -DTypes.Host=42`.

Without this commit:

    [2023-02-01 09:29:00 +0100] critical/Application: Error: Namespace is read-only and must not be modified.

    Additional information is available in '/var/log/icinga2/crash/report.1675240140.425155'

With this commit:

    [2023-02-01 09:30:37 +0100] critical/icinga-app: cannot set 'Types.Host': Namespace is read-only and must not be modified.
2023-02-01 09:30:49 +01:00
Julian Brost a24375bc91
Merge pull request #9264 from Icinga/Al2Klimov-patch-7
Doc: SUSE: install monitoring-plugins-all
2023-01-31 17:44:44 +01:00
Julian Brost 2a4c9166c9
Merge pull request #9640 from Icinga/gha-repair
GHA: build Icinga 2 from source
2023-01-31 16:42:58 +01:00
Alexander A. Klimov e43e657603 GHA: build Icinga 2 from source
as the package build images aren't public anymore.
2023-01-31 10:21:22 +01:00
Julian Brost 2ea866248b
Merge pull request #9642 from Icinga/9486a
ITL: let check_disk choose sane default units by itself
2023-01-27 22:22:24 +01:00
Julian Brost 03c7003cf0
Merge pull request #9644 from Icinga/probot/update-authors/master/0bdcd08e0240e009e6de635854dae625449260a5
Update AUTHORS
2023-01-27 21:09:17 +01:00
icinga-probot[bot] 3a848c600b
Update AUTHORS 2023-01-27 16:00:14 +00:00
Markus Weber 0bdcd08e02
Add the Option to disable RetryWrites to CheckCommand of mongodb (#9539)
* Add the Option to disable RetryWrites to CheckCommand for newer check_mongodb.py

* Add documentation foor the Option to disable RetryWrites in the MongoDB-Check
2023-01-27 15:59:40 +00:00
Alexander A. Klimov 3a1b080338 ITL: let check_disk choose sane default units by itself
so it is responsible for output readability, prefdata precision
and SI vs. IEC on its own.
2023-01-27 16:21:40 +01:00
Alexander A. Klimov fd93feaec7 Include Utility::SetFileOwnership() inside FS transactions
to make them even more atomic.
2023-01-27 12:03:59 +01:00
Alexander A. Klimov d22fdf2a7a Introduce AtomicFile#GetTempFilename() 2023-01-27 12:03:59 +01:00
Alexander A. Klimov 0367c9e099 Remove unused Utility::CreateTempFile() 2023-01-27 12:03:59 +01:00
Alexander A. Klimov b92fe23469 Deduplicate and stabilize fragile filesystem transactions
by using AtomicFile so they ensure all or nothing of a file gets replaced.
2023-01-27 12:03:56 +01:00
Alexander A. Klimov a3e205b990 Introduce AtomicFile::Write() 2023-01-27 11:36:09 +01:00
Alexander Aleksandrovič Klimov 0ebec699ee
Doc: SUSE: install monitoring-plugins-all w/ --recommends
so it does something useful.
2023-01-27 11:25:18 +01:00
Julian Brost 2d860a0f5e
Merge pull request #8118 from Icinga/feature/speed-object-registry-8112
Speed up config object lookup
2023-01-26 19:03:40 +01:00
Alexander Aleksandrovič Klimov 421ac1735c
Merge pull request #9608 from Icinga/move-types-namespace
Move Types namespace into type.cpp and simplify Type::GetByName()
2023-01-26 18:32:41 +01:00
Julian Brost ad8868cab7
Merge pull request #9599 from Icinga/influx-ns
Influx DB: don't unneccessarily truncate timestamps to whole seconds
2023-01-26 17:44:50 +01:00
Alexander A. Klimov b2fc49569c Make ConfigType#m_Mutex a std::shared_timed_mutex
refs #8112
2023-01-26 15:04:02 +01:00
Alexander A. Klimov 21759f015d ConfigType: store config objects in a hash map
refs #8112
2023-01-26 15:03:54 +01:00
Julian Brost 27af8829f2
Merge pull request #9641 from Icinga/code-optimization-1
Some trivial code optimisations
2023-01-26 14:43:31 +01:00
Julian Brost 3dab46623b Move Types namespace into type.cpp and simplify Type::GetByName()
This commit moves the initialization of the globals.Types namespace to type.cpp
in order to keep a pointer to the Namespace object in Type::m_Namespace and
simplify Type::GetByName() using it.

The dynamic type check is moved into an assertion after freezing the namespace.
2023-01-26 14:26:41 +01:00
Yonas Habteab 5a67ddea76 Don't post-increment stl iterators 2023-01-26 09:10:49 +01:00
Yonas Habteab 8bb0b857d8 ApiListener: Fix memory leak & group `a || b && c` correctly 2023-01-26 09:10:49 +01:00
Yonas Habteab 95cec9cba2 Don't mark a method as `virtual` in a `final` class 2023-01-26 09:10:38 +01:00
Yonas Habteab 7b91b200f5 Use simplified if conditions where applicable 2023-01-26 09:06:20 +01:00
Yonas Habteab 38313434d2 Avoid calling `GetDeferredInitializers()` repeatedly 2023-01-26 09:05:19 +01:00
Alexander Aleksandrovič Klimov bb99106926
Merge pull request #7863 from Icinga/bugfix/disallow-receiving-ticket-salt-via-api
Disallow fetching the ticket salt via REST API
2023-01-25 16:39:30 +01:00
Julian Brost 5fea15e090
Merge pull request #7958 from Icinga/bugfix/api-500-404-7956
/v1/actions/*: return 404 if no objects found
2023-01-24 15:08:17 +01:00
Julian Brost 1a158c400f
Merge pull request #9056 from Icinga/Al2Klimov-patch-5
check_logfiles: --winwarncrit is a flag, not a param
2023-01-24 14:01:55 +01:00
Julian Brost b10c288146
Merge pull request #8005 from Icinga/feature/http-verify-host-7969
check_http: support --verify-host
2023-01-24 13:02:08 +01:00
Alexander Aleksandrovič Klimov 11e37a0bd1
Merge pull request #9424 from Icinga/run-only-a-single-job-per-workflow-at-a-time
Run only a single job per workflow at a time
2023-01-20 20:35:51 +01:00
Johannes Meyer 9f757dd551 Run only a single job per workflow matrix at a time
This limits each run of these workflows to a single
active matrix job. This means, for each PR, merge or
release only five jobs run concurrently.
2023-01-20 15:44:40 +01:00
Julian Brost d29ff62017
Merge pull request #9636 from Icinga/gha-cancel
GHA: let GitHub cancel redundant jobs
2023-01-20 15:33:24 +01:00
Julian Brost c3e4098b41
Merge pull request #9635 from Icinga/eol
GHA: drop EOL OSes
2023-01-20 14:19:43 +01:00
Michael Friedrich 4d57de2a1a Hide TicketSalt in /v1/variables 2023-01-20 12:38:18 +01:00
Alexander Aleksandrovič Klimov e38a907a7e
Merge pull request #9627 from Icinga/namespace-shared-mutex
Namespace: use rwlock and disable read locking after freeze
2023-01-19 22:44:30 +01:00
Julian Brost 24b57f0d3a Namespace: don't acquire shared locks on frozen namespaces
This makes freezing a namespace an irrevocable operation but in return allows
omitting further lock operations. This results in a performance improvement as
reading an atomic bool is faster than acquiring and releasing a shared lock.

ObjectLocks on namespaces remain untouched as these mostly affect write
operations which there should be none of after freezing (if there are some,
they will throw exceptions anyways).
2023-01-19 17:56:44 +01:00