Dave Shield wrote:
> On 13/11/06, Thomas Anders <[EMAIL PROTECTED]> wrote:
>> I'm not sure I see the benefits of tweaking the MIB and the code to
>> replace "virtual memory" by "real+swap" for these objects.
>
> The changes to the MIB are intended to make the behaviour more
> explicit - thus avoiding the potential ambiguities that have bedevilled
> these objects in the past.
We certainly agree that clarification is needed.
>> What's wrong with using "virtual memory" for these objects?
>
> I don't want to do this because in most cases, the HAL memory
> entry that's labelled as VIRTMEM does *not* actually monitor
> virtual memory. In pracise, it's tended to be implemented as
> real+swap - which may or may not be the same thing.
At this point in time, I still think it's the most simple change.
The lack of feedback and votes makes it hard to judge, but perhaps
people would be happier with a simple change to clarify that
memTotalFree is meant to be "free virtual memory" and
memMinimumSwap/memSwapError/memSwapErrorMsg relate to just that?
Attached please find an alternative patch that does this, open for
comments and votes.
I'd personally be fine with both patches, rather than ignoring the issue
and keeping things as-is. As for Dave's patch, I'd still call for
clarification in the MIB that we monitor "free" rather than "available"
memory if that's what we do.
+Thomas
--
Thomas Anders (thomas.anders at blue-cable.de)
Index: mibs/UCD-SNMP-MIB.txt
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/mibs/UCD-SNMP-MIB.txt,v
retrieving revision 5.7
diff -u -p -r5.7 UCD-SNMP-MIB.txt
--- mibs/UCD-SNMP-MIB.txt 7 Nov 2006 22:14:44 -0000 5.7
+++ mibs/UCD-SNMP-MIB.txt 15 Nov 2006 18:39:15 -0000
@@ -53,8 +53,10 @@ ucdavis MODULE-IDENTITY
email: [email protected]
"
DESCRIPTION
- "Clarify behaviour of mem*Text objects (& provide updated versions)."
- REVISION "200611070000Z"
+ "Clarify behaviour of mem*Text objects (& provide updated versions).
+ Introduce ErrorFlag TC. Clarify memTotalFree, memMinimumSwap and
+ memSwapError* objects."
+ REVISION "200611170000Z"
DESCRIPTION
"Added ssCpuRawSoftIRQ for Linux (2.6) and forgotten raw swap counters."
REVISION "200404070000Z"
@@ -157,6 +159,12 @@ Float ::= TEXTUAL-CONVENTION
is '07'h; and the value is '9f780442f60000'h."
SYNTAX Opaque (SIZE (7))
+ErrorFlag ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "Represents a possible error condition"
+ SYNTAX INTEGER { noError(0), error(1) }
+
--
-- Process table checks
--
@@ -471,7 +479,8 @@ memTotalFree OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
- "Total Available Memory on the host"
+ "Total free virtual memory on the host.
+ Typically covers both free real memory and free swap."
::= { memory 11 }
memMinimumSwap OBJECT-TYPE
@@ -479,9 +488,10 @@ memMinimumSwap OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
- "Minimum amount of free swap required to be free
- or else memErrorSwap is set to 1 and an error string is
- returned memSwapErrorMsg."
+ "Minimum amount of free virtual memory required to be kept
+ available. If such memory (as reported by memTotalFree)
+ falls below this level, memSwapError is set to 1 and an
+ error message returned via memSwapErrorMsg."
::= { memory 12 }
memShared OBJECT-TYPE
@@ -525,11 +535,13 @@ memUsedRealTXT OBJECT-TYPE
::= { memory 17 }
memSwapError OBJECT-TYPE
- SYNTAX Integer32
+ SYNTAX ErrorFlag
MAX-ACCESS read-only
STATUS current
DESCRIPTION
- "Error flag. 1 indicates very little swap space left"
+ "Indicates whether the amount of free virtual memory
+ as reported by memTotalFree, is less than the required
+ threshold."
::= { memory 100 }
memSwapErrorMsg OBJECT-TYPE
@@ -537,7 +549,9 @@ memSwapErrorMsg OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
- "Error message describing the Error Flag condition"
+ "Describes whether the amount of free virtual memory
+ as reported by memTotalFree, is less than the required
+ threshold."
::= { memory 101 }
Index: agent/mibgroup/ucd-snmp/memory.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/ucd-snmp/memory.c,v
retrieving revision 5.19
diff -u -p -r5.19 memory.c
--- agent/mibgroup/ucd-snmp/memory.c 7 Nov 2006 23:33:15 -0000 5.19
+++ agent/mibgroup/ucd-snmp/memory.c 15 Nov 2006 18:39:15 -0000
@@ -187,21 +187,21 @@ handle_memory(netsnmp_mib_handler *handl
val *= (mem_info->units/1024);
break;
case MEMORY_SWAP_ERROR:
- /* XXX - or NS_MEM_TYPE_PHYSMEM */
- mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ /* Compare against memTotalFree */
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 0 );
if (!mem_info)
goto NOSUCH;
val = ((mem_info->units / 1024) * mem_info->free > minimum_swap) ? 0 : 1;
break;
case MEMORY_SWAP_ERRMSG:
- /* XXX - or NS_MEM_TYPE_PHYSMEM */
- mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ /* Compare against memTotalFree */
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 0 );
if (!mem_info)
goto NOSUCH;
if ((mem_info->units / 1024) * mem_info->free > minimum_swap)
buf[0] = 0;
else
- sprintf(buf, "Running out of swap space (%ld)", mem_info->free);
+ sprintf(buf, "Running out of virtual memory (%ld)", mem_info->free);
snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
(u_char *)buf, strlen(buf));
return SNMP_ERR_NOERROR;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders