Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Prometheus monitors liunx host

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Exporter is used in liunx basic resource monitoring

What is exporter?

Exporter is a component that collects monitoring data and provides data through prometheus monitoring. Exporter mainly obtains monitoring data through monitoring-related interfaces provided by monitored objects.

Installation and deployment

Wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz

Install to the corresponding directory

Make standard startup service

Cat / etc/systemd/system/node_ exporter.service[Unit] Description=node_ export[Service] ExecStart=/op/xxx/node_ export[Install] WantedBy=multi-user.target

Start

Systemctl enable node_exporter.service

Systemctl start node_exporter.service

Add host information in prometheus server

Scrape_configs: # The job name is added as a label `job= `to any timeseries scraped from this config. -job_name: 'shanghai' static_configs:-targets: [' x.x.x.xblog 90'] relabel_configs:-action: replace source_labels: ['job'] regex: (. *) replacement: $1 target_label: idc-job_name:' node1' static_configs:-targets: ['x.x.x.xpur9100']

Restart prometheus or reload the configuration file kill-hup $pid

Check whether the monitoring is in effect

Common monitoring items in exporter

Node_disk disk

Node_cpu cpu

Node_memory memory

Node_network network

Node_load1 system load

Commonly used query statements

Cpu utilization rate

Avg by (instance) (irate (node_cpu {instance= "xxx:9100", mode= "idle"} [5m])) * 100)

Average machine load

Network card receiving

Sum (rate (node_network_receive_bytes_total {instance= "xxx:9100", job= "server", lo = "lo"} [5m]))

Output of network card

Sum (rate (node_network_transmit_bytes {instance= "xxx:9100", job= "server", lo = "lo"} [5m]))

System load

Node_load1 {instance= "xxx:9100"} / / 1 minute load

Node_load5 {instance= "xxx:9100"} / / 5-minute load

Node_load15 {instance= "xxx:9100"} / / 15-minute load

Memory utilization

Round ((node_memory_MemTotal_bytes- (node_memory_MemFree_bytes+node_memory_Buffers_bytes+node_memory_Cached_bytes)) / node_memory_MemTotal_bytes * 100)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report