Giter Club home page Giter Club logo

grafana-mikrotik's Introduction

Grafana-Mikrotik

logo

visitors example branch parameter mikrotikOS Grafana Prometheus snmp_exporter

Donate using Liberapay


๐Ÿณ Deploy with docker-compose

Deploy with bash script

git clone https://github.com/IgorKha/Grafana-Mikrotik.git
cd ./Grafana-Mikrotik
bash ./run.sh --config
  You can also pass some arguments to script to set some these options:

    --config: change the user and password to grafana and specify the mikrotik IP address

    --stop: stop docker containers

    --help

For example:

    bash run.sh --config

asciicast

deploy with docker-compose manual

1.Change targets ip (192.168.88.1) into file prometheus/prometheus.yml

2.Run

docker-compose up -d

3.Open localhost:3000

  • Grafana login: admin

  • Password: mikrotik

If you want to change the credentials, then edit the ".env" file


Manual deploy

1.add into prometheus.yml

  - job_name: Mikrotik
    static_configs:
      - targets:
        - 192.168.88.1  # SNMP device IP.
    metrics_path: /snmp
    params:
      module: [mikrotik]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: localhost:9116  # The SNMP exporter's real hostname:port.

2.Configure Prometheus and run /snmp/snmp_exporter

3.Add dashboard https://grafana.com/grafana/dashboards/14420


Docker snmp_exporter (deprecated)

Docker Pulls

amd64-linux container

sudo docker run -d -p 9116:9116 mashinkopochinko/snmp_exporter_mikrotik:latest

img1

grafana-mikrotik's People

Contributors

igorkha avatar lotheac avatar massgame avatar palindrom615 avatar yyovkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-mikrotik's Issues

the graph does not appear on the traffic interface and simple queue

i cant get graph on
image
image
image
early time i keep getting "context deadline exceed" prometheus, so i try adding scrape_interval and scrape_timeout on prometheus.yml
image
image
it work but i cant get graph one those 3 above.

I tried on different router as target and everything work fine.
and can we monitor more than 1 mikrotik router?

Error "error walking target x.x.x.x: request timeout (after 3 retries)"

While trying to scrape Mikrotik target, in walking subtree" oid=1.3.6.1.4.1.14988, snmp_exporter returns the following error message:

Error scraping target" err="error walking target x.x.x.x: request timeout (after 3 retries)

I also try snmpwalk (snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.4.1.14988) the target with subtree 1.3.6.1.4.1.14988 and encounter "No more variables" error

[snipped]
SNMPv2-SMI::enterprises.14988.1.1.17.1.1.4.1 = STRING: "RouterOS v6.48.3 May/25/2021 06:09:45"
SNMPv2-SMI::enterprises.14988.1.1.17.1.1.5.1 = INTEGER: 1
SNMPv2-SMI::enterprises.14988.1.1.17.1.1.6.1 = INTEGER: 1
SNMPv2-SMI::enterprises.14988.1.1.20.1.1.0 = Gauge32: 0
SNMPv2-SMI::enterprises.14988.1.1.20.2.1 = No more variables left in this MIB View (It is past the end of the MIB tree)

I did some search but can't figure out what causes the issue. Would you mind shedding me some light?

Wifi Client count not showing clients when using capsman

Hi there, I love this dashboard and is one my first Grafana / Prometheus, so I'm not so experienced yet customizing on my own.
With this said, is there any chance on kindly taking into consideration these two request:

  1. Add wifi client count support on the main view of the dashboard when using capsman, without capsman this works just fine but with capsman I see the client count as zero.
    imagen

  2. In the wireless tab there is a cool graph showing the historic level of signal of the customers, is there anyway to replicate this in the capsman tab?

Raspberry Pi support for 'snmp_exporter_mikrotik' docker image?

After much troubleshooting, I finally figured out why the snmp docker container wasn't starting on RPi 3, turns out that docker image only supports x64 machine type not arm type. The armv7 binaries for snmp_exporter are already available would you be able to add support for that. Thanks

P.S: I'm a total noob, when it comes to docker, so I haven't been able to come up with a solution for fixing the issue.

[Improvement] Some more things to make the `run.sh` script better

  • Be consistent in the style.
    • Use [[ (which is better) everywhere.
    • Always use ${var} instead of $var.
    • No reason to intermix ' and " quoted strings.
  • Avoid sub-shells when it's not necessary. Example:
    • RED=$(printf '\033[31m') โ†’ RED='\033[31m'... just use echo -e "${RED}Blah" to print escape symbols
    • $(id -u) is just ${UID}
    • $(id -g) is ${GID}
  • The .env file is by design is a shell compatible. No need to "parse" it w/ grep and sed... just source it. Example:
        [[ -f ${ENV_FILE} ]] && . "${ENV_FILE}"
        IP=${MIKROTIK_IP} # However, this become useless ;-)
  • ${2:-} ?? empty default value ?? ;-) this is default ;-) It's equal to $2 in this case...
  • The idea of modifying files in the repo is not really nice... someone may occasionally commit the changes.
  • Moreover, the .env file (typically) is not supposed to be in the repo and ought to be in .gitignore. This is personal user settings.
  • The helper() function violates the DRY (Do not Repeat Yourself) principle. Since you have a similar comment in the beginning it can "reuse" it ;)
      help() {
          sed -n -e 's/^#   //' -e '4,9p;' $0
      }
    And better to reduce its responsibility... if u call it, then a help screen is really needed (and there is no need to check anything). Just call it from the --help option case and exit.

there are definitely some more things to fix but I guess it's enough for the start ;-) I can review it again after fixes...

Simple queues queries

It's not an issue with dashboard. I just don't understand what simple queue query mean. Rather hard Prometheus queries for me.
Could you please give some information what they show? "In - myqueuename" and "PCQ In - myqueuename" for example.
Also I see the warning in Grafana "Metric mtxrQueueSimplePCQQueuesIn is a counter. Try apply a rate() function". There are the same warnings for all PCQ-queries.
I like your dashboard. Gave it 5 stars but review has been pending for 2 weeks now.

RouterSO v7 not showing System Info

Hello,

I have a CCR2216 and when I use your exporter, I do not see certain parts.

System is fully marked "No Data" except the Uptime

How can I fix this?

generator.yml

Hye there! Could you please share the generator.yml file from what you got snmp.yml
Thank you!

Error Docker Compose

please help i see issue when run #docker-compose up -d

this is error screen

root@mikrotik:~/Grafana-Mikrotik# docker-compose up -d
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

mk_prometheus container in Starting status

After launch, some of the containers start, but this one cannot. Please help me get started. Console output below.

[root@ww Grafana-Mikrotik]# bash run.sh --config

====================================

Prometheus

Change target mikrotik IP address ? (current 192.168.3.1) [Y/n]
Enter target mikrotik IP address: 192.168.3.30

... Prometheus target IP changed to 192.168.3.30

====================================

Grafana

Change default credentials Grafana ? [y/N]
Default Grafana:
User: admin
Password: mikrotik
[+] Building 0.0s (0/0)
[+] Running 2/3
โœ” Container mk_grafana Running 0.0s
โ ฟ Container mk_prometheus Starting 43516.2s
โœ” Container mk_snmp_exporter Recreated 0.3s
^Z
[3]+ Stopped bash run.sh --config

Base docker image broken

snmp_exporter of v0.20.0, embedded in this repo's dockerfile, won't work with proposed config

level=info ts=2023-12-21T17:06:38.467Z caller=main.go:152 msg="Starting snmp_exporter" version="(version=0.20.0, branch=HEAD, revision=c33572b6c8c8e43a479fde0f9fa8ac86e15598bc)"
level=info ts=2023-12-21T17:06:38.467Z caller=main.go:153 build_context="(go=go1.15.8, user=root@eebd39e6960e, date=20210212-11:37:48)"
level=error ts=2023-12-21T17:06:38.482Z caller=main.go:159 msg="Error parsing config file" err="yaml: unmarshal errors:\n  line 3: field public_v2 not found in type config.plain\n  line 10: field mikrotik not found in type config.plain"

[Improvement] Check requirements first

In the run.sh, before doing anything make sure that all needed tools are present/installed. Cuz it's gonna be a disappointment to see an error about some missing tool in the middle of actions.

Multiple equipment

Hi! How i can use more than one mikrotik for monitoring?
I am added some hosts in config:

- job_name: Mikrotik
    static_configs:
      - targets:
        - 172.16.1.254 # LER130
        - 172.16.6.254 # CHONA
        - 172.16.7.254 # SDM

   metrics_path: /snmp
    params:
      module: [mikrotik]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: mk_snmp_exporter:9116

but i didn't see it in dropbox of grafana

RouterOS version: 6.48.6

Cannot see interfaces metrics

Hello friends,
Maybe you can help me.. I'm a bit newly in Grafana

I cannot see many of MK datas, as board info, cpu or interfaces list (the table of interfaces is amazing designed, but I cannot see it)

See my screens:
Screenshot_25
Screenshot_26

My snmp is placed at /etc/prometheus/snmp.yml and /usr/local/bin/snmp.yml

This is my file
snmp.zip

Grafana ver 8
Prometheus ver 0.20.0
snmp_exporter installed like this: https://snapcraft.io/install/prometheus-snmp-exporter/centos
(I was not able to see a step by step install procedure)
Distribution: Centos 8

What I'm doing wrong?

Thank you so much for your help

K8S issue

First off, thank you for your work on this. I'm just having issues with the dashboard when running this on my k8s cluster. More than likely a relabeling issue and I am not quite sure how to address it to be completely honest. My router is on IP 10.10.0.1 but the container IP is 172.16.0.66. I only have one relabeling, but the dashboard is showing a lot of duplicate entries. I'm definitely a noob at grafana/prometheus so hoping you could maybe point me in the right direction.

relabelings:

- sourceLabels: [__param_target]
    targetLabel: instance

screenshot:
Screen Shot 2021-07-20 at 12 57 12 PM

CCR2216 No System Data SHowing

Hello,

I have your exporter and dashboard working with a remote CCR2216 but there are some issues.

1.) No "System" info is displaying except for the uptime.

2.) Tx Ether Errors, Rx Ether errors show no data.

Please let me know how I can fix this!

Wi-Fi Clients panel doesn't work

Wi-Fi Clients panel doesn't work. If I try to open Transform rules of this dashboard I get error: Undefined: SortBy.
transform

When I enter this dashboard I get this errors:
template

snmpv3 authentication

Where is documentation on snmp authentication???
What about using snmpv3, does this support snmpv3?

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.