From 21e4d6953d2d6b935e25d08098bbab1fed7f7284 Mon Sep 17 00:00:00 2001 From: jihaofeng <1343277221@qq.com> Date: Wed, 4 Sep 2024 14:26:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]opcua-exporter=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E7=9A=84=E5=8F=82=E6=95=B0=E5=90=8D=E7=A7=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opcua-exporter/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opcua-exporter/main.cpp b/opcua-exporter/main.cpp index 9e0385b..f3b3b47 100644 --- a/opcua-exporter/main.cpp +++ b/opcua-exporter/main.cpp @@ -82,7 +82,7 @@ private: int main(int argc, char *argv[]) { mg_init_library(0); spdlog::info("OPC-UA Exporter"); - std::string config_file_name = "./opcua.yml"; + std::string config_file_name = "../opcua.yaml"; #ifdef Debug spdlog::set_level(spdlog::level::trace); @@ -98,8 +98,8 @@ int main(int argc, char *argv[]) { YAML::Node config = YAML::LoadFile(config_file_name); - auto exposer_bind_addr = config["exposer"]["bind"].as("0.0.0.0:8090"); - auto exposer_thread_num = config["exposer"]["thread"].as(2); + auto exposer_bind_addr = config["exporter"]["exporter_bind"].as("0.0.0.0:8090"); + auto exposer_thread_num = config["exporter"]["exporter_thread"].as(2); spdlog::info("exposer bind addr : {}", exposer_bind_addr); spdlog::info("exposer thread number : {}", exposer_thread_num); prometheus::Exposer exposer{exposer_bind_addr, exposer_thread_num}; @@ -113,12 +113,12 @@ int main(int argc, char *argv[]) { CivetServer webServer(civetOptions); - auto ua_edp = config["opcua"]["endpoint"].as(); + auto ua_edp = config["datasource"]["opcua_service_address"].as(); if (ua_edp.empty()) { spdlog::error("the opc ua endpoint not exists."); return EXIT_FAILURE; } - + ua_edp = "opc.tcp://" + ua_edp; auto ua_client = std::make_shared(ua_edp);