sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
508 stars 543 forks source link

[saphana] fix add_command_output() formatting #1071

Closed bmr-cymru closed 3 years ago

bmr-cymru commented 7 years ago
                            # get GREEN/RED status
                            self.add_command_output(
                                'su - %s -c "sapcontrol -nr %s \
                                -function GetProcessList"'
                                % (sidadm, inst),
                                suggest_filename="%s_%s_status"
                                % (sid, inst)
                            )

                            path = '/usr/sap/%s/HDB%s/exe/python_support'
                            path %= (sid, inst)

                            if os.path.isdir("%s" % path):
                                # SCALE OUT - slow
                                self.add_command_output(
                                    'su - %s -c "python \
                                    %s/landscapeHostConfiguration.py"'
                                    % (sidadm, path),
                                    suggest_filename="%s_%s_landscapeConfig"
                                    % (sid, inst)
                                )

No thank you please...

bmr-cymru commented 7 years ago

Also sapnw (and local get_directory_listing method)

TurboTurtle commented 3 years ago

Started looking at this, and in sapnw we see this:

        for sid in sidsunique:
            for line in self.get_directory_listing("/usr/sap/%s/" % sid):
                if 'DVEB' in line:
                    self.add_cmd_output(
                        "grep 'client driver' /usr/sap/%s/%s/work/dev_w0"
                        % (sid, line), suggest_filename="%s_dbclient"
                        % sid)

lolwut? We should just be collecting that file if anything I should think.

bmr-cymru commented 3 years ago

Ack - grepping fragments out of files is only really useful in a plugin if it's used to drive further collection work.