Ad Widget

Collapse

Check Route Path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HeadQuaker
    Member
    • Jul 2015
    • 58

    #1

    Check Route Path

    Hello,

    The Company has one main site and plenty of externals sites everywhere in Europe.

    What I NEED to check the route path to every externals sites because on each network path, there are 2 lines:
    - The main network line
    - The backup

    We have to know if the main line is up or down.

    I have already something that do the job using external scripts but I have plenty of false errors because of the overload of the zabbix server.

    Do you have an idea of how to do that more natively ?

    What I CAN'T do:
    - Count the number of hopes because main and backup lines have the same hopes number.
    - Ping a hope, because it's impossible
    - Install the zabbix agent or do something on a computer or a server on the remote sites

    To be clear: everything have to be done localy.

    On zabbix 2.0.4. No other linux servers.
    Last edited by HeadQuaker; 30-05-2016, 12:50.
  • HeadQuaker
    Member
    • Jul 2015
    • 58

    #2
    For the main line we use something like : main.site.domainName
    For the backup line : backup.site.domaineName

    $1 = destination
    $2 = hopes
    $3 = main.site.domainName

    Code:
     result=""
            result=$(traceroute $1 -m $2 -w 10 -q 1 )
            result2=""
            result2=$(echo $result | grep $3)
    
            if [[ -z $result2 ]]
            then
                    #echo -e "NOK \n\n $result"
                    echo 1
                    return 1
            else
                    #echo -e "OK \n\n $result"
                    echo 0
                    return 0
            fi
    Example:

    Network on the main line:
    traceroute to aa.bb.cc.dd, 4 hops max, 40 byte packets using UDP
    1 name1 (ip) 0.781 ms 0.742 ms 0.694 ms
    2 name2 (ip) 2.284 ms 2.294 ms 2.865 ms
    3 name3 (ip) 20.439 ms 20.193 ms 20.235 ms
    4 main.site.domainName (ip) 20.218 ms 20.210 ms 20.211 ms

    Network on the backup line:
    traceroute to aa.bb.cc.dd, 4 hops max, 40 byte packets using UDP
    1 name1 (ip) 0.781 ms 0.742 ms 0.694 ms
    2 name2 (ip) 2.284 ms 2.294 ms 2.865 ms
    3 name3 (ip) 20.439 ms 20.193 ms 20.235 ms
    4 backup.site.domaineName (ip) 20.218 ms 20.210 ms 20.211 ms

    The result will depend of the line 4. If the $3 is not find -> ERROR
    Last edited by HeadQuaker; 30-05-2016, 10:20.

    Comment

    • HeadQuaker
      Member
      • Jul 2015
      • 58

      #3
      Well, no motivation or idea ?

      Comment

      • HeadQuaker
        Member
        • Jul 2015
        • 58

        #4
        OK if I need nothink I'll ask next time.

        Comment

        Working...