Skip to content
Snippets Groups Projects
Commit c606ac89 authored by Michael Schwarz's avatar Michael Schwarz
Browse files

Changed layout of debugreport

parent c7adc6c1
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ function cmd(_command) ...@@ -8,7 +8,7 @@ function cmd(_command)
local f = io.popen(_command) local f = io.popen(_command)
local l = f:read("*a") local l = f:read("*a")
f:close() f:close()
return "--- START COMMAND " .. _command .. " ---\n" .. l .. "--- END COMMAND " .. _command .. " ---\n\n" return "# " .. _command .. ": \n" .. l .. "\n"
end end
-- read contents of a given file -- read contents of a given file
...@@ -17,7 +17,7 @@ function readFile(_file) ...@@ -17,7 +17,7 @@ function readFile(_file)
if f~=nil then if f~=nil then
local l = f:read("*a") local l = f:read("*a")
f:close() f:close()
return "--- BEGIN OF FILE " .. _file .. " ---\n" .. l .. "--- END OF FILE " .. _file .. " ---\n\n" return "--- Content of file " .. _file .. " ---\n" .. l .. "\n\n"
else else
return "" return ""
end end
...@@ -50,18 +50,24 @@ if debugFile==nil then ...@@ -50,18 +50,24 @@ if debugFile==nil then
print ('This may take some seconds, please stand by.') print ('This may take some seconds, please stand by.')
-- first of all, collect some generic information about the system -- first of all, collect some generic information about the system
debugdata = debugdata .. "---- BEGIN SYSTEM INFORMATION ----\n"
debugdata = debugdata .. cmd("uname -n") debugdata = debugdata .. cmd("uname -n")
debugdata = debugdata .. cmd("cat /lib/gluon/release") debugdata = debugdata .. cmd("cat /lib/gluon/release")
debugdata = debugdata .. cmd("cat /tmp/sysinfo/model") debugdata = debugdata .. cmd("cat /tmp/sysinfo/model")
debugdata = debugdata .. cmd("uptime") debugdata = debugdata .. cmd("uptime")
debugdata = debugdata .. cmd("date") debugdata = debugdata .. cmd("date")
debugdata = debugdata .. "---- END SYSTEM INFORMATION ----\n\n"
-- now get some information about the network status -- now get some information about the network status
debugdata = debugdata .. cmd("ip addr show")
debugdata = debugdata .. "---- BEGIN IP AND ROUTUNG INFORMATION ----\n"
debugdata = debugdata .. cmd("ip addr show")
debugdata = debugdata .. cmd("ip route show") debugdata = debugdata .. cmd("ip route show")
debugdata = debugdata .. cmd("ip -6 route show") debugdata = debugdata .. cmd("ip -6 route show")
debugdata = debugdata .. "---- BEGIN IP AND ROUTUNG INFORMATION ----\n\n"
-- get wireless status -- get wireless status
debugdata = debugdata .. "---- BEGIN WIRELESS INFORMATION ----\n"
debugdata = debugdata .. cmd("iw phy phy0 info") debugdata = debugdata .. cmd("iw phy phy0 info")
debugdata = debugdata .. cmd("iw dev wlan0 info") debugdata = debugdata .. cmd("iw dev wlan0 info")
debugdata = debugdata .. cmd("iw dev wlan0 station dump") debugdata = debugdata .. cmd("iw dev wlan0 station dump")
...@@ -71,8 +77,11 @@ if debugFile==nil then ...@@ -71,8 +77,11 @@ if debugFile==nil then
debugdata = debugdata .. cmd("iwinfo wlan0-1 info") debugdata = debugdata .. cmd("iwinfo wlan0-1 info")
debugdata = debugdata .. cmd("iwinfo wlan0 assoclist") debugdata = debugdata .. cmd("iwinfo wlan0 assoclist")
debugdata = debugdata .. cmd("iwinfo wlan0-1 assoclist") debugdata = debugdata .. cmd("iwinfo wlan0-1 assoclist")
debugdata = debugdata .. "---- END WIRELESS INFORMATION ----\n\n"
-- try to get some more information about wlan hardware status -- try to get some more information about wlan hardware status
debugdata = debugdata .. "---- BEGIN HARDWARE STATUS ----\n"
_files = {"reset", "queues", "interrupt"} _files = {"reset", "queues", "interrupt"}
for file in list_iter(_files) do for file in list_iter(_files) do
debugdata = debugdata .. readFile(ATH9K_DEBUGFS_DIR .. "/" .. file) debugdata = debugdata .. readFile(ATH9K_DEBUGFS_DIR .. "/" .. file)
...@@ -86,14 +95,17 @@ if debugFile==nil then ...@@ -86,14 +95,17 @@ if debugFile==nil then
for file in list_iter(_files) do for file in list_iter(_files) do
debugdata = debugdata .. readFile(ATH9K_DEBUGFS_DIR .. "/" .. file) debugdata = debugdata .. readFile(ATH9K_DEBUGFS_DIR .. "/" .. file)
end end
debugdata = debugdata .. "---- END HARDWARE STATUS ----\n\n"
-- get batman status
-- get batman status
debugdata = debugdata .. "---- BEGIN BATMAN AND FASTD STATUS ----\n"
debugdata = debugdata .. cmd("batctl gwl") debugdata = debugdata .. cmd("batctl gwl")
debugdata = debugdata .. cmd("batctl tl") debugdata = debugdata .. cmd("batctl tl")
-- finally get fastd status -- finally get fastd status
os.execute("killall -USR1 fastd 2>/dev/null") os.execute("killall -USR1 fastd 2>/dev/null")
debugdata = debugdata .. cmd("logread") debugdata = debugdata .. cmd("logread")
debugdata = debugdata .. "---- END BATMAN AND FASTD STATUS ----\n\n"
-- write debugreport to file -- write debugreport to file
debugFile = io.open("/tmp/debugreport.txt", "w") debugFile = io.open("/tmp/debugreport.txt", "w")
...@@ -108,6 +120,7 @@ siteConfig = require("gluon.site_config") ...@@ -108,6 +120,7 @@ siteConfig = require("gluon.site_config")
if localMode then if localMode then
print ('As requested, i will not send the report, here it is:') print ('As requested, i will not send the report, here it is:')
print (debugdata) print (debugdata)
os.execute("rm /tmp/debugreport.txt")
os.exit(0) os.exit(0)
else else
print('Sending report to Admin-Team ...') print('Sending report to Admin-Team ...')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment