Hazard's stuff

Smokeping Mikrotik SSH plugin with VRF support

— Posted by hazard @ 2015-07-13 00:54
I have released a Smokeping plugin for Mikrotik RouterOS devices. It supports VRFs and connects via SSH. Installation instructions:
  • Download the plugin to your server.
  • Install by copying the file into lib/Smokeping/probes directory under your smokeping installation (e.g. to /opt/smokeping/lib/Smokeping/probes).
  • You might also have to install Net::OpenSSH Perl module, if it's not already installed (check by running " perl -e 'use Net::OpenSSH' ").
  • Add the following section to your smokeping config:
    + OpenSSHMikrotikPing
    packetsize = [e.g. usual MTU is 1500]
    mikrotikuser = [user]
    mikrotikpass = [pass]
    # feel free to change params below as you wish
    forks = 5
    offset = 50%         
    timeout = 15
    step = 120
    
  • Individual targets are configured as follows:
    ++ sample-target
      probe = OpenSSHMikrotikPing
      menu = [menu name]
      title = [title]
      host = [destination IP to ping from Mikrotik device]
      pings = [numer of ICMP pings to send, e.g. 5]
      source = [Mikrotik device to login into]
      vrf = [routing-instance name, optional]
      psource = [Mikrotik interface source IP to ping from, optional]
    
  • ssh to the Mikrotik device once from the commmand line from the account of the user who is running smokeping (su -s /bin/sh [username]). On the first connect ssh will ask to add the new host to its known_hosts file, confirm it. Otherwise Smokeping will fail to login as the ssh key of your Mikrotik box is not in the known_hosts file.