haqistan

homeaboutlinkslicensearchivesrss

ttyplotisms: the journey continues

887 words by attila written on 2022-08-02, last edit: 2022-11-22, tags: bsd, cli, monitoring, shell, ttyplot, unixPrevious post: Christina Sharpe, 2016: Lose your kinNext post: Corporate Churn


Video capture of my screen running the 5-sec ttyplot when all is well
Video capture of my screen running the 5-sec ttyplot when all is well

Since I wrote the ttyplotisms post, I've refined my fu as my network has gotten worse. Yes, worse. It has been months now and Telmex still can't get our DSL working for more than a couple of hours a day.

The winning entry so far for useful ttyplot thang to properly visualize network conditions is this:

# helper I need often
microtime () {
    perl -MTime::HiRes=time -Mv5.10 -e 'say time'
}

# ping rtt plot, alt approach:
# $ pingplot2 some.ip [optional-null-value]
# try really hard to produce a data point every 5 seconds
pingplot2 () {
    local host=$1
    local errfile="/tmp/$host.errs"
    shift
    local null=0
    [ $# -gt 0 ] && {
        null=$1
        shift
    }
    local opts="$*"
    local target=$host
    while true; do
        local val
        local t0=$(microtime)
        local ping_cmd="ping -c 1 -W 5 -nO $target"
        val=$(${ping_cmd} 2>$errfile | grep time= | sed -u -e "s/^.*time=//g" -e "s/ ms//g")
        local dt=$(perl -e "print $(microtime) - $t0")
        if [ -z "$val" ]; then
            val=$null
        fi
        echo $val
        # try within reason to do it every 5 seconds
        local gap=$(perl -e "print 5.0 - $dt")
        case "${gap}" in
            -*) sleep 0.01; ;;
            [0-9]*) sleep ${gap} ;;
            *) ;;
        esac
    done | ttyplot -u ms -t "ping rtt: $host"
}

I've managed to make some not too terrible screen recordings as animated GIFs to get the idea across... it is as boring as watching paint dry, really: my magnum opus. You can see what it looks like at the top of this post when all is well.

The ttyplot section of the screen is a 7 minutes and 20 seconds window into WTF is going on with the net: 88 columns times 5 seconds per data point. When it looks like the capture above all is well, my packets get to New York and back more or less.

When things go bad, the null value of zero looks about right, even though technically it isn't:

Video capture of my screen when the DSL dies
Video capture of my screen when the DSL dies

Dead air trailing off to the right; you can see my last patch of decent connectivity slowly fading into memory, and the board is solid red except for LNK: no DNS, no SSH and no Tor for you, monkey boy.

Here it is coming back, the indicator lights slowly tell the story:

Video capture of my DSL coming back after dying
Video capture of my DSL coming back after dying

I'm continuing down the horrible path of complaint/response etc. but I'm also deeply concerned that, like with many problems in realityland, there is no solution.

The fact is that COVID has done a real number on the infrastructure in Mexico at large, and we are definitely not at large here, we are the ennnnnd of the line. The telephone poles that drag that poor, hammered, messed up 2wire cable out to my house are in bad shape, have not been maintained since before COVID and have seen some of the worse weather ever recorded here.

For that matter, they were never even supposed to be there at all: CORRUPTION is the word, I believe... The story is simple: some asshole gringo, a retired cop named Ralph Brown who I had the unpleasant experience of meeting on a couple of occasions, paid some Telmex workers cash to show up on a Sunday and help some telephone poles literally fall off a truck and get installed by his house and, as it turns out, ours. This must've been nearly 25 years ago (just before we got here). I know this because one of those workers ended up coming to my house to fix my busted-ass DSL several years ago and we ended up bullshitting a bit. He was weeks away from retirement. He recalled it with some mirth. It was ridiculous. It all continues to be ridiculous.

I'm also told by the current crop of Telmex workers (whenever one actually shows up out here) that the management at Telmex has been using COVID to marginalize or even get rid of the union, one of the oldest in Mexico, and so they have had to respond in kind. Even in the city of Merida I hear widespread complaints about DSL, people are switching en masse to other options (which also have problems and aren't available out here).

I don't know what all of this means for us here. We've noticed that this AirBNB hotel just north of us has just installed a Satellite dish of the kind being hawked around here now to gringos and others who can afford it... we cannot afford it, but it might be the only way to stay connected out here in the short term. There is zero incentive for the PIC to pour any money into infrastructure way the fuck out here, they're too busy selling cenotes to rich dicks from Dubai to give too much of a shit. As I've said, the city of Merida, over 2 million people now, is having serious issues with this and every other infrastructural issue: they aren't thinking about helping us out here at all.

Welp, that's the deal: on our own, too many dogs, not enough internet.


Copyright © 1999-2023 by attila <attila@haqistan.net>. All Rights Reserved.