Mikrotik Firewall Mangle

I need some enlightenments to add a script in LibreNMS

  1. The script will connect and fetch to my Mikrotik and read the:

:local a [/ip firewall mangle get [ find comment=“downstream local” ] bytes ]; :put $a
:local b [/ip firewall mangle get [ find comment=“upstream local” ] bytes ]; :put $b

  1. Here is how I call the script.

#!/bin/sh

mikrotik with ip 192.168.100.2

SSHKEY=“/usr/bin/ssh -i /home/awarmanf/.ssh/id_dsa [email protected]
SED=“/usr/bin/sed”

sed used to remove CRLF line terminators

$SSHKEY “/system script run get-traf-international” | $SED -e ‘s/\r//’

3… Here is the example output.

$ cd /usr/local/sbin
$ ./getTrafInt.sh 
1088699432
149212232

So, the question, how do add such “data” to a device?

Thanks

Using check_mk with munin. We don’t have that much documentation on munin side but you can get check_mk setup with:

You will then find a munin script in the librenms-agent repo. You can update your script to support auto graphing which you can find example script in: