unpoller_unpoller/plugins/mysql/README.md

958 B

MYSQL Output Plugin Example

The code here, and the dynamic plugin provided shows an example of how you can write your own output for unifi-poller. This plugin records some very basic data about clients on a unifi network into a mysql database.

You could write outputs that do... anything. An example: They could compare current connected clients to a previous list (in a db, or stored in memory), and send a notification if it changes. The possibilities are endless.

You must compile your plugin using the unifi-poller source for the version you're using. In other words, to build a plugin for version 2.0.1, do this:

mkdir -p $GOPATH/src/github.com/davidnewhall
cd $GOPATH/src/github.com/davidnewhall

git clone git@github.com:davidnewhall/unifi-poller.git
cd unifi-poller

git checkout v2.0.1
make vendor

cp -r <your plugin> plugins/
GOOS=linux make plugins

The plugin you copy in must have a main.go file for make plugins to build it.