• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Plesk Docker installation of lightmeter.io

t.van.der.plas

Basic Pleskian
Dear all,

I´ve been trying to install lightmeter as a docker container inside plesk, but do not seem to make any progress - settings below - error is always:

No logs sources specified or import flag provided! Use -help to more info.

The lightmeter documentation can be found here:

Did anyone succeed in installing this?

Regards

Tobias
 

Attachments

  • Bildschirmfoto 2020-12-22 um 15.44.08.png
    Bildschirmfoto 2020-12-22 um 15.44.08.png
    183.9 KB · Views: 20
Hi,

First of all, thank you for trying Lightmeter! :)

If you are using the official Lightmeter Control Center image, you need to make the following changes:

- None of the environment variables you listed is needed. The official Dockerfile [1] might help you to understand how the image is build.
- The docker image requires some command line arguments (docker CMD), namely: `-watch_dir /logs/ -workspace /path/to/writable/persistency/directory`
- You'll need to map the port 8080 as well that contains an http based user interface.

I haven't tried Plesk yet, so please let me know if any information is missing.

Regards,
Leandro (Lightmeter lead developer)

[1] ci/Dockerfile · master · Lightmeter / ControlCenter

Dear all,

I´ve been trying to install lightmeter as a docker container inside plesk, but do not seem to make any progress - settings below - error is always:

No logs sources specified or import flag provided! Use -help to more info.

The lightmeter documentation can be found here:

Did anyone succeed in installing this?

Regards

Tobias
 
Hi @Ryan Davis

We've just implemented support for received configuration via environment variables on Lightmeter Control Center, enabling it to run within Plesk! :)
It's still an experimental support, available in the `lightmeter/controlcenter:1.6.0-RC1` docker image,

Could you please test if it works for you?

I've managed to only launch Control Center in Plesk, but we did not have time to test it in depth yet, so please report us any bugs :)

The correspondent gitlab issue in our side is in the link: Evaluate supporting Plesk, Hosting Control Panel (#371) · Issues · Lightmeter / ControlCenter

I'm attaching some screenshots showing it working out of the box.

The application UI will have the web ui available in the port 8080 of the docker container.

The documentation for the environment variables used can be obtained at Lightmeter / ControlCenter

Depending on your setup, you can have different environment variables defined, but as mandatory values you'll need `LIGHTMETER_WORKSPACE`, pointing to a writable directory where Control Center will store its database and other important files.

If you are reading Postfix logs from the filesystem, you'll need to map the log directory (often /var/log/mail) to the `/logs:ro` volume and set the environemnt variable `LIGHTMETER_WATCH_DIR=/logs`.

If you are using rsync to obtain the logs, in addition to the previous variable, you'll need to set `LIGHTMETER_LOGS_USE_RSYNC=true`.

If you are using Logstash or similar tool to get the logs, please check the link Lightmeter / ControlCenter

Regards,
Leandro
 

Attachments

  • docker-available.png
    docker-available.png
    125.3 KB · Views: 10
  • 7-fixed-logs.png
    7-fixed-logs.png
    234.7 KB · Views: 12
  • 6-fixed-docket-variable.png
    6-fixed-docket-variable.png
    141.7 KB · Views: 12
Last edited:
Hi Leandro,

awesome! lightmeter now starts in Docker without any issues - the only thing missing now is how to access the webinterface - port 8080 has been allowed in centos firewall, as well as in plesk firewall, but unfortunately the panel is not loading - any idea why? When using the listen parameter with the internal address - i get a /src/server/server.go:88 > listen tcp 10.10.100.15:8080: bind: cannot assign requested address
 
Hi @t.van.der.plas,

Could you please try to use the docker image:tag `lightmeter/controlcenter:nightly-develop` instead?

This version allows plesk to recognize that the port 8080 is used by the container and map it accordingly, as in the image below. Please notice that this exposes the UI in plain HTTP, which is unsafe, so please ensure that you can access this port only through a secure connection or setup Lightmeter Control Center to run behind a reverse proxy that exposes only https connections.

Please let us know if this solution works for you and we are keen for feedback :)

Regards,
Leandro

1618227205851.png
 
great - one step further - lightmeter is up and running, but does not find the logs - plesk postfix usually uses a file for this /var/log/maillog - if i enter this directly, it´s not working - not sure if it makes sense to map a file to a volume - what do you think?
 
Last edited:
Hi @t.van.der.plas, thank you for the feedback. We're glad you could get it running :)

For the log file, you should mount the /var/log/ directory as /logs and use the env var LIGHTMETER_WATCH_DIR=/logs, as Lightmeter Control Center should be able to detect automatically the maillog file.

If it doesn't work, please fill a bug report on Lightmeter / ControlCenter :)

Regards,
Leandro
 
hi Leandro, ok so currently i have the following error:
error":"Could not find any matching log files in the directory: /logs that are more recent than 0001-01-01 00:00:00 +0000 UTC","file":"/src/logeater/dirwatcher/dir_importer.go","line":463}
docker container is afaik ok - see screenshot
/var/log has a symlink to /logs
 

Attachments

  • D93AEDB1-D75C-47A9-BB1B-E39C0AEF3570.jpeg
    D93AEDB1-D75C-47A9-BB1B-E39C0AEF3570.jpeg
    456.6 KB · Views: 6
Oh, please also map a volume for a workspace, otherwise all the data for the container (like database, etc.) will be lost when the container ends.

In order to do that, click on "Add mapping", and map some writable directory in the host, for instance /var/lib/controlcenter to "/workspace" and set the environment variable "LIGHTMETER_WORKSPACE" to "/workspace".

Something that looks like this:

1618398821466.png
 
Hi,

quick update - i have changed the settings two days ago, but lightmeter is stuck in generating insights
 

Attachments

  • 3AAE8EDC-8EE6-4521-8BA5-E80C3E040B7D.jpeg
    3AAE8EDC-8EE6-4521-8BA5-E80C3E040B7D.jpeg
    369.1 KB · Views: 8
  • 3698F5F5-26EE-4EAA-8BA6-908508E414B4.jpeg
    3698F5F5-26EE-4EAA-8BA6-908508E414B4.jpeg
    736.1 KB · Views: 6
Hi @t.van.der.plas,

Could you please try to stop the container, remove the directory mapped in the variable `LIGHTMETER_WORKSPACE` and start it again?
Also, could you please if there's any content in the file `/var/log/maillog`?
 
Hi Leandro,
directory has been removed - lightmeter is working now - any idea how to map this properly to a directory, so that the settings & data are stored properly
Regards
Tobias
 
Hi Leandro,
directory has been removed - lightmeter is working now - any idea how to map this properly to a directory, so that the settings & data are stored properly
Regards
Tobias
If you kept the /workspace volume mapped to somewhere in the host filesystem and the LIGHTMETER_WORKSPACE variable, the data should be kept safe if the container is restarted.

One possible explanation is that Plesk is in the background removing/rotating the log files before Lightmeter Control Center is able to read them. If this is the case, please try removing such directory from the filesystem again.

Regards,
Leandro
 
Back
Top