[Suggestions] New Mikrotik Template

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

Moderators: Developers, Moderators

striteiro
Posts: 1
Joined: Thu Mar 20, 2014 9:17 am

Re: [Suggestions] New Mikrotik Template

Post by striteiro »

i`m here too.
Ready to test.
Martinellly
Posts: 1
Joined: Mon Apr 14, 2014 5:15 pm

Re: [Suggestions] New Mikrotik Template

Post by Martinellly »

Good morning, I use cacti to monitor other tools, however Mikroik need to monitor my equipment, and all equipment mesu use RouterOS 5.x, would you provide this new template?

We are an institute of research and conservation located in the state of Amazonas Brazil Teffe.

www.mamiraua.org.br
sideamet
Posts: 1
Joined: Sat May 24, 2014 4:06 am

Re: [Suggestions] New Mikrotik Template

Post by sideamet »

Any working Mikrotik template with cacti 0.8.8b ?
soheilgh
Posts: 1
Joined: Tue May 31, 2011 7:15 am

Re: [Suggestions] New Mikrotik Template

Post by soheilgh »

Is this work fine with 0.8.8b ?

Thanks :)
acidsas
Posts: 3
Joined: Mon Jul 14, 2014 9:19 am

Re: [Suggestions] New Mikrotik Template

Post by acidsas »

Where can I find updated template? I'm currently in process of upgrading my cacti installation to a new version. Also wanted to update your template.
zyx
Posts: 3
Joined: Fri Jan 17, 2014 7:16 am

Re: [Suggestions] New Mikrotik Template

Post by zyx »

Is this template still under active development?
SheldonV
Posts: 3
Joined: Thu Jan 23, 2014 2:06 am

Re: [Suggestions] New Mikrotik Template

Post by SheldonV »

any news on the template? :)
acidsas
Posts: 3
Joined: Mon Jul 14, 2014 9:19 am

Re: [Suggestions] New Mikrotik Template

Post by acidsas »

Nothing…
nanoteck
Posts: 1
Joined: Wed Nov 05, 2014 1:06 pm

Re: [Suggestions] New Mikrotik Template

Post by nanoteck »

Hello, I want to know HOW GRAPH QUEUE TREE ON MIKROTIK? I search too much but anything.... Can someone help me? Please I need
knorbi
Posts: 1
Joined: Tue Nov 11, 2014 4:27 am

Re: [Suggestions] New Mikrotik Template

Post by knorbi »

hello,
I have a problem, my cacti 0.8.8.b version
my problem is mikrotik signal strength. I can not see signal in graph. The other signal is works.

Verbose Query log:
+ Running data query [10].
+ Found type = '4' [Script Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/mikrotik_wireless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for num of indexes 'php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php pcpc 172.16.10.58 num_indexes'
+ Found number of indexes: Interfaces: Array
+ Found number of indexes: (
+ Found number of indexes: ["ether1"] => 1
+ Found number of indexes: ["ether2"] => 2
+ Found number of indexes: ["ether3"] => 3
+ Found number of indexes: ["5GHz_V"] => 6
+ Found number of indexes: ["5GHz_AP_Szektor"] => 7
+ Found number of indexes: ["5GHz_H"] => 8
+ Found number of indexes: [""] => 14
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: SSID: Array
+ Found number of indexes: (
+ Found number of indexes: [0] => iso.3.6.1.4.1.14988.1.1.1.1.1.5.8
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: Array
+ Found number of indexes: (
+ Found number of indexes: [0] => STRING: "PC_DUTEP_H"
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: CMAC: Array
+ Found number of indexes: (
+ Found number of indexes: [0] => iso.3.6.1.4.1.14988.1.1.1.2.1.3.0.14.142.7.171.205.7
+ Found number of indexes: [1] => iso.3.6.1.4.1.14988.1.1.1.2.1.3.0.21.109.104.132.223.8
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: Array
+ Found number of indexes: (
+ Found number of indexes: [0] => INTEGER: -62
+ Found number of indexes: [1] => INTEGER: -57
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: Interface database: Array
+ Found number of indexes: (
+ Found number of indexes: [8] => Array
+ Found number of indexes: (
+ Found number of indexes: [ssid] => PC_DUTEP_H
+ Found number of indexes: [soid] => Array
+ Found number of indexes: (
+ Found number of indexes: [1] => 3.0.21.109.104.132.223
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: [ifIndex] => Array
+ Found number of indexes: (
+ Found number of indexes: [1] => 00:00:15:6D:68:84:DF
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: [7] => Array
+ Found number of indexes: (
+ Found number of indexes: [soid] => Array
+ Found number of indexes: (
+ Found number of indexes: [1] => 3.0.14.142.7.171.205
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: [ifIndex] => Array
+ Found number of indexes: (
+ Found number of indexes: [1] => 00:00:0E:8E:07:AB:CD
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: )
+ Found number of indexes:
+ Found number of indexes: )
+ Executing script for list of indexes 'php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php pcpc 172.16.10.58 index' Index Count: 2
+ Found index: 00:00:0E:8E:07:AB:CD
+ Found index: 00:00:15:6D:68:84:DF
+ Executing script query 'php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php pcpc 172.16.10.58 query ifName'
+ Found item [ifName='"5GHz_AP_Szektor"'] index: 00:00:0E:8E:07:AB:CD
+ Found item [ifName='"5GHz_H"'] index: 00:00:15:6D:68:84:DF
+ Executing script query 'php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php pcpc 172.16.10.58 query ifIndex'
+ Found item [ifIndex='00:00:0E:8E:07:AB:CD'] index: 00:00:0E:8E:07:AB:CD
+ Found item [ifIndex='00:00:15:6D:68:84:DF'] index: 00:00:15:6D:68:84:DF

Cacti log files:
014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.46', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.20'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'192.168.20.18', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.20'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.51', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.20'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.46', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.19'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'192.168.20.18', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.19'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.51', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.19'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.46', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.18'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.51', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.18'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'192.168.20.18', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.18'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.46', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.17'
11/11/2014 04:40:09 PM - CMDPHP: Poller[0] WARNING: SNMP Walk Timeout for Host:'172.16.10.51', and OID:'.1.3.6.1.4.1.14988.1.1.5.1.1.17'
'
What is problem with the SNMP WALK or other?

I thank from help
jaroslavhala
Posts: 1
Joined: Thu Aug 14, 2014 3:31 am

Re: [Suggestions] New Mikrotik Template

Post by jaroslavhala »

Where is the final XML file?:-)
hermanator
Posts: 4
Joined: Thu Jan 15, 2015 7:33 am

Re: [Suggestions] New Mikrotik Template

Post by hermanator »

@mojiro - Thank you for the Template, however I have a problem that i do not know how to fix. All files are imported as instructed however it does not seem to be able to index any of the data queries, and when i go to the new graphs menu it states [Error in data query]

Any body have some ideas ?
tudor2k3
Posts: 5
Joined: Mon Jul 18, 2011 3:57 am

Re: [Suggestions] New Mikrotik Template

Post by tudor2k3 »

Hello,

Can anyone post the template? :)

Thank you.
ALX1S
Posts: 1
Joined: Fri Jan 30, 2015 7:22 am

Re: [Suggestions] New Mikrotik Template

Post by ALX1S »

Hi to everyone, I'm very new in this Cacti world, and its awesome.
Does anyone was able to run the "wireless client" or the "Wireless registration table" in the Cacti v0.8.8b?, because I get the "Error in Data query" and when I run in Debug mode don't see any error:

Debugg Get Wireless Information

+ Running data query [14].
+ Found type = '4' [Script Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/mikrotik_wirelless_interfaces.xml'
+ XML file parsed ok.
+ Executing script for num of indexes '/mnt/hd01/php/bin/php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php A.B.C.D num_indexes'
+ Executing script for list of indexes '/mnt/hd01/php/bin/php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php A.B.C.D index' Index Count: 0
+ Executing script query '/mnt/hd01/php/bin/php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php A.B.C.D query index'
+ Executing script query '/mnt/hd01/php/bin/php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php A.B.C.D query name'
+ Executing script query '/mnt/hd01/php/bin/php -q /usr/share/cacti/site/scripts/mikrotik_wireless_interfaces.php A.B.C.D query cmac'


I used the templates mentioned in http://forums.cacti.net/viewtopic.php?f=12&t=17936, but did not let it working

Cacti V 0.8.8b
Ubuntu 17.4
Apache2

Thanks.
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: [Suggestions] New Mikrotik Template

Post by DJHiP »

Sorry for the long post, but myself and some others seem to have fixed it.

It revolves around mikrotik_wireless_interfaces.php, which every template seems to call at some stage.

Backstory, it appears the original script was built on a work around due to the php call snmprealwalk() having a bug; https://bugs.php.net/bug.php?id=51336

They fixed it in PHP 5.4; but it seems most people are running 5.3 and older with this script.

What it meant is the script, when parsing for clients, would incorrectly workout the MAC address, causing it to get an extra paid of leading 00's on the MAC address (which of course makes the MAC invalid). This would then throw the entire script off.

I've tested this on Cacti 0.8.8a, 0.8.8b and 0.8.8c, all with PHP 5.5 (Ubuntu 14.04 LTS), as well as separately as a script on a few other servers.

So the working script should output:

Code: Select all

Interfaces: Array
(
    ["lo"] => 1
    ["eth0"] => 2
    ["eth1"] => 3
    ["wifi0"] => 4
    ["ath0"] => 5
    ["eth0.40"] => 6
    ["br0"] => 7
)

SSID: Array
(
)

Array
(
)

CMAC: Array
(
    [0] => .1.3.6.1.4.1.14988.1.1.1.2.1.3.220.159.219.64.86.181.5
    [1] => .1.3.6.1.4.1.14988.1.1.1.2.1.3.220.159.219.76.76.149.5
)

Array
(
    [0] => INTEGER: -68
    [1] => INTEGER: -71
)

Interface database: Array
(
    [5] => Array
        (
            [soid] => Array
                (
                    [1] => .220.159.219.64.86.181
                    [2] => .220.159.219.76.76.149
                )

            [ifIndex] => Array
                (
                    [1] => DC:9F:DB:40:56:B5
                    [2] => DC:9F:DB:4C:4C:95
                )

        )

)
But what is happening is this:

Code: Select all

Interfaces: Array
(
    ["lo"] => 1
    ["eth0"] => 2
    ["eth1"] => 3
    ["wifi0"] => 4
    ["ath0"] => 5
    ["eth0.40"] => 6
    ["br0"] => 7
)

SSID: 

CMAC: Array
(
    [0] => iso.3.6.1.4.1.14988.1.1.1.2.1.3.220.159.219.64.86.181.5
    [1] => iso.3.6.1.4.1.14988.1.1.1.2.1.3.220.159.219.76.76.149.5
)

Array
(
    [0] => INTEGER: -68
    [1] => INTEGER: -71
)

Interface database: Array
(
    [5] => Array
        (
            [soid] => Array
                (
                    [1] => 3.220.159.219.64.86.181
                    [2] => 3.220.159.219.76.76.149
                )

            [ifIndex] => Array
                (
                    [1] => 00:DC:9F:DB:40:56:B5
                    [2] => 00:DC:9F:DB:4C:4C:95
                )

        )

)
Notice most things off by one, causing everything misread SNMP OIDs and thus extra digits in the MAC Address.

(You can prove this to yourself by running the following command in the cacti/scripts directory: php mikrotik_wireless_interfaces.php <SNMP Community> <Host> )

The fix? For each refernce of 'iso', replace it with .1 to restore the OID correctly.

After Line 77

Code: Select all

$cmac_mib  = array_keys($cmac_info);
Add this

Code: Select all

foreach($cmac_mib as &$m) $m = str_replace('iso', '.1', $m);
So Line 77,78,79 end up like this

Code: Select all

$cmac_mib  = array_keys($cmac_info);
foreach($cmac_mib as &$m) $m = str_replace('iso', '.1', $m);
$cmac_val  = array_values($cmac_info);
Hopefully I've done enough testing to make sure it works, but my outputs are back to what they should be!

You will need to go through your devices and 'Reload Associated Query' on Data Query [Mikrotik - Wireless - Registration Table], which will update the MAC address for each client. (Alternatively, just delete the device altogether in Cacti and re-add it).

It's a fix that should fix it for a while, but if the OP wants to update the script entirely still that's welcomed :)

Enjoy!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests