ROS command / Script to return trace hop #

I’m trying to create a script which will report the # number hop in a traceroute.

I have managed to get the router to display the entire traceroute but for this purpose I only want it to show “GATEWAY = _______” in the device label

See the command I have created already

"
[oid(“1.3.6.1.2.1.1.5.0”)]
[Device.Name]
[device_performance()][Device.ServicesDown]
[ros_command(“/tool traceroute 168.210.2.2”)]

"

Assistance would be greatly appreciated

Hi,
not sure this will work, but instead of

[ros_command("/tool traceroute 168.210.2.2")]

try this

[array_size(ros_command("/tool traceroute 168.210.2.2"))]

Hi there, thanks for the script but that just returns the size of the array which is 1.

I don’t want to return the HOP #. I actually want it to return the hop value
roscommand.jpg