CCR BeagleBone Tools  v0.0.1-2206
Production Tools for BeagleBone Devices
 All Pages
CCR Log
See Also
BeagleBone Tools

CCR_Log logs a short text message on a remote web server via the use of a known URL. The user agent is unique to each device.

Key Description
available since 2017-01
package filename ccr_log-xyz.deb
configuration /opt/ccr/files/log.ccr
cron job /etc/cron.d/ccr_log
script /usr/bin/ccr_log.sh [<message>]
example ccr_log.sh "Device is restarting"

A URL is provided (see /opt/ccr/files/log.ccr) to which the log text message is appended as a HTML query. wget is then used to retrieve the URL, which results in a record of the request in the web server's log. This is definitely not meant for normal logging, but instead a single message per day or per week as a beacon. (See rsyslog if UDP or TCP remote logging is required.)

To install:

sudo dpkg -i ccr_log-*.deb

Then call ccr_log.sh manually to log a message:

ccr_log.sh "Device is restarting"

or:

ccr_log.sh Device is restarting

On the web server, messages received will appear as follows in Apache's access.log file:

192.168.1.38 - - [09/Jan/2017:09:33:47 +0000] "GET /ccr/device.html?m=Device%20is%20restarting HTTP/1.1" 200 5864 "-" "CCR ID=29e5ee03ffb34c7f91c5432df4d3e0ef"

Note how wget automatically URL encodes the text message at the end of the request.

The same message logged with wget on the remote HTTP server is also logged locally with rsyslog:

Jan 9 01:33:43 bbbw-testing ccr[28462]: /usr/bin/ccr_log.sh: CCR ID=29e5ee03ffb34c7f91c5432df4d3e0ef: Device is restarting
See Also
/opt/ccr/files/log.ccr
/etc/machine-id
/var/lib/dbus/machine-id