Mikrotik RouterOS Statistics (Update 02/10/2009)

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

Moderators: Moderators, Developers

Post Reply
Author
Message
johnm
Posts: 3
Joined: Thu Feb 12, 2009 4:48 am

#31 Post by johnm » Thu Feb 12, 2009 4:54 am

Hi
i have big problem whit Mikrotik - Wireless - Registration Table
When i click new graph->Data Query [Mikrotik - Wireless - Registration Table]->reload associeted query whit debug mode then i see :
+ Running data query [14].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/www/vhosts//cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/local/bin/php -q /usr/www/vhosts/cacti/scripts/mikrotik_wireless_interfaces.php public 192.168.30.25 index'
+ Executing script query '/usr/local/bin/php -q /usr/www/vhosts/cacti/scripts/mikrotik_wireless_interfaces.php public 192.168.30.25 query ifName'
+ Executing script query '/usr/local/bin/php -q /usr/www/vhosts//cacti/scripts/mikrotik_wireless_interfaces.php public 192.168.30.25 query ifIndex'
+ Found data query XML file at '/usr/www/vhosts/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/www/vhosts/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/usr/www/vhosts/cacti/resource/script_server/mikrotik_wireless_interfaces.xml'


all other options:
1) Mikrotik - Queue - Simple
2) Mikrotik - Queue - Tree
3) Mikrotik - Wireless - Client
4) SNMP - Interface Statistics
work ok

please help me what is wrong

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

#32 Post by mojiro » Thu Feb 12, 2009 6:54 am

What did you expected to see?

What I see? I see that the script did not find any entries in wireless registration table.

My verbosed query produced:
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /cacti-dir/scripts/mikrotik_wireless_interfaces.php public 10.x.y.z index'
+ Executing script query '/usr/bin/php -q /cacti-dir/scripts/mikrotik_wireless_interfaces.php public 10.x.y.z query ifName'
+ Found item [ifName='ath0'] index: 00:xx:yy:zz:xx:zz
+ Executing script query '/usr/bin/php -q /cacti-dir/scripts/mikrotik_wireless_interfaces.php public 10.x.y.z query ifIndex'
+ Found item [ifIndex='00:xx:yy:zz:xx:zz'] index: 00:xx:yy:zz:xx:zz
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
+ Found data query XML file at '/cacti-dir/resource/script_server/mikrotik_wireless_interfaces.xml'
Note: I have one connected client with mac 00:xx:yy:zz:xx:zz
[i]Born to be online![/i]

johnm
Posts: 3
Joined: Thu Feb 12, 2009 4:48 am

#33 Post by johnm » Thu Feb 12, 2009 9:20 am

Hi
Thanks for your answer.

Why in my wireless registration table dont show any connections?
What are taking data form MT as the same as Mikrotik - Wireless - Client - SNMP?
Maybe I should set any options in my MT?
Maybe when I querty wireless registration table I dont have corect configuration my PHP server? What check it?

johnm
Posts: 3
Joined: Thu Feb 12, 2009 4:48 am

#34 Post by johnm » Thu Feb 12, 2009 11:06 am

Hi
Now all is ok, i have 2 php one whit snmp 2 no support snmp
now all is ok
big thx
Good job mojiro

kendirangu
Posts: 5
Joined: Fri Jul 18, 2008 5:14 pm
Contact:

Error: XML: Hash version does not exist.

#35 Post by kendirangu » Fri Feb 27, 2009 4:01 am

I keep getting this error when I try to load the host template file.

"Error: XML: Hash version does not exist."

I'm I doing something wrong ?

Regards

kendirangu
Posts: 5
Joined: Fri Jul 18, 2008 5:14 pm
Contact:

#36 Post by kendirangu » Fri Feb 27, 2009 9:30 am

I upgraded to the latest cacti version and it works now.

Thanks

archon
Posts: 8
Joined: Tue Feb 12, 2008 4:20 pm

#37 Post by archon » Thu Mar 05, 2009 5:00 pm

Hi mojiro,
I thought about problem of counting active IP addresses at a time and as far as i'm concerned the only way would be to execute command via SSH

Code: Select all

ip arp print count-only
And then graph the output (number).
Are you interested in adding this feature? I am very much, and i offer my time to help.
Best Regards

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

#38 Post by mojiro » Fri Mar 06, 2009 6:38 am

archon wrote:Hi mojiro,
I thought about problem of counting active IP addresses at a time and as far as i'm concerned the only way would be to execute command via SSH

Code: Select all

ip arp print count-only
And then graph the output (number).
Are you interested in adding this feature? I am very much, and i offer my time to help.
Best Regards
ARP cache is allready being graphed using snmp. It is working only on linux installations because of the usage of awk and grep.

Do you have cacti on Windows? I will convert the counting scripts into php's one day, in order to be used from windows too.
[i]Born to be online![/i]

archon
Posts: 8
Joined: Tue Feb 12, 2008 4:20 pm

#39 Post by archon » Fri Mar 06, 2009 12:16 pm

I have cacti on linux.
The problem is that i need to collect data from MikroTik, so as far as i know the only method is to use some script that execute a command on MT?

Ilya Evseev
Posts: 11
Joined: Sun Mar 01, 2009 7:39 am
Location: Saint-Petersburg, Russia
Contact:

#40 Post by Ilya Evseev » Sat Mar 07, 2009 5:19 pm

cacti_host_template_mikrotik.xml contains command that works incorrectly under FreeBSD:

Code: Select all

/usr/bin/snmpwalk <ip> -v <ver> -c <comm> <oid> | /bin/wc -l | /bin/awk '{printf$0}'
1) snmpwalk is actually installed in /usr/local/bin, wc and awk are in /usr/bin/

2) IP-address must be located immediately before OID, after all switches.
When IP is passed as first argument, snmpwalk displays error:
-v2: Unknown Object Identifier (Sub-id not found: (top) -> -v2)

3) Cacti passes version "2", but snmpwalk knows about "2c" only:
Invalid version specified after -v flag: 2
USAGE: snmpwalk [OPTIONS] AGENT [OID]

IMHO, it would be better to put entire stuff into cacti/scripts/query_mikrotik_host.pl,
where it can be easily adopted for concrete platform:

Code: Select all

#!/usr/bin/perl

die "Usage: $0 ip ver comm oid\n" if @ARGV != 4;
my ($ip, $version, $community, $oid) = @ARGV;
$version = '2c' if $version eq '2';

open F, "/usr/local/bin/snmpwalk -v$version -c $community $ip $oid |";
my $lines = 0;
$lines++ while <F>;
close F;

print "$lines\n";
So, fixed template should contain following command:

Code: Select all

perl <path_cacti>/scripts/query_mikrotik_host.pl <ip> <ver> <comm> <oid>

lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

#41 Post by lonecrow » Thu Mar 12, 2009 10:28 am

Any way you could add packets per second to this?

thavinci
Posts: 26
Joined: Tue Nov 06, 2007 12:14 pm
Location: JHB
Contact:

Some Graphs Don't Work

#42 Post by thavinci » Fri Apr 10, 2009 6:49 pm

No errors on rrdtool.......
advise? using ROS v3.22

Image

And

Image

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

#43 Post by mojiro » Sat Apr 11, 2009 3:09 am

for some reason you do not collecting values...
check log file

does other rrd's, collect values?
[i]Born to be online![/i]

thavinci
Posts: 26
Joined: Tue Nov 06, 2007 12:14 pm
Location: JHB
Contact:

Sad Panda

#44 Post by thavinci » Sat Apr 11, 2009 7:32 pm

Most of the other scripts from this pack do indeed work correctly....

eg...

Image
&
Image
&
Image

These are few that ive tested thus far and work.

As for log...

Code: Select all

04/12/2009 02:25:15 AM - SYSTEM THOLD STATS: Time:0.2167 Tholds:1 Hosts:0
04/12/2009 02:25:15 AM - SYSTEM STATS: Time:13.1128 Method:cmd.php Processes:1 Threads:N/A Hosts:20 HostsPerProcess:20 DataSources:236 RRDsProcessed:162
04/12/2009 02:25:14 AM - CMDPHP: Poller[0] Host[19] DS[196] WARNING: Result from SNMP not valid. Partial Result: U
04/12/2009 02:25:14 AM - CMDPHP: Poller[0] Host[18] DS[147] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:14 AM - CMDPHP: Poller[0] Host[18] DS[149] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[157] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[157] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[156] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[156] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[155] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:12 AM - CMDPHP: Poller[0] Host[10] DS[154] WARNING: Result from CMD not valid. Partial Result: U
04/12/2009 02:25:11 AM - CMDPHP: Poller[0] Host[9] DS[90] WARNING: Result from SNMP not valid. Partial Result: U
04/12/2009 02:25:11 AM - CMDPHP: Poller[0] Host[9] DS[90] WARNING: Result from SNMP not valid. Partial Result: U
04/12/2009 02:25:09 AM - CMDPHP: Poller[0] Host[8] NOTICE: HOST EVENT: Host Returned from DOWN State: 

Unfortunately this doesn't give me anything usefull and i have MANY hosts and graphs on this system already!

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

#45 Post by mojiro » Mon Apr 13, 2009 2:44 pm

ah...

notice:
1) when your radio is in ap mode, it can only capture client's radio stats
2) when your radio is in station mode, then it can capture its radio stats

Which means ap mode <> local radio stats.
[i]Born to be online![/i]

Post Reply