MetricsHub
Documentation 0.9.03
-
Home
- Getting Started
Installation
You can install MetricsHub on the operating system of your choice as they are equally supported.
On Linux
Download
Download the Linux package, metricshub-linux-0.9.03.tar.gz
, from the MetricsHub Release v0.9.03[1] page.
Install
Unzip and untar the content of metricshub-linux-0.9.03.tar.gz
into a program directory, like /opt
. There is no need to create a specific subdirectory for metricshub
as the archive already contains a metricshub
directory.
/ $ cd /opt
/opt $ sudo tar xzf /tmp/metricshub-linux-0.9.03.tar.gz
Configure
In the ./lib/config/metricshub.yaml
file, located under the ./metricshub
installation directory, configure:
- the resources to be monitored[2]
- the OpenTelemetry Protocol endpoint[3] that will receive the MetricsHub signals.
To assist with the setup process, the configuration example ./lib/config/metricshub-example.yaml
is provided for guidance in the installation directory (./metricshub
).
Start
To start MetricsHub in an interactive terminal with the default configuration file ./lib/config/metricshub.yaml
, run the command below:
/ $ cd /opt/metricshub/bin
/opt/metricshub/bin $ ./service
To start MetricsHub with an alternate configuration file, run the command below:
/ $ cd /opt/metricshub/bin
/opt/metricshub/bin $ ./service --config <PATH>
Example:
/ $ cd /opt/metricshub/bin
/opt/metricshub/bin $ ./service --config config/my-metricshub.yaml
To start MetricsHub as a Linux service, follow the steps below:
-
Create a systemd service file
Create a file (for example:
/etc/systemd/system/metricshub-service.service
) and define the MetricsHub Service configuration as follows:[Unit] Description=MetricsHub Service [Service] ExecStart=/opt/metricshub/bin/service Restart=on-failure [Install] WantedBy=multi-user.target
-
Reload systemd
After creating the Linux service file, reload
systemd
to recognize the new service.systemctl daemon-reload
-
Start the MetricsHub Service
systemctl start metricshub-service
To enable the Linux service to start on boot, run the command below:
systemctl enable metricshub-service
-
Check status
To verify that the MetricsHub Service is running without errors, run the command below:
systemctl status metricshub-service
This will give you information about the current status of your service.
Stop
Interactive Terminal
To manually stop the MetricsHub Service in an interactive terminal, use the keyboard shortcut CTRL+C
. This will interrupt the running process and terminate the MetricsHub Service.
Background Process
If the MetricsHub Service is running in the background, follow these steps to stop it:
-
Run the
ps
command to get the MetricsHub Service PID:ps aux | grep service
-
Write down the PID associated with the MetricsHub Service.
-
Terminate the process using the
kill
command below:kill -9 <PID>
where <PID>
should be replaced with the actual process ID.
Service
To stop the MetricsHub Service that is started as a Linux service, run the command below:
systemctl stop <metricshub-service>
where <metricshub-service>
should be replaced with the actual service name. For example, metricshub-service
if the systemd
service file is /etc/systemd/system/metricshub-service.service
Uninstall
- Stop the MetricsHub Service.
- Navigate to the directory where MetricsHub is located (e.g.,
/opt
) and remove the entiremetricshub
directory.
/ $ cd /opt
/opt $ rm -rf metricshub
If the MetricsHub Service was set up as a Linux Service, delete the file /etc/systemd/system/metricshub-service.service
and run the below command to reload systemd
:
systemctl daemon-reload
On Windows
Download
Download the Windows package, metricshub-windows-0.9.03.zip
, from the MetricsHub Release v0.9.03[1] page.
Install
Unzip the content of metricshub-windows-0.9.03.zip
into a program folder, like C:\Program Files
. There is no need to create a specific subdirectory for MetricsHub
as the zip archive already contains a MetricsHub
directory.
Note: You will need administrative privileges to unzip into
C:\Program Files
.
Configure
In the C:\ProgramData\MetricsHub\config\metricshub.yaml
file, configure:
- the resources to be monitored[2]
- the OpenTelemetry Protocol endpoint[3] that will receive the MetricsHub signals.
To assist with the setup process, the configuration example .\config\metricshub-example.yaml
is provided for guidance in the installation directory (typically, C:\Program Files\MetricsHub
).
Start
To start MetricsHub Service in CMD.EXE
or Windows Terminal
[4], run the command below:
c:\> cd "c:\Program Files\MetricsHub"
c:\Program Files\MetricsHub> MetricsHubServiceManager
Note: Run
CMD.EXE
orWindows Terminal
with elevated privileges (Run As Administrator).
This will start MetricsHub with the default configuration file C:\ProgramData\MetricsHub\config\metricshub.yaml
.
Run the command below to start MetricsHub with an alternate configuration file:
c:\> cd "c:\Program Files\MetricsHub"
c: \Program Files\MetricsHub> MetricsHubServiceManager --config <PATH>
Example:
c:\> cd "c:\Program Files\MetricsHub"
c:\Program Files\MetricsHub> MetricsHubServiceManager --config C:\ProgramData\MetricsHub\config\my-metricshub.yaml
To start MetricsHub as a Windows service, run the following commands under the installation folder (assuming the product has been installed in C:\Program Files
):
c:\> cd "c:\Program Files\MetricsHub"
c:\Program Files\MetricsHub>
c:\Program Files\MetricsHub> service-installer install MetricsHub "c:\Program Files\MetricsHub\MetricsHubServiceManager.exe"
c:\Program Files\MetricsHub> service-installer set MetricsHub AppDirectory "c:\Program Files\MetricsHub"
c:\Program Files\MetricsHub> service-installer set MetricsHub DisplayName MetricsHub
c:\Program Files\MetricsHub> service-installer set MetricsHub Start SERVICE_AUTO_START
The service will appear as MetricsHub
in the services.msc
console.
Stop
Interactive Terminal
To stop the MetricsHub Service manually, use the keyboard shortcut CTRL+C
. This will interrupt the running process and terminate the MetricsHub Service.
Background Process
If the MetricsHub Service is running in the background, execute the taskkill
command as follows:
taskkill /F /IM MetricsHubServiceManager.exe
Service
To stop the MetricsHub Service started as a Windows service:
- Run
services.msc
to access all the Windows services. - In the Services window, locate the
MetricsHub
service you manually created. - Right-click the
MetricsHub
service and click Stop.
Uninstall
- Stop the MetricsHub Service.
- Navigate to the folder where MetricsHub is installed (e.g.,
C:\Program Files
) and delete the entireMetricsHub
folder.
If the MetricsHub Service was set up as a Windows Service, run the following command to remove it:
sc delete MetricsHub
On Docker
Download
Download the Docker package, metricshub-linux-0.9.03-docker.tar.gz
, from the MetricsHub Release v0.9.03[1] page.
Install
Unzip and untar the content of metricshub-linux-0.9.03-docker.tar.gz
into a directory, like /docker
.
/ $ cd /docker
/docker $ sudo tar xzf /tmp/metricshub-linux-0.9.03-docker.tar.gz
Configure
In the ./lib/config/metricshub.yaml
file, locally under the ./metricshub
installation directory, configure:
- the resources to be monitored[2]
- the OpenTelemetry Protocol endpoint[3] that will receive the MetricsHub signals.
To assist with the setup process, the configuration example ./lib/config/metricshub-example.yaml
is provided for guidance in the installation directory (./metricshub
).
Build the docker image
Run the following command to build the docker image:
/ $ cd /docker/metricshub
/docker/metricshub $ sudo docker build -t metricshub:latest .
Start
Run the following command to start MetricsHub with the default configuration file, ./lib/config/metricshub.yaml
:
/ $ cd /docker/metricshub
/docker/metricshub $ sudo docker run --name=metricshub metricshub:latest
You can start MetricsHub with an alternate configuration file with the following command:
/ $ cd /docker/metricshub
/docker/metricshub $ sudo docker run --name=metricshub -v /docker/metricshub/lib/config:/opt/metricshub/lib/config metricshub:latest
Docker Compose Example
You can start MetricsHub with docker compose:
/docker/metricshub $ sudo docker compose up -d --build
Example (docker-compose.yaml
):
version: "2.1"
services:
metricshub:
# for image we will use ``image: sentrysoftware/metricshub:latest``
build: .
container_name: metricshub
volumes:
# Mount the volume ./lib/logs into /opt/metricshub/lib/logs in the container
- ./lib/logs:/opt/metricshub/lib/logs
# Mount the volume ./lib/config into /opt/metricshub/lib/config in the container
- ./lib/config:/opt/metricshub/lib/config
restart: unless-stopped
Stop
To stop MetricsHub started as a docker container, run the following command:
/docker/metricshub $ sudo docker stop metricshub
Docker Compose:
If you are using docker compose from the ./metricshub
directory, run the following command to stop MetricsHub:
/docker/metricshub $ sudo docker compose down
Uninstall
To force-stop and remove the MetricsHub container, run the following commands:
/docker/metricshub $ sudo docker stop -f metricshub
/docker/metricshub $ sudo docker rm -f metricshub
Adjust the commands to meet your specific requirements for stopping and removing the Docker container running MetricsHub.