Forum Discussion

Antony_Hawkins's avatar
8 years ago

Traceroute ConfigSources

Update:

A ConfigSource, for use with LM Config, to monitor and alert on changes of route from the collector to any of a list of destinations. This is now combined a single ConfigSource that will run for both Windows and Linux collectors:

v1.1.0: JGZ7GK

If you really want to have a different ConfigSource per OS, the original two OS-specific ConfigSources are at: EK4HEG (Windows v1.5.0); HCPCXA (Linux v1.2.0).

To use, you'll need to add a property 'traceroute.list' to the Windows or Linux collector device* you want to use to check the route from, with the value being a comma separated list of destinations, e.g. '8.8.8.8,www.logicmonitor.com'

*You can modify the AppliesTo such that this datasource could apply to any device, however it will always be the collector running the script and doing the traceroute / tracert.

The ConfigSource will run the trace and print a summary of the results in a way that can easily be alerted on (if you really want to) in the event of a route change, plus a full dump of the route information including hop timings for information, in a way that is excluded from alerting.

Credit to @Jake Cohen for the basis of the script these are built from. :)/emoticons/smile@2x.png 2x" title=":)" width="20">

  • @Jono it should be possible within the proc.eachLine{} section to exclude hops that match a pattern, for example if they end '.mydatacenter.com', or you can add exceptions in the 'RouteHasChanged' diff check.

  • I wonder if anyone has accomplished what I'm looking for with this.  I'd like to have a known good traceroute, then have it poll every 5 minutes, then alert if outside the known good traceroute and resolve when it's back inline with known good traceroute.
    The changes would be, allow us to poll config source more frequently than 1 hour.  Then set a "golden config" to compare against.

  • Hi Jono,

    Briefly and off the top of my head, one way to accomplish this could be as follows:

    1. Set a device property to list the steps of the known good route, e.g. "10.0.0.1, 10.0.0.55, edgerouter.mynetwork.local, isp.whatever.com"

    2. Have a scripted DataSource (not ConfigSource) that ran the traceroute script every five minutes.

    The DataSource would be able to pull in the known good route from the device property and compare the listed steps to the result of the traceroute and either confirm the two lists were a match, or not, outputting a suitable 1/0 code which could then be alerted on. Alternatively, it might output 0 if all steps matched vs the step number of the first mis-match.

    Clearly you'd have to do some clever parsing if the steps might vary within a domain, e.g. if *.whatever.com were acceptable at step 4 in the above.

    Not necessarily pretty, but probably achievable.

  • Hi Antony,

    getting Import Error for this ConfigSource saying "LogicModule is Private, Cannot Read". Would you be able to change that? Thanks.

     

  • was able to add the configSource and it seems to be working great for a couple of quick tests i did.

    Thank you Antony.