Ansible:管理 Grafana 仪表板

5

我正在尝试将一个Grafana仪表盘导入到Grafana中。

我正在使用以下模块:

- name: Export dashboard
  grafana_dashboard:
    grafana_url: "http://{{ inventory_hostname }}:3000"
    grafana_user: "user"
    grafana_password: "password"
    org_id: "1"
    state: present
    slug: "node-exporter"
    overwrite: yes
    path: "/tmp/test/node_exporter.json"

我有node_exporter.json文件,在本地机器和远程机器上都有。但是当我运行ansible playbook时,它会抛出以下错误:

fatal: [172.16.8.231]: FAILED! => {"changed": false, "msg": "error : Unable to create the new dashboard node-exporter-test : 404 - {'body': '{\"message\":\"Dashboard not found\",\"status\":\"not-found\"}', 'status': 404, 'content-length': '54', 'url': 'http://172.16.8.231:3000/api/dashboards/db', 'msg': 'HTTP Error 404: Not Found', 'connection': 'close', 'date': 'Wed, 10 Apr 2019 14:52:58 GMT', 'content-type': 'application/json'}."}

我在本地和远程机器上都看到了“dashboard not found”的提示,是否有配置步骤被忽略了?

1个回答

1

在Grafana中,仪表盘管理很混乱。到目前为止,我发现最好的方法是使用“配置仪表板”(Grafana的特殊配置,从文件系统中选择仪表板)。

请查看cloudalchemy.grafana角色(tasks/dashboards.yml),了解他们如何做到这一点。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接