5. install services

To ensure that all VIMON components run consistently, they must be integrated as services.

Set up Services under Linux

Both of the following variants use the set configuration to start all relevant Services in the correct user context.

Under Linux, the Services to be started must be activated under ../vimon/config/services/service_config:

  1. Edit the file service_config and set all desired Services to true which should run on this server.
    Example:

    installation linux services
  2. Implement either init.d or Register service (recommended).

Register service

It is possible to integrate the service file ../vimon/services/vimon.service with systemd. However, this must first be adapted to the local conditions.

installation linux services systemd
  1. Copy the file ../vimon/services/vimon.service into the directory /etc/systemd/system.

  2. Activate Service.
    sudo systemctl enable vimon.service

init.d

The Service services/monitoringservice can be integrated with init.d.

Rotating and compressing the log files

In addition, logrotate can be used under Linux to rotate and compress the log files. There is a template for this in the VIMON base bundle at vimon/config/logrotate.d/vimon This can be copied to /etc/logrotate.d/.

In addition, the base directory may need to be adapted in the copied template.

Setting up Services under Windows

There are installation scripts for Windows at services/install for setting up the services. The Services can be set up/removed/edited with the following commands:

Execute the command prompt (cmd) as administrator.

  • Grafana:

    grafana install

    Set up service

    grafana uninstall

    Remove service

    grafana manage

    Check/manually edit service

  • Prometheus:

    prometheus install

    Set up service

    prometheus uninstall

    Remove service

    prometheus manage

    Check/manually edit service

  • Loki:

    loki install

    Set up service

    loki uninstall

    Remove service

    loki manage

    Check/manually edit

  • Exporter:

    The exporters are managed via a consolidated script exporter. This expects an additional Parameter with the respective exporter.
    If the script is executed without Parameters (i.e. simply exporter), it recognizes all available exporters and outputs their names:

    c:\virtimo\vimon\services\install>exporter
    Usage: exporter <Install,Uninstall,Manage> <Exporter_Name>
    List of available exporter_names:
    blackbox_exporter
    diskbench_exporter
    isdb_exporter
    promtail
    windows_exporter

    It can then be used in the same way as the others, e.g. for the Windows exporter:

    exporter install windows_exporter

    Set up service

    exporter uninstall windows_exporter

    Remove service

    exporter manage windows_exporter

    Check/manually edit service

Now you can start, stop, activate and deactivate the Services via Windows Services Management.

installation windows services

Before the service can be started, it usually has to be configured first.