aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/docker.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index 5b2acff5..69ac997e 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -33,6 +33,14 @@ class Docker(Plugin):
"/var/lib/docker/repositories-*"
])
+ self.add_journal(units="docker")
+ self.add_cmd_output("ls -alhR /etc/docker")
+
+ if not self.service_is_running('docker'):
+ # if docker is not running none of the below commands will provide
+ # any useful output
+ return
+
subcmds = [
'events --since 24h --until 1s',
'info',
@@ -53,9 +61,6 @@ class Docker(Plugin):
if self.get_option('size'):
self.add_cmd_output('docker ps -as')
- self.add_journal(units="docker")
- self.add_cmd_output("ls -alhR /etc/docker")
-
nets = self.get_command_output('docker network ls')
if nets['status'] == 0: