Community discussions

MikroTik App
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Power monitoring!

Fri Jan 09, 2009 10:15 am

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:
Image

Wireless Status (CPE Side):
Image

CPU Usage:
Image

Disk Usage:
Image

Memory Usage:
Image

Radius Client Stats:
Image

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....
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 11:56 am

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 :)
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 12:04 pm

these aren't cacti :) you don't get these values via SNMP (Not all of them anyways)....
Last edited by savage on Fri Jan 09, 2009 12:16 pm, edited 1 time in total.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Power monitoring!

Fri Jan 09, 2009 12:07 pm

how do you get these values, and generate the graphs?
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 12:22 pm

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?? :P :) :P :) You can graph anything you can dream off in a matter of 5 minutes....
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 2:41 pm

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 :)
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 :) 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.
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: Power monitoring!

Fri Jan 09, 2009 3:13 pm

It would be great to have this as part of Mikrotik.
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 3:46 pm

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 :lol:
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 4:11 pm

Image

Will dynamically configure the graph and add a line for every client in the registration table :)
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Power monitoring!

Fri Jan 09, 2009 4:20 pm

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
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 5:07 pm

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 :)

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)...
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 5:30 pm

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? ;)
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri Jan 09, 2009 6:19 pm

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.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Power monitoring!

Tue Jan 13, 2009 1:48 pm

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

Can't wait for the rest :)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Power monitoring!

Wed Jan 14, 2009 12:34 pm

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.
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Wed Jan 14, 2009 12:50 pm

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 :lol: 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???
 
Gerard
Trainer
Trainer
Posts: 336
Joined: Wed Apr 26, 2006 4:21 am
Location: Kentucky, USA
Contact:

Re: Power monitoring!

Wed Jan 14, 2009 5:04 pm

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
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Wed Jan 14, 2009 5:13 pm

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

Can't wait for the rest :)
Just FYI - I'm done now ;) 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...
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Power monitoring!

Thu Jan 15, 2009 10:40 am

if you want a free L6 license for this great article, please email support
 
radocicala
Member Candidate
Member Candidate
Posts: 136
Joined: Fri Aug 10, 2007 6:56 pm

Re: Power monitoring!

Fri May 29, 2009 11:18 am

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).

2. PERL srcipt: mikrotikcpu_node1.somewhere.com I saved as mikrotikcpu_192.168.1.1
3. 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

4. I restarted munin-node:
$ /etc/init.d/munin-node restart

5. 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.
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri May 29, 2009 4:13 pm

In munin-node.conf, did you modify the ACL correctly?

Look for the allow lines
 
radocicala
Member Candidate
Member Candidate
Posts: 136
Joined: Fri Aug 10, 2007 6:56 pm

Re: Power monitoring!

Fri May 29, 2009 8:24 pm

Propably I made mistake in /etc/munin/munin.conf
[192.168.1.1]
address 127.0.0.1
should be liked this:
 [192.168.1.1]
address 192.168.1.1
then I tryed:

r-c@rclr-srv:~$ sudo /etc/munin/plugins/mikrotikcpu_192.168.1.1 config
host_name 192.168.1.1
graph_args -l 0 -r --vertical-label percent --lower-limit 0 --upper-limit 100
graph_title CPU usage
graph_category system
graph_info This graph shows the router's CPU usage.
graph_order Total
graph_vlabel %
graph_scale no
Total.label CPU Usage
Total.draw AREA
Total.warning 60
Total.critical 90
That seems good.

Then I tryed:
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.
and in apache, only shows name: 192.168.1.1, nothing more, no graphs(only graphs for local machine 127.0.0.1)

This i filled in /etc/munin/munin.conf:
[192.168.1.1]
    address 192.168.1.1
    use_node_name yes
and in /etc/munin/munin-node.conf
# Which port to bind to;
#host *
host 127.0.0.1
user root
group root
setsid yes

I dont now what I am doing wrong.
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Fri May 29, 2009 8:29 pm

munin-node.conf
# A list of addresses that are allowed to connect.  This must be a
# regular expression, due to brain damage in Net::Server, which
# doesn't understand CIDR-style network notation.  You may repeat
# the allow line as many times as you'd like
allow ^127\.0\.0\.1$
As I mentioned, you do not have the allow lines. Munin is rejecting the connection to 127.0.0.1 (your telnet) because it is not authorised to connect
 
radocicala
Member Candidate
Member Candidate
Posts: 136
Joined: Fri Aug 10, 2007 6:56 pm

Re: Power monitoring!

Sat May 30, 2009 12:48 pm

I have it, sorry I didnt post complete config files:
munin-node.conf
r-c@rclr-srv:~$ cat /etc/munin/munin-node.conf
#
# Example config-file for munin-node
#

log_level 4
log_file /var/log/munin/munin-node.log
port 4949
pid_file /var/run/munin/munin-node.pid
background 1
setseid 1

# Which port to bind to;
#host *
host 127.0.0.1
user root
group root
setsid yes

# Regexps for files to ignore

ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$

# Set this if the client doesn't report the correct hostname when
# telnetting to localhost, port 4949
#
#host_name localhost.localdomain

# A list of addresses that are allowed to connect.  This must be a
# regular expression, due to brain damage in Net::Server, which
# doesn't understand CIDR-style network notation.  You may repeat
# the allow line as many times as you'd like

allow ^127\.0\.0\.1$
munin.conf:
r-c@rclr-srv:~$ cat /etc/munin/munin.conf
# Example configuration file for Munin, generated by 'make build'

# The next three variables specifies where the location of the RRD
# databases, the HTML output, and the logs, severally.  They all
# must be writable by the user running munin-cron.
dbdir	/var/lib/munin
htmldir	/var/www/munin
logdir	/var/log/munin
rundir  /var/run/munin

# Where to look for the HTML templates
tmpldir	/etc/munin/templates

# Make graphs show values per minute instead of per second
#graph_period minute

# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime 
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
#
# For those with Nagios, the following might come in handy. In addition,
# the services must be defined in the Nagios server as well.
#contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg

# a simple host tree
[example.com]
    address 127.0.0.1
    use_node_name yes

# 
# A more complex example of a host tree
#
## First our "normal" host.
# [fii.foo.com]
#       address foo
#
## Then our other host...
# [fay.foo.com]
#       address fay
#
## Then we want totals...
# [foo.com;Totals] #Force it into the "foo.com"-domain...
#       update no   # Turn off data-fetching for this "host".
#
#   # The graph "load1". We want to see the loads of both machines... 
#   # "fii=fii.foo.com:load.load" means "label=machine:graph.field"
#       load1.graph_title Loads side by side
#       load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#
#   # The graph "load2". Now we want them stacked on top of each other.
#       load2.graph_title Loads on top of each other
#       load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#       load2.dummy_field.draw AREA # We want area instead the default LINE2.
#       load2.dummy_field.label dummy # This is needed. Silly, really.
#
#   # The graph "load3". Now we want them summarised into one field
#       load3.graph_title Loads summarised
#       load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load
#       load3.combined_loads.label Combined loads # Must be set, as this is
#                                                 # not a dummy field!
#
## ...and on a side note, I want them listen in another order (default is
## alphabetically)
#
# # Since [foo.com] would be interpreted as a host in the domain "com", we
# # specify that this is a domain by adding a semicolon.
# [foo.com;]
#       node_order Totals fii.foo.com fay.foo.com
#

[192.168.1.1]
    address 192.168.1.1
    use_node_name yes
snmp is enabled in mk:
[R-C@MikroTik] snmp> print
   enabled: yes
   contact: "admin"
  location: "mk1"
Server on which is installed and run munin has ip: 192.168.1.4.
 
JHughes
just joined
Posts: 16
Joined: Tue Mar 03, 2009 5:54 am

Re: Power monitoring!

Fri Jun 05, 2009 2:11 am

OK... pulling my hair out on this one. I've tried a few different settings. I can't get them to show up as a node, followed wiki exactly.

Just as my contemporary, radocicala I...

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

2. PERL srcipt: mikrotikcpu_node1.somewhere.com I saved as mikrotikcpu_10.1.30.1

3. I changed the rights:
Code:
$ chmod u+x /etc/munin/plugins/mikrotikcpu_10.1.30.1
$ chown munin:munin /etc/munin/plugins/mikrotikcpu_10.1.30.1

4. Tested it:
sudo /etc/munin/plugins/mikrotikcpu_10.1.30.1 config
host_name 10.1.30.1
graph_args -l 0 -r --vertical-label percent --lower-limit 0 --upper-limit 100
graph_title CPU usage
graph_category system
graph_info This graph shows the router's CPU usage.
graph_order Total
graph_vlabel %
graph_scale no
Total.label CPU Usage
Total.draw AREA
Total.warning 60
Total.critical 90
**@WW-LINUX-01:/etc/munin/plugins$
5. I restarted munin-node:
sudo /etc/init.d/munin-node restart
BECAUSE OF ---->>>
The address, will always be pointing to 127.0.0.1 as Munin needs to connect to our only real munin-node we have running on localhost.

I kept the "address 127.0.0.1" instead of changing this part to 10.1.30.1 (But I tried both ways)


When I try to show the node that I had just made I got the following......
(ONLY LISTING "localhost" not any other)
telnet 127.0.0.1 4949
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at localhost
nodes
localhost
.
quit
Connection closed by foreign host.
******@WW-LINUX-01:/etc/munin$
BUT! I did happen to type "list" and low and behold, there sits "10.1.30.1" in the list... hell if I know why....
# munin node at localhost
list
open_inodes if_err_eth0 apache_processes mysql_slowqueries entropy irqstats processes if_eth0 if_err_eth2 mysql_threads df interrupts swap if_eth2 mysql_bytes load df_inode cpu if_err_eth1 if_eth1 mysql_queries mikrotikcpu_10.1.30.1 iostat forks open_files memory 10.1.30.1 vmstat
munin.conf
# Example configuration file for Munin, generated by 'make build'

# The next three variables specifies where the location of the RRD
# databases, the HTML output, and the logs, severally.  They all
# must be writable by the user running munin-cron.
dbdir   /var/lib/munin
htmldir /var/www/munin
logdir  /var/log/munin
rundir  /var/run/munin

# Where to look for the HTML templates
tmpldir /etc/munin/templates

# Make graphs show values per minute instead of per second
#graph_period minute

# Graphics files are normaly generated by munin-graph, no matter if
# the graphs are used or not.  You can change this to
# on-demand-graphing by following the instructions in
# http://munin.projects.linpro.no/wiki/CgiHowto
#
#graph_strategy cgi

# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
#
# For those with Nagios, the following might come in handy. In addition,
# the services must be defined in the Nagios server as well.
#contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg

# a simple host tree
[localhost]
    address 127.0.0.1
    use_node_name yes
[10.1.30.1]
    127.0.0.1
    use_node_name yes
#
# A more complex example of a host tree
#
## First our "normal" host.
# [fii.foo.com]
#       address foo
#
## Then our other host...
# [fay.foo.com]
#       address fay
#
## Then we want totals...
# [foo.com;Totals] #Force it into the "foo.com"-domain...
#       update no   # Turn off data-fetching for this "host".
#
#   # The graph "load1". We want to see the loads of both machines...
#   # "fii=fii.foo.com:load.load" means "label=machine:graph.field"
#       load1.graph_title Loads side by side
#       load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#
#   # The graph "load2". Now we want them stacked on top of each other.
#       load2.graph_title Loads on top of each other
#       load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#       load2.dummy_field.draw AREA # We want area instead the default LINE2.
#       load2.dummy_field.label dummy # This is needed. Silly, really.
#
#   # The graph "load3". Now we want them summarised into one field
#       load3.graph_title Loads summarised
#       load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load
#       load3.combined_loads.label Combined loads # Must be set, as this is
#                                                 # not a dummy field!
#
## ...and on a side note, I want them listen in another order (default is
## alphabetically)
#
# # Since [foo.com] would be interpreted as a host in the domain "com", we
# # specify that this is a domain by adding a semicolon.
# [foo.com;]
#       node_order Totals fii.foo.com fay.foo.com
#
munin-node.conf
#
# Example config-file for munin-node
#

log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setseid 1

user root
group root
setsid yes

# Regexps for files to ignore

ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$

# Set this if the client doesn't report the correct hostname when
# telnetting to localhost, port 4949
#
host_name localhost

# A list of addresses that are allowed to connect.  This must be a
# regular expression, due to brain damage in Net::Server, which
# doesn't understand CIDR-style network notation.  You may repeat
# the allow line as many times as you'd like

allow ^127\.0\.0\.1$

# Which address to bind to;
#host *
host 127.0.0.1

# And which port
port 4949
 
JHughes
just joined
Posts: 16
Joined: Tue Mar 03, 2009 5:54 am

Re: Power monitoring!

Fri Jun 05, 2009 3:59 am

FOUND IT! :)
ok.. I couldn't figure out the whole file color thing inside the /etc/munin/plugins/ directory. All the other flies were cyan where the file that we were directed to create was green after investigating why this was I did a ls -l , and after looking at it a few dozen times realized that ALL the scripts in the /etc/munin/plugins/ directory were links to the REAL file in /usr/share/munin/plugins/ directory.

Update needed for wiki

Make link:
sudo link /etc/munin/plugins/mikrotikcpu_node1.somewhere.com /usr/share/munin/plugins/mikrotikcpu_node1.somewhere.com
THEN restart munin
sudo /etc/init.d/munin-node restart
Check munin (in telnet)
telnet 127.0.0.1 4949
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at localhost
nodes
10.1.30.1
localhost
.
quit
Connection closed by foreign host.
and low and behold there sits my router!

Anyone wanna confirm this?

Thanks,

Josh

****EDIT****
False alarm... musta changed something else... it only showed up on the graph for a minute, when I restarted munin.conf the next time - NO VA
 
radocicala
Member Candidate
Member Candidate
Posts: 136
Joined: Fri Aug 10, 2007 6:56 pm

Re: Power monitoring!

Tue Jun 09, 2009 8:54 pm

JHughes is that work or not?
Is anybody who managed to set it up and is running it? I need it for monitoring signal qualities over day. Thanks.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 2:23 pm

Fantastic. I've got all three of the SNMP scripts set up and working like a charm:
cpu.png
diskspace.png
memory.png
The only thing I can't get my head around is how munin-node knows which plugins to run against which node. For example, I have the following:
# telnet 127.0.0.1 4949
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at XXXX.vitell.co.uk
nodes
181.87.193.10
xxxx.vitell.co.uk
.
quit
Connection closed by foreign host.
all the plugins are in the same directory (/etc/munin/plugins) and yet:
# telnet 127.0.0.1 4949
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at xxxx.vitell.co.uk
list 181.87.193.10
mikrotikcpu_181.87.193.10 mikrotikdiskspace_181.87.193.10 mikrotikmemory_181.87.193.10
list xxxx.vitell.co.uk
open_inodes apache_processes entropy apache_accesses processes apache_volume squid_cache df interrupts netstat swap load if_err_venet0 df_inode cpu if_venet0 forks open_files memory squid_requests squid_traffic vmstat
quit
Connection closed by foreign host.
it knows which plugins to apply to which host.

Now, I can understand how the mikrotik* plugins work as they define 'host name' when you run the 'mikrotikcpu_HOSTNAME config' script, but I just don't get how/why the standard 'apache_accesses' script runs against xxxx.vitell.co.uk but not 181.87.193.10.

Anyway, it works, so I guess I shouldn't be questioning things, I'd just like to know why it works!
You do not have the required permissions to view the files attached to this post.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 3:47 pm

With the mikrotikppp_HOST script:
Use of /g modifier is meaningless in split at
        /usr/lib/perl5/vendor_perl/5.8.8/Net/Telnet/Cisco.pm line 756 (#1)
    (W regexp) You used the /g modifier on the pattern for a split
    operator.  Since split always tries to match the pattern
    repeatedly, the /g has no effect.
After some digging, it appears that this is a known bug in some versions of Net::Telnet::Cisco. In my case, the CentOS supplied package (perl-Net-Telnet-Cisco) comes complete with this bug. In case anybody else has this problem, edit the file mentioned in the error message and change the line from "return wantarray ? split /$/mg, $_ : $_; # ORS instead?" to "return wantarray ? split /$/m, $_ : $_; # ORS instead?". How this affects other things I could not say, but given that I installed Net::Telnet::Cisco specifically for this purpose, it works fine for me.

Also, there is a bug in the script. Munin doesn't like a graph_vlabel with spaces in it. I replaced "# of connections" with "number" and it worked just fine. I have updated the wiki accordingly.

Interestingly (and apropos of my last post), I have four hosts being monitored from the one box:

MT_1
MT_2
localhost
remotehost

Whilst the mikrotikcpu (and diskspace and memory) plugins only work against the MT_x hosts, mikrotikppp works against MT_1, localhost and remotehost, but not MT_2. What gives?
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 3:50 pm

Oh, and here's a piccy of the PPP graph
ppp.png
just to show it working.
You do not have the required permissions to view the files attached to this post.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 6:06 pm

More from me, I'm afraid...

I tried to get the 'mikrotikwirelessregistrations' code working and found that the comments preceding it were correct (it doesn't work!!), so I decided to write my own in PHP using the PHP API - http://wiki.mikrotik.com/wiki/API_PHP_class. The code is below and I'll tidy it up and post it on the wiki as and when somebody else tests it too!!
#!/usr/bin/php
<?php

// Use the ROS API.
require('routeros_api.class.php');

// Create a new instance
$API = new routeros_api();

// debug - true or false
$API->debug = false;

// First things first, get the information we want to look at
if ($API->connect('111.222.111.222', 'USER', 'PASS')) {

   $API->write('/interface/wireless/registration-table/getall');
   $ARRAY = $API->read();

   $API->disconnect();
} else {
  die("Unable to connect to API.");
}

// Work out the hostname to use based on the filename called
$hostname = explode("_",$argv[0],2);

// And die if there isn't one.
if (! isset($hostname[1])) {
  die("No hostname available");
}

// If the first argument is 'config', then do the config stuff.
if ($argc > 1 && $argv[1] == 'config') {
  printconfig($hostname[1]);
  if (!empty($ARRAY)) {
    foreach ($ARRAY as $value) {
      print $value["interface"] . ".label " . $value["interface"] . "\n";
    }
  }
  exit;
}

// Otherwise, display the values.
if (!empty($ARRAY)) {
  foreach ($ARRAY as $value) {
    $signal=explode("d",$value["signal-strength"],2);
    $signal=$signal[0];
    print $value["interface"] . ".value " . $signal . "\n";
  }
}
exit;

// Function which prints the information needed for 'config'.
function printconfig($hostname) {
        print "host_name $hostname\n";
        print "graph_args -l 0 --lower-limit -100 --upper-limit 0\n";
        print "graph_title Wireless Interface Registrations (Signal Strength)\n";
        print "graph_vlabel dBm Signal\n";
        print "graph_category network\n";
        print "graph_info This graph shows the wireless registration signal strength\n";
        print "graph_scale no\n";
}
?>
Now, can somebody explain why the graph shows
signal.png
even though the code returns:
/etc/munin/plugins/mikrotikwirelessregistrations_181.87.78.85
wlan2.value -84
wlan3.value -58
Because that's puzzling me!
You do not have the required permissions to view the files attached to this post.
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 6:28 pm

Can you post what the output of mikrotikwirelessregistrations_181.87.78.85 config returns?

I doubt there is anything wrong - may just take a bit of time for the graph to 'seatle' down. /var/log/munin/* is also your friend.

And yes, its the same issue on FreeBSD too - the latest versions of Net::Telnet::Cisco is broken. Packaged versions seems to be a older version which still works. It's trivial to ammend the code to use Net::Telnet instead of Net::Telnet::Cisco though (just the Prompt regex needs to change afaik).
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 6:37 pm

With the mikrotikppp_HOST script:
Use of /g modifier is meaningless in split at
        /usr/lib/perl5/vendor_perl/5.8.8/Net/Telnet/Cisco.pm line 756 (#1)
    (W regexp) You used the /g modifier on the pattern for a split
    operator.  Since split always tries to match the pattern
    repeatedly, the /g has no effect.
After some digging, it appears that this is a known bug in some versions of Net::Telnet::Cisco. In my case, the CentOS supplied package (perl-Net-Telnet-Cisco) comes complete with this bug. In case anybody else has this problem, edit the file mentioned in the error message and change the line from "return wantarray ? split /$/mg, $_ : $_; # ORS instead?" to "return wantarray ? split /$/m, $_ : $_; # ORS instead?". How this affects other things I could not say, but given that I installed Net::Telnet::Cisco specifically for this purpose, it works fine for me.
Known issue with newer versions of Net::Telnet::Cisco yes. Change it to use Net::Telnet and ammend the regex for the prompt acordingly. It works absolutely fine, i.e:
use Net::Telnet;
...
  my $Telnet = new Net::Telnet (Timeout => 10,
                                Prompt  => '/\[.+\] > $/');  # <-- NB Critical
  $Telnet->open($Data['2']);
  $Telnet->login(RLM_TELNET_USER . '+ct', RLM_TELNET_PASS);
  @Output = $Telnet->cmd("whatever");
...
Also, there is a bug in the script. Munin doesn't like a graph_vlabel with spaces in it. I replaced "# of connections" with "number" and it worked just fine. I have updated the wiki accordingly.
Thanks. I've noticed this a while ago, never got arround to updating it.
Interestingly (and apropos of my last post), I have four hosts being monitored from the one box:

MT_1
MT_2
localhost
remotehost

Whilst the mikrotikcpu (and diskspace and memory) plugins only work against the MT_x hosts, mikrotikppp works against MT_1, localhost and remotehost, but not MT_2. What gives?
1) For some reason, these things don't always work when you have physical plugin commands. Best practises, use, and stick to, symlinks.
2) Ensure that everything works when Munin starts. When you start Munin-Node, it verifies all configured hosts, if it fails, it is marked as dead and won't ever become active
3) Have a look at the munin-node log files for possible errors, also perhaps bump up the logging levels in munin-node
4) No need to specify local host :)
4.1) The munin node where all the scripts run, will automatically monitor the host where it is being run on by itself (all the other scripts in the plugins directory)
4.2) munin uses the 'nodes' command to determine what other nodes it is configured for, i.e:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at fusion
nodes
WMEO01-CORE01
WMEO01-EDGE01
fusion
4.3) It then proceeds to do a 'list' command for itself, as well as all nodes. This tells munin which plugins to execute for which nodes, i.e:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at fusion
list fusion
open_inodes asterisk_channelstypes irqstats mysql_slowqueries if_eth0 apache_accesses squid_cache raid ntp_states mysql_threads apt df uptime swap load postfix_mailstats df_inode cpu mysql_queries open_files iostat forks asterisk_voicemail memory ntp_igubu_saix_net vmstat asterisk_channels asterisk_iaxchannels if_err_eth0 apache_processes entropy asterisk_iaxpeers postfix_mailqueue processes asterisk_iaxlag apache_volume ntp_queries metar_pressure asterisk_sipchannels netstat interrupts mysql_bytes asterisk_sippeers munin_graph metar_temp postfix_mailvolume munin_update asterisk_codecs squid_requests metar_wind squid_traffic ntp_induna_saix_net
Hope this helps a bit, and great work on the new plugins - we should stick them on the WIKI... I still feel this needs to be integrated inside MT however, shruglette...
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 6:44 pm

Can you post what the output of mikrotikwirelessregistrations_181.87.78.85 config returns?
host_name 181.87.78.85
graph_args -l 0 --lower-limit -100 --upper-limit 0
graph_title Wireless Interface Registrations (Signal Strength)
graph_vlabel dBm Signal
graph_category network
graph_info This graph shows the wireless registration signal strength
graph_scale no
wlan2.label wlan2
wlan3.label wlan3
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 6:49 pm

Hmm,

Try setting the upper limit to 1? Might be something with munin that's not too intelligent.
root@fusion:/etc/munin/plugins# ./mikrotikwirelessinterface_WMEO01-EDGE01 config
host_name WMEO01-EDGE01
graph_args -l 0 --lower-limit -100 --upper-limit 100
graph_title Wireless Interface Quality (MACAddress)
graph_vlabel Comms Quality
graph_category network
graph_info This graph shows the wireless interface statistics
graph_order txccq rxccq txsignal txrate rxrate acttimeout noisefloor
graph_scale no
txccq.label TX CCQ (%)
rxccq.label RX CCQ (%)
txsignal.label TX Signal Strength (dBm)
acttimeout.label ACT Timeout (us)
noisefloor.label Noise Floor (dBm)
txrate.label TX Rate (Mbps)
rxrate.label RX Rate (Mbps)
works fine for negative numbers here...
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jun 10, 2009 7:02 pm

Try setting the upper limit to 1
Nope. Although the graph now has the correct scale, nothing's being plotted on it (I suspect that what's there is still positive and out of range of the graph.

Strange.
 
radocicala
Member Candidate
Member Candidate
Posts: 136
Joined: Fri Aug 10, 2007 6:56 pm

Re: Power monitoring!

Wed Jun 10, 2009 11:03 pm

NAB please could you post here you munin.conf and munin-node.conf? or email it to me?
radocicala@gmail.com

thanks a lot
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Thu Jun 11, 2009 12:52 am

please could you post here you munin.conf and munin-node.conf
Sure.

munin.conf:
dbdir   /var/lib/munin
htmldir /var/www/munin
logdir  /var/log/munin
rundir  /var/run/munin
tmpldir /etc/munin/templates

[localhost]
    address 127.0.0.1
    use_node_name yes

[xxxx.vitell.co.uk]
        address 1.2.3.4
    use_node_name no

[MT_1]
        address 127.0.0.1
    use_node_name no

[MT_2]
        address 127.0.0.1
    use_node_name no
munin_node.conf:
log_level 4
log_file /var/log/munin/munin-node.log
port 4949
pid_file /var/run/munin/munin-node.pid
background 1
setseid 1
host *
user root
group root
setsid yes
ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
allow ^127\.0\.0\.1$
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Tue Jun 23, 2009 6:42 pm

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

Can't wait for the rest :)
I have added another piece of code (using the PHP API) to the wiki which allows the active DHCP leases to be graphed.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Tue Jun 23, 2009 7:47 pm

I've added another piece of code which allows the number of firewall rules in each chain to be graphed.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Munin (was: Re: Power monitoring!)

Tue Jun 23, 2009 9:38 pm

And another one - last one of the day!!

I have just added the code to allow graphing of packet volume matching certain firewall rules. If you want to graph the number of packets matching a rule, add a comment to the rule in the form "GRAPH - xxxxx" (where "xxxxx" is the label you want to give the data).

This allows you to easily add and remove data to be graphed just by changing the comment.

Note that this does not work on ROS 3.25 since the API no longer gives access to the comments field (I assume this is a bug and have reported it as such).

I'll leave it a day or so to allow some nice graphs to be produced, then I'll upload those examples to the wiki.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Fri Jun 26, 2009 6:55 pm

Right, I've updated the wiki with the graphs the three new plugins (the three at the bottom of the page):

http://wiki.mikrotik.com/wiki/Munin_Monitoring

I've spent a fair bit of time with this and it's certainly useful to me - is it useful to anybody else? Does anybody else have some ideas on what other useful information could be graphed?
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Tue Jun 30, 2009 2:51 pm

That'd be a 'no' then. Shame. At least I find it useful.
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: Power monitoring!

Tue Jun 30, 2009 7:02 pm

Ahaha
Not really NAB. I find it really usefull too! (except the firewallrule count that can't imagine an use...)
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jul 01, 2009 12:43 pm

(except the firewallrule count that can't imagine an use...)
Heh. I know what you mean. I just wrote it as an exercise to see what could be monitored and for no other reason. However, I found a use for it pretty much straight after I wrote it - I use ROS at home and share my Internet connection with my neighbours. Monitoring firewall rules makes it a piece of cake to graph bandwidth use by each of those neighbours. I simply add a rule which matches their traffic and which does nothing (passthrough). It doesn't give me absolute figures, but it does show me when they're hammering the connection and for how long.
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: Power monitoring!

Wed Jul 01, 2009 4:24 pm

That's not the monitoring i was pointing out:
mikrotikfirewallrules_

Installation:	Advanced
Technology Used:	API (PHP)
Notes:	Produces a graph which shows the number of active firewall rules for each chain.
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Wed Jul 01, 2009 4:33 pm

That's not the monitoring i was pointing out:
Ah sorry. Mea Culpa. Well, the theory was that individual people could contribute firewall rules to various chains and that it may be useful to see when changes have been made. It's also handy to see when dynamic rules have been added/removed. Again, not a useful tool in itself, but it could provide a reasonable overview.
 
Muqatil
Trainer
Trainer
Posts: 573
Joined: Mon Mar 03, 2008 1:03 pm
Location: London - UK
Contact:

Re: Power monitoring!

Thu Jul 02, 2009 10:32 am

Which scenario has multiple network admins that continuosly add/remove firewall filter rules?
 
User avatar
NAB
Trainer
Trainer
Posts: 542
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Power monitoring!

Thu Jul 02, 2009 11:49 am

Which scenario has multiple network admins that continuosly add/remove firewall filter rules?
Sadly, in my experience, any number of small-ish companies who don't want to employ one person to look after their infrastructure and who shares the work out amongst a team of people.
 
duvi
Frequent Visitor
Frequent Visitor
Posts: 70
Joined: Fri Jun 05, 2009 12:32 pm
Contact:

Re: Power monitoring!

Fri Feb 26, 2010 4:39 pm

I added a script that generates interface incoming and outgoing rate graphs.
See http://wiki.mikrotik.com/wiki/Munin_Mon ... tikifrate_

I've been needing this for a long time. This way, I can finally change a router without losing the interface graphs (:
You do not have the required permissions to view the files attached to this post.
 
rado3105
Member
Member
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Re: Power monitoring!

Wed Nov 03, 2010 4:09 pm

I have problem to install this using wiki manual, can anybody help:

My situation: ubuntu router(ip: 12.12.12.12)
mikrotik router ip: 192.168.1.1

I added virtual host like this to my /etc/apache2/apache2.conf:
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName monitor.example.com
        DocumentRoot /var/www/munin
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        CustomLog /var/log/apache2/monitor.example.com.access.log combined
        ErrorLog /var/log/apache2/monitor.example.com.error.log
        ServerSignature On
</VirtualHost>
munin.conf:
# Example configuration file for Munin, generated by 'make build'

# The next three variables specifies where the location of the RRD
# databases, the HTML output, and the logs, severally.  They all
# must be writable by the user running munin-cron.
dbdir   /var/lib/munin
htmldir /var/www/munin
logdir  /var/log/munin
rundir  /var/run/munin
tmpldir /etc/munin/templates

# Where to look for the HTML templates
tmpldir /etc/munin/templates

# Make graphs show values per minute instead of per second
#graph_period minute

# Graphics files are normaly generated by munin-graph, no matter if
# the graphs are used or not.  You can change this to
# on-demand-graphing by following the instructions in
# http://munin.projects.linpro.no/wiki/CgiHowto
#
#graph_strategy cgi

# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
#
# For those with Nagios, the following might come in handy. In addition,
# the services must be defined in the Nagios server as well.
#contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg

# a simple host tree
[localhost]
    address 127.0.0.1
    use_node_name yes
[192.168.1.1]
    address 127.0.0.1


#
# A more complex example of a host tree
#
## First our "normal" host.
# [fii.foo.com]
#       address foo
#
## Then our other host...
# [fay.foo.com]
#       address fay
#
## Then we want totals...
# [foo.com;Totals] #Force it into the "foo.com"-domain...
#       update no   # Tur#
#   # The graph "load1". We want to see the loads of both machines...
#   # "fii=fii.foo.com:load.load" means "label=machine:graph.field"
#       load1.graph_title Loads side by side
#       load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#
#   # The graph "load2". Now we want them stacked on top of each other.
#       load2.graph_title Loads on top of each other
#       load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load
#       load2.dummy_field.draw AREA # We want area instead the default LINE2.
#       load2.dummy_field.label dummy # This is needed. Silly, really.
#
#   # The graph "load3". Now we want them summarised into one field
#       load3.graph_title Loads summarised
#       load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load
#       load3.combined_loads.label Combined loads # Must be set, as this is
#                                                 # not a dummy field!
#
## ...and on a side note, I want them listen in another order (default is
## alphabetically)
#
# # Since [foo.com] would be interpreted as a host in the domain "com", we
# # specify that this is a domain by adding a semicolon.
# [foo.com;]
#       node_order Totals fii.foo.com fay.foo.com
#
n off data-fetching for this "host".
munin-node.conf:
#
# Example config-file for munin-node
#

log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setseid 1

user root
group root
setsid yes

# Regexps for files to ignore

ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$

# Set this if the client doesn't report the correct hostname when
# telnetting to localhost, port 4949
#
host_name localhost

# A list of addresses that are allowed to connect.  This must be a
# regular expression, due to brain damage in Net::Server, which
# doesn't understand CIDR-style network notation.  You may repeat
# the allow line as many times as you'd like

allow ^127\.0\.0\.1$
I created: /etc/munin/plugins/mikrotikcpu_192.168.1.1 and put inside php text from wiki.
Then I: sudo /etc/munin/plugins/mikrotikcpu_192.168.1.1 config
host_name 192.168.1.1
graph_args -l 0 -r --vertical-label percent --lower-limit 0 --upper-limit 100
graph_title CPU usage
graph_category system
graph_info This graph shows the router's CPU usage.
graph_order Total
graph_vlabel %
graph_scale no
Total.label CPU Usage
Total.draw AREA
Total.warning 60
Total.critical 90
Then I:
$ telnet localhost 4949
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at localhost
Connection closed by foreign host.
Graphs for local pc are showing under: /12.12.12.12/munin, but graphs of mikrotik 192.168.1.1 dont show, can anybody help what is wrong with my configuration?
 
HansWorst
just joined
Posts: 2
Joined: Wed Nov 03, 2010 5:01 pm

Re: Power monitoring!

Wed Nov 03, 2010 5:09 pm

looks good!
 
rado3105
Member
Member
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Re: Power monitoring!

Thu Nov 04, 2010 3:28 pm

The problem was: I had to: sudo chmod -R a+rwx(i allowed it to run for all users), but you can limit it to user you want.

It shows me this error in mikrotikwirelessconnected template:
r-c@ubuntu-server:~$ sudo /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 config
Uncaught exception from user code:
	problem connecting to "192.168.76.1", port 23: Connection refused at /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 line 22
 at /usr/share/perl5/Net/Telnet.pm line 2036
	Net::Telnet::_croak('Net::Telnet::Cisco=GLOB(0x9de2360)', 'problem connecting to "192.168.76.1", port 23: Connection ref...') called at /usr/share/perl5/Net/Telnet.pm line 539
	Net::Telnet::error('Net::Telnet::Cisco=GLOB(0x9de2360)', '') called at /usr/share/perl5/Net/Telnet/Cisco.pm line 542
	Net::Telnet::Cisco::error('Net::Telnet::Cisco=GLOB(0x9de2360)', '') called at /usr/share/perl5/Net/Telnet.pm line 1307
	Net::Telnet::open('Net::Telnet::Cisco=GLOB(0x9de2360)') called at /usr/share/perl5/Net/Telnet.pm line 193
	Net::Telnet::new('Net::Telnet::Cisco', 'Host', 192.168.76.1, 'Port', 23, 'Prompt', '/[\>\#] $/', 'Timeout', 30, ...) called at /usr/share/perl5/Net/Telnet/Cisco.pm line 46
	Net::Telnet::Cisco::new('Net::Telnet::Cisco', 'Host', 192.168.76.1, 'Port', 23, 'Prompt', '/[\>\#] $/', 'Timeout', 30, ...) called at /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 line 22
Version of routeros is: 4,10.
 
darvinet
just joined
Posts: 1
Joined: Mon Jan 02, 2012 12:56 pm

Re: Power monitoring!

Tue Jan 03, 2012 1:05 am

The problem was: I had to: sudo chmod -R a+rwx(i allowed it to run for all users), but you can limit it to user you want.

It shows me this error in mikrotikwirelessconnected template:
r-c@ubuntu-server:~$ sudo /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 config
Uncaught exception from user code:
	problem connecting to "192.168.76.1", port 23: Connection refused at /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 line 22
 at /usr/share/perl5/Net/Telnet.pm line 2036
	Net::Telnet::_croak('Net::Telnet::Cisco=GLOB(0x9de2360)', 'problem connecting to "192.168.76.1", port 23: Connection ref...') called at /usr/share/perl5/Net/Telnet.pm line 539
	Net::Telnet::error('Net::Telnet::Cisco=GLOB(0x9de2360)', '') called at /usr/share/perl5/Net/Telnet/Cisco.pm line 542
	Net::Telnet::Cisco::error('Net::Telnet::Cisco=GLOB(0x9de2360)', '') called at /usr/share/perl5/Net/Telnet.pm line 1307
	Net::Telnet::open('Net::Telnet::Cisco=GLOB(0x9de2360)') called at /usr/share/perl5/Net/Telnet.pm line 193
	Net::Telnet::new('Net::Telnet::Cisco', 'Host', 192.168.76.1, 'Port', 23, 'Prompt', '/[\>\#] $/', 'Timeout', 30, ...) called at /usr/share/perl5/Net/Telnet/Cisco.pm line 46
	Net::Telnet::Cisco::new('Net::Telnet::Cisco', 'Host', 192.168.76.1, 'Port', 23, 'Prompt', '/[\>\#] $/', 'Timeout', 30, ...) called at /etc/munin/plugins/mikrotikwirelessconnected_192.168.76.1 line 22
Version of routeros is: 4,10.

Hello all.

Any solution for this? I have the same problem.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Power monitoring!

Mon Jan 09, 2012 11:55 am

port 23: Connection refused
make sure you have telnet access to your router from that server

Who is online

Users browsing this forum: ffernandes, sebi099 and 54 guests