GithubHelp home page GithubHelp logo

gowatcher's Introduction

Build Status RaspberryPi compilation command example GOARCH=arm GOARM=7 go build -o watcher watcher.go

Usage:

  -d	Daemonize gowatcher
  -s string
    	send signal to the daemon
		quit — graceful shutdown
		stop — fast shutdown
  -t
    	Test mode - print test phrase without run all modules
  -version
        Print version info

Makefile shortcuts:

    make run        run program (<Ctrl+C> to exit)
    make run_test   run program in test mode (print "It's work" phrase and shutdown)
    make build      build program (with native arch)
    make build_rpi  build program for raspberry pi arch
    make tests      run tests

How does it work?

It send to receivers (slack or telegram) messages periodically, like this:

*raspberrypi* *uptime* says:
 17:41:11 up 18 days, 23:16,  3 users,  load average: 0,31, 0,39, 0,37

or this

*raspberrypi* *who* says:
New user detected: username       pts/1        2018-08-18 17:39 00:02       19165 (192.168.0.245)

Now implemented 4 handlers (watchers): w, who, df, uptime. Each one run self command and send the result to receivers.

How to configure it?

  1. Copy config.json.dist to folder with program cp config.json.dist config.json
  2. Modify the configuration vim config.json
  3. Restart the app watcher -s stop && watcher -d

Planned features:

  1. In case one receiver is not available (for example, telegram is blocked) then other receivers must report this.
  2. ✔️ Each watcher has self time of loop in settings
  3. ✔️ Watchers supports some args in settings
  4. df watcher can report about critical free size of partial
  5. Exists load average graph which published to receivers periodically
  6. Released email receiver with customizable watchers
  7. Hot reconfigure app
  8. ✔️ Min & Max loop constrains
  9. Add system log watcher for app errors

gowatcher's People

Contributors

sepuka avatar

Watchers

 avatar  avatar

gowatcher's Issues

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.