autofact

package module
v0.0.0-...-aef646c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2017 License: MIT Imports: 1 Imported by: 0

README

autofact

Write: the product is thoroughly pizzled.

-Philip K. Dick, Autofac

Autofact periodically collects data about a client for basic monitoring purposes. Autofact is simple, fast, and uses minimal client resources. It can either collect the data locally as JSON or push it to a remote location using Websockets, usually autofactory.

About

autofactory. Autofact's goal is to collect information about a client's usage with minimal impact on the client on which it is running. To accomplish this, Autofact uses joefriday to collect the information, which was created to minimize CPU usage and memory allocations during data collection.

Autofact, on start-up, will collect information about the system on which it is running: CPU, RAM, network interfaces, Kernel, and OS. Once running, it collects, at minimum, the system's loadavg on a regular interval. It can also collect a client's CPU utilization, RAM usage, and network usage. This data is either collected locally as JSON or sent to Autofactory as Flatbuffer serialized bytes.

Communications between the server and client are via websockets and most messages are serialized using flatbuffers. An inventory of clients is persisted using boltdb..

When Autofactory is used, it can either save the data to InfluxDB or as JSON to stdout or some other output destination.

Optional Dependencies

InfluxDB can be used to store the facts. Currently, it is assumed that InfluxDB is on the localhost and listening on port 8086.

To install follow the instructions: https://influxdata.com/downloads/.

Once installed, the database and database user need to be created:

$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.10.2
InfluxDB shell 0.10.2
> create user autoadmin with password 'thisisnotapassword'
> grant all privileges to autoadmin
> create database autofacts
> quit

Use the graph and dashboard builder of your choice: Grafana is one option.

autofactory

Autofactory is the optional server. By default, it listens on :8675 and processes incoming messages.

When a client connects, it responds with the client configuration, which defines what data is to be collected and the invterval of its colleciton. If the client is a new client, the client's ID will also be sent.

This component is not necessary if autofact is running in serverless mode.

autofact

Autofact runs on client nodes. This is the only required component. It can be run in serverless mode, which will output the data, as JSON, to a local destination, which defaults to stdout. In client-server mode, it sends the collected data to the Autofactory server.

Notes

This is a work in progress.

At this point in time, nothing is encrypted and ws is being used so definitely don't use this where communications will go over public networks.

Currently, only Linux systems are supported and this has only been tested on Debian Jessie.

Autofact may support other serialization formats with protocol buffers being the most likely.

Documentation

Index

Constants

View Source
const PathVarName = "AUTOFACTPATH"

PathVarName is the environment variable name for the autofact path.

Variables

View Source
var (
	// WriteBufferSize is the The default size for a websocket write buffer.
	WriteBufferSize = 1024
	// ReadBufferSize is the The default size for a websocket read buffer.
	ReadBufferSize = 1024

	// WriteWait is the default time to wait for a write to succeed.
	WriteWait = 5 * time.Second
)
View Source
var (
	// LoadAvg is used for requesting a system's loadavg.
	LoadAvg = []byte("loadavg")
)

Text Message stuff.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
autofact command
autofactory command
autofactory/output
package output exists for stringer generation because having it in autofactory results in go stringer errors.
package output exists for stringer generation because having it in autofactory results in go stringer errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL