Git Product home page Git Product logo

ansible-role-nginx_logfile_exporter's Introduction

CI

Ansible Role: Nginx Logfile exporter

This role installs Prometheus' Nginx logfile exporter on Nginx hosts.

Requirements

Add this to nginx.conf

log_format prometheus '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent" '
                    'rt=$request_time uct=$upstream_connect_time uht=$upstream_header_time urt=$upstream_response_time sn=$host';

Add this to the server block of your vhost. You can use access_log multiple times.

access_log   /var/log/nginx/servername.prometheus.log prometheus;

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

nginx_logfile_exporter_version: '1.9.2'

The version of Nginx Logfile exporter to install. Available releases can be found on the tags listing in the Nginx Logfile exporter repository. Drop the v off the tag.

If you change the version, the nginx_logfile_exporter binary will be replaced with the updated version, and the service will be restarted.

nginx_logfile_exporter_arch: 'amd64'
nginx_logfile_exporter_download_url: https://github.com/Lusitaniae/nginx_logfile_exporter/releases/download/v{{ nginx_logfile_exporter_version }}/nginx_logfile_exporter-{{ nginx_logfile_exporter_version }}-{{ nginx_logfile_exporter_arch }}.tar.gz

The path where the nginx_logfile_exporter binary will be downloaded and installed from.

nginx_logfile_exporter_options: ''

Any additional options to pass to nginx_logfile_exporter when it starts.

nginx_logfile_exporter_state: started
nginx_logfile_exporter_enabled: true

Controls for the nginx_logfile_exporter service.

Dependencies

None.

Example Playbook

- hosts: all
  roles:
    - role: ansible-role-nginx_logfile_exporter

License

MIT / BSD

Author Information

This role was created in 2021 by Daniel Weeber. Heavily inspired and forked from Jeff Geerling, author of Ansible for DevOps.

ansible-role-nginx_logfile_exporter's People

Contributors

dweebertwt avatar

Watchers

 avatar  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.