Commit Graph

21 Commits

Author SHA1 Message Date
Gibheer efa2f5b307 add support for debug checker log output
With monzero supporting slog to get debug output from check commands,
moncheck now supports that too by changing the level to debug.
2023-09-05 15:24:11 +02:00
Gibheer 26a4ca6ab5 migrate moncheck to slog
With this moncheck itself is also changed to use slog.
The early config parsing is still using log as we do not have any idea
what else to use.
But from then slog is used at all points.

With the additional config options a man page was also added to explain
the new config options.
2023-09-05 15:07:38 +02:00
Gibheer 41d4805d58 cmd/moncheck - fix missing return value 2021-12-02 17:53:47 +01:00
Gibheer b69cd1ea3e cmd/moncheck - switch to monzero.Checker
This switches the internals of the moncheck instance to using the
monzero.Checker API. This way we can reuse it completely and also see if
it works properly.
2021-12-02 15:57:00 +01:00
Gibheer e2b479c34f support new checker api
With this, it is now possible to support multiple check instances and
balance the load.
2019-08-12 14:49:53 +02:00
Gibheer 142f9cf358 fill in state_change column
Any time the state of the check changes, we need to refresh the column.
This will be used in the frontend. This way it is much faster than using
the notifications and also doesn't rely on the last of it being still
around.
2019-05-28 13:38:16 +02:00
Gibheer 2bfe75c8a7 cmd/moncheck: use mapping only for notifications
This should make the frontend much easier to handle than before. It
isn't the best solution, but it makes it easier in the frontend for now.
2019-04-10 09:09:15 +02:00
Gibheer 532f55d640 fix idle in transaction
It happend all the time, that connections were hanging in idle in
transaction state.
This was caused by a rollback stuck behind a sleep loop to wait for the
next bunch of checks to run.

This also replaces a Query() call with QueryRow, as we only expect a
single row and this cleans up the code a bit.
2019-04-09 09:51:52 +02:00
Gibheer 7ed255d591 moncheck - add hostname to notifications
This can help with determining which exact check connection broke the
check.
2019-01-11 13:02:37 +01:00
Gibheer 3b222e06ed moncheck - make workers configurable
The default worker count was set to 25, which might be too much
depending on the amount of cores available. Now make the default 25 and
let people decide on how many they want to use.
2019-01-07 15:50:55 +01:00
Gibheer affbe8c420 moncheck - log the state which wasn't found 2018-12-12 14:05:46 +01:00
Gibheer af843d76e1 moncheck - move notifications to dedicated table
It would be nice to support multiple notification mechanisms with a way
to disable all or part of them. So for now, this is bound to the check
but may change again in the future.

Apart from that, all notifications get written to the notification
table, so that the notifiers can do their job and ACK their own
notifications.
2018-12-11 20:21:14 +01:00
Gibheer 02925bc335 moncheck - add alarm mapping to notification
This should enable the notifier to make a decent decision on what to do.
2018-12-11 13:24:13 +01:00
Gibheer 24456400eb moncheck - add mapping levels
This adds mapping levels to the check runner. When the exit code is
returned, the actual level is looked up using the configured mapping.
After that, the state is entered into the table and added the same way
to the notifications.
2018-12-11 13:02:23 +01:00
Gibheer 40e744cd6a moncheck - add PATH environment
This adds the path environment configuration to control which programs
to call.
2018-12-10 09:34:00 +01:00
Gibheer 83a1b45b19 moncheck - add timeout option
Before the timeout for checks was static. With this change it is finally
an option to configure.
2018-11-29 10:45:33 +01:00
Gibheer ddc0053ce8 moncheck - add function to remove acknowledge
An acknowledge should be set to false when the alarm switches to an ok
state.
2018-11-20 21:47:35 +01:00
Gibheer b7cacc928f remove debug output
This output was poluting the log and wasn't necessary.
2018-11-19 11:30:29 +01:00
Gibheer 4db00b00ed moncheck: fix error reporting of daedlines
The deadlines were wrong all over the place, so this commit finally
fixes that.
2018-11-18 21:38:04 +01:00
Gibheer 1960907547 moncheck - adjust queries to take less data
With selecting only the bare minimum we get much nicer performance.
2018-11-16 20:09:31 +01:00
Gibheer bfd2b5d324 initial commit 2018-11-16 10:39:21 +01:00