Code Monkey home page Code Monkey logo

arploggingdaemon's Introduction

ARP logging daemon

Simple systemd Daemon to write ARP from interface wlp2s0 requests/replies to syslog. Also you can pause logging by sending commands through unix domain socket in format: integer time in seconds or word 'continue'. If pause expires daemon will write to syslog amount of missed requests. Written in pure golang using gopacket lib to capture packets.

Getting Started

It's important, that daemon must be run with root privileges, or you should run something like :setcap cap_net_raw+ep <your_appp_name>. Pull repository, build all *.go. Than you can just run program with root privilege. Integrating daemon with systemd is described in install section.

Prerequisites

Required libcap-dev library. All go packets can be received using "go get" command.Required golang ver. 1.6.2 or higher (doesn't compile under go 1.3.3 and go 1.4) Also it's usefull to use socat utility. Example for Debian/Ubuntu:

sudo apt-get update
sudo apt-get install libpcap-dev
sudo apt-get install socat
go get github.com/google/gopacket
go get github.com/google/gopacket/layers
go get github.com/google/gopacket/pcap
go get github.com/coreos/go-systemd/daemon
sudo socat - UNIX-CONNECT:/tmp/foo   // use this then daemon is already working to pause/continue logging

Installing

Pull repository, build all *.go files using go build and install in /usr/bin/arpLoggingDaemon or wherever you want, if you change ExecStart value in ArpLogginDaemon.service. You should also locate ArpLogginDaemon.service in /etc/systemd/system/ or write your own systemd script. After that execute the following commands (my unit here is name of *.service script (without .service)):

systemctl status myunit
systemctl enable myunit // if status: disabled
systemctl start myunit

If systemctl prints errors, fix it before start.

Running the tests

No tests added yet, it was my first learning program in golang.

Built With

go build *.go should work just fine, also you print all filenames manually or write your own build script.

arploggingdaemon's People

Contributors

neversleepingowl avatar

Stargazers

Dmitry Bragin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.