Help with munin scripts using PHP API

Hi,

Following the instructions for configuring Munin on the Wiki, I have been able to connect my RB951G running RouterOS 5.24 to my Munin-Master. At the moment, scripts which rely on Telnet access are working fine for me. However, I think there is an issue with a couple of the scripts which use the PHP API.

For the script Firewall Count, the key command appears to be the following:

23: $API->write('/ip/firewall/filter/getall');

However, when I check via SSH there does not appear to be a getall option under ip/firewall/filter anymore:

[admin@MikroTik] /ip firewall filter>
add  comment  disable  edit  enable  export  find  move  print  remove  reset-counters  reset-counters-all  set  unset

Any suggestions on an alternative command that will yield the same output as what the script is expecting?

For the script Interface Transfer Rate, the key command appears to be the following:

30:  $API->write('/interface/print',false);
31:  $API->write('=stats=');

I’m not sure how the command in Line 31 is supposed to be executed, but the script seems to depend on the response returned by this command. Is there a new command that works in a similar manner?

if you check API manual here:
http://wiki.mikrotik.com/wiki/Manual:API

you could see that API command consists of:




also “getall” is the same as “print”. If that was written for older RouterOS then you have to add what exactly you want to see similar to the console.

second command just consists of 2 lines, and 2nd line -

but you always can check CLI output for command that has to be converted to API

like,
/ip firewall filter print becomes /ip/firewall/filter/print