diff options
Diffstat (limited to 'libglusterfs/src/monitoring.c')
-rw-r--r-- | libglusterfs/src/monitoring.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libglusterfs/src/monitoring.c b/libglusterfs/src/monitoring.c index 041b70acf7..316875257c 100644 --- a/libglusterfs/src/monitoring.c +++ b/libglusterfs/src/monitoring.c @@ -234,6 +234,14 @@ gf_monitor_metrics(glusterfs_ctx_t *ctx) if (dumppath == NULL) { dumppath = GLUSTER_METRICS_DIR; } + ret = mkdir_p(dumppath, 0755, true); + if (ret) { + /* EEXIST is handled in mkdir_p() itself */ + gf_msg("monitoring", GF_LOG_ERROR, 0, LG_MSG_STRDUP_ERROR, + "failed to create metrics dir %s (%s)", filepath, + strerror(errno)); + return NULL; + } ret = gf_asprintf(&filepath, "%s/gmetrics.XXXXXX", dumppath); if (ret < 0) { |