[Outages-discussion] [outages] Level3 Routing...
Jeremy Chadwick
jdc at koitsu.org
Fri Feb 28 21:34:27 EST 2014
On Fri, Feb 28, 2014 at 09:23:06PM -0500, staticsafe wrote:
> On 2/28/2014 20:49, Jeremy Chadwick wrote:
> > I'd suggest setting up a cron job that logs the mtr data on two systems
> > (system A, going from A->B, and system B, going from B->A), so that you
> > can review it if/when it happens again.
> >
> > I have a small shell script I wrote, which uses a dorky config file of
> > sorts, that can do this for you if you want me to provide it. I use it
> > on my home FreeBSD system, and my FreeBSD VPS system, checking
> > connectivity between them (and to some other places as well).
> >
>
> Something like this would be much appreciated. I was thinking of writing
> a similar script to mail mtr output on an hourly basis.
I take no responsibility for support or misuse or misunderstanding of
how this works. Normally anything I release publicly I tend to provide
some degree of support for; this is an exception, i.e. "this works for
me" and was thrown together one day without the usual amount of care or
caution I normally apply when writing code.
I expect people using this to take the time to figure out how it works
(it's not hard); paths/etc. should become fairly obvious once said
examination is done.
People may also need to update to mtr 0.85 to get all the benefits.
Attachments:
mtr.sh = shell script that calls mtr with specific arguments, and reads
a pseudo configuration file from stdin
config = configuration file
cronjob itself:
##
# Periodic mtrs to numerous locations.
#
# EXECUTION: Every 1 minute
#
*/1 * * * * cd /var/log/captures && cat config | ./mtr.sh
How relevant log files are rotated, how many are kept, etc. -- done
quite simply through FreeBSD newsyslog(8). That entry:
/var/log/captures/*.log root:staff 664 40 * @T00 GB
--
| Jeremy Chadwick jdc at koitsu.org |
| UNIX Systems Administrator http://jdc.koitsu.org/ |
| Making life hard for others since 1977. PGP 4BD6C0CB |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mtr.sh
Type: application/x-sh
Size: 1087 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/outages-discussion/attachments/20140228/ed887be6/attachment.sh>
-------------- next part --------------
# src = should match `hostname` else line ignored
# dst = destination (FQDN or IP)
# flags = any additional flags passed to mtr(8)
#
# src dst flags
# ========= ============= ==========
#
my.home.comcast.box my.vps.system
my.home.comcast.box www.google.com
my.home.comcast.box www.yahoo.com
my.vps.system my.home.comcast.box
More information about the Outages-discussion
mailing list