From a826eac1e9b19ed1be7828914f537f221f846735 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 20 Sep 2023 12:54:56 +0900 Subject: [PATCH] in_node_exporter_metrics: Plug undefined value for netif name Signed-off-by: Hiroshi Hatake --- plugins/in_node_exporter_metrics/ne_netdev_darwin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/in_node_exporter_metrics/ne_netdev_darwin.c b/plugins/in_node_exporter_metrics/ne_netdev_darwin.c index 094915a8a7b..4f3aaef36f8 100644 --- a/plugins/in_node_exporter_metrics/ne_netdev_darwin.c +++ b/plugins/in_node_exporter_metrics/ne_netdev_darwin.c @@ -162,6 +162,7 @@ static int netdev_update(struct flb_ne *ctx) if (!if_indextoname(i, ifname)) { flb_plg_debug(ctx->ins, "failed to if_index_toname for %d", i); + snprintf(ifname, IF_NAMESIZE, "(unknown %i)", i); } cmt_gauge_set(ctx->darwin_receive_packets, ts,