diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bbda020..242e3068 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif () # set PKTMINERG_MAJOR_VERSION, PKTMINERG_MINOR_VERSION, etc. set(PKTMINERG_MAJOR_VERSION "0") set(PKTMINERG_MINOR_VERSION "7") -set(PKTMINERG_PATCH_VERSION "4") +set(PKTMINERG_PATCH_VERSION "5") set(PKTMINERG_VERSION_STRING "${PKTMINERG_MAJOR_VERSION}.${PKTMINERG_MINOR_VERSION}.${PKTMINERG_PATCH_VERSION}") if (WIN32) diff --git a/src/daemonManager.cpp b/src/daemonManager.cpp index d45c467b..334929fe 100644 --- a/src/daemonManager.cpp +++ b/src/daemonManager.cpp @@ -1118,7 +1118,7 @@ DaemonManager::DaemonManager(const boost::program_options::variables_map &vm, ti } } - daemon_.setClientVersion("0.7.4"); + daemon_.setClientVersion("0.7.5"); std::vector strs; split(strs, SUPPORT_API_VERSIONS, boost::algorithm::is_any_of(",")); for (const auto& str:strs) { diff --git a/src/pktminerg.cpp b/src/pktminerg.cpp index ff1da4a2..be16ba3a 100644 --- a/src/pktminerg.cpp +++ b/src/pktminerg.cpp @@ -86,14 +86,37 @@ static std::string getProccssIdWithContainer(const std::string &containerId, Log id = containerId.substr(pos+3); } - std::string output_buffer = std::string("Get containerId:") + id; + std::string output_buffer = std::string("Get Id:") + id +std::string(" from CPM."); ctx.log(output_buffer, log4cpp::Priority::INFO); std::cout << StatisLogContext::getTimeString() << output_buffer << std::endl; - const auto cmd = boost::str( - boost::format("sh /usr/local/bin/get_pid_with_container.sh %1%") % id); - fp=popen(cmd.c_str(),"r"); - fgets(buffer,sizeof(buffer),fp); + //get pid with docker + auto cmd = std::string("docker inspect ") + id + std::string("|grep -i \"pid\""); + fp=popen(cmd.c_str(),"r"); + if (!fgets(buffer,sizeof(buffer),fp)) { + pclose(fp); + cmd = std::string("crictl inspect ") + id + std::string("|grep -i \"pid\""); + fp=popen(cmd.c_str(),"r"); + fgets(buffer,sizeof(buffer),fp); + } + std::cout<