prometheus监控linux系统-node_exporter

本文涉及的产品
EMR Serverless StarRocks,5000CU*H 48000GB*H
可观测监控 Prometheus 版,每月50GB免费额度
简介: prometheus监控linux系统-node_exporter

prometheus安装教程 已经了解到了如何安装prometheus

node_exporter安装

node_exporter可以采集主机信息(服务器信息)

下载地址:

https://github.com/prometheus/node_exporter/releases

wget  https://github.com/prometheus/node\_exporter/releases/download/v1.3.1/node\_exporter-1.3.1.linux-amd64.tar.gz
tar -zvxf node_exporter-1.3.1.linux-amd64.tar.gz
cd node_exporter-1.3.1.linux-amd64/

启动

\[root@localhost node\_exporter-1.3.1.linux-amd64\]# ./node\_exporter 
ts=2022-06-07T05:47:29.871Z caller=node\_exporter.go:182 level=info msg="Starting node\_exporter" version="(version=1.3.1, branch=HEAD, revision=a2321e7b940ddcff26873612bccdf7cd4c42b6b6)"
ts=2022-06-07T05:47:29.871Z caller=node\_exporter.go:183 level=info msg="Build context" build\_context="(go=go1.17.3, user=root@243aafa5525c, date=20211205-11:09:49)"
ts=2022-06-07T05:47:29.871Z caller=node_exporter.go:185 level=warn msg="Node Exporter is running as root user. This exporter is designed to run as unpriviledged user, root is not required."
ts=2022-06-07T05:47:29.871Z caller=filesystem_common.go:111 level=info collector=filesystem msg="Parsed flag --collector.filesystem.mount-points-exclude" flag=^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+)($|/)
ts=2022-06-07T05:47:29.871Z caller=filesystem\_common.go:113 level=info collector=filesystem msg="Parsed flag --collector.filesystem.fs-types-exclude" flag=^(autofs|binfmt\_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:108 level=info msg="Enabled collectors"
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=arp
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=bcache
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=bonding
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=btrfs
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=conntrack
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=cpu
ts=2022-06-07T05:47:29.872Z caller=node_exporter.go:115 level=info collector=cpufreq

设置为系统服务

vi /etc/systemd/system/node_exporter.service
\[Unit\]
Description=node-exporter
\[Service\]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/node\_exporter/node\_exporter
\[Install\]
WantedBy=multi-user.target

启动:

systemctl start node_exporter
 systemctl status node_exporter
 systemctl enable node_exporter

配置prometheus

在prometheus.yml上新增监控节点:

- job_name: 'my-home-linux'
    static_configs:
      - targets:
          - 'localhost:9100'

重启prometheus,即可看到服务器信息

目录
相关文章
|
10天前
|
Linux Windows
Linux01---目录结构,Linux系统下只有一个最顶级的树/,Windows系统有盘符概念,而Linux系统没有盘符概念,整个系统都在/根目录下,Linux 系统写法 /user/local
Linux01---目录结构,Linux系统下只有一个最顶级的树/,Windows系统有盘符概念,而Linux系统没有盘符概念,整个系统都在/根目录下,Linux 系统写法 /user/local
|
10天前
|
安全 Linux 网络安全
部署07--远程连接Linux系统,利用FinalShell可以远程连接到我们的操作系统上
部署07--远程连接Linux系统,利用FinalShell可以远程连接到我们的操作系统上
|
10天前
|
Linux 虚拟化 数据安全/隐私保护
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
|
1天前
|
Linux
Linux系统中,根目录
【7月更文挑战第14天】
12 4
|
4天前
|
Web App开发 安全 Linux
Linux系统之安装Firefox浏览器
【7月更文挑战第8天】Linux系统之安装Firefox浏览器
27 8
|
2天前
|
Ubuntu Linux Shell
Ubuntu/linux系统环境变量配置详解
理解和掌握如何配置环境变量对于使用和管理Ubuntu/Linux系统非常重要。
10 2
|
3天前
|
Linux 数据处理 C语言
【Linux】基础IO----系统文件IO & 文件描述符fd & 重定向(下)
【Linux】基础IO----系统文件IO & 文件描述符fd & 重定向(下)
18 0
|
8天前
|
网络协议 Ubuntu Linux
Linux系统之mtr命令的基本使用
【7月更文挑战第5天】Linux系统之mtr命令的基本使用
26 3
|
7天前
|
Ubuntu Linux 网络安全
群晖搭建网页版Linux Ubuntu系统并实现远程访问
群晖搭建网页版Linux Ubuntu系统并实现远程访问
10 1
|
7天前
|
Linux
Linux系统中“sid”是什么意思?
建一个新的会话,并为其分配一个唯一的sid。这个sid可以用来跟踪用户的会话,例如查看用户在该会话中运行了哪些进程。
11 1