13. Automatic Upload of Resulting sos Report Archive-file

13. Automatic Upload of Resulting sos Report Archive-file

sos report Direct Upload

The sos command's integration with protocols like HTTPS, SFTP, and FTP simplifies direct upload, reducing the manual steps involved in diagnostics.

It is possible to upload the resulting sos report archive-file directly from the command line to a sos report diagnostic and analysis service or to the server from your technical support team. The file can be transferred using either SFTP or an HTTPS upload request.

In any case a valid URL, a valid username and a valid password are required and have to be provided in the command line of the sos report execution as follows:

--upload-url URL

A support protocol must be specified in this URL. Currently, uploading is supported for HTTPS, SFTP, and FTP protocols.  If your destination server listens on a non-standard port, specify the listening port in the URL. A common URL will look like these:

      https://sos-vault.com/api/upload

      sftp://support.redhat.com:2022/customers

If no username and/or not a password is provided, You  will  be  prompted  for  a username and password (except if the --batch option was used). If these credentials are not provided, sos will still run and create an archive but will  not  attempt  an automatic upload, instead relying on the end user to upload it as needed.

--upload-user USER

Specify the username to use for authentication with the destination server usually your email address in the case of sos-vault.

--upload-pass PASS

Specify the password to use for authentication with the destination server.

--upload-directory DIR

Specify a directory to upload to. Default is '/'.

--upload-method METHOD

Specify the HTTP method to use for uploading to the provided --upload-url. Valid values are 'auto' (default), 'put', or 'post'.

--upload-no-ssl-verify

Disable SSL verification for HTTPS uploads. This may be used to allow uploading to locations that have self-signed certificates, or certificates that are otherwise untrusted by the local system. Use this option with caution. Disabling SSL verification can expose you to man-in-the-middle (MITM) attacks.

sos-vault automatic Upload and Decrypt Keys

sos-vault supports uploading sosreports archives into your vault directly from the command line via the --upload-url, --upload-user and --upload-password. For this, an upload-pass needs to be configured in the “Settings → Keys” menu of your account. Also in the same menu, if you want these sosreports to be automatically decrypted uppon arrival, a decrypt-pass needs to be defined and you must use this key as value for the --encrypt-pass option when executing the sos command.

Automatic upload of sosreports into your vault for automatic unpacking and analysis is perfect for CI/CD pipeline integration.

Upload and Decrypt Keys

sos report Example

The command line to generate an obfuscated and encrypted sos report from your system and automatically upload it to your sos-vault vault and then automatically unpack it and analyze it, will look something like this:

sudo sos report -q --clean --batch --case-id "CASE_ID" --encrypt-pass "***ENCRYPTION PASSWORD***" --upload-url "https://sos-vault.com/api/upload" --upload-user "USER@example.com" --upload-pass "***UPLOAD PASSWORD***" --upload-method post

Please note that you have to use your own CASE_ID, USER (email address), ENCRYPTION PASSWORD and UPLOAD PASSWORD in the above example for the command to work properly.

This command may look daunting but you can always write all the options in the /etc/sos/sos.conf file as described in this article and invoke like this:

sudo sos report --case-id "CASE_ID" 

sos upload Example

Starting from v8.9.0, the sos command supports the upload subcommand to upload sos reports to a policy defined remote location (Red-Hat or Ubuntu policies), or a user defined location. This subcommand is used to upload previously generated sos reports.

Once the resulting sos report archive-file has been created (after the first sos report execution), upload it using the sos upload command. Is similar to the behaviour described previuosly but a second sos command execution is required.

sos upload supports exactly the same options described above. The command would look like this:

sudo sos upload /tmp/sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz.gpg --case-id "CASE_ID" --encrypt-pass "***ENCRYPTION PASSWORD***" --upload-url "https://sos-vault.com/api/upload" --upload-user "USER@example.com" --upload-pass "***UPLOAD PASSWORD***" --upload-method post

curl Example

Another option is to upload after the resulting sos report archive-file has been created (after sos report execution) by means of curl or wget. For example, assume that the execution of the sos report command created the file sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz under the /tmp directory, then the following curl command will upload the archive-file to the diagnostic and analysis service.

(NOTE: You need to change the macros USERNAME, PASSWORD in the following example, with your own data accordingly).

sudo curl -X POST -u USERNAME:PASSWORD -F "file=@/tmp/sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz.gpg" https://sos-vault.com/api/upload