kc32668287
2022-08-04 15:42
采纳率: 28.6%
浏览 118
已结题

Grafana Image Renderer 安装及使用问题

Grafana Image Renderer 安装操作
一目的:通过Grafana Image Renderer 去截取指定IP,指定时间段的特定图形通过邮件发送出来,或者导出到execl表格中去
二环境: prometheus-2.36.0.linux-amd64(安装路径/opt/prometheus),grafana-8.5.4(安装路径/opt/prometheus/grafana), alertmanager-0.24.0.linux-amd64(安装路径/opt/prometheus/alertmanager)
三服务器IP:192.168.15.62


##########docker 安装#######start########
##参考资料https://blog.csdn.net/dandanfengyun/article/details/115346594
docker pull grafana/grafana-image-renderer
docker run -d --name=render --network=host --restart=always -e BROWSER_TZ=Asia/Shanghai grafana/grafana-image-renderer
安装完成可访问
http://192.168.15.62:8081
出来 
Grafana Image Renderer
 docker ps -a |grep render
463a6332316f   grafana/grafana-image-renderer   "dumb-init -- node b…"   2 minutes ago   Up 2 minutes 

设置render。
[rendering]
cat /opt/prometheus/grafana/conf/defaults.ini |grep -v "#" |grep -v "^$"  |grep server_url
server_url = http://192.168.15.62:8081/render   #server_url 是Remote rendering service 的地址,也就是安装 Grafana Image Renderer 的地址

cat /opt/prometheus/grafana/conf/defaults.ini |grep -v "#" |grep -v "^$"  |grep callback_url
callback_url = http://192.168.15.62:3000/       #callback_url 是本grafana的地址。

# Skipping finding plugins as directory does not exist logger=plugin.finder path=/opt/prometheus/grafana/data/plugins
 mkdir -p /opt/prometheus/grafana/data/plugins

加载新配置。
killall -9 grafana-server
killall -9 grafana-server
cd /opt/prometheus/grafana/bin/ && ./grafana-server  &

# Skipping finding plugins as directory does not exist logger=plugin.finder path=/opt/prometheus/grafana/data/plugins
  mkdir -p /opt/prometheus/grafana/data/plugins
 
# 这个看不懂怎么用  {"url":"/render?deviceScaleFactor=1.000000&domain=192.168.199.90&encoding=&height=500&renderKey=i2aH9ocrfNAwLyT59Im1cf3lyeTBbcso&timeout=15&timezone=&url=http%3A%2F%2F192.168.199.90%3A3000%2Fd-solo%2FKzZOgaYGk%2Fcollectd-libvirtd-dashboard-with-alert-panel%3ForgId%3D1%26panelId%3D29%26render%3D1&width=1000","stack":"TimeoutError: waiting for function failed: timeout 15000ms exceeded\n    at new WaitTask (/usr/src/app/node_modules/puppeteer/lib/DOMWorld.js:549:28)\n    at DOMWorld.waitForFunction (/usr/src/app/node_modules/puppeteer/lib/DOMWorld.js:454:12)\n    at Frame.waitForFunction (/usr/src/app/node_modules/puppeteer/lib/FrameManager.js:657:28)\n    at Page.waitForFunction (/usr/src/app/node_modules/puppeteer/lib/Page.js:1144:29)\n    at Browser.<anonymous> (/usr/src/app/build/browser/browser.js:174:24)\n    at Generator.next (<anonymous>)\n    at fulfilled (/usr/src/app/build/browser/browser.js:5:58)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","message":"Request failed"}

##########docker 安装#######end########

#########二进制安装方法#############start
cd /opt/prometheus/grafana/bin
./grafana-cli plugins install grafana-image-renderer
✔ Downloaded grafana-image-renderer v3.5.0 zip successfully
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.

killall -9 grafana-server
killall -9 grafana-server
cd /opt/prometheus/grafana/bin/ && ./grafana-server  &

cd /opt/prometheus/grafana/bin
 ./grafana-cli plugins ls
installed plugins:
grafana-image-renderer @ 3.5.0
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.

 ldd /var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome |grep "not found"
        libatk-bridge-2.0.so.0 => not found
        libxkbcommon.so.0 => not found
        libatspi.so.0 => not found

yum  -y install libXcomposite libXdamage libXtst cups libXScrnSaver pango atk adwaita-cursor-theme adwaita-icon-theme at at-spi2-atk at-spi2-core cairo-gobject colord-libs dconf desktop-file-utils ed emacs-filesystem gdk-pixbuf2 glib-networking gnutls gsettings-desktop-schemas gtk-update-icon-cache gtk3 hicolor-icon-theme jasper-libs json-glib libappindicator-gtk3 libdbusmenu libdbusmenu-gtk3 libepoxy liberation-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts libgusb libindicator-gtk3 libmodman libproxy libsoup libwayland-cursor libwayland-egl libxkbcommon m4 mailx nettle patch psmisc redhat-lsb-core redhat-lsb-submod-security rest spax time trousers xdg-utils xkeyboard-config alsa-lib

[root@localhost conf]#  ldd /var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome |grep "not found"
[root@localhost conf]#         
        
cat /opt/prometheus/grafana/conf/defaults.ini |grep -v "#" |grep -v "^$" |grep rendering_language
rendering_language = zh

 cat /opt/prometheus/grafana/conf/defaults.ini |grep -v "#" |grep -v "^$" |grep rendering_timezone
rendering_timezone = Asia/Shanghai

killall -9 grafana-server
killall -9 grafana-server
cd /opt/prometheus/grafana/bin/ && ./grafana-server  &









img


点击
Direct link rendered image
出来这个黑乎乎的界面,按钮,至于剩下的截取指定IP,指定时间段的特定图形通过邮件发送出来,或者导出到execl表格中去 也无从做起,求指导,谢谢!

请加私信,估计要远程,谢谢https://img-mid.csdnimg.cn/release/static/image/mid/ask/846323366956153.png "#left")

3条回答 默认 最新

相关推荐 更多相似问题