pystats is a simple and useful program.It is a little tool to collect and format data from log(e.g., nginx log).Data wiil be sent to StatsD backend service.StatsD usually works with graphite together.pystats is a small piece of puzzle to build a monitor system.You can override the Parser class for adapting to your own project.
- python 2.6 or Higher(2.x)
- A POSIX compatible operating system (Linux, OSX, BSD)
-
server:
install graphite
install statsd
-
client:
install pystatsd
-
clone the project
-
start the pystats:
python pystats.py -f access.log
Usage: pystats.py [options]
Options:
-h, --help show this help message and exit
-f FILE, --file=FILE file to tail into statsD
-H HOST, --host=HOST destination StatsD host server
-p PORT, --port=PORT destination StatsD port
-b BEGIN, --begin=BEGIN
where does tail begin, 0 means beginning, 1 means
current, 2 means end
-c CATEGORY, --category=CATEGORY
which category of file to collect