prometheus监控

部署prometheus监控端
mkdir /opt/monitor/
[root@zabbix ~]# tar -xf prometheus-2.25.0.linux-amd64.tar.gz -C /opt/monitor/
[root@zabbix ~]# mv prometheus-2.25.0.linux-amd64.tar.gz /opt/monitor/prometheus
[root@zabbix ~]# cd /opt/monitor/prometheus-2.25.0.linux-amd64/
[root@zabbix prometheus-2.25.0.linux-amd64]# ls
console_libraries consoles LICENSE NOTICE prometheus prometheus.yml promtool
[root@zabbix monitor]# mv prometheus-2.25.0.linux-amd64/ prometheus/

[root@zabbix monitor]# cd /usr/lib/systemd/system/
[root@zabbix monitor]# cat prometheus.service
[Unit]
Description=prometheus
[Service]
ExecStart=/opt/monitor/prometheus/prometheus --config.file=/opt/monitor/prometheus/prometheus.yml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target

[root@zabbix system]#systemctl restart prometheus
[root@zabbix system]# ps -ef | grep prometheus
root 75418 1 0 08:45 ? 00:00:00 /opt/monitor/prometheus/prometheus --config.file=/opt/monitor/prometheus/prometheus.yml
root 78206 66919 0 08:49 pts/2 00:00:00 grep --color=auto prometheus
[root@zabbix system]# ss -anptu | grep prometheus
tcp LISTEN 0 128 :::9090 :::* users:(("prometheus",pid=75418,fd=8))
tcp ESTAB 0 0 ::1:42484 ::1:9090 users:(("prometheus",pid=75418,fd=3))
tcp ESTAB 0 0 ::1:9090 ::1:42484 users:(("prometheus",pid=75418,fd=7))
访问 ip:9090

部署grafana可视化页面
[root@zabbix ~]# tar -xf grafana-7.4.5.linux-amd64.tar.gz -C /opt/monitor/
[root@zabbix ~]# cd /opt/monitor/
[root@zabbix monitor]# mv grafana-7.4.5/ grafana/
[root@zabbix system]# cd /usr/lib/systemd/system
[root@zabbix system]# cat grafana.service
[Unit]
Description=grafana
[Service]
ExecStart=/opt/monitor/grafana/bin/grafana-server -homepath=/opt/monitor/grafana
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target


[root@zabbix ~]# systemctl restart grafana
[root@zabbix ~]# ps -ef | grep grafana
root 82018 1 6 08:55 ? 00:00:00 /opt/monitor/grafana/bin/grafana-server -homepath=/opt/monitor/grafana
root 82165 66919 0 08:55 pts/2 00:00:00 grep --color=auto grafana
[root@zabbix ~]# ss -anptu | grep grafana
tcp ESTAB 0 31 192.168.0.60:50536 185.199.109.133:443 users:(("grafana-server",pid=82018,fd=10))
tcp ESTAB 0 0 192.168.0.60:52324 34.120.177.193:443 users:(("grafana-server",pid=82018,fd=9))
tcp LISTEN 0 128 :::3000 :::* users:(("grafana-server",pid=82018,fd=8))
访问: ip:3000

访问不了清空防火墙 iptables -F

上一篇:druid monitor使用


下一篇:python表格数据过滤复制到另外一个表格