Agentless Multi-Cloud Monitoring with VictoriaMetrics and vmagent on a Central VPS
A detailed guide on setting up agentless infrastructure monitoring using VictoriaMetrics and vmagent on a central VPS. Covers installation, configuration, testing, and performance...
Introduction to Agentless Infrastructure Monitoring
Infrastructure monitoring is essential for ensuring system stability, especially in multi-cloud environments. Instead of installing agents on each server, you can use vmagent—a lightweight data collector from VictoriaMetrics—to gather metrics from sources like Prometheus, SNMP, or HTTP endpoints without installing software on the target machines. This guide walks you through configuring multi-cloud infrastructure monitoring on a central VPS using VictoriaMetrics and vmagent, completely agentless.
Prerequisites
To follow this guide, you need:
- A central VPS (High-RAM Cloud VPS) with root access.
- At least two servers or devices to monitor (can be VPS, physical servers, or cloud services).
- Public IP addresses or network connectivity from the central VPS to monitored devices.
- Cloud VPS RAM lớn for self-hosting LLMs and API gateways (if required).
Install and Configure VictoriaMetrics
VictoriaMetrics is a time-series data storage and query engine. Install it on the central VPS using Docker:
docker run -d --name vmstorage -p 8428:8428 -p 8429:8429 victoriametrics/vmstorage:latest
Then deploy the VictoriaMetrics single server:
docker run -d --name vmsingle -p 8428:8428 victoriametrics/vmsingle:latest
Access http:// to verify the system is running.
Configure vmagent for Data Collection
vmagent collects data without requiring agents. To monitor a remote server, create a vmagent.yml configuration file:
scrape_configs:
- job_name: 'remote_server'
static_configs:
- targets: ['192.168.1.100:9100'] # Target server IP and port
relabel_configs:
- source_labels: [__address__]
target_label: instance
Start vmagent with the configuration:
docker run -d --name vmagent -p 8429:8429 -v /path/to/vmagent.yml:/etc/vmagent/config.yml victoriametrics/vmagent:latest
vmagent will collect metrics and send them to VictoriaMetrics via port 8429.
Testing and Optimization
To validate the setup:
- Visit
http://to view collected metrics.:8428 - Use Prometheus Query Language (PromQL) to query data.
- Implement manual failover IP with Keepalived for high availability.
Optimization tips:
- Reduce scrape frequency if not needed.
- Use
relabel_configsto filter out unnecessary data. - Set memory and CPU limits for Docker containers.
Troubleshooting
If vmagent fails to send data:
- Verify VictoriaMetrics is running and listening on port 8429.
- Ensure
vmagent.ymlis correctly formatted. - Confirm the target server allows port 9100 (or your configured port).
- Check vmagent logs:
docker logs vmagent.
References
- Official vmagent Documentation
- Official VictoriaMetrics Documentation
- Building an AI Content Factory
- Complete Guide to Building a Fully Open-Source VoIP PBX System
Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
