Simple access log parsing for zabbix (tested with nginx)

Overview

zabbix-nginx-stats

Simple script to import basic nginx statistics into zabbix. It parses the log file (currently only supports one basic format) and pushes the data into zabbix. It is written in perl with a small bash wrapper script which uses logtail.

Synced values include (all since last execution):

  • Request Count
  • Request count by status code
  • Request Time: Average, Mean, Median, 90%, 80% and 25% lines
  • Upstream Response Time (Same as Request Time)
  • Body Bytes Sent: Average, Sum

The default zabbix template has preconfigured triggers to warn on 5 errors (status code 500, 503 and 403) and graphs for request time and request count by status.

Installation/Configuration:

checkout from github

install dependencies

  • logtail2 (debian: apt-get install logtail)
  • Perl
  • Statistics::Descriptive, Date::Parse and File::Temp
    • for debian: install packages libstatistics-descriptive-perl libtimedate-perl

configure logfile output:

     log_format timed_combined '$remote_addr $host $remote_user [$time_local]  '
                '"$request" $status $body_bytes_sent '
                '"$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe';
                
     access_log /var/log/nginx/access.log timed_combined;

Import template zbx_template_nginx.xml

configure crontab to run every 10 minutes:

8-59/10 * * * *   root      /home/scripts/zabbix-nginx-stats/zabbix-nginx-stats-runner.sh

watch results coming in.

Screenshot Requests by Status

Changelog

  • 2013-07-15: Initial release

Roadmap

Allow pushing to multiple zabbix hosts - If you are using nginx as proxy in front of various applications it should be possible to filter these applications to get separated statistics.

Bitdeli Badge

You might also like...

Simple and modern news app that incorporates REST API (newsapi.org), all built entirely with Flutter.

Simple and modern news app that incorporates REST API (newsapi.org), all built entirely with Flutter.

A simple news app with a minimalistic and clean UI that incorporates the newsapi.org api all built entirely with Flutter. Be sure to leave a star 🌟

Dec 1, 2022

Simple student record manager app for learning flutter basics

Simple Student Record Manager Simple student record manager app for learning flutter basics integrated with Django REST API (refer Generic-Student-API

Oct 31, 2022

A simple app to keep track the time you Learn, Playing, Reading, ... in every week. This is also my attempt to teach myself Flutter & Dart

A simple app to keep track the time you Learn, Playing, Reading, ... in every week. This is also my attempt to teach myself Flutter & Dart

Progressor 0.0.1 Sometime you want to set a target for you weekly, for example: "Reading Book for 8 hours every week". This app helps you to do that.

Oct 12, 2022

Simple, pretty and powerful logger for flutter

Simple, pretty and powerful logger for flutter

Language: English | 中文简体 flutter_logger Simple, pretty and powerful logger for flutter,It has the log level, file name and line number, and can custom

Sep 23, 2022

A super simple l10n tool with auto translations via GoogleSheet.

A super simple l10n tool with auto translations via GoogleSheet.

Flutter Translation Sheet Generator [fts] Command line application to make your l10n super fast. Compose your strings in yaml/json format and use Goog

Oct 24, 2022

A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background which in turn increases your credit score.

A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background which in turn increases your credit score.

Sahayog A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background whi

May 21, 2022

Server that provide API to simple note application

Server that provide API to simple note application

note-app-api-mobile end-to-end note application API Golang for the web application MongoDB for the database PostMan requests Collection Flutter simple

Oct 4, 2022

simple battery app with Flutter

battery_app A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Feb 26, 2022

A simple, modern AppImageHub Client, powered by flutter.

A simple, modern AppImageHub Client, powered by flutter.

AppImagePool Simple AppImageHub Client Main Features FLOSS and non profit app Simple categories Download from github directly, no extra-server involve

Jan 1, 2023
Comments
  • Move 501, 502 and 503 errors to separate counters, do not alert on 403/404

    Move 501, 502 and 503 errors to separate counters, do not alert on 403/404

    Due to high random traffic on the internet these days there is little point into alerting on 403/404 errors. On the other hand 502, 503 and 504 errors are pretty common nowadays when traffic to modern web applications is proxied through nginx.

    opened by adlugopolski 0
  • Use of uninitialized value $value in addition

    Use of uninitialized value $value in addition

    Hello,

    I use the template to monitor Ngnix and get this error

    Use of uninitialized value $value in addition (+) at /etc/zabbix/zabbix-nginx-stats/zabbix-nginx-stats.pl line 146, <> line 1.

    Thank you for your help

    opened by julioo 1
Owner
Herbert Poul
Freelance app developer @ https://codeux.design/ Check out my latest OSS project at https://authpass.app/
Herbert Poul
A type-safe command-line parsing library for Dart

plade Plade is a type-safe CLI parsing library for Dart. Highlights Fully type-safe and null-safe. Support for a variety of different parsing styles (

Ryan Gonzalez 6 Jan 1, 2022
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 6, 2023
Simple yet powerful, open-source SpaceX launch tracker.

SpaceX GO! Simple yet powerful, open-source SpaceX launch tracker About the project The purpose of this project is to develop the ultimate SpaceX expe

Jesús Rodríguez 782 Dec 24, 2022
A simple Pomodoro App.

flutter_pomodoro_timer This App follows the design by Matheus Gois on Dribble (it doesn't mean this project will be such a clone, it's just based ?? )

Lucas S Nogueira 60 Dec 29, 2022
A simple Flutter Note Taking app with local database.

Flutter Simple & Lightweight Note App Flutter Simple & Lightweight Note App UI/UX Credit: https://dribbble.com/shots/11875872-A-simple-and-lightweight

Ahmad Amin 63 Nov 10, 2022
Simple markdown editor. with custom keyboard helper for making bold, italic, list, URL, photoURL, etc

Flutter Markdown Editor A simple markdown creator/editor application, developer with flutter. special auxiliary keyboard features (for develop markdow

Ismael Shakverdiev 36 Dec 15, 2022
A simple, cross-platform password manager created with Flutter.

PassMan PassMan Logo © 2021 by Yash Ahir is licensed under CC BY-NC 4.0 A simple, cross-platform password manager created with Flutter. How to run thi

Yash Ahir 19 Dec 14, 2022
Simple manga reader app for MangaSee, built with Flutter

MAPI Simple manga reader app for MangaSee. Mind that this is my very first attempt on using Flutter. Why I wanted to try out Flutter, and i needed an

Simone 17 Nov 21, 2022
A simple and easy to use Redis client for Dart

redis_dart A simple and minimalist Redis client for Dart See it in pub: https://pub.dev/packages/redis_dart and GitHub: https://github.com/gabrielpach

Gabriel Pacheco 7 Dec 25, 2022
Weather app A complete simple weather application.

Weather app A complete simple weather application. Getting Started Get your own API key from: open weathe map aqicn Google Cloud Platform Setup for go

Yoad 10 Oct 25, 2022