Reimplements the transmission of the report using nixio (instead of netcat).
As the old implementation lead to rather inconsistent notifications on the
screen due to some incorrect return value handlings of os.execute(cat ...),
which as well produced an inconsistent output (an error message of netcat
got printed to the screen for the first host without the information that
there is a second one to which the report can be send; if the transmission
to that host succeeds, one will see the irritating sequence "failure" -->
"report has been sent" on the screen).
As error handling and output-redirection via os.execute(...) would have re-
quired some refactoring anyway, the logic is now implemented using nixio
sockets, as their behaviour is easier to control from within a Lua-script,
and - additionally - enables us to keep the debug data in memory (i.e. we
don't have to temporarily write it to /tmp/debug-report.txt anymore). The
report only needs to be stored permanetely, if the transmission fails for
whatever reason. Thus, as this part of the script had to be changed as well,
we now make use of the nixio library to interact with files.
Signed-off-by:
Stefan Laudemann <thisco@webcake.de>
Please register or sign in to comment