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
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: