[修改]opcua-exporter读取的参数名称修改
This commit is contained in:
@@ -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<std::string>("0.0.0.0:8090");
|
||||
auto exposer_thread_num = config["exposer"]["thread"].as<std::size_t>(2);
|
||||
auto exposer_bind_addr = config["exporter"]["exporter_bind"].as<std::string>("0.0.0.0:8090");
|
||||
auto exposer_thread_num = config["exporter"]["exporter_thread"].as<std::size_t>(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<std::string>();
|
||||
auto ua_edp = config["datasource"]["opcua_service_address"].as<std::string>();
|
||||
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<client>(ua_edp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user