self-diagnostics: substitute possible slashes in report names

This commit is contained in:
Roman Azarenko 2023-11-14 09:10:49 +00:00 committed by Vivek Kumar Dutta
parent 2dac7741d4
commit 237f30c3f7
10 changed files with 48 additions and 48 deletions

View file

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=self-diagnostics PKG_NAME:=self-diagnostics
PKG_VERSION:=1.0.2 PKG_VERSION:=1.0.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0-only PKG_LICENSE:=GPL-2.0-only

View file

@ -19,7 +19,7 @@ Options:
It also has an uci file to configure the various parameters: It also has an uci file to configure the various parameters:
```bash ```bash
# cat /etc/config/self-diagnostics # cat /etc/config/self-diagnostics
config globals 'globals' config globals 'globals'
option extended_spec_dir '/etc/self-diagnostics/spec' option extended_spec_dir '/etc/self-diagnostics/spec'
option exec_timeout '5' option exec_timeout '5'
@ -117,7 +117,7 @@ Extension Module(s):
### Run and collect logs ### Run and collect logs
```bash ```bash
# self-diagnostics # self-diagnostics
/tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz /tmp/self-diagnostics-report-EX600-Y.0721140081.tar.gz
``` ```

View file

@ -37,7 +37,7 @@ log()
{ {
log_file="${REPORT_DIR}/execution.log" log_file="${REPORT_DIR}/execution.log"
if [ "$VERBOSE" -eq 1 ]; then if [ "$VERBOSE" -eq 1 ]; then
logger -t $0 "$*" logger -t $0 "$*"
fi fi
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file} echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
} }
@ -77,7 +77,7 @@ config_load()
[ -n "${temp}" ] && \ [ -n "${temp}" ] && \
REPORT_NAME="$(eval echo ${temp})" REPORT_NAME="$(eval echo ${temp})"
REPORT_NAME="${REPORT_NAME// /_}" REPORT_NAME="${REPORT_NAME//[ \/]/_}"
temp="$(uci -q get self-diagnostics.globals.compression_level)" temp="$(uci -q get self-diagnostics.globals.compression_level)"
[ -n "${temp}" ] && \ [ -n "${temp}" ] && \

View file

@ -7,15 +7,15 @@
}, },
{ {
"description": "Installed Packages", "description": "Installed Packages",
"cmd": "opkg list-installed" "cmd": "opkg list-installed"
}, },
{ {
"description": "Database", "description": "Database",
"cmd": "db export" "cmd": "db export"
}, },
{ {
"description": "Configuration", "description": "Configuration",
"cmd": "uci export" "cmd": "uci export"
}, },
{ {
"description": "Runtime Configuration", "description": "Runtime Configuration",
@ -23,7 +23,7 @@
}, },
{ {
"description": "Firmware Environment", "description": "Firmware Environment",
"cmd": "fw_printenv" "cmd": "fw_printenv"
} }
] ]
} }

View file

@ -8,7 +8,7 @@
{ {
"type": "file", "type": "file",
"file": "/etc/config/ieee1905" "file": "/etc/config/ieee1905"
} }
], ],
"exec" : [ "exec" : [
{ {
@ -34,7 +34,7 @@
{ {
"description": "IEEE1905 Others", "description": "IEEE1905 Others",
"cmd": "ubus call ieee1905 others" "cmd": "ubus call ieee1905 others"
}, },
{ {
"description": "IEEE1905 Topology", "description": "IEEE1905 Topology",
"cmd": "ubus call ieee1905.topology dump" "cmd": "ubus call ieee1905.topology dump"
@ -42,7 +42,7 @@
{ {
"description": "MAP Agent Info", "description": "MAP Agent Info",
"cmd": "ubus call map.agent info" "cmd": "ubus call map.agent info"
}, },
{ {
"description": "MAP Agent Status", "description": "MAP Agent Status",
"cmd": "ubus call map.agent status" "cmd": "ubus call map.agent status"
@ -50,7 +50,7 @@
{ {
"description": "MAP Agent Backhaul Info", "description": "MAP Agent Backhaul Info",
"cmd": "ubus call map.agent backhaul_info" "cmd": "ubus call map.agent backhaul_info"
}, },
{ {
"description": "MAP Controller Status", "description": "MAP Controller Status",
"cmd": "ubus call map.controller status" "cmd": "ubus call map.controller status"
@ -66,6 +66,6 @@
{ {
"description": "Data Elements Dump", "description": "Data Elements Dump",
"cmd": "ubus call wifi.dataelements.collector refresh; sleep 2; ubus call wifi.dataelements.collector dump2" "cmd": "ubus call wifi.dataelements.collector refresh; sleep 2; ubus call wifi.dataelements.collector dump2"
} }
] ]
} }

View file

@ -12,7 +12,7 @@
{ {
"description": "Linux Network Interface Config", "description": "Linux Network Interface Config",
"cmd": "ifconfig -a" "cmd": "ifconfig -a"
}, },
{ {
"description": "IPv4 Routes", "description": "IPv4 Routes",
"cmd": "ip -d r" "cmd": "ip -d r"
@ -60,7 +60,7 @@
{ {
"description": "Bridge FDB", "description": "Bridge FDB",
"cmd": "bridge fdb" "cmd": "bridge fdb"
}, },
{ {
"description": "TCP listened ports", "description": "TCP listened ports",
"cmd": "netstat -tlnp" "cmd": "netstat -tlnp"

View file

@ -3,65 +3,65 @@
"exec" : [ "exec" : [
{ {
"description": "Firmware banks", "description": "Firmware banks",
"cmd": "ubus call fwbank dump" "cmd": "ubus call fwbank dump"
}, },
{ {
"description": "System Info", "description": "System Info",
"cmd": "ubus call system info" "cmd": "ubus call system info"
}, },
{ {
"description": "Board Info", "description": "Board Info",
"cmd": "ubus call system board" "cmd": "ubus call system board"
}, },
{ {
"description": "Running Processes", "description": "Running Processes",
"cmd": "top -b -n 1" "cmd": "top -b -n 1"
}, },
{ {
"description": "Kernel Parameters", "description": "Kernel Parameters",
"cmd": "sysctl -A 2>/dev/null" "cmd": "sysctl -A 2>/dev/null"
}, },
{ {
"description": "System Log", "description": "System Log",
"cmd": "timeout 5 logread -l 1000" "cmd": "timeout 5 logread -l 1000"
}, },
{ {
"description": "Driver Message", "description": "Driver Message",
"cmd": "timeout 5 dmesg" "cmd": "timeout 5 dmesg"
}, },
{ {
"description": "PCI Devices", "description": "PCI Devices",
"cmd": "lspci -k" "cmd": "lspci -k"
}, },
{ {
"description": "Installed Modules", "description": "Installed Modules",
"cmd": "lsmod" "cmd": "lsmod"
}, },
{ {
"description": "CPU Info", "description": "CPU Info",
"cmd": "cat /proc/cpuinfo" "cmd": "cat /proc/cpuinfo"
}, },
{ {
"description": "Memory Info", "description": "Memory Info",
"cmd": "cat /proc/meminfo" "cmd": "cat /proc/meminfo"
}, },
{ {
"description": "Slab Info", "description": "Slab Info",
"cmd": "cat /proc/slabinfo" "cmd": "cat /proc/slabinfo"
}, },
{ {
"description": "eMMC Partition/Volume Info", "description": "eMMC Partition/Volume Info",
"cmd": "fdisk -l", "cmd": "fdisk -l",
"dependency" : { "dependency" : {
"file": "/sbin/fdisk" "file": "/sbin/fdisk"
} }
}, },
{ {
"description": "NAND Partition/Volume Info", "description": "NAND Partition/Volume Info",
"cmd": "ubinfo --all", "cmd": "ubinfo --all",
"dependency" : { "dependency" : {
"file": "/usr/sbin/ubinfo" "file": "/usr/sbin/ubinfo"
} }
} }
] ]
} }

View file

@ -4,13 +4,13 @@
{ {
"type": "file", "type": "file",
"file": "/etc/config/cwmp" "file": "/etc/config/cwmp"
} }
], ],
"exec" : [ "exec" : [
{ {
"description": "TR-181 DM MAP", "description": "TR-181 DM MAP",
"cmd": "uci -c /etc/bbfdm/dmmap export" "cmd": "uci -c /etc/bbfdm/dmmap export"
}, },
{ {
"description": "TR-181 Parameters via BBFDM", "description": "TR-181 Parameters via BBFDM",
"cmd": "bbfdmd -c get Device." "cmd": "bbfdmd -c get Device."
@ -18,7 +18,7 @@
{ {
"description": "TR-181 Parameters via CWMP", "description": "TR-181 Parameters via CWMP",
"cmd": "icwmpd -c get Device." "cmd": "icwmpd -c get Device."
}, },
{ {
"description": "TR-069 status", "description": "TR-069 status",
"cmd": "ubus call tr069 status" "cmd": "ubus call tr069 status"
@ -31,17 +31,17 @@
"type": "file", "type": "file",
"file": "/var/log/icwmpd.log" "file": "/var/log/icwmpd.log"
} }
] ]
}, },
{ {
"description": "TR-181 Parameters via USP", "description": "TR-181 Parameters via USP",
"cmd": "obuspa -c get Device.", "cmd": "obuspa -c get Device.",
"timeout": 10 "timeout": 10
}, },
{ {
"description": "USP Agent Database", "description": "USP Agent Database",
"cmd": "obuspa -f $(uci -q get obuspa.global.db_file) -c show database" "cmd": "obuspa -f $(uci -q get obuspa.global.db_file) -c show database"
}, },
{ {
"description": "USP Logs", "description": "USP Logs",
"cmd": "cat /var/log/obuspa.log", "cmd": "cat /var/log/obuspa.log",
@ -50,7 +50,7 @@
"type": "file", "type": "file",
"file": "/var/log/obuspa.log" "file": "/var/log/obuspa.log"
} }
] ]
} }
] ]
} }

View file

@ -4,7 +4,7 @@
{ {
"type": "file", "type": "file",
"file": "/etc/config/asterisk" "file": "/etc/config/asterisk"
} }
], ],
"exec" : [ "exec" : [
{ {
@ -14,7 +14,7 @@
{ {
"description": "Endpoint Count", "description": "Endpoint Count",
"cmd": "ubus call endpt count" "cmd": "ubus call endpt count"
}, },
{ {
"description": "Voice Status", "description": "Voice Status",
"cmd": "ubus call voice.asterisk status" "cmd": "ubus call voice.asterisk status"
@ -27,7 +27,7 @@
"type": "file", "type": "file",
"file": "/etc/config/dect" "file": "/etc/config/dect"
} }
] ]
}, },
{ {
"description": "DECT Handsets", "description": "DECT Handsets",
@ -37,7 +37,7 @@
"type": "file", "type": "file",
"file": "/etc/config/dect" "file": "/etc/config/dect"
} }
] ]
} }
] ]
} }

View file

@ -4,7 +4,7 @@
{ {
"type": "file", "type": "file",
"file": "/sys/class/ieee80211" "file": "/sys/class/ieee80211"
} }
], ],
"exec" : [ "exec" : [
{ {
@ -26,6 +26,6 @@
{ {
"description": "iwinfo interface details", "description": "iwinfo interface details",
"cmd": "/usr/bin/iwinfo" "cmd": "/usr/bin/iwinfo"
} }
] ]
} }