Giter VIP home page Giter VIP logo

nginxtop's Introduction

Nginxtop

UNIX top-like app for nginx (or Apache, if you wish) access logs.

Every so often, a poorly behaved spammer or web crawler will hit one of the websites I manage, and proceed to load the same pages over and over, causing a resource issue and possibly even a Denial of Service. I got tired of this, so I built my own tool to determine in real time who the culrprits were.

Installation

Via npm (recommended)

npm install -g nginxtop

This will install nginxtop into /usr/local/bin/ or somewhere else likely to be in your path.

From source

[email protected]:dmuth/nginxtop.git
cd nginxtop

This will check out a copy of the nginxtop app to your current directory.

Usage

tail -f /var/log/nginx/access.log | nginxtop [ -n num_hosts_to_print] [-i report_interval_in_seconds]

Testing

There is a file called test.log in this directory. It contains sample log entries. To test nginxtop using it:

tail -fn100 test.log | nginxtop -n 5

You'll start to see output like this once every second:

             Nginxtop Top Hosts
===========================================
                    127.0.0.10:     14 hits
                     127.0.0.1:      7 hits
                     127.0.0.2:      6 hits
                     127.0.0.3:      6 hits
                     127.0.0.4:      5 hits

Where to find this

Feedback

Have feedback? Want to report bugs?

Hit me up via email ([email protected]) or via many other methods listed at: http://www.dmuth.org/contact

Enjoy!

nginxtop's People

Contributors

dmuth avatar

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.