Asi*_*mez 5 ansible grafana grafana-api
我正在尝试将 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"
Run Code Online (Sandbox Code Playgroud)
我在本地计算机和远程计算机中都有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'}."}
Run Code Online (Sandbox Code Playgroud)
它抛出该错误dashboard not found,但位于本地和远程计算机中。我是否跳过任何所需的配置?
grafana 中的仪表板管理一团糟。到目前为止,我发现的最好方法是使用“配置的仪表板”(grafana 的一个特殊配置,用于从文件系统中获取仪表板)。
查看cloudalchemy.grafana角色 ( tasks/dashboards.yml) 以了解他们是如何做到的。
| 归档时间: |
|
| 查看次数: |
2005 次 |
| 最近记录: |