Skip to content
Snippets Groups Projects
Commit 3183499f authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Script to send logs from the device

Without de-duplication, but works.
parent 674f6875
No related branches found
No related tags found
No related merge requests found
#!/bin/busybox sh
# Configuration
# List of daemon names. Separate by \|, it's put into the regular expression.
DAEMONS='ucollect\|updater\|watchdog'
# Where to put the logs (don't forget the question mark at the end)
BASEURL='http://securt-test.labs.nic.cz/logsend/upload.cgi?'
# TODO: Get the router ID
RID=12345
# Grep regexp: Month date time hostname something.something daemon
logread | \
grep "^[^ ][^ ]* *[0-9][0-9]* *[0-9:][0-9:]* [^ ][^ ]* [a-z][a-z]*\.[a-z][a-z]* \($DAEMONS\)\(\[[0-9]*\]\|\):" | \
curl -T - "$BASEURL$RID" -X POST
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