diff --git a/pages/index.md b/pages/index.md index dac801ab409..225d1d51513 100644 --- a/pages/index.md +++ b/pages/index.md @@ -724,6 +724,7 @@ + [How to install ownCloud on a Public Cloud instance](public_cloud/compute/install-owncloud-on-a-public-cloud-instance) + [Installing Plesk on an instance](public_cloud/compute/install_plesk_on_an_instance) + [Installing WordPress on an instance](public_cloud/compute/install_wordpress_on_an_instance) + + [Installing Prometheus Agent on a Public Cloud instance](public_cloud/compute/install_prometheus_agent_on_instance) + [How to deploy the 3CX IPBX automatically on OVHcloud Public Cloud](web_cloud/phone_and_fax/voip/deployer_3cx_sur_public_cloud) + [Repairing the GRUB bootloader](public_cloud/compute/repairing_the_grub_bootloader) + [How to retrieve databases in rescue mode](bare_metal_cloud/dedicated_servers/restore-bdd-rescue) diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.de-de.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.de-de.md new file mode 100644 index 00000000000..864a379a89c --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.de-de.md @@ -0,0 +1,251 @@ +--- +title: 'Prometheus Agent auf einer Public Cloud Instanz installieren' +excerpt: 'Erfahren Sie, wie Sie den Prometheus Node Exporter- oder Windows Exporter-Agent auf einer OVHcloud Public Cloud Instanz installieren, um Metriken zu sammeln' +updated: 2026-01-28 +--- + +## Ziel + +Prometheus ist ein Monitoring-System und eine Zeitreihendatenbank. Sie können den Agenten auf einer OVHcloud Public Cloud Instanz installieren und verwenden, um Metriken von Ihren Servern und Anwendungen zu sammeln. + +**Diese Anleitung erklärt, wie Sie den Prometheus Node Exporter- oder Windows Exporter-Agent auf einer OVHcloud Public Cloud Instanz installieren.** + +> [!warning] +>OVHcloud stellt Ihnen Dienstleistungen zur Verfügung, für deren Konfiguration und Verwaltung Sie verantwortlich sind. Es liegt somit bei Ihnen, sicherzustellen, dass diese ordnungsgemäß funktionieren. +> +>Diese Anleitung soll Sie bei allgemeinen Aufgaben bestmöglich unterstützen. Wir empfehlen jedoch, einen [spezialisierten Dienstleister](/links/partner) zu kontaktieren oder Ihre Fragen an die [OVHcloud Community](/links/community) zu richten, wenn Sie auf Schwierigkeiten stoßen. +> + +## Voraussetzungen + +- Sie verfügen über eine [Public Cloud Instanz](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- Sie haben [administrativen Zugriff auf die Instanz](/pages/public_cloud/compute/public-cloud-first-steps). +- Sie haben einen Prometheus-Server, der von der Instanz aus erreichbar ist. + +## In der praktischen Anwendung + +Folgen Sie diesen Schritten, um den Prometheus Node Exporter- oder Windows Exporter-Agent auf Ihrer OVHcloud Public Cloud Instanz zu installieren, um Metriken zu sammeln. + +### Schritt 1: Verbindung mit Ihrer Instanz herstellen + +Stellen Sie über SSH eine Verbindung zu Ihrer Instanz her: + +```bash +ssh root@ +``` + +Ersetzen Sie `` durch die öffentliche IP-Adresse Ihrer Instanz. + +> [primary] +> +> Auf Windows können Sie PowerShell mit SSH oder einen SSH-Client wie [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) verwenden, wenn Sie eine Befehlszeile bevorzugen. +> +> Bei Windows Server mit GUI können Sie auch RDP (Remote Desktop) verwenden. +> + +### Schritt 2: System aktualisieren + +Stellen Sie sicher, dass Ihre Systempakete auf dem neuesten Stand sind: + +> [!tabs] +> Für Debian/Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Für CentOS/RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Für Windows +>> +>> Keine spezifische Systemaktualisierung ist für Windows Exporter erforderlich. Optional können Sie sicherstellen, dass Ihr System über Windows Update auf dem neuesten Stand ist. +>> + +### Schritt 3: Prometheus-Benutzer erstellen (optional) + +Die Erstellung eines dedizierten Benutzers für Node Exporter verbessert die Sicherheit unter Linux, ist aber für Windows Exporter unter Windows optional. + +> [!tabs] +> Für Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Dies erstellt einen Benutzer mit eingeschränkten Berechtigungen, um Node Exporter auszuführen. +>> - Empfohlen für die Produktion, um Sicherheitsrisiken zu reduzieren. +>> - Sie können Node Exporter anschließend unter diesem Benutzer über systemd starten. +>> +> Für Windows +>> +>> > [!primary] +>> > +>> > **Hinweis**: Führen Sie diese PowerShell-Befehle innerhalb der VM über SSH aus. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Node Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Hinweis**: Windows Exporter kann unter dem aktuellen Benutzer laufen. Die Erstellung eines dedizierten Benutzers ist optional, um den Zugriff strikt zu kontrollieren. +>> + +### Schritt 4: Node Exporter / Windows Exporter herunterladen + +> [!tabs] +> Für Linux +>> +>> ```bash +>> # Ersetzen Sie VERSION durch die neueste Version, z. B. 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Für Windows (über SSH/PowerShell in der VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` erfordert PowerShell 3.0 oder neuer. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Alles wird direkt innerhalb der VM durchgeführt, es ist kein Dateitransfer von Ihrem lokalen Rechner erforderlich. +>> + +### Schritt 5: Node Exporter / Windows Exporter ausführen + +> [!tabs] +> Für Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Optional**: Richten Sie einen systemd-Dienst ein, um Node Exporter automatisch auszuführen. +>> - Wenn Sie den dedizierten prometheus-Benutzer verwenden, stellen Sie sicher, dass der Dienst unter diesem Account läuft. +>> +> Für Windows (über SSH/PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> - Auf Desktop oder Core können Sie es direkt in PowerShell ausführen oder es als Windows-Dienst konfigurieren. +>> +>> Es ist möglich, Sammler zu anpassen; siehe die [offizielle Dokumentation](https://github.com/prometheus-community/windows_exporter#collectors) für die vollständige Liste. +>> + +### Schritt 6: Node Exporter / Windows Exporter überprüfen + +> [!primary] +> +> Node Exporter lauscht standardmäßig auf Port 9100. +> +> Windows Exporter lauscht standardmäßig auf Port 9182. +> +> Ersetzen Sie durch 9100 für Linux oder 9182 für Windows. +> + +Der folgende Befehl ermöglicht es Ihnen, Metriken wie CPU, Arbeitsspeicher, Disks- und Netzwerkverwendung zu überwachen: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> Auf Windows Desktop können Sie auch einen Browser öffnen, um dies zu überprüfen. Über SSH/PowerShell verwenden Sie jedoch `curl` oder `Invoke-WebRequest`. +> + +### Schritt 7: Firewall-/Sicherheitsregeln (OVHcloud) + +Stellen Sie sicher, dass der von dem Exporter verwendete Port sowohl in der VM-Firewall als auch in Ihrer OVHcloud Sicherheitsgruppe geöffnet ist. + +Beschränken Sie den Zugriff auf Ihren Prometheus-Server, um die Sicherheit zu gewährleisten. + +> [!tabs] +> Für Linux (Debian/Ubuntu mit UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Hinweis**: Wenn UFW **Status: inactive** anzeigt, bedeutet dies, dass die Firewall auf der VM nicht aktiviert ist. Die Portregel ist hinzugefügt, aber nicht erzwungen. +>> +>> Die Sicherheit wird hauptsächlich über Ihre OVHcloud Sicherheitsgruppe verwaltet. +>> +>> Wenn Sie UFW aktivieren möchten, erlauben Sie zunächst SSH, um nicht ausgeschlossen zu werden: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Für Windows +>> +>> Öffnen Sie Port 9182 in der Windows-Firewall: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> Sie können auch überprüfen: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Schritt 8: Node Exporter / Windows Exporter mit Prometheus verbinden + +1\. Bearbeiten Sie die Prometheus-Konfiguration auf Ihrem Prometheus-Server (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # oder 'windows_exporter' + static_configs: + - targets: [':9100'] # oder 9182 für Windows Exporter +``` + +2\. Laden Sie Prometheus neu: + +> [!tabs] +> Für Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Für Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Die Metriken von Node Exporter / Windows Exporter sollten nun in Prometheus angezeigt werden. + +## Weiterführende Informationen + +[Offizielle Node Exporter-Dokumentation](https://github.com/prometheus/node_exporter) + +[Erstellen und Konfigurieren einer Sicherheitsgruppe in Horizon](/pages/public_cloud/compute/setup_security_group) + +Treten Sie unserer [User Community](/links/community) bei. \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.en-gb.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.en-gb.md new file mode 100644 index 00000000000..0ca3a53ecbb --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.en-gb.md @@ -0,0 +1,251 @@ +--- +title: 'Installing Prometheus Agent on a Public Cloud instance' +excerpt: 'Find out how to install Prometheus Node Exporter or Windows Exporter on an OVHcloud Public Cloud instance to gather metrics' +updated: 2026-01-28 +--- + +## Objective + +Prometheus is a monitoring system and time series database. You can install and use its agent on OVHcloud Public Cloud instances to gather metrics from your servers and applications. + +**Find out how to install the Prometheus Node Exporter or Windows Exporter agent on an OVHcloud Public Cloud instance.** + +> [!warning] +> OVHcloud provides services for which you are responsible with regard to their configuration and management. It is therefore your responsibility to ensure that they function correctly. +> +> This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend contacting a [specialist service provider](/links/partner) or reaching out to [our community](/links/community) if you experience any issues. +> + +## Requirements + +- [An instance created via the OVHcloud Control Panel](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project) +- [Administrative access to the instance](/pages/public_cloud/compute/public-cloud-first-steps) +- A Prometheus server running and reachable from the instance + +## Instructions + +Follow these steps to install the Prometheus Node Exporter or Windows Exporter agent on your OVHcloud Public Cloud instance to collect metrics. + +### Step 1: Connecting to your instance + +Connect to your instance via SSH: + +```bash +ssh root@ +``` + +Replace `` with the public IP address of your instance. + +> [primary] +> +> On Windows, use PowerShell with SSH or an SSH client such as [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) if you prefer using a command-line interface. +> +> For Windows Server with GUI, you can also use RDP (Remote Desktop). +> + +### Step 2: Updating your system + +Make sure your system packages are up to date: + +> [!tabs] +> For Debian/Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> For CentOS/RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> For Windows +>> +>> No system update is required specifically for Windows Exporter. Optionally, ensure your system is up to date via Windows Update. +>> + +### Step 3: Creating a Prometheus user (Optional) + +Creating a dedicated user for Node Exporter improves security on Linux, but is optional for Windows Exporter on Windows. + +> [!tabs] +> For Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - This creates a user with limited permissions to run Node Exporter. +>> - Recommended for production to reduce security risks. +>> - You can then start Node Exporter under this user via systemd. +>> +> For Windows +>> +>> > [!primary] +>> > +>> > **Note**: Run these PowerShell commands inside the VM via SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Node Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Note**: Windows Exporter can run under the current user. Creating a dedicated user is optional for stricter access control. +>> + +### Step 4: Downloading Node Exporter / Windows Exporter + +> [!tabs] +> For Linux +>> +>> ```bash +>> # Replace VERSION with the latest release, e.g., 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> For Windows (via SSH/PowerShell on the VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` requires PowerShell 3.0 or later. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Everything is done directly inside the VM, no need to transfer files from your local machine. +>> + +### Step 5: Running Node Exporter / Windows Exporter + +> [!tabs] +> For Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Optional**: set up a systemd service to run Node Exporter automatically. +>> - If using the dedicated prometheus user, ensure the service runs under this account. +>> +> For Windows (via SSH/PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> - On Desktop or Core, you can run it directly in PowerShell or configure it as a Windows service. +>> +>> It is possible to customize collectors; see the [official documentation](https://github.com/prometheus-community/windows_exporter#collectors) for the full list. +>> + +### Step 6: Verifying Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter listens on port 9100 by default. +> +> Windows Exporter listens on port 9182 by default. +> +> Replace with 9100 for Linux or 9182 for Windows. +> + +The command below allows you to monitor metrics such as CPU, memory, disk, and network usage: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> On Windows Desktop, you can also open a browser to check. However, via SSH/PowerShell, use `curl` or `Invoke-WebRequest`. +> + +### Step 7: Firewall/Security rules (OVHcloud) + +Ensure that the port used by the exporter is open in both the VM firewall and your OVHcloud Security Group. + +Restrict access to only your Prometheus server for security. + +> [!tabs] +> For Linux (Debian/Ubuntu with UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Note**: If UFW shows **Status: inactive**, it means the firewall is not enabled on the VM. The port rule is added but not enforced. +>> +>> Security is mainly handled by your OVHcloud Security Group. +>> +>> If you want UFW active, first allow SSH to avoid being locked out: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> For Windows +>> +>> Open port 9182 in Windows Firewall: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> You can also verify rules via: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Step 8: Connecting Node Exporter / Windows Exporter to Prometheus + +1\. Edit Prometheus config on your Prometheus server (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # or 'windows_exporter' + static_configs: + - targets: [':9100'] # or 9182 for Windows Exporter +``` + +2\. Reload Prometheus: + +> [!tabs] +> For Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> For Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Node Exporter / Windows Exporter metrics from your OVHcloud instance should now appear in Prometheus. + +## Go further + +[Official Node Exporter documentation](https://github.com/prometheus/node_exporter) + +[Creating and configuring a security group in Horizon](/pages/public_cloud/compute/setup_security_group) + +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.es-es.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.es-es.md new file mode 100644 index 00000000000..ac6b05b8900 --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.es-es.md @@ -0,0 +1,252 @@ +--- +title: "Instalar el agente Prometheus en una instancia Public Cloud" +excerpt: "Descubra cómo instalar Prometheus Node Exporter o Windows Exporter en una instancia Public Cloud de OVHcloud para recopilar métricas" +updated: 2026-01-28 +--- + +## Objetivo + +Prometheus es un sistema de supervisión y una base de datos de series temporales. Puede instalar y utilizar su agente en instancias Public Cloud de OVHcloud para recopilar métricas desde sus servidores y aplicaciones. + +**Descubra cómo instalar Prometheus Node Exporter o Windows Exporter en una instancia Public Cloud de OVHcloud.** + +> [!warning] +> +> OVHcloud pone a su disposición servicios cuya responsabilidad recae en usted. En efecto, al no tener acceso a estas máquinas, no somos sus administradores y no podremos brindarle asistencia. Por lo tanto, le corresponde a usted gestionar y asegurar el software de estas diariamente. +> +> Pusimos a su disposición esta guía para ayudarle en las tareas habituales. Sin embargo, le recomendamos encarecidamente que acuda a un [proveedor especializado](/links/partner) si experimenta dificultades o dudas sobre la administración, el uso o la seguridad de un servidor. No dude en visitar nuestro [foro comunitario](/links/community) para intercambiar opiniones con otros usuarios. +> + +## Requisitos + +- [Crear una instancia desde el área de cliente de OVHcloud](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- [Disponer de un acceso administrador a la instancia](/pages/public_cloud/compute/public-cloud-first-steps). +- Un servidor Prometheus en funcionamiento y accesible desde la instancia. + +## Procedimiento + +Siga estos pasos para instalar el agente Prometheus **Node Exporter** o **Windows Exporter** en su instancia Public Cloud de OVHcloud para recopilar métricas. + +### Paso 1: Conectarse a la instancia + +Conéctese a su instancia mediante SSH: + +```bash +ssh root@ +``` + +Reemplace `` por la dirección IP pública de su instancia. + +> [primary] +> +> En Windows, utilice PowerShell con SSH o un cliente SSH como [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) si prefiere utilizar una interfaz de línea de comandos. +> +> Para Windows Server con interfaz gráfica, también puede utilizar el RDP (Remote Desktop). +> + +### Paso 2: Actualizar el sistema + +Asegúrese de que los paquetes de su sistema estén actualizados: + +> [!tabs] +> Para Debian / Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Para CentOS / RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Para Windows +>> +>> No se requiere ninguna actualización específica para Windows Exporter. Puede asegurarse opcionalmente de que el sistema esté actualizado a través de Windows Update. +>> + +### Paso 3: Crear un usuario Prometheus (opcional) + +La creación de un usuario dedicado para Node Exporter mejora la seguridad en Linux, pero es opcional para Windows Exporter en Windows. + +> [!tabs] +> Para Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Esto crea un usuario con permisos limitados para ejecutar Node Exporter. +>> - Recomendado en producción para reducir los riesgos de seguridad. +>> - Puede luego iniciar Node Exporter bajo este usuario a través de systemd. +>> +> Para Windows +>> +>> > [!primary] +>> > +>> > **Nota**: Ejecute estos comandos de PowerShell dentro de la VM a través de SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Windows Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Nota**: Windows Exporter puede ejecutarse con el usuario actual. La creación de un usuario dedicado es opcional para un control de acceso más estricto. +>> + +### Paso 4: Descargar Node Exporter / Windows Exporter + +> [!tabs] +> Para Linux +>> +>> ```bash +>> # Reemplace VERSION por la última versión, por ejemplo 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Para Windows (a través de SSH / PowerShell en la VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` requiere PowerShell 3.0 o superior. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Todo se realiza directamente dentro de la VM, no es necesario transferir archivos desde su máquina local. +>> + +### Paso 5: Iniciar Node Exporter / Windows Exporter + +> [!tabs] +> Para Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Opcional**: configure un servicio systemd para ejecutar Node Exporter automáticamente. +>> - Si utiliza el usuario dedicado prometheus, asegúrese de que el servicio se ejecute bajo este usuario. +>> +> Para Windows (a través de SSH / PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> En Windows Desktop o Core, puede ejecutarlo directamente en PowerShell o configurarlo como servicio de Windows. +>> +>> Es posible personalizar los collectors; consulte la [documentación oficial](https://github.com/prometheus-community/windows_exporter#collectors) para obtener la lista completa. +>> + +### Paso 6: Verificar Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter escucha por defecto en el puerto 9100. +> +> Windows Exporter escucha por defecto en el puerto 9182. +> +> Reemplace `` por 9100 para Linux o 9182 para Windows. +> + +El siguiente comando permite observar métricas como el uso del CPU, la memoria, el disco y la red: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> En Windows Desktop, también puede abrir un navegador para verificar. Sin embargo, a través de SSH / PowerShell, utilice `curl` o `Invoke-WebRequest`. +> + +### Paso 7: Reglas de firewall / seguridad (OVHcloud) + +Asegúrese de que el puerto utilizado por el exporter esté abierto tanto en el firewall de la VM como en su Security Group de OVHcloud. + +Limite el acceso únicamente al servidor Prometheus para mayor seguridad. + +> [!tabs] +> Para Linux (Debian / Ubuntu con UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Nota**: si UFW indica **Status: inactive**, significa que el firewall no está activado en la VM. La regla del puerto se añade pero no se aplica. +>> +>> La seguridad se gestiona principalmente a través de su Security Group de OVHcloud. +>> +>> Si desea activar UFW, comience por autorizar SSH para evitar bloquear su conexión: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Para Windows +>> +>> Abra el puerto 9182 en el firewall de Windows: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> También puede verificar las reglas con: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Paso 8: Conectar Node Exporter / Windows Exporter a Prometheus + +1\. Edite el archivo de configuración de Prometheus en su servidor Prometheus (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # o 'windows_exporter' + static_configs: + - targets: [':9100'] # o 9182 para Windows Exporter +``` + +2\. Recargue Prometheus: + +> [!tabs] +> Para Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Para Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Las métricas de Node Exporter o Windows Exporter de su instancia de OVHcloud deberían aparecer ahora en Prometheus. + +## Más información + +[Documentación oficial de Node Exporter](https://github.com/prometheus/node_exporter) + +[Crear y configurar un grupo de seguridad en Horizon](/pages/public_cloud/compute/setup_security_group) + +Interactúe con nuestra [comunidad de usuarios](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.fr-fr.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.fr-fr.md new file mode 100644 index 00000000000..54ed7471bb3 --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.fr-fr.md @@ -0,0 +1,252 @@ +--- +title: "Installer l’agent Prometheus sur une instance Public Cloud" +excerpt: "Découvrez comment installer Prometheus Node Exporter ou Windows Exporter sur une instance Public Cloud OVHcloud pour collecter des métriques" +updated: 2026-01-28 +--- + +## Objectif + +Prometheus est un système de supervision et une base de données de séries temporelles. Vous pouvez installer et utiliser son agent sur des instances Public Cloud OVHcloud pour collecter des métriques depuis vos serveurs et applications. + +**Découvrez comment installer Prometheus Node Exporter ou Windows Exporter sur une instance Public Cloud OVHcloud.** + +> [!warning] +> +> OVHcloud met à votre disposition des services dont la responsabilité vous revient. En effet, n’ayant aucun accès à ces machines, nous n’en sommes pas les administrateurs et ne pourrons vous fournir d'assistance. Il vous appartient de ce fait d’en assurer la gestion logicielle et la sécurisation au quotidien. +> +> Nous mettons à votre disposition ce guide afin de vous accompagner au mieux sur des tâches courantes. Néanmoins, nous vous recommandons de faire appel à un [prestataire spécialisé](/links/partner) si vous éprouvez des difficultés ou des doutes concernant l’administration, l’utilisation ou la sécurisation d’un serveur. N'hésitez pas à vous rendre sur notre [forum communautaire](/links/community) pour échanger avec d'autres utilisateurs. +> + +## Prérequis + +- [Avoir créé une instance depuis l’espace client OVHcloud](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- [Disposer d’un accès administrateur à l'instance](/pages/public_cloud/compute/public-cloud-first-steps). +- Un serveur Prometheus en fonctionnement et accessible depuis l’instance. + +## En pratique + +Suivez ces étapes pour installer l'agent Prometheus **Node Exporter** ou **Windows Exporter** sur votre instance Public Cloud OVHcloud afin de collecter des métriques. + +### Étape 1 : Se connecter à votre instance + +Connectez-vous à votre instance via SSH : + +```bash +ssh root@ +``` + +Remplacez `` par l’adresse IP publique de votre instance. + +> [primary] +> +> Sous Windows, utilisez PowerShell avec SSH ou un client SSH comme [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) si vous préférez utiliser une interface en ligne de commande. +> +> Pour Windows Server avec interface graphique, vous pouvez également utiliser le RDP (Remote Desktop). +> + +### Étape 2 : Mettre à jour le système + +Assurez-vous que les paquets de votre système sont à jour : + +> [!tabs] +> Pour Debian / Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Pour CentOS / RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Pour Windows +>> +>> Aucune mise à jour spécifique n’est requise pour Windows Exporter. Vous pouvez éventuellement vous assurer que le système est à jour via Windows Update. +>> + +### Étape 3 : Créer un utilisateur Prometheus (optionnel) + +La création d’un utilisateur dédié pour Node Exporter améliore la sécurité sur Linux, mais est optionnelle pour Windows Exporter sur Windows. + +> [!tabs] +> Pour Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Cela crée un utilisateur avec des permissions limitées pour exécuter Node Exporter. +>> - Recommandé en production pour réduire les risques de sécurité. +>> - Vous pouvez ensuite lancer Node Exporter sous cet utilisateur via systemd. +>> +> Pour Windows +>> +>> > [!primary] +>> > +>> > **Note** : Exécutez ces commandes PowerShell à l’intérieur de la VM via SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Windows Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Note** : Windows Exporter peut s’exécuter avec l’utilisateur actuel. La création d’un utilisateur dédié est optionnelle pour un contrôle d’accès plus strict. +>> + +### Étape 4 : Télécharger Node Exporter / Windows Exporter + +> [!tabs] +> Pour Linux +>> +>> ```bash +>> # Remplacez VERSION par la dernière version, par exemple 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Pour Windows (via SSH / PowerShell sur la VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` nécessite PowerShell 3.0 ou supérieur. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Tout se fait directement à l’intérieur de la VM, aucun transfert de fichiers depuis votre machine locale n’est nécessaire. +>> + +### Étape 5 : Lancer Node Exporter / Windows Exporter + +> [!tabs] +> Pour Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Optionnel** : configurez un service systemd pour exécuter Node Exporter automatiquement. +>> - Si vous utilisez l’utilisateur dédié prometheus, assurez-vous que le service s’exécute sous ce compte. +>> +> Pour Windows (via SSH / PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> Sur Windows Desktop ou Core, vous pouvez l’exécuter directement dans PowerShell ou le configurer en tant que service Windows. +>> +>> Il est possible de personnaliser les collectors ; consultez la [documentation officielle](https://github.com/prometheus-community/windows_exporter#collectors) pour obtenir la liste complète. +>> + +### Étape 6 : Vérifier Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter écoute par défaut sur le port 9100. +> +> Windows Exporter écoute par défaut sur le port 9182. +> +> Remplacez `` par 9100 pour Linux ou 9182 pour Windows. +> + +La commande ci-dessous permet d'observer des métriques telles que l’utilisation du CPU, de la mémoire, du disque et du réseau : + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> Sur Windows Desktop, vous pouvez également ouvrir un navigateur pour vérifier. Cependant, via SSH / PowerShell, utilisez `curl` ou `Invoke-WebRequest`. +> + +### Étape 7 : Règles de pare-feu / sécurité (OVHcloud) + +Assurez-vous que le port utilisé par l’exporter est ouvert à la fois dans le pare-feu de la VM et dans votre Security Group OVHcloud. + +Limitez l’accès uniquement au serveur Prometheus pour plus de sécurité. + +> [!tabs] +> Pour Linux (Debian / Ubuntu avec UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Note** : si UFW indique **Status: inactive**, cela signifie que le pare-feu n’est pas activé sur la VM. La règle de port est ajoutée mais pas appliquée. +>> +>> La sécurité est principalement gérée par votre Security Group OVHcloud. +>> +>> Si vous souhaitez activer UFW, commencez par autoriser SSH pour éviter de bloquer votre connexion : +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Pour Windows +>> +>> Ouvrez le port 9182 dans le pare-feu Windows : +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> Vous pouvez également vérifier les règles avec : +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Étape 8 : Connecter Node Exporter / Windows Exporter à Prometheus + +1\. Éditez le fichier de configuration de Prometheus sur votre serveur Prometheus (prometheus.yml) : + +```yaml +scrape_configs: + - job_name: 'node_exporter' # ou 'windows_exporter' + static_configs: + - targets: [':9100'] # ou 9182 pour Windows Exporter +``` + +2\. Rechargez Prometheus : + +> [!tabs] +> Pour Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Pour Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Les métriques Node Exporter ou Windows Exporter de votre instance OVHcloud devraient maintenant apparaître dans Prometheus. + +## Aller plus loin + +[Documentation officielle de Node Exporter](https://github.com/prometheus/node_exporter) + +[Créer et configurer un groupe de sécurité dans Horizon](/pages/public_cloud/compute/setup_security_group) + +Échangez avec notre [communauté d’utilisateurs](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.it-it.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.it-it.md new file mode 100644 index 00000000000..4fb16ed573d --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.it-it.md @@ -0,0 +1,252 @@ +--- +title: "Installare l'agente Prometheus su un'istanza Public Cloud" +excerpt: "Scopri come installare Prometheus Node Exporter o Windows Exporter su un'istanza Public Cloud OVHcloud per raccogliere metriche" +updated: 2026-01-28 +--- + +## Obiettivo + +Prometheus è un sistema di monitoraggio e un database di serie temporali. È possibile installare e utilizzare il suo agente su istanze Public Cloud OVHcloud per raccogliere metriche dai propri server e applicazioni. + +**Scopri come installare Prometheus Node Exporter o Windows Exporter su un'istanza Public Cloud OVHcloud.** + +> [!warning] +> +> OVHcloud mette a disposizione servizi la cui responsabilità è vostra. Essendo noi privi di accesso a tali macchine, non ne siamo gli amministratori e non potremo fornire alcun supporto. È quindi a voi che compete la gestione software e la sicurezza quotidiana. +> +> Mettiamo a disposizione questa guida per accompagnarvi al meglio in attività comuni. Tuttavia, vi consigliamo di contattare un [fornitore specializzato](/links/partner) in caso di difficoltà o dubbi riguardo all'amministrazione, all'utilizzo o alla sicurezza di un server. Non esitate a visitare il nostro [forum comunitario](/links/community) per interagire con altri utenti. +> + +## Prerequisiti + +- [Creare un'istanza dallo Spazio Cliente OVHcloud](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- [Disporre di un accesso amministratore all'istanza](/pages/public_cloud/compute/public-cloud-first-steps). +- Un server Prometheus in esecuzione e accessibile dall'istanza. + +## Procedura + +Segui questi passaggi per installare l'agente Prometheus **Node Exporter** o **Windows Exporter** sulla tua istanza Public Cloud OVHcloud per raccogliere metriche. + +### Passo 1: Connettersi all'istanza + +Connettiti all'istanza tramite SSH: + +```bash +ssh root@ +``` + +Sostituisci `` con l'indirizzo IP pubblico della tua istanza. + +> [primary] +> +> Su Windows, utilizza PowerShell con SSH o un client SSH come [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) se preferisci utilizzare un'interfaccia a riga di comando. +> +> Per Windows Server con interfaccia grafica, puoi anche utilizzare il RDP (Remote Desktop). +> + +### Passo 2: Aggiornare il sistema + +Assicurati che i pacchetti del tuo sistema siano aggiornati: + +> [!tabs] +> Per Debian / Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Per CentOS / RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Per Windows +>> +>> Non è richiesto alcun aggiornamento specifico per Windows Exporter. Puoi eventualmente verificare che il sistema sia aggiornato tramite Windows Update. +>> + +### Passo 3: Creare un utente Prometheus (opzionale) + +La creazione di un utente dedicato per Node Exporter migliora la sicurezza su Linux, ma è opzionale per Windows Exporter su Windows. + +> [!tabs] +> Per Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Questo crea un utente con permessi limitati per eseguire Node Exporter. +>> - Consigliato in produzione per ridurre i rischi di sicurezza. +>> - È possibile quindi avviare Node Exporter sotto questo utente tramite systemd. +>> +> Per Windows +>> +>> > [!primary] +>> > +>> > **Nota**: Esegui questi comandi PowerShell all'interno della VM tramite SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Windows Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Nota**: Windows Exporter può essere eseguito con l'utente corrente. La creazione di un utente dedicato è opzionale per un controllo degli accessi più rigoroso. +>> + +### Passo 4: Scaricare Node Exporter / Windows Exporter + +> [!tabs] +> Per Linux +>> +>> ```bash +>> # Sostituisci VERSION con l'ultima versione, ad esempio 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Per Windows (tramite SSH / PowerShell sulla VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` richiede PowerShell 3.0 o superiore. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Tutto avviene direttamente all'interno della VM, non è necessario trasferire file dalla tua macchina locale. +>> + +### Passo 5: Avviare Node Exporter / Windows Exporter + +> [!tabs] +> Per Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Opzionale**: Configura un servizio systemd per eseguire Node Exporter automaticamente. +>> - Se utilizzi l'utente dedicato prometheus, assicurati che il servizio venga eseguito con questo account. +>> +> Per Windows (tramite SSH / PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> Su Windows Desktop o Core, puoi eseguirlo direttamente in PowerShell o configurarlo come servizio Windows. +>> +>> È possibile personalizzare i collector; consulta la [documentazione ufficiale](https://github.com/prometheus-community/windows_exporter#collectors) per ottenere l'elenco completo. +>> + +### Passo 6: Verificare Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter ascolta di default sulla porta 9100. +> +> Windows Exporter ascolta di default sulla porta 9182. +> +> Sostituisci `` con 9100 per Linux o 9182 per Windows. +> + +Il comando seguente permette di osservare metriche come l'utilizzo della CPU, della memoria, del disco e della rete: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> Su Windows Desktop, puoi anche aprire un browser per verificare. Tuttavia, tramite SSH / PowerShell, utilizza `curl` o `Invoke-WebRequest`. +> + +### Passo 7: Regole del firewall / sicurezza (OVHcloud) + +Assicurati che la porta utilizzata dall'exporter sia aperta sia nel firewall della VM che nel tuo Security Group OVHcloud. + +Limita l'accesso esclusivamente al server Prometheus per maggiore sicurezza. + +> [!tabs] +> Per Linux (Debian / Ubuntu con UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Nota**: se UFW indica **Status: inactive**, significa che il firewall non è attivo sulla VM. La regola della porta è aggiunta ma non applicata. +>> +>> La sicurezza è principalmente gestita dal tuo Security Group OVHcloud. +>> +>> Se desideri attivare UFW, inizia autorizzando SSH per evitare di bloccare la tua connessione: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Per Windows +>> +>> Apri la porta 9182 nel firewall Windows: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> Puoi anche verificare le regole con: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Passo 8: Connettere Node Exporter / Windows Exporter a Prometheus + +1\. Modifica il file di configurazione di Prometheus sul tuo server Prometheus (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # o 'windows_exporter' + static_configs: + - targets: [':9100'] # o 9182 per Windows Exporter +``` + +2\. Ricarica Prometheus: + +> [!tabs] +> Per Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Per Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Le metriche Node Exporter o Windows Exporter della tua istanza OVHcloud dovrebbero ora apparire in Prometheus. + +## Per saperne di più + +[Documentazione ufficiale di Node Exporter](https://github.com/prometheus/node_exporter) + +[Creare e configurare un gruppo di sicurezza in Horizon](/pages/public_cloud/compute/setup_security_group) + +Contatta la nostra [Community di utenti](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pl-pl.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pl-pl.md new file mode 100644 index 00000000000..3d9811e698b --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pl-pl.md @@ -0,0 +1,252 @@ +--- +title: 'Instalacja agenta Prometheus na instancji Public Cloud' +excerpt: 'Dowiedz się, jak zainstalować Prometheus Node Exporter lub Windows Exporter na instancji OVHcloud Public Cloud, aby zbierać metryki' +updated: 2026-01-28 +--- + +## Wprowadzenie + +Prometheus to system monitorowania i baza danych szeregów czasowych. Możesz zainstalować i używać jego agenta na instancjach OVHcloud Public Cloud, aby zbierać metryki z Twoich serwerów i aplikacji. + +**Dowiedz się, jak zainstalować Prometheus Node Exporter lub Windows Exporter na instancji OVHcloud Public Cloud.** + +> [!warning] +> +> OVHcloud oferuje usługi, za które odpowiadasz samodzielnie. Faktycznie, ponieważ nie mamy dostępu administracyjnego do tych maszyn, nie jesteśmy administratorami i nie możemy udzielić wsparcia. Oznacza to, że Ty odpowiadasz za zarządzanie oprogramowaniem i bezpieczeństwem na co dzień. +> +> Udostępniliśmy Ci ten przewodnik, aby pomóc Ci w wykonywaniu typowych zadań. Jednak zalecamy kontakt z [specjalistycznym dostawcą](/links/partner), jeśli doświadczysz jakichkolwiek trudności lub wątpliwości dotyczących administracji, użycia lub bezpieczeństwa serwera. Zapraszamy również do odwiedzenia naszego [forum społecznościowego](/links/community), aby porozmawiać z innymi użytkownikami. +> + +## Wymagania początkowe + +- [Instancja utworzona za pomocą Panelu klienta OVHcloud](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- [Dostęp administracyjny do instancji](/pages/public_cloud/compute/public-cloud-first-steps). +- Uruchomiony serwer Prometheus, który jest dostępny z instancji. + +## W praktyce + +Postępuj zgodnie z poniższymi krokami, aby zainstalować agenta Prometheus Node Exporter lub Windows Exporter na Twojej instancji OVHcloud Public Cloud i zbierać metryki. + +### Krok 1: Połączenie z instancją + +Połącz się z instancją za pomocą SSH: + +```bash +ssh root@ +``` + +Zastąp `` publicznym adresem IP Twojej instancji. + +> [primary] +> +> Na Windowsie użyj PowerShell z SSH lub klienta SSH, takiego jak [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows), jeśli preferujesz interfejs wiersza poleceń. +> +> Dla Windows Server z GUI możesz również użyć RDP (Remote Desktop). +> + +### Krok 2: Aktualizacja systemu + +Upewnij się, że pakiety systemowe są aktualne: + +> [!tabs] +> Dla Debian/Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Dla CentOS/RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Dla Windows +>> +>> Nie jest wymagana specjalna aktualizacja systemu dla Windows Exporter. Opcjonalnie upewnij się, że system jest aktualny za pomocą Windows Update. +>> + +### Krok 3: Tworzenie użytkownika Prometheus (opcjonalnie) + +Tworzenie dedykowanego użytkownika dla Node Exporter poprawia bezpieczeństwo na systemach Linux, ale jest opcjonalne dla Windows Exporter na Windows. + +> [!tabs] +> Dla Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Tworzy użytkownika z ograniczonymi uprawnieniami do uruchamiania Node Exporter. +>> - Zalecane w środowisku produkcyjnym, aby zminimalizować ryzyko bezpieczeństwa. +>> - Możesz następnie uruchomić Node Exporter pod tym użytkownikiem za pomocą systemd. +>> +> Dla Windows +>> +>> > [!primary] +>> > +>> > **Uwaga**: Uruchom te polecenia PowerShell wewnątrz maszyny wirtualnej za pomocą SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Node Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Uwaga**: Windows Exporter może działać pod bieżącym użytkownikiem. Tworzenie dedykowanego użytkownika jest opcjonalne, aby uzyskać ścisłą kontrolę dostępu. +>> + +### Krok 4: Pobieranie Node Exporter / Windows Exporter + +> [!tabs] +> Dla Linux +>> +>> ```bash +>> # Zastąp VERSION najnowszą wersją, np. 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Dla Windows (za pomocą SSH/PowerShell na maszynie wirtualnej) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` wymaga PowerShell 3.0 lub nowszego. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Wszystko jest wykonywane bezpośrednio wewnątrz maszyny wirtualnej, nie ma potrzeby przenoszenia plików z Twojego komputera. +>> + +### Krok 5: Uruchamianie Node Exporter / Windows Exporter + +> [!tabs] +> Dla Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Opcjonalnie**: skonfiguruj usługę systemd, aby Node Exporter działał automatycznie. +>> - Jeśli używasz dedykowanego użytkownika prometheus, upewnij się, że usługa działa pod tym kontem. +>> +> Dla Windows (za pomocą SSH/PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> - Na Desktop lub Core możesz uruchomić go bezpośrednio w PowerShell lub skonfigurować go jako usługę Windows. +>> +>> Możesz dostosować kolekcjonery; zobacz [oficjalną dokumentację](https://github.com/prometheus-community/windows_exporter#collectors) dla pełnej listy. +>> + +### Krok 6: Weryfikacja Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter domyślnie nasłuchuje na porcie 9100. +> +> Windows Exporter domyślnie nasłuchuje na porcie 9182. +> +> Zastąp numerem 9100 dla systemu Linux lub 9182 dla Windows. +> + +Poniższe polecenie pozwala monitorować metryki takie jak CPU, pamięć, dysk i użycie sieci: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> Na Windows Desktop możesz również otworzyć przeglądarkę, aby sprawdzić. Jednak za pomocą SSH/PowerShell użyj `curl` lub `Invoke-WebRequest`. +> + +### Krok 7: Reguły zapory / bezpieczeństwa (OVHcloud) + +Upewnij się, że port używany przez eksportera jest otwarty zarówno w zaporze maszyny wirtualnej, jak i w Twojej grupie bezpieczeństwa OVHcloud. + +Ogranicz dostęp tylko do swojego serwera Prometheus, aby zapewnić bezpieczeństwo. + +> [!tabs] +> Dla Linux (Debian/Ubuntu z UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Uwaga**: Jeśli UFW pokazuje **Status: inactive**, oznacza to, że zapora nie jest włączona na maszynie wirtualnej. Reguła portu jest dodana, ale nie jest stosowana. +>> +>> Bezpieczeństwo głównie jest obsługiwane przez Twoją grupę bezpieczeństwa OVHcloud. +>> +>> Jeśli chcesz, aby UFW był aktywny, najpierw zezwól na SSH, aby uniknąć zablokowania dostępu: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Dla Windows +>> +>> Otwórz port 9182 w Windows Firewall: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> Możesz również sprawdzić reguły za pomocą: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Krok 8: Połączenie Node Exporter / Windows Exporter z Prometheus + +1\. Edytuj konfigurację Prometheus na swoim serwerze Prometheus (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # lub 'windows_exporter' + static_configs: + - targets: [':9100'] # lub 9182 dla Windows Exporter +``` + +2\. Załaduj ponownie Prometheus: + +> [!tabs] +> Dla Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Dla Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. Metryki Node Exporter / Windows Exporter z Twojej instancji OVHcloud powinny teraz być widoczne w Prometheus. + +## Sprawdź również + +[Dokumentacja oficjalna Node Exporter](https://github.com/prometheus/node_exporter) + +[Tworzenie i konfigurowanie grupy bezpieczeństwa w Horizon](/pages/public_cloud/compute/setup_security_group) + +Dołącz do [grona naszych użytkowników](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pt-pt.md b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pt-pt.md new file mode 100644 index 00000000000..d82cab0c367 --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/guide.pt-pt.md @@ -0,0 +1,252 @@ +--- +title: "Instalar o agente Prometheus numa instância Public Cloud" +excerpt: "Descubra como instalar Prometheus Node Exporter ou Windows Exporter numa instância Public Cloud OVHcloud para recolher métricas" +updated: 2026-01-28 +--- + +## Objetivo + +Prometheus é um sistema de supervisão e uma base de dados de séries temporais. Pode instalar e utilizar o seu agente em instâncias Public Cloud OVHcloud para recolher métricas a partir dos seus servidores e aplicações. + +**Descubra como instalar Prometheus Node Exporter ou Windows Exporter numa instância Public Cloud OVHcloud.** + +> [!warning] +> +> A OVHcloud coloca à sua disposição serviços cuja responsabilidade é sua. De fato, não tendo acesso a estas máquinas, não somos os seus administradores e não poderemos prestar assistência. É, portanto, da sua responsabilidade gerir e assegurar a segurança do software diariamente. +> +> Colocamos à sua disposição este guia para o ajudar no melhor possível com tarefas correntes. No entanto, recomendamos que contacte um [fornecedor especializado](/links/partner) se tiver dificuldades ou dúvidas em relação à administração, utilização ou segurança de um servidor. Não hesite em visitar o nosso [fórum comunitário](/links/community) para trocar informações com outros utilizadores. +> + +## Requisitos + +- [Criar uma instância a partir da Área de Cliente OVHcloud](/pages/public_cloud/public_cloud_cross_functional/create_a_public_cloud_project). +- [Dispor de um acesso administrador à instância](/pages/public_cloud/compute/public-cloud-first-steps). +- Um servidor Prometheus em funcionamento e acessível a partir da instância. + +## Instruções + +Siga estes passos para instalar o agente Prometheus **Node Exporter** ou **Windows Exporter** na sua instância Public Cloud OVHcloud para recolher métricas. + +### Passo 1: Conectar-se à sua instância + +Conecte-se à sua instância via SSH: + +```bash +ssh root@ +``` + +Substitua `` pelo endereço IP público da sua instância. + +> [primary] +> +> Em Windows, utilize o PowerShell com SSH ou um cliente SSH como [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) se preferir utilizar uma interface de linha de comandos. +> +> Para Windows Server com interface gráfica, também pode utilizar o RDP (Remote Desktop). +> + +### Passo 2: Atualizar o sistema + +Certifique-se de que os pacotes do seu sistema estão atualizados: + +> [!tabs] +> Para Debian / Ubuntu +>> +>> ```bash +>> sudo apt update && sudo apt upgrade -y +>> ``` +>> +> Para CentOS / RHEL +>> +>> ```bash +>> sudo yum update -y +>> ``` +>> +> Para Windows +>> +>> Não é necessária nenhuma atualização específica para Windows Exporter. Pode eventualmente garantir que o sistema está atualizado através do Windows Update. +>> + +### Passo 3: Criar um utilizador Prometheus (opcional) + +A criação de um utilizador dedicado para Node Exporter melhora a segurança em Linux, mas é opcional para Windows Exporter em Windows. + +> [!tabs] +> Para Linux +>> +>> ```bash +>> sudo useradd --no-create-home --shell /bin/false prometheus +>> ``` +>> +>> - Isto cria um utilizador com permissões limitadas para executar Node Exporter. +>> - Recomendado em produção para reduzir os riscos de segurança. +>> - Pode, em seguida, iniciar Node Exporter sob este utilizador através do systemd. +>> +> Para Windows +>> +>> > [!primary] +>> > +>> > **Nota**: Execute estes comandos PowerShell dentro da VM através de SSH. +>> > +>> +>> ```powershell +>> New-LocalUser "prometheus" -NoPassword -Description "User for Windows Exporter" +>> +>> Add-LocalGroupMember -Group "Users" -Member "prometheus" +>> ``` +>> +>> **Nota**: Windows Exporter pode ser executado com o utilizador atual. A criação de um utilizador dedicado é opcional para um controlo de acesso mais estrito. +>> + +### Passo 4: Transferir Node Exporter / Windows Exporter + +> [!tabs] +> Para Linux +>> +>> ```bash +>> # Substitua VERSION pela versão mais recente, por exemplo 1.10.2 +>> VERSION="1.10.2" +>> wget https://github.com/prometheus/node_exporter/releases/download/v$VERSION/node_exporter-$VERSION.linux-amd64.tar.gz +>> tar xvf node_exporter-$VERSION.linux-amd64.tar.gz +>> cd node_exporter-$VERSION.linux-amd64 +>> ``` +>> +> Para Windows (através de SSH / PowerShell na VM) +>> +>> > [!primary] +>> > +>> > `Invoke-WebRequest` requer PowerShell 3.0 ou superior. +>> > +>> +>> ```powershell +>> mkdir C:\windows_exporter +>> cd C:\windows_exporter +>> +>> Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.msi" -OutFile "windows_exporter.msi" +>> ``` +>> +>> Tudo é feito diretamente dentro da VM, não sendo necessário transferir ficheiros a partir da sua máquina local. +>> + +### Passo 5: Iniciar Node Exporter / Windows Exporter + +> [!tabs] +> Para Linux +>> +>> ```bash +>> ./node_exporter +>> ``` +>> +>> - **Opcional**: configure um serviço systemd para executar Node Exporter automaticamente. +>> - Se utilizar o utilizador dedicado prometheus, certifique-se de que o serviço é executado sob esta conta. +>> +> Para Windows (através de SSH / PowerShell) +>> +>> ```powershell +>> msiexec /i windows_exporter.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,net,os,service,system,textfile /qn +>> ``` +>> +>> Em Windows Desktop ou Core, pode executá-lo diretamente no PowerShell ou configurá-lo como um serviço Windows. +>> +>> É possível personalizar os collectors; consulte a [documentação oficial](https://github.com/prometheus-community/windows_exporter#collectors) para obter a lista completa. +>> + +### Passo 6: Verificar Node Exporter / Windows Exporter + +> [!primary] +> +> Node Exporter escuta por padrão na porta 9100. +> +> Windows Exporter escuta por padrão na porta 9182. +> +> Substitua `` por 9100 para Linux ou 9182 para Windows. +> + +O comando seguinte permite observar métricas como a utilização da CPU, memória, disco e rede: + +```bash +curl http://:/metrics +``` + +> [!primary] +> +> Em Windows Desktop, também pode abrir um navegador para verificar. No entanto, através de SSH / PowerShell, utilize `curl` ou `Invoke-WebRequest`. +> + +### Passo 7: Regras de firewall / segurança (OVHcloud) + +Certifique-se de que a porta utilizada pelo exporter está aberta tanto no firewall da VM como no seu Security Group OVHcloud. + +Limite o acesso apenas ao servidor Prometheus para maior segurança. + +> [!tabs] +> Para Linux (Debian / Ubuntu com UFW) +>> +>> ```bash +>> sudo ufw allow 9100/tcp +>> sudo ufw status +>> ``` +>> +>> **Nota**: se UFW indicar **Status: inactive**, isso significa que o firewall não está ativado na VM. A regra da porta é adicionada mas não aplicada. +>> +>> A segurança é principalmente gerida pelo seu Security Group OVHcloud. +>> +>> Se quiser ativar UFW, comece por autorizar SSH para evitar bloquear a sua ligação: +>> +>> ```bash +>> sudo ufw allow ssh +>> sudo ufw enable +>> sudo ufw status +>> ``` +>> +> Para Windows +>> +>> Abra a porta 9182 no firewall do Windows: +>> +>> ```powershell +>> netsh advfirewall firewall add rule name="Windows Exporter" dir=in action=allow protocol=TCP localport=9182 +>> ``` +>> +>> Também pode verificar as regras com: +>> +>> ```powershell +>> netsh advfirewall firewall show rule name=all | findstr "9182" +>> ``` +>> + +### Passo 8: Conectar Node Exporter / Windows Exporter a Prometheus + +1\. Edite o ficheiro de configuração de Prometheus no seu servidor Prometheus (prometheus.yml): + +```yaml +scrape_configs: + - job_name: 'node_exporter' # ou 'windows_exporter' + static_configs: + - targets: [':9100'] # ou 9182 para Windows Exporter +``` + +2\. Recarregue Prometheus: + +> [!tabs] +> Para Linux +>> +>> ```bash +>> sudo systemctl reload prometheus +>> ``` +>> +> Para Windows +>> +>> ```powershell +>> sc stop prometheus +>> sc start prometheus +>> ``` +>> + +3\. As métricas Node Exporter ou Windows Exporter da sua instância OVHcloud devem agora aparecer em Prometheus. + +## Quer saber mais? + +[Documentação oficial de Node Exporter](https://github.com/prometheus/node_exporter) + +[Criar e configurar um grupo de segurança no Horizon](/pages/public_cloud/compute/setup_security_group) + +Fale com a nossa [comunidade de utilizadores](/links/community). \ No newline at end of file diff --git a/pages/public_cloud/compute/install_prometheus_agent_on_instance/meta.yaml b/pages/public_cloud/compute/install_prometheus_agent_on_instance/meta.yaml new file mode 100644 index 00000000000..6b10f55acb7 --- /dev/null +++ b/pages/public_cloud/compute/install_prometheus_agent_on_instance/meta.yaml @@ -0,0 +1,3 @@ +id: e8f273c1-b77c-497f-8730-12b8f4924f59 +full_slug: public-cloud-compute-install-prometheus-agent +translation_banner: true \ No newline at end of file