重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 53|回复: 0
打印 上一主题 下一主题

[系统管理] prometheus如何监控LINUX主机

[复制链接]
跳转到指定楼层
楼主
发表于 4 天前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
prometheus监控LINUX主机
前提:
      prometheus 主机已经安装好。


1.下载软件
wget https://github.com/prometheus/no ... .linux-amd64.tar.gz


2. 解压
tar xvf node_exporter-1.8.2.linux-amd64.tar.gz

3.重命名
mv node_exporter-1.8.2.linux-amd64 /usr/local/prometheus

4.创建自动启动服务
vim  /etc/systemd/system/node_exporter.service

[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/prometheus/node_exporter
Restart=on-failure

[Install]
WantedBy=multi-user.target


生效
systemctl daemon-reload
systemctl status node_exporter.service
systemctl enable node_exporter.service
systemctl start node_exporter.service
systemctl status node_exporter.service

5.监控端增加目标

找到前面的prometheus.yml配置文件,添加agent节点的信息,包括主机ip和端口号。

vim /opt/prometheus/prometheus.yml

- job_name: 'host2_prometheus'
    static_configs:
    - targets: ['192.168.133.200:9100']

6.grana 检查
  如果以前加了 node_exporter ,在grana就可以看到,如果没有,应进行仪表盘的导入即可。


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-10-2 18:34 , Processed in 0.085254 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表