Collecting KioskNet LogsIn the event of a failure to DTN or higher layer applications, we require a means to collect debug logs. This set of scripts is designed to collect logs from each node in a KioskNet deployment, flood logs across the DTN, and store them on a central server. Acknowledgement messages are then flooded across the network to delete logs from each node. ScriptsThe following scripts can be found in the KioskNet source tree within the KioskNet/scripts/log-flood/ folder. log-pkg.plThis script archives the contents of /var/log/ and truncates each file. The compressed log files are transferred to /var/KioskNet/nodes/<eid>/<timestamp>_logs.tar.gz. The <eid> folder is the unique end point ID of the KioskNet node. In a typical deployment it is sufficient to run this script once a day to archive the day's logs. The following entry in /etc/crontab will archive the logs at 1:30 AM each night. 30 1 * * * root /bin/KioskNet/log-flood/log-pkg.pl log-flood.plThis script runs on each disconnected node in the KioskNet deployment (kiosks and buses). The script waits for an event from the wireless interfaces. When the node receives a connection from another node it requests acknowledgement messages from it. Acknowledgement messages are located at /var/KioskNet/nodes_ack/. When an ack message is received, the original message is deleted. After requesting and processing acknowledgement messages, the script pushes logs to the neighboring node. Logs for the local node as well as other nodes are located within /var/KioskNet/nodes/. These logs are flooded across the disconnected network until they reach an Internet gateway. This script is invoked with an optional parameter indicating the SSH private key used to connect to a neighboring node. log-upload.plThis script runs on an Internet gateway. Disconnected nodes upload logs to the gateway in the usual /var/KioskNet/nodes/ directory. This script does not flood the logs of for the local node. Instead, it periodically uploads the entire contents of /var/KioskNet/nodes/ to a server on the Internet. This script is invoked with an optional parameter indicating the SSH private key used to connect to the central server on the Internet. log-ack.plThis script runs on the server collecting logs. It periodically creates acknowledgement messages for received logs. These logs are downloaded by the log-upload.pl script running on each Internet gateway. RequirementsThese scripts have the following external requirements /etc/KioskNet/log-flood/user_at_hostThis file contains the username and hostname of the log backup account on the proxy node. This file should contain one line in the form: <user>@<hostname> In log-upload.pl, this line is passed to the ssh when tunneling rsync data. /etc/KioskNet/eidThis file contains the unique end point ID of the KioskNet node. InvocationThe log-flood.pl, log-upload.pl and log-ack.pl scripts should be invoked automatically when the node starts up. The KioskNet/scripts/log-flood/init.d/ folder within the KioskNet source tree contains init.d scripts for automatically starting each logging script. Return to deployment guide. |
![]() |
