From nobody Tue Dec 19 16:09:37 2023 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvhV31C0Nz54TWM; Tue, 19 Dec 2023 16:09:47 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvhV26DmSz4Yc8; Tue, 19 Dec 2023 16:09:46 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8713C5C0172; Tue, 19 Dec 2023 11:09:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 19 Dec 2023 11:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1703002185; x=1703088585; bh=N7mC28AX7idMMuGeCZrNqMVl65ny1GtzS9Vkq1WSH9U=; b= Ya4c9NKsf8PmzrrpdaFk8tcW19ry6OkDC4Q/5BIm/XgA2RhZsilke55geqTkeEPi U3bEtcwLxNuuGgNqCH8ArSyyr2m9VXCYCzuNOHDEwdjOL5+umLfeolau9ffRgKLg +to1vUipvIjlKhnmTwX+KTMchMa/07O/brGPDMKQXreNRm8NWkNNC4NQt2k42DBI LxS5qZVjA+7/2Vi6KM9MT8wQtECMYAHuTy5pHekRvFrhd7Nb9WNpXcDUhQSoVGn2 ANQwfwgbW5t1+8/36TB6BeR2gtz33M67sG+5Vl+0OS8ylFSVOn07dPBJuaoghhJd UCNxGQbzZnHmoU8hmqNm9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703002185; x= 1703088585; bh=N7mC28AX7idMMuGeCZrNqMVl65ny1GtzS9Vkq1WSH9U=; b=1 O7QHrV3lfm7yX8JFpgm14Xt1EGayR/ejyz33bu84GfJwIW8fq89iocIyrU0dectG jgENjWs6Ra70pDB095D8kwzrKu7/eR3rQhMV8WkAvlp3T3vKnFhUDpf80Sv4ieT7 snNJcCCA9M25Gx2gMqMZKp+01eJTCW0M5XrG2TtzqJ6LtUFoEKxlPcKghzsWExJw WHabKuC08TQIXPFFhdAtdwYvJW9xe6rztTynSdj4jxz2jTy2BsWSyinQJ3mMfRgM gsOFLbQj6jg/jGW0Y8E0Z8W1jiJ6Q7YPlO81zK2FnVrNi1w0M9dV1N/mlrC3t3Pr DYm2/KCAsuJV1AxDu7EQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddutddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpegjuhhr ihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeenucggtffrrghtthgvrhhnpefftdeute ekvedvieeujeeivdefjeekjedtfeduveduuddthfehhfefgedufeeivdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihesrggvthgvrh hnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Dec 2023 11:09:43 -0500 (EST) Message-ID: <8f4cf72e-8320-4bfd-a4d9-3db34db4580d@aetern.org> Date: Tue, 19 Dec 2023 23:09:37 +0700 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Odd values for various memory metrics via SNMP Content-Language: en-US To: "Patrick M. Hausen" Cc: FreeBSD-STABLE Mailing List , FreeBSD Net References: <1EDAF2AC-3A2B-43BE-B66B-E095F5A80C2C@punkt.de> <84B7C7D7-BC06-4944-A7E0-5AFC47B6BC0E@punkt.de> From: Yuri In-Reply-To: <84B7C7D7-BC06-4944-A7E0-5AFC47B6BC0E@punkt.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SvhV26DmSz4Yc8 Patrick M. Hausen wrote: > HI Yuri, > >> Am 19.12.2023 um 09:50 schrieb Yuri : >> Let's start with OIDs, which ones exactly you are looking at (numeric or >> textual will do)? > > To start I'll post the 4 odd ones of my OPNsense system, FreeBSD 13.2-p7, net-snmp 5.9.1_4,1: OK, guess the following (physical memory) looks correct for you as well? --- HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1 HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageRam HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 4096 Bytes HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 4183816 HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 1499092 HOST-RESOURCES-MIB::hrStorageAllocationFailures.1 = Counter32: 0 --- > HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2 > HOST-RESOURCES-MIB::hrStorageType.2 = OID: HOST-RESOURCES-TYPES::hrStorageRam > HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real memory > HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 4096 Bytes > HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 191414 > HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 189988 > HOST-RESOURCES-MIB::hrStorageAllocationFailures.2 = Counter32: 0 > --- > HOST-RESOURCES-MIB::hrStorageIndex.9 = INTEGER: 9 > HOST-RESOURCES-MIB::hrStorageType.9 = OID: HOST-RESOURCES-TYPES::hrStorageOther > HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: Shared real memory > HOST-RESOURCES-MIB::hrStorageAllocationUnits.9 = INTEGER: 4096 Bytes > HOST-RESOURCES-MIB::hrStorageSize.9 = INTEGER: 25627 > HOST-RESOURCES-MIB::hrStorageUsed.9 = INTEGER: 24175 > HOST-RESOURCES-MIB::hrStorageAllocationFailures.9 = Counter32: 0 > --- > HOST-RESOURCES-MIB::hrStorageIndex.8 = INTEGER: 8 > HOST-RESOURCES-MIB::hrStorageType.8 = OID: HOST-RESOURCES-TYPES::hrStorageOther > HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Shared virtual memory > HOST-RESOURCES-MIB::hrStorageAllocationUnits.8 = INTEGER: 4096 Bytes > HOST-RESOURCES-MIB::hrStorageSize.8 = INTEGER: 54962 > HOST-RESOURCES-MIB::hrStorageUsed.8 = INTEGER: 41268 > HOST-RESOURCES-MIB::hrStorageAllocationFailures.8 = Counter32: 0 > --- > HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3 > HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory > HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory > HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 4096 Bytes > HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 1279129 > HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 1258824 > HOST-RESOURCES-MIB::hrStorageAllocationFailures.3 = Counter32: 0 I took a look at FreeBSD-specific interface for getting memory values (agent/mibgroup/hardware/memory/memory_freebsd.c) and all it does is parsing the following sysctl (vm.vmtotal) output: --- vm.vmtotal: System wide totals computed every five seconds: (values in kilobytes) =============================================== Processes: (RUNQ: 2 Disk Wait: 0 Page Wait: 0 Sleep: 30) Virtual Memory: (Total: 538434716K Active: 538414860K) Real Memory: (Total: 78488K Active: 75752K) Shared Virtual Memory: (Total: 52052K Active: 32236K) Shared Real Memory: (Total: 27284K Active: 24588K) Free Memory: 9474964K --- So I guess what net-snmp reports makes sense and the only value that should be used for alerts is that "physical memory" one.