Skip to content

Python Collectd plugin for RouterOS/MikroTik

Notifications You must be signed in to change notification settings

jbartak/routeros-collectd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

routeros-collectd

Python Collectd plugin for RouterOS/MikroTik using the Python librouteros and collectd-python, superseding the abandoned Plugin:RouterOS

This plugin collects the following parameters from a MikroTik router:

  • cpu: percent active (from /system resource monitor)
  • memory: free (from /system resource monitor)
  • interface: if_octets, if_packets, if_errors, if_dropped (from /interface)
  • sensors: cpu temperature (from /system health)

Installation

  1. Store routeros.py in a known location accessible by the collectd daemon, e.g. /opt/collectd_plugins/
  2. Create a user on your MikroTik router with read only access via web interface under System -> Users
  3. Update collectd.conf to configure:
    1. Host, user, password: credentials to connect to
    2. Hostname: collectd host label to use for metrics
    3. Interface: interface to monitor (probably your WAN interface)
LoadPlugin python
<Plugin python>
    ModulePath "/opt/collectd_plugins"
    Import "routeros"
    <Module routeros>
        Host "127.0.0.1"
        Hostname "mikrotik"
        User "username"
        Password "password"
        Interface "ether10"
    </Module>
</Plugin>
  1. Restart collectd, check log file for issues: sudo systemctl restart collectd && sudo systemctl restart collectd

Todo

  1. Allow for multiple routers to be monitored
  2. Allow for multiple interfaces to be monitored

Sources

About

Python Collectd plugin for RouterOS/MikroTik

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%