原创

prometheus配置之grafana面板(二)



一、下载、安装grafana

# 下载
wget https://dl.grafana.com/enterprise/release/grafana-enterprise-8.3.3-1.x86_64.rpm

# 安装
yum install grafana-enterprise-8.3.3-1.x86_64.rpm

# 配置文件目录 (暂时不需要修改)
/etc/grafana/grafana.ini 

启动

systemctl start grafana-server

查看启动状态

[root@bogon prometheus-2.32.1.linux-amd64]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2021-12-30 16:03:26 CST; 1 day 2h ago
     Docs: http://docs.grafana.org
 Main PID: 21244 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─21244 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=rpm cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugi...
1231 15:55:37 bogon grafana-server[21244]: t=2021-12-31T15:55:37+0800 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=400 remote_addr=192.168.30.235 time_ms=1 size=92 referer="h...rgId=1&editPanel=20"
1231 15:55:37 bogon grafana-server[21244]: t=2021-12-31T15:55:37+0800 lvl=eror msg="Instant query failed" logger=tsdb.prometheus query="count(node_cpu_seconds_total{instance=~\"192\\\\.168\\\\.30\\\\.131:9100\", mode=\"system\"}) or count(node_cpu{instance=~\"192\...
12月 31 15:55:37 bogon grafana-server[21244]: t=2021-12-31T15:55:37+0800 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=400 remote_addr=192.168.30.235 time_ms=1 size=92 referer="h...rgId=1&editPanel=20"
12月 31 15:55:49 bogon grafana-server[21244]: t=2021-12-31T15:55:49+0800 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=0 remote_addr=192.168.30.235 time_ms=1 size=0 referer=
12月 31 16:03:26 bogon grafana-server[21244]: t=2021-12-31T16:03:26+0800 lvl=info msg="Validated license token" logger=licensing appURL=http://localhost:3000/ source=disk status=NotFound
12月 31 16:03:26 bogon grafana-server[21244]: t=2021-12-31T16:03:26+0800 lvl=warn msg="failed to load or validate token" logger=licensing.renewal err="license token file not found: /var/lib/grafana/license.jwt"
12月 31 17:03:26 bogon grafana-server[21244]: t=2021-12-31T17:03:26+0800 lvl=info msg="Validated license token" logger=licensing appURL=http://localhost:3000/ source=disk status=NotFound
12月 31 17:03:26 bogon grafana-server[21244]: t=2021-12-31T17:03:26+0800 lvl=warn msg="failed to load or validate token" logger=licensing.renewal err="license token file not found: /var/lib/grafana/license.jwt"
12月 31 18:03:26 bogon grafana-server[21244]: t=2021-12-31T18:03:26+0800 lvl=info msg="Validated license token" logger=licensing appURL=http://localhost:3000/ source=disk status=NotFound
12月 31 18:03:26 bogon grafana-server[21244]: t=2021-12-31T18:03:26+0800 lvl=warn msg="failed to load or validate token" logger=licensing.renewal err="license token file not found: /var/lib/grafana/license.jwt"
Hint: Some lines were ellipsized, use -l to show in full.

二、访问grafana、并配置

1、访问

地址:IP地址:3000

默认用户名/密码:admin/admin

2、配置

数据选择prometheus


连接prometheus



点击Create your first dashboard 创建仪表



监控指标查看:被监控主机IP:9100/metrics



正文到此结束
评论

登录后才能发表评论 登录/注册

0评论
  • 还没有评论,快来抢沙发吧!