From 11f31b68dd64599b8e15d9a5b9ce6c274c6e3185 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 5 Dec 2023 16:29:10 +0900 Subject: [PATCH] in_node_exporter_metrics: Suppress error log when NVMe is not mounted in the node Signed-off-by: Hiroshi Hatake --- plugins/in_node_exporter_metrics/ne_nvme_linux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/in_node_exporter_metrics/ne_nvme_linux.c b/plugins/in_node_exporter_metrics/ne_nvme_linux.c index 2e3eedc8b38..52000f33108 100644 --- a/plugins/in_node_exporter_metrics/ne_nvme_linux.c +++ b/plugins/in_node_exporter_metrics/ne_nvme_linux.c @@ -137,6 +137,13 @@ static int nvme_update(struct flb_ne *ctx) .firmware_revision = "" }; + if (access(nvme_class_path, F_OK) == -1 && + errno == ENOENT) { + flb_plg_debug(ctx->ins, "NVMe storage is not mounted"); + + return 0; + } + mk_list_init(&nvme_class_list); ts = cfl_time_now();