Re: RFV: memSwapError handling

This is a discussion on Re: RFV: memSwapError handling within the SNMP Coders forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --------------060006000102080402030503 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-15-2006
Thomas Anders
 
Posts: n/a
Default Re: RFV: memSwapError handling

This is a multi-part message in MIME format.
--------------060006000102080402030503
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Dave Shield wrote:
> On 13/11/06, Thomas Anders <thomas.anders@blue-cable.de> 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)

--------------060006000102080402030503
Content-Type: text/x-patch;
name="net-snmp-5.4.rc2-mem-error2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="net-snmp-5.4.rc2-mem-error2.diff"

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: net-snmp-coders@lists.sourceforge.net
"
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;

--------------060006000102080402030503
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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?p...rge&CID=DEVDEV
--------------060006000102080402030503
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--------------060006000102080402030503--

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0