Skip to content

🔨A real time monitor for Nginx access log written in Go

License

Notifications You must be signed in to change notification settings

Marticles/nginx-log-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nginx-Log-Monitor

MIT Licence

Introduction

A simple monitor for analyzing nginx log.

This Project implemented as two separate parts:

  1. Read, clean, process and append the each log to the databse from nginx log file "access.log". This part is implemented in Go.
  2. Fetch the relevant information from the databse and visualize the data element by using Grafana.

Usage

  • Get influxDB in Go
$ go get github.com/influxdata/influxdb
  • Install and run InfluxDB
$ docker pull influxdb
$ docker run influxdb
  • Install and run Grafana
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.3.2_amd64.deb 
$ sudo dpkg -i grafana_5.3.2_amd64.deb
$ sudo service grafana-server start
  • Run procrss.go and open the follwing url , then you will see the visualization
https://localhost:3000
  • Open https://localhost:9999/monitor will return monitor's general info with json
{
	"handleLine": 999,
	"tps": 123,
	"readChanLen": 456,
	"writeChanLen": 456,
	"runTime": "8h47m51.6090878s",
	"errNum": 123
}

About

🔨A real time monitor for Nginx access log written in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages