Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Bash Script To Check The 1st & 2nd Hop Of Your Network
Current Version
Last Release Date
May 28, 2009
Owner
Joe McShinsky
##### Created by Joe McShinsky #####
#! /bin/bash
if [ $# -ne 3 ] then echo "Usage: check_traceroute.sh [host] [1st hop] [2nd hop]" exit 3 fi
chr=`/bin/traceroute -n -N 1 --max-hops=4 $1` chf=`echo "$chr" | grep $2 | wc -l` chs=`echo "$chr" | grep $3 | wc -l`
fh=`echo "$chr" | head -n2 | tail -n1 | awk '{ print $2 }'` sh=`echo "$chr" | head -n3 | tail -n1 | awk '{ print $2 }'`
out="(1st Hop = $fh) (2nd Hop = $sh)"
if [ `expr $chf + $chs` = 2 ] then echo "OK: $out" exit 0 fi if [ `expr $chf + $chs` -ne 2 ] then echo "CRITICAL: $out" exit 2 fi echo "Oops! Something Went Wrong $out" exit 3
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!