Mikrotik RouterOS Statistics (Update 02/10/2009)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Mikrotik RouterOS Statistics (Update 02/10/2009)

Post by mojiro »

One year after my last post in this forum I come back with lots of graphs that have to do with Mikrotik RouterOs. Many of them are based on older templates of mine. A lot of new work has been based on Marlow's work with Wireless Registration Tables and Queues.


Cacti Version: cacti-0.8.7c
RouterOs Version: 2.9.x & 3.0.x



Graph Support For:
  • System
    HDD
    CPU
    Memory
    Uptime

    General
    Active PPP Connections
    Number of Routes
    Number of Active Wireless Connections (Linux Only)
    Number of Current ARP Entries (Linux Only)

    Wireless Registration Tables (per Wireless Client)
    Signal Strength
    Data Rates
    Packets
    Traffic (bits and Bytes)

    Wireless Client
    Signal Strength
    Data Rates
    Frequency 802.11b/g
    Frequency 802.11a

    Queues
    Simple Packets
    Simple Traffic (bits and Bytes)
    Tree Packets
    Tree Traffic (bits and Bytes)
Installation:
A. Unzip somewhere the attachment (mikrotik-20090210.zip)
B. Copy:
  • 1. zipdir/scripts/mikrotik_wireless_interfaces.php -> cacti-web-dir/scripts/mikrotik_wireless_interfaces.php
    2. zipdir/scripts/mikrotik_ppp_connections.php -> cacti-web-dir/scripts/mikrotik_ppp_connections.php
    3. zipdir/resources/script_server/mikrotik_wireless_interfaces.xml -> cacti-web-dir/resources/script_server/mikrotik_wireless_interfaces.xml
    4. zipdir/resources/snmp_queries/mikrotik_queue_simple.xml -> cacti-web-dir/resources/snmp_queries/mikrotik_queue_simple.xml
    5. zipdir/resources/snmp_queries/mikrotik_queue_tree.xml -> cacti-web-dir/resources/snmp_queries/mikrotik_queue_tree.xml
    6. zipdir/resources/snmp_queries/mikrotik_wireless_client.xml -> cacti-web-dir/resources/snmp_queries/mikrotik_wireless_client.xml
C. Import zipdir/templates/cacti_host_template_mikrotik.xml -> http://cacti.url.path/templates_import.php
D. Now just Add a New Device and select "Mikrotik" on Host Template


Notes:
The Mikrotik Host Template contains all of its dependencies, like Interface Statistics
All new templates have nothing to do with older. Are totally incompatible.


Changelog:
* fixes on old templates of mine
* template variable names corrected to follow cacti naming style
* added support for Marlow's work on wireless registration tables
* added more graphs for wireless registration tables
* added support for Arci's work on Queue Trees
* added more graphs for Queue Trees
* added graphs for Simple Queue
* added graphs for Routes & Active PPP Connections


Templates are based on:

Development, Cacti Templates
http://doc.thewan.net/wiki/index.php/Development

Mikrotik SNMP Queue Tree Monitor
http://forums.cacti.net/viewtopic.php?t=10373

Mikrotik RouterOS Statistics (Update 01/21/2006)
http://forums.cacti.net/viewtopic.php?t=8855

Mikrotik RouterOS Registration Tables (Update 11/21/2006)
http://forums.cacti.net/viewtopic.php?t=17936
Attachments
mikrotik-20090210.zip
Version 02/10/2009
(36.43 KiB) Downloaded 21602 times
cacti_mikrotik_template.zip
Version 01/18/2008
(30.55 KiB) Downloaded 14913 times
Last edited by mojiro on Mon Feb 09, 2009 8:09 pm, edited 4 times in total.
[i]Born to be online![/i]
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

Using this template

OID Tree, Branch Counter
http://forums.cacti.net/viewtopic.php?t=25360

You may count varius things based on OID's. There is no reason to create a unique template for each countable thing, so you may use this generic.

ex. providing the following OID's you will get...
ARP Entries: 1.3.6.1.2.1.4.22.1.4
Mikrotik Neighbors (v3.x): .1.3.6.1.4.1.14988.1.1.11.1.1.6
[i]Born to be online![/i]
redkurawa
Posts: 6
Joined: Tue May 02, 2006 5:54 am

byte to bit

Post by redkurawa »

Hi mojiro,

Thanks for the script. It work properly in my cacti :D.

I have one question.

How i can change the unit for simple queue traffic from byte to bit ? :roll:
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

it needs the "hard way"

goto
Console -> Templates -> Graph Templates

Tick
Mikrotik - Queue - Simple Traffic (bytes/sec, Total Bandwidth)
Mikrotik - Queue - Tree Traffic (bytes/sec, Total Bandwidth)
Mikrotik - Wireless - RegTable Traffic (bytes/sec, Total Bandwidth)

Choose an action: Duplicate
Click [GO]

at
Title Format:
Use

Mikrotik - Queue - Simple Traffic (bits/sec, Total Bandwidth)
Mikrotik - Queue - Tree Traffic (bits/sec, Total Bandwidth)
Mikrotik - Wireless - RegTable Traffic (bits/sec, Total Bandwidth)

After go again to Graph Templates and open one-by-one the new templates.

In each Template you will open each Item (ex. (traffic_in): Inbound) and you will select Turn Bytes into bits from "CDEF Function"

At last you will change the "Vertical Label" of each Template to Bits per second
[i]Born to be online![/i]
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

I'm trying to make new templates :P
[i]Born to be online![/i]
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

Post by sizulku »

mojiro wrote:I'm trying to make new templates :P
Any update about your new templates?
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

sizulku wrote:
mojiro wrote:I'm trying to make new templates :P
Any update about your new templates?
I have made bits & bytes traffic graphs for all(simple/tree queues, reg tables)

For the moment I work on creating graphs for PPP connections.

Also I'm thinkin on making a script that collects info for all queues in a tree and outputs them in the same graph aggregated.

Do you want me to export, a patch instead of the final work? It is possible too.
[i]Born to be online![/i]
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

Post by sizulku »

mojiro wrote: Also I'm thinkin on making a script that collects info for all queues in a tree and outputs them in the same graph aggregated.
That's great. I would love to see it.

mojiro wrote: Do you want me to export, a patch instead of the final work? It is possible too.
Any estimated date for final release? a patch also would be great. Thanks.
redkurawa
Posts: 6
Joined: Tue May 02, 2006 5:54 am

Post by redkurawa »

I have problem with my setup.

I have success add one queue to my mikrotik. and finished make the graph appear.

when i insert the second queue, the list on data query is missing.

Image

When i clik the debug mode i can see the queue is existing.

Image

As you can see, the first query is planet and the second is eranet

Please help.
keefe007
Posts: 24
Joined: Fri Sep 23, 2005 11:33 pm

Post by keefe007 »

Does this support packets per second on ethernet interfaces?
skysurfer
Posts: 15
Joined: Tue Aug 07, 2007 7:26 am

Post by skysurfer »

Great job (again) mojiro!
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Post by superdust »

Great job! Thank you.

Just one queston, is there no way to read out SNR and CCQ on MikroTik?
dansoftware
Posts: 2
Joined: Tue Apr 08, 2008 6:11 am
Location: Orel, Russia

Post by dansoftware »

The registration table template does not work on MikroTik RouterOS 3.6 + RouterBOARD 333 under Cacti v 0.8.7b. The appropriate data query runs without any errors but it does not return any data.

Code: Select all

Mikrotik - Wireless - Registration Table  (Verbose Query)  Uptime Goes Backwards  Success [0 Items, 0 Rows]

Code: Select all

Data Query Debug Information 
 
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/local/php5/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 index'
+ Executing script query '/usr/local/php5/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 query ifName'
+ Executing script query '/usr/local/php5/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 query ifIndex'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
Is there any solution?

I am not the only who has such troubles. There are several posts about this problem on MikroTik forum.
dansoftware
Posts: 2
Joined: Tue Apr 08, 2008 6:11 am
Location: Orel, Russia

Post by dansoftware »

dansoftware wrote:The registration table template does not work on MikroTik RouterOS 3.6 + RouterBOARD 333 under Cacti v 0.8.7b. The appropriate data query runs without any errors but it does not return any data.
Solution is simple. PHP was built without SNMP support. That’s why "/usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php" didn’t work.

Code: Select all

Data Query Debug Information 
 
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 index'
+ Executing script query '/usr/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 query ifName'
+ Found item [ifName='wlan1:1'] index: 00:0B:6B:57:47:61
+ Found item [ifName='wlan1:2'] index: 00:0B:6B:57:47:12
+ Found item [ifName='wlan1:4'] index: 00:0B:6B:57:43:EB
+ Executing script query '/usr/bin/php -q /usr/local/cacti/scripts/mikrotik_wireless_interfaces.php cacti 10.1.0.2 query ifIndex'
+ Found item [ifIndex='00:0B:6B:57:47:61'] index: 00:0B:6B:57:47:61
+ Found item [ifIndex='00:0B:6B:57:47:12'] index: 00:0B:6B:57:47:12
+ Found item [ifIndex='00:0B:6B:57:43:EB'] index: 00:0B:6B:57:43:EB
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'

Code: Select all

Mikrotik - Wireless - Registration Table  (Verbose Query)  Uptime Goes Backwards  Success [6 Items, 3 Rows]
jstjst
Posts: 4
Joined: Sat Jan 05, 2008 2:10 pm

Post by jstjst »

Hi all....

this are amaizing tamplates, finaly complet graphing for mikrotik...

question: is there a way to set graph tamplate Mikrotik - Wireless - RegTable Data Rates and Mikrotik - Wireless - RegTable Signal Strength to show hostname too ?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests