Mirrored from GitLab! Monitoring and automation for Open Source email servers, starting with Postfix. Please do not submit issues or PRs here - join us at: http
Mirrored from GitLab! Monitoring and automation for Open Source email servers, starting with Postfix. Please do not submit issues or PRs here - join us at: http
Note: This application has been deprecated and is unlikely to receive future updates.
Welcome to Lightmeter Control Center, the Open Source mailops monitoring application.
Currently Postfix MTA is supported. Future support for additional MTAs is planned.
./lightmeter -workspace ~/lightmeter_workspace -watch_dir /var/log
This command will start the application monitoring /var/log in real time (including old logs found there), and store operation files in lightmeter_workspace folder in your user's home directory.http://localhost:8080/ to see the web interfaceDocker images are generated for each release and published to Docker Hub and the GitHub Container Registry.
You can use the latest tag if desired. For usage see Docker image.
The historical nightly-master and nightly-develop image tags are retained. Their automatic schedules are disabled; maintainers can publish them manually through GitHub Actions. Neither nightly tag is recommended for production.
The following dependencies are needed during development:
For instance, on Alpine Linux 3.12, they can be installed with:
$ apk add git make gcc go libc-dev ragel npm
$ npm install -g @vue/[email protected] @vue/[email protected]To build a release version, dynamically linked to the local libc, execute:
make release
And to create a static linked (supported only if your libc can be statically linked) version, execute:
make static_releaseThat will download all the dependencies and build a file called lightmeter,
which you can simply copy to your Postfix server and use it as described in the Usage section.
If you are planning to contribute with code (Thank you! :-)), please check Development.
Limited Automatic data migration during upgrade is supported. As the data format is not yet stable, we cannot guarantee 100% data safety.
We advice you to create a backup of the workspace directory before a major upgrade. A backup can be performed by stopping controlcenter, copying the workspace directory somewhere else (or creating an archive, etc.), upgrade controlcenter, and finally start it again.
Achieving this is easy using manual upgrade based on replacing binary files. For Docker-based installations you should configure a workspace directory outside of the Lightmeter Docker container. See 'Usage' on how to specify which workspace directory Lightmeter should use.
We have planned support for on-the-fly backup for future releases, where this procedure will become easier, safer and more flexible.
We provide pre-built architecture-dependent binaries on GitHub that should run on any modern Linux distribution. Just download them, set them as executable and executed as described in Usage.
Your operating system should provide certificate authority certificates (ca-certificates package in many distributions) by default,
but in case you are keeping your own CA certificates, you'll need to set the environment variable SSL_CERT_DIR to it.
For instance, on Alpine linux, you can use, before executing the binary:
export SSL_CERT_DIR=/usr/share/ca-certificates/mozillaBut this is almost always not needed as Control Center is able to properly find them.
For more information about how the CA certificates are found, please check the correspondent Go source code.
In case the logs directory passed via -watch_dir is not in the same filesystem as postfix writes them, but instead copied via rsync,
you must pass the command line argument -logs_use_rsync, otherwise new log lines received after the first rsync execution won't be noticed.
When using rsync, remember NOT to use any in-place synchronization option, such as --append, as Control Center expects the default rsync behaviour
on updating files that consists on first create a temporary file in the destination and once it's completely transferred, rename it to the final file.
The simplest way to use the latest version with docker is with the command:
$ docker run -p 8080:8080 -v ":/workspace:rw" -v "/var/log/:/logs:ro" \
docker.io/lightmeter/controlcenter -workspace /workspace -watch_dir /logs
Where `` is a directory where Control Center will keep data that has to be persisted across restarts.
Then open your browser on http://localhost:8080 to access the web based user interface.
You can find released images on Docker Hub and GitHub Container Registry.
You can find the released pkg, module, testbed and an instruction for "How to build & install it?" on Github.
Lightmeter ships with a simple REST API designed for user interfaces. It is used by the Web UI.
Swagger-based API documentation and experimentation pages are generated automatically on development builds. Access them via http://lightmeter-address:8080/api, eg. http://localhost:8080/api.
Headless mode is allows ControlCenter to run the backend only, without the Web UI. This is currently intended for development purposes. Headless modes will be useful for using only the API part of the application.
Running headless mode requires building ControlCenter for this purpose:
make devheadless # Build ControlCenter
./lightmeter -stdin -log-level DEBUG --listen :8003 # Example command to start ControlCenter quickly (same as running a normal build)AllowMultipleUsers in auth/auth.go and recompiling.You can reset the administrator password using the command line:
./lightmeter -email_reset '' -password ''
/auth.db*. E.g.: rm -rf /var/lib/lightmeter_workspace/auth.db*.sqlite3 /auth.db 'delete from users where email = ""'. E.g.: sqlite3 /var/lib/lightmeter_workspace/auth.db 'delete from users where email = "[email protected]"'.For detailed information, check Usage.
lightmeter -help to show a list of all available commandslightmeter to read logs and launch a local webserver, which allows viewing Lightmeter Control Center via a Web UI in a browser on the same network on port 8080, eg. http://localhost:8080/. You can use -listen ":9999" for instance to use a different port or network interface, in this case all interfaces on port 9999.-stdin like `lightmeter -stdin { "log-type" => "mail" }
clones => ["lightmeter"]
}
}
}output { if [log-type] == "mail" and [type] == "lightmeter"{ tcp { host => "address-of-control-center-host" port => 9999 } } }
#### Using a custom log format
Alternatively, add the command line option `-log_format prepend-rfc3339` (or the environment variable `LIGHTMETER_LOG_FORMAT=prepend-rfc3339`),
meaning that it expects a time to come in the beginning of each log line.
Then configure Logstash to something similar to the following (Thank you Alexander Landmesser for the help :-)):
filter { if [log][file][path] == "/var/log/mail.log" { clone { add_field => { "log-type" => "mail" } clones => ["lightmeter"] } } }
output { if [log-type] == "mail" and [type] == "lightmeter"{ tcp { host => "address-of-control-center-host" port => 9999 codec => line { format => "{[@timestamp]} %{[message]}" } } } }
…sh docker run -it --rm lightmeter/controlcenter:latest -dovecot_conf_gen > /path/to/etc/dovecot/conf.d/10-lightmeter.conf
Or, similarly, when using the standalone binary:
```sh
/path/to/lightmeter -dovecot_conf_gen > /etc/dovecot/conf.d/10-lightmeter.confAnd finally, reload the Dovecot configuration with doveconf reload to apply those changes.
If your Dovecot version is older than 2.3.1, you need to pass an extra argument -dovecot_conf_is_old, as in:
/path/to/lightmeter -dovecot_conf_gen -dovecot_conf_is_old > /etc/dovecot/conf.d/10-lightmeter.conf
No open issues yet, or sync has not completed.