[smokeping-users] TelnetIOSPing vrf

Dmitry Melekhov dm at belkam.com
Wed Mar 4 10:00:41 CET 2015


Hello!

I need to check connectivity from router, connected to several ISPs , 
which is logically separated by VRF, so I added vrf support to 
TelnetIOSPing.
Hope this can be helpful to somebody else.

--- TelnetIOSPing.pm.old    2012-10-22 14:15:25.961890042 +0400
+++ TelnetIOSPing.pm    2015-03-04 12:56:31.155588894 +0400
@@ -138,6 +138,10 @@
      my $bytes = $self->{properties}{packetsize};
      my $pings = $self->pings($target);
      my $timeout = $self->{properties}{timeout};
+    my $vrf ="";
+    if ( defined ($target->{vars}{vrf}) ) {
+     $vrf = " vrf $target->{vars}{vrf}";
+    }

      # do NOT call superclass ... the ping method MUST be overwriten
      my %upd;
@@ -166,7 +170,7 @@
       $telnet->waitfor('/[\@\w\-\.]+[>#][ ]*$/');
       $telnet->print("terminal length 0");
       $telnet->waitfor('/[\@\w\-\.]+[>#][ ]*$/');
-     $telnet->print("ping");
+     $telnet->print("ping$vrf");
       $telnet->waitfor('/Protocol \[ip\]: $/');
       $telnet->print("");
       $telnet->waitfor('/Target IP address: $/');
@@ -278,6 +282,14 @@
  DOC
              _example => 'password',
          },
+        vrf => {
+            _doc => <<DOC,
+The vrf option allows you to specify the vrf for ping
+DOC
+            _example => 'VRF1',
+        },
+
+
      });
  }


Thank you!



More information about the smokeping-users mailing list