File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
configuration/contrib/diag-plugins
tests/RobotFramework/tests/tedge/diag Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
OUTPUT_DIR=" "
5
5
COMMAND=" "
6
+ TEDGE_CONFIG_DIR=${TEDGE_CONFIG_DIR:-/ etc/ tedge}
6
7
7
8
# Parse arguments
8
9
while [ $# -gt 0 ]; do
@@ -39,12 +40,33 @@ mosquitto_log() {
39
40
fi
40
41
}
41
42
43
+ mosquitto_config () {
44
+ if command -V tree > /dev/null >&2 ; then
45
+ tree /etc/mosquitto > " $OUTPUT_DIR /etc_mosquitto.tree.txt" || :
46
+ fi
47
+
48
+ mkdir -p " $OUTPUT_DIR /mosquitto"
49
+ if [ -f /etc/mosquitto/mosquitto.conf ]; then
50
+ cp -aR /etc/mosquitto/mosquitto.conf " $OUTPUT_DIR /mosquitto" || :
51
+ fi
52
+ if [ -d /etc/mosquitto/conf.d ]; then
53
+ cp -aR /etc/mosquitto/conf.d " $OUTPUT_DIR /mosquitto/" || :
54
+ fi
55
+
56
+ mkdir -p " $OUTPUT_DIR /tedge"
57
+ cp -aR " $TEDGE_CONFIG_DIR /mosquitto-conf" " $OUTPUT_DIR /tedge/" || :
58
+
59
+ # sanitize password fields
60
+ find " $OUTPUT_DIR " -name " *.conf" -exec sed -i ' s/password\s*.*/password <redacted>/g' {} \; || :
61
+ }
62
+
42
63
collect () {
43
64
if command -V mosquitto > /dev/null 2>&1 ; then
44
65
if command -V journalctl > /dev/null 2>&1 ; then
45
66
mosquitto_journal
46
67
fi
47
68
mosquitto_log
69
+ mosquitto_config
48
70
else
49
71
echo " mosquitto not found" >&2
50
72
# this plugin is not applicable when mosquitto doesn't exist
Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ Test Tags theme:troubleshooting theme:cli theme:plugins
65
65
${log_names } = Create List
66
66
... output.log
67
67
... mosquitto.log
68
+ ... mosquitto/mosquitto.conf
69
+ ... mosquitto/conf.d/mosquitto.conf
68
70
... mosquitto-journal.log
71
+ ... tedge/mosquitto-conf/tedge-mosquitto.conf
72
+ ... tedge/mosquitto-conf/c8y-bridge.conf
69
73
FOR ${log_name } IN @{log_names }
70
74
File Size Is Not Zero ${log_name }
71
75
END
You can’t perform that action at this time.
0 commit comments