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:
-
Edit the file
service_configand set all desired Services totruewhich should run on this server.
Example:
-
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.
-
Copy the file
../vimon/services/vimon.serviceinto the directory/etc/systemd/system. -
Activate Service.
sudo systemctl enable vimon.service
Further information e.g. at: https://wiki.ubuntuusers.de/Howto/systemd_Service_Unit_Beispiel/#service-Datei-anlegen
init.d
The Service services/monitoringservice can be integrated with init.d.
Further information e.g. at: https://openbook.rheinwerk-verlag.de/unix_guru/node103.html
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 ( |
-
Grafana:
grafana installSet up service
grafana uninstallRemove service
grafana manageCheck/manually edit service
-
Prometheus:
prometheus installSet up service
prometheus uninstallRemove service
prometheus manageCheck/manually edit service
-
Loki:
loki installSet up service
loki uninstallRemove service
loki manageCheck/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. simplyexporter), 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_exporterIt can then be used in the same way as the others, e.g. for the Windows exporter:
exporter install windows_exporterSet up service
exporter uninstall windows_exporterRemove service
exporter manage windows_exporterCheck/manually edit service
Now you can start, stop, activate and deactivate the Services via Windows Services Management.
Before the service can be started, it usually has to be configured first.