Power monitoring!

Anyone interested in some real good graphing of MT? I’m asking, because if there is a real demand, I’m more than happy to get these scripts on the WIKI, or even better (normis, PM me please), get this incororated into a MT Package perhaps. The stuff is relatively simple, so it should be quick.

So far, I monitor routing tables:

Wireless Status (CPE Side):

CPU Usage:

Disk Usage:

Memory Usage:

Radius Client Stats:

Adding scripts is relatively easy, I’m still going to add some more stuff (including scripts to monitor various things from /wireless registration-table), but if there’s any specific requirements or graphs that some of you would like to see, feel free to mention them and I’ll see whether it can be coded and included in the wiki pages to follow shortly hopefully…

If this refers to Cacti graphs, it would be nice to have:
Number of PPPoE clients Connected
Number of Wireless Clients Connected per radio
Thanks :slight_smile:

these aren’t cacti :slight_smile: you don’t get these values via SNMP (Not all of them anyways)…

how do you get these values, and generate the graphs?

SSH/Telnet and the graphing engine is something called Munin normis (based on perl, VERY easy to convert into sh / bash / even c++). If we can get munin-node converted to not use perl and run it on MT as a package, then no requirement for Telnet/SSH connections to the router.

Scripts, are as easy and simple as daylight. Hence the first post Normis… Can we make a package?? :stuck_out_tongue: :slight_smile: :stuck_out_tongue: :slight_smile: You can graph anything you can dream off in a matter of 5 minutes…



cknipe@fusion:~/src/mt_munin$ ./mikrotikppp_WMEO01-CORE01.mydomain config
host_name WMEO01-CORE01.mydomain
graph_args --base 1000 -l 0 -r --lower-limit 0
graph_title Active PPP Client Connections
graph_vlabel # of connections
graph_category network
graph_info This graph shows the active amount of ppp connections
graph_order async isdn l2tp ovpn pppoe pptp
async.label async
async.info ASync PPP Connections
isdn.label isdn
isdn.info ISDN PPP Connections
l2tp.label l2tp
l2tp.info L2TP PPP Connections
ovpn.label ovpn
ovpn.info OVPN PPP Connections
pppoe.label pppoe
pppoe.info PPPoE Connections
pptp.label pptp
pptp.info PPTP Connections


cknipe@fusion:~/src/mt_munin$ ./mikrotikppp_WMEO01-CORE01.mydomain
async.value 0
isdn.value 0
l2tp.value 0
ovpn.value 0
pppoe.value 1
pptp.value 0

Done. Not only do we graph PPPoE, we monitor total ppp connections and associate them with the different types of services too :slight_smile: Unfortunately I don’t really use PPP, so I can’t get a sample graph going, but it is working…

Wireless stats are already in with the /wireless registration-table graph I’m making.

It would be great to have this as part of Mikrotik.

Indeed!

Munin operates on a monitoring server → monitoring node principal. We can integrate a node into MT (it’s INSANELY small), and even make the scripts customisable. You upload your scripts to the router for what you want to monitor, the server polls the node, and generate the graphs. What you want, when you want, how you want…

It’s painless to do these probes.

I’m doing the /wireless registration-table graph now, I’ll post the graph once it’s finished - they should update in real time :laughing:

Will dynamically configure the graph and add a line for every client in the registration table :slight_smile:

everything that is needed to integrate it into RouterOS is too big combined, we can’t do it. If possible, please make a detailed manual on the wiki on how people can use it in other ways

Normis - Granted, I still need to look at this, but http://sourceforge.net/projects/muninlite/ Munin Lite is the munin-node engine (the one that needs to be on the MT for best use), that runs as a bash script! It naturally fires off via inetd or xinetd, it already includes some scripts, and adding more scripts is a simple bash/sh script (it is not required that it must be perl, I use perl as my language of choice). There is also http://munin.projects.linpro.no/wiki/OpenWRT-HowTo operating on perlminimal, but granted, I understand you cannot slap perl on a MT :slight_smile:

I don’t know the inner workings, but if inetd isn’t available either… I’m busy writing the WIKI page now. Having hundreds of logins on your router every 5 minutes just isn’t ideal either (every script will login twice - once for a config, and once for getting values)…

like bad scripts do =) maybe it needs to be rewritten for one login per cycle? :wink:

Not quite…

The graphs are based on RRD - it does a config in order to get a list of (and parameters) of the datastores that needs to be configured in the RRD Database. Therefore, it is possible to automatically add and remove data from graphs dynamically. In the case that where I monitor the registration table for example, it will do a config, see that there is two entries, and then automatically create a RRD for the 2nd entry in the registration table. Then go, and fetch the values thereof.

Granted, it would be fantastic if munin can do this in one connection, but it does not unfortunately.

Not all scripts require two logins however (radius stats is static for example, and mem/cpu uses SNMP), but untill munin-node runs on MT itself, it will be a downpoint of it yes. If the node is on the MT, you more than likely wont even notice the connection, as is the case of SNMP.

Currently it looks great! http://wiki.mikrotik.com/wiki/Munin_Monitoring

Can’t wait for the rest :slight_smile:

also, there is perl example of use of API, maybe this is way to go? it is not encrypted, but you won’t be pulling passwords for graphs, would you? and for login there is simple chap challenge.

The API may be a way to go instead of Telnet/SSH yes, I haven’t really played with it yet.

Will look into it at some stage, I just want to get everything on the WIKI for now, let’s call the API version 2 :laughing: Cherry on the cake would still be to have this on MT itself… It can’t be that hard to execute a shell script to service a incoming connection???

While this stuff looks awesome, I would still like to see all of the information that is available in the registration table be available through snmp. It would allow us to make many more cool graphs like these. Not just the registration table, but it would be a good place to start..

Pleeeeeeeeeeeaaaasssssssee!

Thanks,
Gerard

Just FYI - I’m done now :wink: The one script still needs to be tweaked, and I’ll add more scripts as/when I write them on a as needed and/or as requested basis…

if you want a free L6 license for this great article, please email support

I need it for wireless signal graphing.
I installed it using wiki manual:
http://wiki.mikrotik.com/wiki/Munin_Monitoring

1.I put this in /etc/munin/munin.conf

[192.168.1.1]
address 127.0.0.1


I changed [node1.somewhere.com] for IP address of mikrotik I want to get info from(192.168.1.1).

  1. PERL srcipt: mikrotikcpu_node1.somewhere.com I saved as mikrotikcpu_192.168.1.1
  2. I changed the rights:
    $ chmod u+x /etc/munin/plugins/mikrotikcpu_192.168.1.1
    $ chown munin:munin /etc/munin/plugins/mikrotikcpu_192.168.1.1
    $ /etc/munin/plugins/mikrotikcpu_192.168.1.1
  1. I restarted munin-node:
$ /etc/init.d/munin-node restart
  1. connecting using tellnet shows that connection has closed:
    r-c@rclr-srv:~$ telnet localhost 4949
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    # munin node at rclr-srv
    Connection closed by foreign host.

Can you help what I am doing wrong, propably names of that nodes, or?
Thanks.