GithubHelp home page GithubHelp logo

bgilmore / junos_exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from czerwonk/junos_exporter

0.0 0.0 0.0 3.16 MB

Exporter for devices running JunOS to use with https://prometheus.io/

License: MIT License

Dockerfile 0.99% Makefile 2.97% Go 96.04%

junos_exporter's Introduction

junos_exporter

Build Status Docker Build Statu Go Report Card

Exporter for metrics from devices running JunOS (via SSH) https://prometheus.io/

Remarks

This project is an alternative approach for collecting metrics from Juniper devices. The set of metrics is minimal to increase performance. We (a few friends from the Freifunk community and myself) used the generic snmp_exporter before. Since snmp_exporter is highly generic it comes with a lot of complexity at the cost of performance. We wanted to have an KIS and vendor specific exporter instead. This approach should allow us to scrape our metrics in a very time efficient way. For this reason this project was started.

Important notice for users of version < 0.5

In version 0.5 SNMP was replaced by SSH. This is was a breaking change (metric names were kept). All SNMP related parameters were removed at this point. Please have a look on the new SSH related parameters and update your service units accordingly.

Features

The following metrics are supported by now:

  • Interfaces (bytes transmitted/received, errors, drops)
  • Routes (per table, by protocol)
  • Alarms (count)
  • BGP (message count, prefix counts per peer, session state)
  • OSPFv2, OSPFv3 (number of neighbors)
  • Interface diagnostics (optical signals)
  • ISIS (number of adjacencies, total number of routers)
  • Environment (temperatures)
  • Routing engine statistics

Install

go get -u github.com/czerwonk/junos_exporter

Usage

In this example we want to scrape 3 hosts:

  • Host 1 (DNS: host1.example.com, Port: 22)
  • Host 2 (DNS: host2.example.com, Port: 2233)
  • Host 3 (IP: 172.16.0.1, Port: 22)

Binary

./junos_exporter -ssh.targets="host1.example.com,host2.example.com:2233,172.16.0.1" -ssh.keyfile=junos_exporter

Docker

docker run -d --restart unless-stopped -p 9326:9326 -v /opt/junos_exporter_keyfile:/ssh-keyfile:ro -v /opt/junos_exporter_config.yml:/config.yml:ro czerwonk/junos_exporter

Target Parameter

By default, all configured targets will be scrapped when /metrics is hit. As an alternative, it is possible to scrape a specific target by passing the target's hostname/IP address to the target parameter - e.g. http://localhost:9326/metrics?target=1.2.3.4. The specific target must be present in the configuration file or passed in with the ssh.targets flag, otherwise, the request will be denied. This can be used with the below example Prometheus config:

scrape_configs:
  - job_name: 'junos'
    static_configs:
      - targets:
        - 192.168.1.2  # Target device.
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9326  # The junos_exporter's real hostname:port.

Config file

The exporter can be configured with a YAML based config file:

targets:
  - router1
  - router2

features:
  bgp: true
  ospf: false
  isis: false
  environment: true
  routes: true
  routing_engine: true
  interface_diagnostic: true

Third Party Components

This software uses components of the following projects

Contributers

Martin (https://github.com/l3akage)

License

(c) Daniel Czerwonk, 2017. Licensed under MIT license.

Prometheus

see https://prometheus.io/

JunOS

see https://www.juniper.net/us/en/products-services/nos/junos/

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.