Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Trace route style agent/module??

  • Trace route style agent/module??

    Posted by dping28 on March 14, 2008 at 19:23

    Hi, I was wondering if there was a trace route style agent/module or a way to make one that someone might be willing to help me with?

    Basically I need a agent to run trace routes and keep track of where the trace route fails (IF) it fails. Im having sporadic connection issues with another site and trying to track down where the problem is.

    Im very new to Pandora so if this is something easy I am sorry. 🙂

    Thank you!

    -D

    dping28 replied 16 years, 10 months ago 2 Members · 7 Replies
  • 7 Replies
  • manu

    Member
    March 15, 2008 at 21:47
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi,

    No, there is no module like that (yet).

    The first approach that comes to my mind it ain’t quite stylish, but I think it’d do the trick.
    What about….redirecting the output of a traceroute to a file and then reading the last line where an IP appears, that would be the IP where the traceroute got stuck. It could be reported in the webconsole (the same way “last login” module does)

    Again, this is the first approach that came to my mind while sitting in my sofa eating a 500ml yogurt 🙂
    So don’t take it as it would has to be like that!

  • dping28

    Member
    March 21, 2008 at 20:42
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hmmm Im liking where you are going with that. Another idea I had thought I would ask, since that type of module isnt available how about an alert to run an external script? That way if the host alive cant connect it could run my trace route script and at least that way I could have a log file I could parse my self?

    I will also check and see if i can do anything in terms of making something out of a copy of the login module. I only know enough to be dangerous so keep your fingers crossed for me 😉

    Thanks for the reply!!

    -Darrell

    EDIT: Sorry, it appears thats exactly what the alert is. Still trying to wrap my brain around all that this can do 🙂

  • dping28

    Member
    April 18, 2008 at 23:00
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Ive managed to make the traceroute script and created a new alert to use the script however my alert is never going off. I was wondering if someone could tell me the config for the alert to go off when ever the host alive fails? Thanks!

  • manu

    Member
    April 19, 2008 at 11:39
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    You mean an alert assigned to the “Host Alive” module, not the one you’ve created, don’t you? If so, the alert max and min value must be 1, why? Cause the Host Alive module is a proc module, this means, values 0 or 1, 0 is a machine down and 1 is a machine up, therefore, the alert must be configured to be fired whenever the value ain’t 1.

    Do not forget to assign the alert to the module Host Alive, in the combo at the bottom of the manage alerts menu.

    Changing the subject, would send or post the traceroute module you’ve created? I think that might be useful for other people in the future.

    Thanks
    Manuel

  • dping28

    Member
    April 25, 2008 at 23:52
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thanks manu! I will give that a shot. Yeah once I get it working I will post everything I got for everyone. I just want to make sure its working first. Also be warned its probobly not the cleanest code 😉 so keep that in mind when I release it. 🙂 Give me a week or two for testing (only in this office once a week) and will update this. 🙂 Thanks again!

    -D

  • manu

    Member
    April 28, 2008 at 13:27
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Fair, let us know if it worked out !

  • dping28

    Member
    May 2, 2008 at 17:23
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Alright it seems to be working perfectly now. Still need to develop a way to process the log files but at least im getting the data now. Here is the script I made. (Again im no linux guy so its probobly sloppy)

    [code:1]#!/bin/bash

    # Date Sytanx: Fri Mar 21 14:27:40 EDT 2008
    value1=$(date|awk ‘{print $1}’)
    value2=$(date|awk ‘{print $2}’)
    value3=$(date|awk ‘{print $3}’)
    value4=$(date|awk ‘{print $6}’|tr -d 2|tr -s 0)
    # Ex: 21-Mar-08
    value5=$value3-$value2-$value4
    value6=”/var/log/pandora/tracert/”$value5
    value7=$value6/$1.log

    # Traceroute function
    function TraceHost {
    date >> $value7 2>&1
    echo “—————————-” >> $value7 2>&1
    tracert $1 >> $value7 2>&1
    echo “—————————-” >> $value7 2>&1
    }

    # $1 = domain or ip
    if [ $# -gt 0 ]; then
    {

    # Check Log dir exists, if not creates it
    if [ -d $value6 ]; then
    {
    # Dir exists, only runs traceroute
    TraceHost $1
    exit 1
    } else {
    # Make dir & Run traceroute
    mkdir $value6
    TraceHost $1
    exit 1
    }
    fi

    }
    fi

    I placed this script in /usr/share/pandora/util just because there were other pandora files there but you can put it anywhere.

    I then went to pandora made a new alert named Trace Route Log with the command of : /usr/share/pandora/util/tr-log _field1_

    _field1_ is the domain name or IP address

    And I just setup the alert based on the info you gave manu and it then creates a folder for each day and creates a log file for each Agent in that folder. It appends the traceroutes to the log file hence the lines of -‘s to help me see where one stops and other starts.

    Hope someone finds the useful. And any improvements anyone has Id love to hear.. 🙂 Thanks again for your help manu!

    -D