From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.toke.dk X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.4 Received: from mail.toke.dk by mail.toke.dk with LMTP id ULK+B8RkpV6Z0wMAOr1fkg (envelope-from ) for ; Sun, 26 Apr 2020 12:39:00 +0200 Authentication-Results: mail.toke.dk; none (SPF check N/A for local connections - client-ip=77.235.54.103; helo=web6.sd.eurovps.com; envelope-from=flent-users-bounces@flent.org; receiver=) Authentication-Results: mail.toke.dk; dkim=fail reason="signature verification failed" (1024-bit key) header.d=github.com header.i=@github.com header.b=U+E71/Ag Received: from web6.sd.eurovps.com (web6.sd.eurovps.com [77.235.54.103]) by mail.toke.dk (Postfix) with ESMTPS id F32F672F999 for ; Sun, 26 Apr 2020 12:38:58 +0200 (CEST) Received: from [::1] (port=48414 helo=web6.sd.eurovps.com) by web6.sd.eurovps.com with esmtp (Exim 4.93) (envelope-from ) id 1jSegY-00HR8u-Lz; Sun, 26 Apr 2020 13:38:54 +0300 Received: from out-25.smtp.github.com ([192.30.252.208]:33733) by web6.sd.eurovps.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jSegQ-00HR0w-JM for flent-users@flent.org; Sun, 26 Apr 2020 13:38:52 +0300 Received: from github-lowworker-e8b54ca.ac4-iad.github.net (github-lowworker-e8b54ca.ac4-iad.github.net [10.52.23.39]) by smtp.github.com (Postfix) with ESMTP id B1B83282174 for ; Sun, 26 Apr 2020 03:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1587897480; bh=YIcCleN7qgUliXXjhLJ5l/HnQaoz+3QYQjrVlNBx2IY=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=U+E71/AgE0PFk1hR47Aydnr34TfZQ4OOLrdVQNGwoFGDoAUpvcGfA7KcH5zSrI6I9 PwPuRJqP4ximHGrYLW5LylfgA+m8fPkDD813kYEBf7QhlZEPx0I26Leq2Oh6DlwAWs pk9T+t/6tj6VMXe9IkWlvtXoKZzS3GEx2ZwnvsMo= Date: Sun, 26 Apr 2020 03:38:00 -0700 From: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= To: tohojo/flent Message-ID: In-Reply-To: References: Mime-Version: 1.0 Precedence: list X-GitHub-Sender: tohojo X-GitHub-Recipient: flent-users X-GitHub-Reason: subscribed X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: flent-users@flent.org Subject: Re: [Flent-users] [tohojo/flent] ss_iterate.sh yields corrupted output (#204) X-BeenThere: flent-users@flent.org X-Mailman-Version: 2.1.29 List-Id: Flent discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: tohojo/flent Cc: Subscribed Content-Type: multipart/mixed; boundary="===============6789651553601966401==" Errors-To: flent-users-bounces@flent.org Sender: "Flent-users" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - web6.sd.eurovps.com X-AntiAbuse: Original Domain - toke.dk X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - flent.org X-Get-Message-Sender-Via: web6.sd.eurovps.com: acl_c_authenticated_local_user: mailman/mailman X-Authenticated-Sender: web6.sd.eurovps.com: mailman@flent.org --===============6789651553601966401== Content-Type: multipart/alternative; boundary="--==_mimepart_5ea56488a21f9_43783fba344cd9607825"; charset=UTF-8 Content-Transfer-Encoding: 7bit ----==_mimepart_5ea56488a21f9_43783fba344cd9607825 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Olivier Tilmans 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 < 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 ----==_mimepart_5ea56488a21f9_43783fba344cd9607825 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

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, view it on GitHub, or unsubscribe.

----==_mimepart_5ea56488a21f9_43783fba344cd9607825-- --===============6789651553601966401== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Flent-users mailing list Flent-users@flent.org http://flent.org/mailman/listinfo/flent-users_flent.org --===============6789651553601966401==--