Blob Blame History Raw
commit 10cc09bf4d84d76cbcceccc6f3246bd9f8e9bd93
Author: Bryn M. Reeves <bmr@redhat.com>
Date:   Tue Jul 30 17:42:40 2013 +0100

    Restrict wbinfo collection to the current domain.
    
    The samba module calls the wbinfo command to collect user and
    group information. This by default will search all domains to
    which the host has access. In a large AD environment with a number
    of trusted domains this causes the winbindd process to consume
    excessive CPU and memory resources.
    
    The Samba developers have commented that fixing this would require
    a complete rewrite of the winbind protocol and wbinfo client.
    
    Since listing out the _entire_ set of visible users is unlikely
    to be of any use anyway pass the --domain='.' option to restrict
    the search to the current domain of the system.
    
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>

diff --git a/sos/plugins/samba.py b/sos/plugins/samba.py
index d4e2fe8..f3a44b7 100644
--- a/sos/plugins/samba.py
+++ b/sos/plugins/samba.py
@@ -23,8 +23,8 @@ class Samba(Plugin):
         self.add_copy_specs([
             "/etc/samba",
             "/var/log/samba/*",])
-        self.add_cmd_output("wbinfo -g")
-        self.add_cmd_output("wbinfo -u")
+        self.add_cmd_output("wbinfo --domain='.' -g")
+        self.add_cmd_output("wbinfo --domain='.' -u")
         self.add_cmd_output("testparm -s -v")