]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Support grafana dashboard installation
authorBoris Ranto <branto@redhat.com>
Wed, 24 Oct 2018 11:17:00 +0000 (13:17 +0200)
committerBoris Ranto <branto@redhat.com>
Thu, 25 Oct 2018 15:09:02 +0000 (17:09 +0200)
We are currently hosting the grafana dashboards in our repo but we do
not install them. This patch adds the cmake support.

Signed-off-by: Boris Ranto <branto@redhat.com>
CMakeLists.txt
monitoring/grafana/dashboards/CMakeLists.txt [new file with mode: 0644]

index 0af69b440de1b70a1d16841a89fa5c827c50e122..710bc14a5881e29dee2b8c53de2bd9409a9e271c 100644 (file)
@@ -707,6 +707,11 @@ if(LINUX)
   add_subdirectory(etc/sysctl)
 endif()
 
+option(WITH_GRAFANA "install grafana dashboards" OFF)
+if(WITH_GRAFANA)
+  add_subdirectory(monitoring/grafana/dashboards)
+endif()
+
 include(CTags)
 option(CTAG_EXCLUDES "Exclude files/directories when running ctag.")
 add_tags(ctags
diff --git a/monitoring/grafana/dashboards/CMakeLists.txt b/monitoring/grafana/dashboards/CMakeLists.txt
new file mode 100644 (file)
index 0000000..41ca947
--- /dev/null
@@ -0,0 +1,8 @@
+set(CEPH_GRAFANA_DASHBOARDS_DIR "${CMAKE_INSTALL_SYSCONFDIR}/grafana/dashboards/ceph-dashboard"
+  CACHE PATH "Location for grafana dashboards")
+
+FILE(GLOB CEPH_GRAFANA_DASHBOARDS "*.json")
+
+install(FILES
+  ${CEPH_GRAFANA_DASHBOARDS}
+  DESTINATION ${CEPH_GRAFANA_DASHBOARDS_DIR})