“Monitoring with prometheus”的版本间的差异
(→使用教程) |
|||
第109行: | 第109行: | ||
[https://blog.csdn.net/kozazyh/article/details/93759717?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase grafana-利用Google OAuth2 身份验证] | [https://blog.csdn.net/kozazyh/article/details/93759717?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase grafana-利用Google OAuth2 身份验证] | ||
+ | |||
+ | === ng config=== | ||
+ | <pre> | ||
+ | cat gf.conf | ||
+ | server | ||
+ | { | ||
+ | listen 80; | ||
+ | server_name gf.linuxsa.org; | ||
+ | # access_log /var/log/nginx/test-nuxt-bcb-blockchain-website.lliao.net.log; | ||
+ | #error_log /var/log/nginx/test-nux-bcb.evan.error.log; | ||
+ | |||
+ | |||
+ | client_max_body_size 10m; | ||
+ | |||
+ | location / { | ||
+ | proxy_pass http://10.3.10.124:3000; | ||
+ | proxy_http_version 1.1; | ||
+ | |||
+ | #set_real_ip_from 10.0.0.0/8; | ||
+ | #set_real_ip_from 172.16.0.0/12; | ||
+ | #set_real_ip_from 192.168.0.0/16; | ||
+ | #real_ip_header X-Forwarded-For; | ||
+ | |||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Remote-Port $remote_port; | ||
+ | proxy_set_header X-Forwarded-Proto $scheme; | ||
+ | proxy_redirect off; | ||
+ | |||
+ | proxy_connect_timeout 1800s; | ||
+ | proxy_send_timeout 1800s; | ||
+ | proxy_read_timeout 1800s; | ||
+ | |||
+ | |||
+ | |||
+ | real_ip_recursive on; | ||
+ | # real_ip_header X-Forwarded-For; | ||
+ | # set_real_ip_from 0.0.0.0/0; | ||
+ | # proxy_set_header Host $host; | ||
+ | # proxy_set_header X-Real-IP $remote_addr; | ||
+ | # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | |||
+ | |||
+ | #proxy_set_header Host $host:$server_port; | ||
+ | #proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr; | ||
+ | #proxy_set_header X-NginX-Proxy true; | ||
+ | |||
+ | # proxy_set_header X-Real-IP $remote_addr; | ||
+ | # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | # proxy_set_header Upgrade $http_upgrade; | ||
+ | # proxy_set_header Connection "upgrade"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </pre> | ||
==使用教程== | ==使用教程== |
2020年9月28日 (一) 08:28的版本
==
目录
book
进阶
以后全改成自己 docker-compose build
prometheus python 库编写自定义指标的方法(完整代码)
ins on docker-composer
https://gitee.com/atompi/PrometheusStackDockerCompose
安全
node exporter 添加防火墙 curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo # yum install node_exporter
prometheus
Nginx用户密码认证配置 Basic HTTP authentication
不错的书 https://yunlzheng.gitbook.io/prometheus-book/
新型监控告警工具prometheus(普罗米修斯)的入门使用(附视频讲解)
【视频】新型监控告警工具prometheus(普罗米修斯)入门使用(附视频讲解)
为什么说 Prometheus 是足以取代 Zabbix 的监控神器?
usage
Grafana单图表告警邮件&面板图(Dashboard)日报邮件
https://github.com/prometheus/blackbox_exporter/blob/master/blackbox.yml
grafana
#防火墙 grafana ng 在 10.3.10.10 firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.3.10.10" port protocol="tcp" port="3000" accept " firewall-cmd --reload
grafana.com Run Grafana Docker image
中文 Node Exporte for Prometheus Dashboard
usage creat-->import --> id 8919
Container
https://grafana.com/grafana/dashboards/11174
docker-grafana/config.env https://github.com/stefanwalther/docker-grafana/blob/master/config.env
grafana 添加源和数据
grafana 添加用户
1.Users--> 2.Invite --> 3.进行邀请 Email or Username:输入用户邮箱,建议先跟用户名保持相同,然后在后面在写邮箱,后面会说到,这样不会报错 Name:输入用户名 Role:配置用户权限(只读Viewer 编辑Editor 管理员Admin) Send invite email:勾选时,会将新用户的设置密码的链接发到邮箱 点击创建之后回调到新用户设置密码 --> 4.创建好之后,点击Pending Invites 复制链接到浏览器的地址栏中访问(也可从邮件中收到链接) 进去之后是下面的界面,这里有个坑,复制的IP地址是localhost,我们这里改为自己搭建的IP地址,然后在Email填写邮箱地址,设置新用户的密码 设置完成后,会直接以新用户身份登陆 http://localhost:3000/invite/PAhyq4gzfA3ugRiw0PH2RC2vsIuSTa -->
ng config
cat gf.conf server { listen 80; server_name gf.linuxsa.org; # access_log /var/log/nginx/test-nuxt-bcb-blockchain-website.lliao.net.log; #error_log /var/log/nginx/test-nux-bcb.evan.error.log; client_max_body_size 10m; location / { proxy_pass http://10.3.10.124:3000; proxy_http_version 1.1; #set_real_ip_from 10.0.0.0/8; #set_real_ip_from 172.16.0.0/12; #set_real_ip_from 192.168.0.0/16; #real_ip_header X-Forwarded-For; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Remote-Port $remote_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; proxy_connect_timeout 1800s; proxy_send_timeout 1800s; proxy_read_timeout 1800s; real_ip_recursive on; # real_ip_header X-Forwarded-For; # set_real_ip_from 0.0.0.0/0; # proxy_set_header Host $host; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_set_header Host $host:$server_port; #proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr; #proxy_set_header X-NginX-Proxy true; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header Upgrade $http_upgrade; # proxy_set_header Connection "upgrade"; } }
使用教程
grafana使用教程之基本概念(basic concepts)
Grafana快速入门:InfluxDB数据源以及曲线图表仪表盘配置
apached conf
##/etc/httpd/conf.d/gf.conf <VirtualHost *:80> ServerName gf.linuxsa.org ServerAlias gf.linuxsa.org ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> <Location /> ProxyPass http://localhost:3000/ ProxyPassReverse http://localhost:3000/ </Location> </VirtualHost>
vm监控Node-exporter
可以如上的 node Node-exporter
Blackbox
pushgateway
https://songjiayang.gitbooks.io/prometheus/content/pushgateway/how.html
Process-exporter
应用监控
redis
pika主备部署(redis-sentinel)+监控(prometheus+grafana)
Prometheus监控 Redis , redis-cli_exporter
监控MQ
Monitoring with Prometheus & Grafana
监控ES
https://github.com/slok/ecs-exporter
docker
Prometheus+grafana监控:cAdvisor输出的容器内存相关的指标的解读
mysql
prometheus 监控之 mysql 篇(含mysql报警规则)
Prometheus MySQL Exporter源码阅读与分析
Spring boot
https://www.bookstack.cn/read/prometheus_practice/application-spring.md
Prometheus基于java开发exporter样例以及pushgateway的应用
告警
telegram
通过 prome or grafana ?
https://github.com/inCaller/prometheus_bot
https://github.com/metalmatze/alertmanager-bot
基于prometheus + grafana + mysql + Telegram 监控告警
https://my.oschina.net/54188zz/blog/3030618
prometheus alertmanager telegram
教程
prometheus学习系列五: Prometheus配置文件
see also
prometheus部署node,server以及域名加告警