From owner-freebsd-net@freebsd.org Fri Oct 23 13:14:20 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBBF94468F8 for ; Fri, 23 Oct 2020 13:14:20 +0000 (UTC) (envelope-from paul@prt.org) Received: from smtp1.mail.clearhost.co.uk (smtp1.mail.clearhost.co.uk [IPv6:2001:1420::25:101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.mail.clearhost.co.uk", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHl7H575Xz46ch for ; Fri, 23 Oct 2020 13:14:19 +0000 (UTC) (envelope-from paul@prt.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=prt.org; s=dkim1; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3VaDEBs4JFaxCK3Sb5pjzo/ClViPPd9vYOMX1WC8FFM=; b=fO2+uNwlNwdltSk5qdakxVcrwH wdUDGJ9osTBfazdKv5sG25kN/1+OPkDmtQtxv0dHUZGP+9xpY3PjGmLDcNmA4JkSwYwT0HEXJ/b4r t7qplt25CV1igaCAI3MOe31KBN0AZOtYfF4S3sstsR6j7p5qwcjmRp+nhxTWg750Zulk=; Received: from [2001:1420:c:1:1407:e634:f1a5:d12a] (port=50211 helo=242-lan.arccan.com) by smtp1.mail.clearhost.co.uk with esmtpsa (TLSv1:ECDHE-RSA-AES128-SHA:128) (Exim 4.92) (envelope-from ) id 1kVwtX-0004wf-14 for freebsd-net@freebsd.org; Fri, 23 Oct 2020 13:14:11 +0000 To: freebsd-net@freebsd.org From: Paul Thornton Subject: Getting netgraph stats Message-ID: <3b933e75-1ef2-cb80-dc9e-2426cddc4e21@prt.org> Date: Fri, 23 Oct 2020 14:14:10 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ClearHost-AuthUser: paul@prt.org X-ClearHost-AuthDomain: prt.org X-Rspamd-Queue-Id: 4CHl7H575Xz46ch X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=prt.org header.s=dkim1 header.b=fO2+uNwl; dmarc=none; spf=pass (mx1.freebsd.org: domain of paul@prt.org designates 2001:1420::25:101 as permitted sender) smtp.mailfrom=paul@prt.org X-Spamd-Result: default: False [-2.74 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[prt.org:s=dkim1]; FREEFALL_USER(0.00)[paul]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.986]; DMARC_NA(0.00)[prt.org]; R_SPF_ALLOW(-0.20)[+a:smtp.mail.clearhost.co.uk]; DKIM_TRACE(0.00)[prt.org:+]; NEURAL_HAM_SHORT(-0.32)[-0.316]; NEURAL_HAM_MEDIUM(-0.94)[-0.941]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8676, ipnet:2001:1420::/32, country:GB]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-net] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 13:14:20 -0000 I am having a problem monitoring network stats on jails on a host. Scenario: One host, FreeBSD 12.1, with a small number of vnet jails. I'm using netgraph to bridge two or more VLANs from physical NICs into each jail - so each jail has at least 2 ngether interfaces which are the only NICs in the jail. All of this works well. And then I wanted to see what each of my ngethX interface statistics were doing - from my host. snmpd only sees the physical NICs (of course, because the ngeth ones don't appear any more since the jails are started - they all moved to the jails). As another approach, is there any way for me to get the network stats (in/out packets and in/out bytes) from my ngeth netgraph nodes directly? Or have I missed some other way? I really need to monitor the jails from the outside as I cannot guarantee I can reach snmpd running inside the jail (think of the jail as being a private environment where I cannot route my SNMP requests to). Thanks Paul.