router-netsender: add ability to read kernel logs

Issue #42 resolved
Trek Hopton created an issue

We have the functionality to read syslogs of a router remotely, now it would also be helpful to have access to the kernel logs provided through dmesg.

Implementation could be as follows:

  • When the netsender starts, do an initial reading of existing dmesg logs via SSH.
  • Every monitor period, call dmesg again via SSH and add the output to the logs.
  • Provide a cloud controlled boolean ‘clearDmesg' that the netsender will check, if true, run 'dmesg -c’ which will return the output but clear the existing messages. This way we are not reading old messages every time that we want new messages. An alternative would be to keep old messages but compare output and look for anything new but I think for now clearing the dmesg will suffice.

There is no 'logging to server' configuration options for dmesg so we cannot stream new messages only to the pi. If we want new messages, we will have to use the method mentioned above ie. via SSH connection.

Comments (2)

  1. Trek Hopton reporter

    Some dmesg tools have the ability to run similar to tail -f with the option --follow or -w. This would allow us to only see new log messages without clearing the dmesg buffer, however the dmesg provided by busybox doesn’t have this capability.

  2. Log in to comment