AnsweredAssumed Answered

LUA Tracert

Question asked by justin.k.montgomery on Nov 6, 2008
Latest reply on Apr 9, 2010 by carstein.seeberg

function TraceThem(DestHost,MilTimeOut)

 

 


   if MilTimeOut == nil then MilTimeOut = 500 end

 

 


   aTMP = action.command("tracert -w " .. MilTimeOut .. " -h 15 -d " .. DestHost)

 

 


   for i=1,#aTMP do

 

 


      if regexp (aTMP,"*Request*") then

 

 


         return string.match (aTMP,'%d+%.%d+%.%d+%.%d+',1)

 

 


      else

 

 


          cSTR = "Host is online!"

 

 


      end

 

 


   end

 

 


   return cSTR

 

 


end

The function above will return the last available hop to the given network address.  ENJOY!

Outcomes