Hi Thomas,

Before sending the actual patch i need some clarification about the changes
i have made.

Below are the changes i have done in
agent/mibgroup/hardware/memory/memory_hpux.c in *get_swapinfo* function

Before:
   120              mem->units = pss.pss_swapchunk;
   121              mem->size  = pss.pss_nblksenabled;    /* Or
pss_nblks      ? */
   122              mem->free  = pss.pss_nfpgs;           /* Or
pss_nblksavail ? */
   123              mem->other = -1;
   124              *total +=mem->size;
   125              *free  +=mem->other;
   126              *size   = pss.pss_swapchunk;  /* Hopefully consistent!
*/
   127              i++;


After:
   120              mem->units = pss.pss_swapchunk;
   121              mem->size  = pss.pss_nblksenabled;    /* Or
pss_nblks      ? */
   122              mem->free  = 4*pss.pss_nfpgs;           /* Or
pss_nblksavail ? */
   123              mem->other = -1;
   124              *total +=mem->size;
   125              *free  +=mem->free;
   126              *size   = pss.pss_swapchunk;  /* Hopefully consistent!
*/
   127              i++;

Changed line 125 and and 122.
so changes in get_swapinfo are fine.

But problems comes in these below lines


    47      get_swapinfo(&total_swap, &free_swap, &size);
    48      mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
    49      if (!mem) {
    50          snmp_log_perror("No Swap info entry");
    51      } else {
    52          if (!mem->descr)
    53              mem->descr = strdup( "Swap space (total)" );
    54          mem->units = size;
    55          mem->size  = total_swap;
    56          mem->free  = free_swap;
    57          mem->other = -1;
    58      }
In  these lines the swap information will be updated into the mem and send
it to somewere(i am not able to figure out where?).There mem(related to
swap) is getting manipulated such that final o/p is double than the expected
.
so i changed lines 55 and 56 to get the exact o/p as below since it is
getting doubled somewhere(but i didn't find this solution logical).

55          mem->size  = total_swap/2;
    56          mem->free  = free_swap/2;

can you tell me where this information is getting tampered so that changes
can be made accordingly
Thanks & Regards,
Ravindranath


On Thu, Aug 28, 2008 at 4:22 PM, Thomas Anders
<[EMAIL PROTECTED]>wrote:

> ravindra Chavalam wrote:
> > I solved the issue by doing some source code changes
>
> Now that we've been providing help, would you mind returning the favor and
> submit your changes back to the project? http://www.net-snmp.org/patcheswould 
> be the ideal place. Thank you.
>
>
> +Thomas
>
> --
> Thomas Anders (thomas.anders at blue-cable.de)
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to