summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/nvidia_smi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-14 18:12:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-14 18:12:10 +0000
commitb5321aff06d6ea8d730d62aec2ffd8e9271c1ffc (patch)
tree36c41e35994786456154f9d3bf88c324763aeea4 /collectors/python.d.plugin/nvidia_smi
parentAdding upstream version 1.33.1. (diff)
downloadnetdata-upstream/1.34.0.tar.xz
netdata-upstream/1.34.0.zip
Adding upstream version 1.34.0.upstream/1.34.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/nvidia_smi')
-rw-r--r--collectors/python.d.plugin/nvidia_smi/README.md2
-rw-r--r--collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py11
2 files changed, 6 insertions, 7 deletions
diff --git a/collectors/python.d.plugin/nvidia_smi/README.md b/collectors/python.d.plugin/nvidia_smi/README.md
index f8ce824d..fb613064 100644
--- a/collectors/python.d.plugin/nvidia_smi/README.md
+++ b/collectors/python.d.plugin/nvidia_smi/README.md
@@ -61,4 +61,4 @@ poll_seconds : 1
exclude_zero_memory_users : yes
```
-[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fpython.d.plugin%2Fnvidia_smi%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>)
+
diff --git a/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py b/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
index 00bc7884..1913e94e 100644
--- a/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
+++ b/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
@@ -294,14 +294,13 @@ def get_username_by_pid_safe(pid, passwd_file):
try:
uid = os.stat(path).st_uid
except (OSError, IOError):
- return ''
- if IS_INSIDE_DOCKER:
- try:
+ return ''
+ try:
+ if IS_INSIDE_DOCKER:
return passwd_file[uid][0]
- except KeyError:
- return str(uid)
- else:
return pwd.getpwuid(uid)[0]
+ except KeyError:
+ return str(uid)
class GPU: