qq:1053582829

promethues安装

上一篇 / 下一篇  2022-09-08 16:01:12 / 个人分类:prometheus

一、同步服务器时间和时区
*CentOS 7:
    timedatectl set-timezone Asia/Shanghai
    通过whereis crond或者systemctl status crond.service或者crond -V查看是否已经安装,若是什么都没有查到,那就是没有安装。没有安装的话直接通过dnf install crond
    crontab -e 添加  * * * * * ntpdate -u cn.pool.ntp.org

二、下载并安装:
    https://github.com/prometheus/prometheus/releases/download/v2.38.0/prometheus-2.38.0.windows-amd64.tar.gz

三、启动
   ./prometheus 
    /etc/hosts   , local dns server
   chronyd

四、exporter 
    https://github.com/prometheus/node_exporter/releases/download/v1.4.0-rc.0/node_exporter-1.4.0-rc.0.linux-amd64.tar.gz
    curl localhost:9100/metrics | grep node_memory_MemFree
    grep -i node_cpu | head

    cpu time => CPU user time /sys time / nice time / idle time /irq/ ... 
    用户态使用时间,系统/内核态使用时间,nice值分配使用时间,空闲时间,中断时间

      (1-(sum(increase(node_cpu_seconds_total{instance="IP地址:9100",mode="idle"}[1m]))/sum(increase(node_cpu_seconds_total{instance="IP地址:9100"}[1m])))) * 100

      increase() 函数,针对Counter哲宗持续增长的数值,寄去其中一段时间的增量
      gauge类型的数据,属于随机变化数值,并不像counter那样,是持续增长

TAG:

 

评分:0

我来说两句

jumperzzz

jumperzzz

自动化测试 测试流程管理

日历

« 2024-04-25  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 9894
  • 日志数: 18
  • 建立时间: 2016-04-20
  • 更新时间: 2022-12-05

RSS订阅

Open Toolbar