Flent-users discussion archives
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <notifications@github.com>
To: tohojo/flent <flent@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [Flent-users] [tohojo/flent] ss_iterate.sh yields corrupted output (#204)
Date: Sun, 26 Apr 2020 03:38:00 -0700	[thread overview]
Message-ID: <tohojo/flent/issues/204/619526509@github.com> (raw)
In-Reply-To: <tohojo/flent/issues/204@github.com>


[-- Attachment #1.1: Type: text/plain, Size: 1839 bytes --]

Olivier Tilmans <notifications@github.com> writes:

> I am running on a pretty-much bare host, where I have
> ```bash
> $ ss -V
> ss utility, iproute2-ss191125
> ```
>
> It turns out that when `ss_iterate.sh` runs `ss -ntp [...]`, `ss` does
> not output a new line at the very end. This causes `ss_iterate.sh` to
> collate the output with the `Time` field, resulting in the socket stat
> records being all empty as the runner fails to parse a timestamp.

Thank you for the report! I seems this was already fixed in iproute2 -
see commit:

9eee92a41ae6 ("ss: fix end-of-line printing in misc/ss.c")

This is dated Dec 4th, 2019, so I guess it's just after the version
you're running.

> I resolved this locally by tweaking `ss_iterate.sh` to output a new
> line between w/e output ss prints, and the timestamp, i.e., I changed
> the command string generation to:
>
> ```diff
> command_string=$(cat <<EOF
> for i in \$(seq $count); do
>     ss -t -i -p -n state connected "dst $target $filter"
> +   echo ''
>     date '+Time: %s.%N';
>     echo "---";
>     sleep $interval || exit 1;
> done
> EOF
> )
> ```
>
> I don't have the time to test whether this would have any impact on
> hosts where `ss` prints a proper ouput, hence why this is not a PR. An
> alternate way could be to put the timestamp generation _before_ the
> invocation of `ss`. In both cases, the only issue would be if the
> output was parsed without regex--which did not seem to be the case
> from a quick glance.

Yeah, the Flent parser for Ss output is entirely regex-based, so it just
needs the timestamp at the beginning of a line. So I'm fine with adding
your change as well :)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/issues/204#issuecomment-619526509

[-- Attachment #1.2: Type: text/html, Size: 3098 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Flent-users mailing list
Flent-users@flent.org
http://flent.org/mailman/listinfo/flent-users_flent.org

       reply	other threads:[~2020-04-26 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tohojo/flent/issues/204@github.com>
2020-04-26 10:38 ` Toke Høiland-Jørgensen [this message]
2020-04-26 10:41 ` Toke Høiland-Jørgensen
2020-04-26 22:48 ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.flent.org/postorius/lists/flent-users.flent.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tohojo/flent/issues/204/619526509@github.com \
    --to=notifications@github.com \
    --cc=flent@noreply.github.com \
    --cc=reply+AHVNJPZ524EC5IE26QKJIMV4WFCYREVBNHHCIKQBVE@reply.github.com \
    --cc=subscribed@noreply.github.com \
    --subject='Re: [Flent-users] [tohojo/flent] ss_iterate.sh yields corrupted output (#204)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox