Commit Graph

91 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 71cd89a4f1 add debug log support for the checker
This makes it possible to use this library and get a debug checker
output.
2023-09-05 15:23:43 +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 8e6e01f47c switch from log to slog
This commit replaces the various log entry points with a common logger
provided via context. This is helpful as it groups all log entries
together via the txid and should help in the future when debugging
cascading errors.
2023-08-17 22:05:46 +02:00
Gibheer 10f7eb53f4 prepare switch to log/slog
This commit prepares the switch from log to log/slog, which was
introduced in Go 1.21.
slog provides some useful facilities to add metadata to log entries,
which should be helpful for debugging problems.

This commit also adds a small transaction ID generator. It provides a
common identifier between log messages, so that multiple errors can be
viewed together in their order.
2023-08-17 22:02:52 +02:00
Gibheer a4a8c64229 add TODO items 2023-08-17 21:29:24 +02:00
Gibheer 33201efcbf add LICENSE file
This is now under MIT License.
2022-12-15 11:30:53 +01:00
Gibheer e29f38937c monfront - add basic interface to create some entities 2022-12-15 11:16:56 +01:00
Gibheer 49dac92034 monfront - only ACK when the check is in alarm state
The acknowledged flag gets removed by checkers when the state changes to
okay.
But if we acknowledge a check when it is okay the notification system
stops working.
2022-12-02 09:32:05 +01:00
Gibheer 4f5114fe3a monfront - remove more old cruft 2022-11-22 22:02:39 +01:00
Gibheer 36d0ea8f5f monfront - remove create option
The option wasn't implemented properly, so just remove it.
2022-11-22 21:52:15 +01:00
Gibheer d00e3f4a41 remove old schema file
This file is incompatible with all the following schema files. Therefore
remove it and make the installation a bit smoother.
2022-11-22 21:23:26 +01:00
Gibheer fe6bd04947 update dependencies 2022-11-11 11:22:50 +01:00
Gibheer dc9dfb76ff update dependencies 2022-11-08 17:04:09 +01:00
Gibheer fa05045d31 cmd/monfront - import monfront from separate repository
This is the import from the separate monfront repository. The history
could not be imported, but this should suffice.
2021-12-02 17:54:14 +01: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 0639a504eb add basic infrastructure for writing a checker
These are the first components to interact with the database in a
predefined way to write a checker instance.
CheckExec serves as an example implementing the Executor interface.
2021-12-02 15:55:48 +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 88b50033d0 make build the default 2019-08-12 14:49:32 +02:00
Gibheer 0202d1c410 disable CGO support because of build errors 2019-05-28 13:40:36 +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 e5ac5a4e53 move monfront to separate repository
Monfront was forked into its own repository to make it easier to work
on.
2019-03-13 14:29:50 +01:00
Gibheer 361ca94ca3 monfront - fix group list
It was possible that a node was showing multiple times when it had more
than one check. That wasn't the purpose of that list.
Now each node only comes up once and its worst state is shown.
2019-03-08 16:45:28 +01:00
Gibheer bef2cfa349 monfront - enable jumping from groups to checks
This allows to view all the important checks for a group much easier.
2019-03-08 15:18:12 +01:00
Gibheer bb48d9387b monfront - add link to list checks from a group 2019-03-08 14:41:38 +01:00
Gibheer c9a990513a monfront - final fix for select all
There was an issue with the select all in that clicking an input field
didn't trigger the marking as the event was not pushed through to the
underlying elements.
2019-01-24 18:09:20 +01:00
Gibheer aff501bebc monfront - add select all
This commit adds a select all function to select all rows of a list to
mark them all.
This could be used to send a refresh to all these checks or acknowledge
them or whatever.

Also the referrer handling in checkAction() was moved to the start so
that even with an error the same thing happens.
2019-01-24 15:37:43 +01:00
Gibheer b1746c6626 monfront - fix check id variable name
The field name was wrong and therefore actions weren't completed and the
redirect was wrong.
2019-01-24 13:30:05 +01:00
Gibheer 80b7d7cbe4 monfront - firefox has no event.path
Because Firefox has no attribute path for an event to represent the
element chain of the target, we need to iterate through the parents.
2019-01-24 12:01:21 +01:00
Gibheer 02e838e2fe monfront - add highlight to selected rows
The selected rows are now properly highlighted. See #7 for more
information.
2019-01-24 11:41:18 +01:00
Gibheer 18e4ba6ae4 monfront - add line select
As in #7 requested, it is now possible to select a row by clicking on
the row itself. This should make it much easier to select a larger
number of rows.
2019-01-24 11:26:26 +01:00
Gibheer e8e67f091a monfront - link to node checks from check detail
This way it is possible to jump between a node and its checks.
2019-01-24 09:25:00 +01:00
Gibheer a9634bbcaa monfront - fix referer
Somewhen in the last couple years, something called a referer policy was
introduced. This avoided the correct relocation after any action was
sent.
Now with the fix, the redirect properly works.
2019-01-24 09:18:46 +01:00
Gibheer 6a5c0b92bd monfront - add notifications to check details
This adds the first basic listing of notifications to the check details.
No idea how many of them should be listed here, but having the list at
all for a start should be okay.
2019-01-11 23:02:58 +01:00
Gibheer aed518ea76 monfront - remove showNode and showGroup
There is just no information that could possibily be shown there, that
isn't already shown somewhere else.
2019-01-11 19:54:06 +01:00
Gibheer 168c425fb6 add missing table to database schema
The checks_notify table was missing and needs to be added. As this is
still alpha software, there is no need for a migration step yet.
2019-01-11 13:04:35 +01:00
Gibheer 203ca756e1 monfront - send an okay notification when check is acknowledged
When a check is acknowledged, no more further notifications should be
sent. But for the notified system, it should be made clean, that it is
taken care of and no further actions need to be done, therefore send an
okay, even when the check isn't okay.
2019-01-11 13:03:07 +01: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 f804446ad3 monfront - fix group order
The adding of the order by clause happend in the wrong position and
therefore made the resultset unuseable.
2019-01-10 09:50:18 +01:00
Gibheer 73c7353082 monfront - sort result list
The result list should be ordered for the state when unhandled entries
should be returned. Else it is getting weird to figure out, which issue
is the most important to fix.
2019-01-10 07:10:02 +01:00
Gibheer ea658177ee monfront - add hover background color
With some monitors, the view may be too wide to make out, which line
belongs to what. For that purpose, add a background color when the mouse
is hovering over a line.
2019-01-10 05:50:02 +01:00
Gibheer bfe455d936 monfront - add css to make check detail view nicer
Now all the fields are shown in a column like view, which makes viewing
them much nicer to the eye.
2019-01-10 05:48:25 +01:00
Gibheer 96d853fad6 monfront - add check detail view
This adds a detail view for a single check. The purpose is to view
notifications for this check alone and get the context information on
the node it belongs to, the command and settings.
2019-01-09 20:17:49 +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 9ea6b0f343 fix the release script
The config directory was pushed into a subdirectory, when it wasn't
necessary. This lead to a double monzero path mention.
2019-01-07 09:43:18 +01:00
Gibheer 7c541189fe monfront - fix actions on checks
This is related to #6. The muting, enable and disable were not working
properly, because the date was not set when the check was updated.

With this comes also the first icon to represent the muted status.
2019-01-03 19:48:17 +01:00
Gibheer db3a7cdda9 monfront - add some cleanup and search
Monfront now has a basic search functionality for nodes. It also got
some nicer design to make it more useable.
2019-01-03 13:44:21 +01:00