Question

I have an access point running openWRT v12.09 with tcpdump installed. On a server I have node.js running with couchdb. I would like the output of tcpdump to be written to couchdb. This is where I'm a bit in the dark. I can't figure out how to make the connection between openWRT/tcpdump to node.js/couchdb.

I read a pipe is way to have one side reading data and the other side storing the data. That would be the goal since the storage capacity of the access point is limited. I would like the output of tcpdump to be converted in to JSON, is that possible? So it's easy to read and store in the database.

I read about, openVPN, pipe, nodecat and tried a bunch of things but I need some assistance please, thank you.

Was it helpful?

Solution

Why won't you use simple HTTP protocol? That's exactly the case for which it was invented - moving resources accross the Web.

Install lightweight HTTP server on the access point, if you don't have one there already. For example, boa is very lightweight, single-tasking HTTP server, which could be more than enough for this purpose.

Then, just:

  • let the tcpdump store the file in the server directory tree at the access point
  • on the server, use HTTP module of node.js to download the file
  • store it in the database.

That's it. There's no need nor is it a good idea to convert your binary data into JSON!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top