]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add new objects to OBJECT-GROUP; use "self" instead of getpid() 7502/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 20 Feb 2019 09:40:11 +0000 (10:40 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 20 Feb 2019 09:40:11 +0000 (10:40 +0100)
pdns/dnsdistdist/DNSDIST-MIB.txt
pdns/misc.cc
pdns/recursordist/RECURSOR-MIB.txt

index f2c8b7e15cb2d43ca64b2c50981bbf90545ccf9a..4f1f0bc2930aa71a2e2a864a7511c9264476ab69 100644 (file)
@@ -675,6 +675,7 @@ dnsdistGroup OBJECT-GROUP
         latencyAVG1000000,
         uptime,
         realMemoryUsage,
+        specialMemoryUsage,
         nonCompliantQueries,
         nonCompliantResponses,
         rdQueries,
index 05191dd11c7280b5e2b800fd224b284b7a43f370..b9863ed966e901715d6bed02f61b25befb319fc2 100644 (file)
@@ -1241,7 +1241,7 @@ uint64_t getOpenFileDescriptors(const std::string&)
 uint64_t getRealMemoryUsage(const std::string&)
 {
 #ifdef __linux__
-  ifstream ifs("/proc/"+std::to_string(getpid())+"/statm");
+  ifstream ifs("/proc/self/statm");
   if(!ifs)
     return 0;
 
@@ -1261,7 +1261,7 @@ uint64_t getRealMemoryUsage(const std::string&)
 uint64_t getSpecialMemoryUsage(const std::string&)
 {
 #ifdef __linux__
-  ifstream ifs("/proc/"+std::to_string(getpid())+"/smaps");
+  ifstream ifs("/proc/self/smaps");
   if(!ifs)
     return 0;
   string line;
index 625f8f4fc085b537e6de4b4161e68612c3eb8fba..2af4621d08d6daefe3406205d5f5e20e586246ba 100644 (file)
@@ -935,6 +935,7 @@ recGroup OBJECT-GROUP
         noednsOutqueries,
         uptime,
         realMemoryUsage,
+        specialMemoryUsage,
         fdUsage,
         userMsec,
         sysMsec,