Bug 111502

Summary: host/hr_storage is broken in 5.1
Product: [Retired] Red Hat Raw Hide Reporter: Kaj J. Niemi <kajtzu>
Component: net-snmpAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-10 14:49:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Oneliner to enable disk volume sizes/usage again
none
Adds output of memory buffers in use
none
Return total and buffers (instead of free memory and buffers) none

Description Kaj J. Niemi 2003-12-04 17:45:47 UTC
Description of problem:
Seems like host/hr_table is broken in 5.1 on linux... hrStorageSize
(5), hrStorageUsed (6) are missing. 

Steps to Reproduce:
1. (size) snmpwalk -v 2c -c foo localhost .1.3.6.1.2.1.25.2.3.1.5
   (used) snmpwalk -v 2c -c foo localhost .1.3.6.1.2.1.25.2.3.1.5
  
Actual results:
Prints NOSUCHINSTANCE

Expected results:
hrStorageSize should print out something similar to:

% snmpwalk -O n -v 2c -c foo localhost .1.3.6.1.2.1.25.2.3.1.5
.1.3.6.1.2.1.25.2.3.1.5.1 = INTEGER: 251006
.1.3.6.1.2.1.25.2.3.1.5.2 = INTEGER: 26266935
.1.3.6.1.2.1.25.2.3.1.5.3 = INTEGER: 504011
.1.3.6.1.2.1.25.2.3.1.5.4 = INTEGER: 1512088
.1.3.6.1.2.1.25.2.3.1.5.5 = INTEGER: 504004
.1.3.6.1.2.1.25.2.3.1.5.6 = INTEGER: 29542469
.1.3.6.1.2.1.25.2.3.1.5.101 = INTEGER: 1548036
.1.3.6.1.2.1.25.2.3.1.5.102 = INTEGER: 2048248

and hrStorageUsed
% snmpwalk -O n -v 2c -c foo localhost  .1.3.6.1.2.1.25.2.3.1.6
.1.3.6.1.2.1.25.2.3.1.6.1 = INTEGER: 53895
.1.3.6.1.2.1.25.2.3.1.6.2 = INTEGER: 17009811
.1.3.6.1.2.1.25.2.3.1.6.3 = INTEGER: 8207
.1.3.6.1.2.1.25.2.3.1.6.4 = INTEGER: 266372
.1.3.6.1.2.1.25.2.3.1.6.5 = INTEGER: 25071
.1.3.6.1.2.1.25.2.3.1.6.6 = INTEGER: 2730738
.1.3.6.1.2.1.25.2.3.1.6.101 = INTEGER: 1537432
.1.3.6.1.2.1.25.2.3.1.6.102 = INTEGER: 199296

Comment 1 Kaj J. Niemi 2003-12-04 18:41:03 UTC
Created attachment 96347 [details]
Oneliner to enable disk volume sizes/usage again

Seems to work for me.

Comment 2 Kaj J. Niemi 2003-12-04 20:57:22 UTC
Created attachment 96353 [details]
Adds output of memory buffers in use

Ok. The real problem here was that if NO_DUMMY_VALUES is in use (it's the
default) var_hrstorage() returns NULL instead of *u_char. Somehow this hoses
everything in the calling layer above and no information further down the oid
row is will be returned.

I got bored determining what's calling what and decided to fix this issue
another way -- by adding to the missing functionality on linux preventing the
return of NULL. :)

Works for me, now, really.

Comment 3 Kaj J. Niemi 2003-12-04 21:37:43 UTC
Created attachment 96354 [details]
Return total and buffers (instead of free memory and buffers)

I was figuring buffers would have been allocated from memory free but this
wasn't the case and it resulted in funny looking graphs (say there's only 10 M
free but 90M buffers you end up with 900% as an end result).. instead we return
the total amount of memory and the amount of buffers allocated.

Hopefully this will end with values 0 <= x <= 100 when dividing hrStorageUsed
with hrStorageSize.

Comment 4 Phil Knirsch 2003-12-10 14:49:53 UTC
Yeah, that looks good. Have you submitted the patch to Wes or David
upstream? Might be a good idea if not. ;-)

Thanks again,

Read ya, Phil

PS: And of course it will be included in the next net-snmp-5.1-3
package. :-)