i am testing librouteros in a linux server, using collectd to graph a mikrotik server
The problem i have is i success graph CPU, Memory and DF, but Interfaces is not working, collectd makes emptys graphs, after checking with the script "ros" i get this :
./ros -u warn1ng 10.0.0.58 interface
=== ===
Type: pppoe-in
Comment: (null)
Bytes: 0 / 0
Packets: 0 / 0
Errors: 0 / 0
Drops: 0 / 0
MTU: 1480
L2 MTU: 0
Running: true
Dynamic: true
Enabled: true
=== ===
Type: pppoe-in
Comment: (null)
Bytes: 0 / 0
Packets: 0 / 0
Errors: 0 / 0
Drops: 0 / 0
MTU: 1492
L2 MTU: 0
Running: true
Dynamic: true
Enabled: true
Dunno why i am getting 0 stats, on all the interfaces (like 500 interfaces if i count the pppoe ones)
What i am Running is:
Collectd version 5.1.0
Librouteros version 1.1.2
Mikrotik Routerboard server version 5.19 x86
Sorry my bad english.
Perhaps between 2010 and now, RouterOS changed something in the interfaces, while the “ros” executable is doing more than a simple print, and is thus not coping with the new changes…
Try to use low(er) level commands, e.g.
./ros -u warn1ng 10.0.0.58 /interface/print
Works incorrectly with CCR + ROS 6.x
In collectd, SFP interfaces are not graphed at all.
DfComplex and Memory have strange values (3.5T free, 360G used)
All other graphs are empty.
Crossposted to http://forum.mikrotik.com/t/collectd-plugin-routeros-on-the-horizon/33459/4
boen_robot:
Perhaps between 2010 and now, RouterOS changed something in the interfaces, while the “ros” executable is doing more than a simple print, and is thus not coping with the new changes…
Try to use low(er) level commands, e.g.
./ros -u warn1ng 10.0.0.58 /interface/print
Collectd correctly displays “eth*” interface names on graphs, but all graphs still empty:
ros -u collectd 10.70.59.1 /interface/print
Password for user collectd:
Status: re
Param 0: .id = *F
Param 1: name = ether01_LAN
Param 2: default-name = ether1
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A4
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: slave = true
Param 19: disabled = true
===
Status: re
Param 0: .id = *10
Param 1: name = ether02_LAN
Param 2: default-name = ether2
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A5
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: slave = true
Param 19: disabled = true
===
Status: re
Param 0: .id = *11
Param 1: name = ether03_LAN
Param 2: default-name = ether3
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A6
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: slave = true
Param 19: disabled = true
===
Status: re
Param 0: .id = *12
Param 1: name = ether04_LAN
Param 2: default-name = ether4
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A7
Param 8: fast-path = true
Param 9: rx-byte = 22475761
Param 10: tx-byte = 418094497
Param 11: rx-packet = 143888
Param 12: tx-packet = 324924
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *13
Param 1: name = ether05_LAN
Param 2: default-name = ether5
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A8
Param 8: fast-path = true
Param 9: rx-byte = 356395444712
Param 10: tx-byte = 48596693134
Param 11: rx-packet = 685974862
Param 12: tx-packet = 609338823
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *14
Param 1: name = ether06_LAN
Param 2: default-name = ether6
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A9
Param 8: fast-path = true
Param 9: rx-byte = 264152870004
Param 10: tx-byte = 53936499555
Param 11: rx-packet = 719514605
Param 12: tx-packet = 691531130
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *15
Param 1: name = ether07_LAN
Param 2: default-name = ether7
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AA
Param 8: fast-path = true
Param 9: rx-byte = 146900634331
Param 10: tx-byte = 30481556029
Param 11: rx-packet = 409007180
Param 12: tx-packet = 390219318
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *16
Param 1: name = ether08_LAN
Param 2: default-name = ether8
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AB
Param 8: fast-path = true
Param 9: rx-byte = 218856709717
Param 10: tx-byte = 47879654073
Param 11: rx-packet = 633436637
Param 12: tx-packet = 607387093
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *17
Param 1: name = ether09_LAN
Param 2: default-name = ether9
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AC
Param 8: fast-path = true
Param 9: rx-byte = 447860895429
Param 10: tx-byte = 69233856522
Param 11: rx-packet = 939517709
Param 12: tx-packet = 887465285
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *18
Param 1: name = ether10_LAN
Param 2: default-name = ether10
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AD
Param 8: fast-path = true
Param 9: rx-byte = 431504627163
Param 10: tx-byte = 63614709989
Param 11: rx-packet = 872832678
Param 12: tx-packet = 807329985
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *19
Param 1: name = ether11_LAN
Param 2: default-name = ether11
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AE
Param 8: fast-path = true
Param 9: rx-byte = 195302575489
Param 10: tx-byte = 21441921136
Param 11: rx-packet = 171273971
Param 12: tx-packet = 123160019
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: slave = true
Param 19: disabled = false
===
Status: re
Param 0: .id = *1A
Param 1: name = ether12_WAN
Param 2: default-name = ether12
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:AF
Param 8: fast-path = true
Param 9: rx-byte = 342010995001
Param 10: tx-byte = 2059177914381
Param 11: rx-packet = 4110351222
Param 12: tx-packet = 4424968198
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = true
Param 18: disabled = false
===
Status: re
Param 0: .id = *B
Param 1: name = sfp1
Param 2: default-name = sfp1
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A0
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: disabled = true
===
Status: re
Param 0: .id = *C
Param 1: name = sfp2
Param 2: default-name = sfp2
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A1
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: disabled = true
===
Status: re
Param 0: .id = *D
Param 1: name = sfp3
Param 2: default-name = sfp3
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A2
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: disabled = true
===
Status: re
Param 0: .id = *E
Param 1: name = sfp4
Param 2: default-name = sfp4
Param 3: type = ether
Param 4: mtu = 1500
Param 5: l2mtu = 1590
Param 6: max-l2mtu = 10226
Param 7: mac-address = D4:CA:6D:AC:E1:A3
Param 8: fast-path = true
Param 9: rx-byte = 0
Param 10: tx-byte = 0
Param 11: rx-packet = 0
Param 12: tx-packet = 0
Param 13: rx-drop = 0
Param 14: tx-drop = 0
Param 15: rx-error = 0
Param 16: tx-error = 0
Param 17: running = false
Param 18: disabled = true
===
Status: re
Param 0: .id = *9
Param 1: name = LANs
Param 2: type = bridge
Param 3: mtu = 1500
Param 4: l2mtu = 1590
Param 5: mac-address = D4:CA:6D:AC:E1:AE
Param 6: fast-path = false
Param 7: rx-byte = 1986184929974
Param 8: tx-byte = 334517187333
Param 9: rx-packet = 4394982897
Param 10: tx-packet = 4108226360
Param 11: rx-drop = 0
Param 12: tx-drop = 0
Param 13: rx-error = 0
Param 14: tx-error = 0
Param 15: running = true
Param 16: disabled = false
===
Status: done
===
janisk
November 26, 2013, 1:41pm
5
API command:
/interface/ethernet/print
=stats=
example of result for 1 interface form RB2011
<<< /interface/ethernet/print
<<< =stats=
<<<
>>> !re
>>> =.id=*2
>>> =name=ether1
>>> =default-name=ether1
>>> =mtu=1500
>>> =l2mtu=1598
>>> =mac-address=D4:CA:6D:86:E1:85
>>> =orig-mac-address=D4:CA:6D:86:E1:85
>>> =arp=enabled
>>> =auto-negotiation=true
>>> =full-duplex=true
>>> =speed=100Mbps
>>> =master-port=none
>>> =bandwidth=unlimited/unlimited
>>> =switch=switch1
>>> =poe-out=auto-on
>>> =poe-priority=10
>>> =driver-rx-byte=62470600
>>> =driver-rx-packet=269966
>>> =driver-tx-byte=60176282
>>> =driver-tx-packet=106563
>>> =rx-bytes=63550137
>>> =rx-too-short=0
>>> =rx-64=64346
>>> =rx-65-127=115497
>>> =rx-128-255=51012
>>> =rx-256-511=10619
>>> =rx-512-1023=4434
>>> =rx-1024-1518=24054
>>> =rx-1519-max=0
>>> =rx-too-long=0
>>> =rx-broadcast=113466
>>> =rx-pause=0
>>> =rx-multicast=69227
>>> =rx-fcs-error=0
>>> =rx-align-error=0
>>> =rx-fragment=0
>>> =rx-overflow=0
>>> =tx-bytes=60389574
>>> =tx-64=7154
>>> =tx-65-127=53886
>>> =tx-128-255=5658
>>> =tx-256-511=2714
>>> =tx-512-1023=2616
>>> =tx-1024-1518=34528
>>> =tx-1519-max=0
>>> =tx-too-long=0
>>> =tx-broadcast=831
>>> =tx-pause=0
>>> =tx-multicast=448
>>> =tx-underrun=0
>>> =tx-collision=0
>>> =tx-excessive-collision=0
>>> =tx-multiple-collision=0
>>> =tx-single-collision=0
>>> =tx-excessive-deferred=0
>>> =tx-deferred=0
>>> =tx-late-collision=0
>>> =running=true
>>> =disabled=false