Skip to content

Commit

Permalink
Merge pull request #56 from signalfx/processlist
Browse files Browse the repository at this point in the history
fix issue preventing the host process list from being reported
  • Loading branch information
charless-splunk authored Jun 19, 2017
2 parents 9de886a + baa9466 commit 6194d1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
0.0.31 / 2017-06-19
0.0.32 / 2017-06-19
===================

* Fix issue preventing host process info from being reported.

0.0.31 / 2017-06-19

* Configure alternate proc path
* Configure alternate etc path
* Fix logging of "Next Metadata Send" message
Expand Down
8 changes: 4 additions & 4 deletions src/signalfx_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
TIMEOUT = 3
POST_URLS = []
DEFAULT_POST_URL = "https://ingest.signalfx.com/v1/collectd"
VERSION = "0.0.31"
VERSION = "0.0.32"
MAX_LENGTH = 0
COLLECTD_VERSION = ""
LINUX_VERSION = ""
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def get_cpu_info(host_info={}):
break

else:
with open("/proc/cpuinfo") as f:
with open(os.path.join(psutil.PROCFS_PATH, "cpuinfo")) as f:
nb_cpu = 0
nb_cores = 0
nb_units = 0
Expand Down Expand Up @@ -1241,7 +1241,7 @@ def to_time(secs):


def read_proc_file(pid, file, field=None):
with open(os.path.join(psutil.PROCFS_PATH, pid, file)) as f:
with open(os.path.join(psutil.PROCFS_PATH, str(pid), file)) as f:
if not field:
return f.read().strip()
for x in f.readlines():
Expand Down Expand Up @@ -1338,7 +1338,7 @@ def get_memory(host_info):
str(int(popen(["sysctl", "-n", "hw.memsize"])) / 1024)
else:
"""get total physical memory for machine"""
with open("/proc/meminfo") as f:
with open(os.path.join(psutil.PROCFS_PATH, "meminfo")) as f:
pieces = f.readline()
_, mem_total, _ = pieces.split()
host_info["host_mem_total"] = mem_total
Expand Down

0 comments on commit 6194d1b

Please sign in to comment.