This tutorial walks through setting up VMAgent on Ubuntu as a standalone process and monitor itself.
VMAgent is a tiny agent which helps you collect metrics from
various sources, relabel and filter the collected metrics and store them in Prometheus compatible remote storage such as
Last9 using the Prometheus remote write protocol.
In this tutorial, we’ll cover how to install VMAgent on your Ubuntu server, manage the VMAgent process, and set up
scrape configs to collect metrics from VMAgent itself.
Prerequisites
Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on your server and
also basic dependencies such as wget.
$levitate_remote_write_password - Write token created for the cluster
Download & extract VMAgent
VMAgent is available in as part of the VictoriaMetrics
repository’s latest releases.
First obtain the required binary.
Extract VMAgent from the compressed file i.e /var/tmp/vmutils.tar.gz
Setup VMAgent scrape config
Create a scrape config in the same directory as the VMAgent binary.
This adds the VMagent itself as a static target so that VMAgent can be monitored. Additional scrape targets can be
added. The complete list of options in the scrape_config section can be
found here.
Run VMAgent as a standalone service
Define a service using the below command. Ensure that you replace the placeholder values for remote write URL, username
and password with the correct values as described in the prerequisites section.
Now we’ll reload systemd and start the service
Verification
Check the status of our service by running the below command and if all is well then we should see the below output as
well.
Visit the Embedded Grafana dashboard in Last9, select the cluster where you have configured the VMAgent to send the
data and query the following metric vm_app_version{via_cluster="ec2-vmagent"}. The value will be 1 if the ingestion
is happening correctly.