|
12 | 12 | # plugins in the list are run. |
13 | 13 | # SOS_DECOMPRESS: bool to disable decompressing sos reports. Set to 0 to disable |
14 | 14 | # or set to 1 to enable. Defaults to 1 |
15 | | -# |
| 15 | +# SOS_EDPM_JOURNAL_SIZE: Limit the size of collected journals in MiB. Must be |
| 16 | +# a positive integer. If not set or invalid, journal |
| 17 | +# size limiting is ignored. |
16 | 18 |
|
17 | 19 | # When called from the shell directly |
18 | 20 | if [[ -z "$DIR_NAME" ]]; then |
|
32 | 34 | IFS=',' read -r -a SOS_EDPM <<< "$SOS_EDPM" |
33 | 35 | fi |
34 | 36 |
|
| 37 | +# --journal-size: Limit the size of collected journals in MiB |
| 38 | +if [[ -z "$SOS_EDPM_JOURNAL_SIZE" || ! "$SOS_EDPM_JOURNAL_SIZE" =~ ^[0-9]+$ ]]; then |
| 39 | + echo "Journal size limit not set or invalid: ignoring" |
| 40 | + SOS_JOURNAL="" |
| 41 | +else |
| 42 | + echo "Setting journal size limit to ${SOS_EDPM_JOURNAL_SIZE} MiB" |
| 43 | + SOS_JOURNAL="--journal-size $SOS_EDPM_JOURNAL_SIZE" |
| 44 | +fi |
| 45 | + |
35 | 46 | # Default to some profiles if SOS_EDPM_PROFILES is not set |
36 | 47 | SOS_EDPM_PROFILES="${SOS_EDPM_PROFILES-container,openstack_edpm,system,storage,virt}" |
37 | 48 | if [[ -n "$SOS_EDPM_PROFILES" ]]; then |
@@ -67,7 +78,7 @@ gather_edpm_sos () { |
67 | 78 | done |
68 | 79 | fi |
69 | 80 |
|
70 | | - SSH sudo "bash -c \"rm -rf $TMPDIR && mkdir $TMPDIR && sos report --batch --all-logs --tmp-dir=$TMPDIR $SOS_LIMIT\"" |
| 81 | + SSH sudo "bash -c \"rm -rf $TMPDIR && mkdir $TMPDIR && sos report --batch --all-logs --tmp-dir=$TMPDIR $SOS_JOURNAL $SOS_LIMIT\"" |
71 | 82 | # shellcheck disable=SC2181 |
72 | 83 | if [ $? -ne 0 ]; then |
73 | 84 | echo "Failed to run sos report on ${node}, won't retrieve data" |
|
0 commit comments