New Data Center in Spain: Bare Metal & VPS — Ryzen / EPYC / Xeon Gold ⭐ Best Price on the Market!
EN
Currency:
EUR – €
Choose a currency
  • Euro EUR – €
  • United States dollar USD – $
VAT:
OT 0%
Choose your country (VAT)
  • OT All others 0%
Choose a language
  • Choose a currency
    Choose you country (VAT)
    Dedicated Servers
  • Instant
  • Custom
  • Single CPU servers
  • Dual CPU servers
  • Servers with 4th Gen EPYC
  • Servers with AMD Ryzen and Intel Core i9
  • Storage Servers
  • Servers with 10Gbps ports
  • Hosting virtualization nodes
  • GPU
  • Sale
  • Virtual Servers
  • Instant VPS & VDS
  • Hosting with ispmanager
  • Hosting with cPanel
  • GPU
  • Dedicated GPU server
  • VM with GPU
  • Tesla A100 80GB & H100 Servers
  • Nvidia RTX 5090
  • GPU servers equipped with AMD Radeon
  • Sale
    Apps
    Colocation
  • Colocation in the Netherlands
  • Remote smart hands
  • Services
  • L3-L4 DDoS Protection
  • Network equipment
  • IPv4 and IPv6 address
  • Managed servers
  • SLA packages for technical support
  • Monitoring
  • Software
  • VLAN
  • Announcing your IP or AS (BYOIP)
  • USB flash/key/flash drive
  • Traffic
  • Hardware delivery for EU data centers
  • AI Chatbot Lite
  • AI Platform
  • About
  • Careers at HOSTKEY
  • Server Control Panel & API
  • Data Centers
  • Network
  • Speed test
  • Hot deals
  • Sales contact
  • Reseller program
  • Affiliate Program
  • Grants for winners
  • Grants for scientific projects and startups
  • News
  • Our blog
  • Payment terms and methods
  • Legal
  • Abuse
  • Looking Glass
  • The KYC Verification
  • Hot Deals

    31.10.2022

    Monitoring Linux Services with Prometheus

    server one
    HOSTKEY
    Rent dedicated and virtual servers with instant deployment in reliable TIER III class data centers in the Netherlands and the USA. Free protection against DDoS attacks included, and your server will be ready for work in as little as 15 minutes. 24/7 Customer Support.

    Author: Senior Devops. Hostkey Lead Infrastructure Specialist Nikita Zubarev

    In the last article we talked about how to set up metric collection and the display alerts to monitor services using Prometheus. However, during the process, the question arose of how to monitor individual services on Linux servers. For example, in one of our previous articles, we described the case of using Ovirt web consoles using Apache Guacamole. Now let's look at how to organize the monitoring of services on Linux machines.

    Guacamole is a cross-platform remote desktop gateway that requires Apache Tomcat and Guacd to run.

    Open the service created for node_exporter:

    /usr/lib/systemd/system/node_exporter.service

    [Unit]
    
    Description=Prometheus exporter for machine metrics, written in Go with pluggable metric collectors.
    Documentation=https://github.com/prometheus/node_exporter
    After=network.target
    
    
    [Service]
    
    EnvironmentFile=-/etc/default/node_exporter
    User=root
    ExecStart=/usr/bin/node_exporter $NODE_EXPORTER_OPTS
    Restart=on-failure
    RestartSec=5s
    
    [Install]
    
    WantedBy=multi-user.target
    
    by default, $NODE_EXPORTER_OPTS is loaded from the file:
    # /etc/default/node_exporter
    
    
    If necessary, we can either monitor individual services by adding the collector.systemd.unit-whitelist option:
    
    #NODE_EXPORTER_OPTS="--collector.systemd --collector.systemd.unit-whitelist="(tomcat|guacd).service""

    After restarting the service, we get the metric on node_exporter:

    All you need to do is describe the rule for the alert:

    - alert: guacd_service
    	expr: node_systemd_unit_state{name="guacd.service",state="active"} == 0
    	for: 1s
    	annotations:
    		summary: "Instance {{ $labels.instance }} is down"
    		description: "{{ $labels.instance }} of job {{ $labels.job }} is down."
    - alert: tomcat_service
    	expr: node_systemd_unit_state{name="tomcat.service",state="active"} == 0
    	for: 1s
    	annotations:
    		summary: "Instance {{ $labels.instance }} is down"
    		description: "{{ $labels.instance }} of job {{ $labels.job }} is down."
    

    An example of an alert on the Alertmanager dashboard in Grafana:

    Conclusions

    In this short article, we looked at how services are monitored on Linux machines.This solution allows you to monitor the work of any system server and greatly simplifies the administration of server hardware. In the next article, we will explain how you should not display the basic parameters that the exporter returns.

    Rent dedicated and virtual servers with instant deployment in reliable TIER III class data centers in the Netherlands and the USA. Free protection against DDoS attacks included, and your server will be ready for work in as little as 15 minutes. 24/7 Customer Support.

    Other articles

    22.05.2025

    Comparison of Server Parameters and Hosting Providers for Validating Blockchain Transactions Using Solana as an Example

    Which server is best for running a Blockchain validator? Learn the optimal CPU, RAM, and storage specs for high-performance blockchain validation.

    25.04.2025

    More 5090 – more problems? Testing a dual NVIDIA GPU setup

    Dual RTX 5090 server: Scaling performance or multiplying problems in AI tasks?

    25.03.2025

    Jensen Huang, seriously!? Testing the NVIDIA RTX 5090 in AI workflows

    The new GeForce RTX 5090 was promised to be a breakthrough for AI tasks. We put it to the test with real-world benchmarking — speed improved, but without issues. Find out how well the 5090 lived up to the hype!

    14.03.2025

    Automated Markdown Translation from the Command Line: Ollama and OpenWebUI API

    Ready to accelerate your localization process? Use Ollam and the OpenWebUI API in the command line, write a bash script, tune your prompts—and streamline your workflow!

    27.02.2025

    How to Add Mods to an ARK Dedicated Server: Full Guide

    Hosting an ARK server? Learn how to install, configure, and troubleshoot mods — the easy way.

    Upload