Re: Question Never Answered - Re: 64bit counters not showing up.
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 25/10/06, David Grohmann <[email protected]> wrote: > I never got an answer to this question. Is there anyone who has a guess as > to what the problem might be? > we have used both snmp v1 and v2c. same problems. With SNMPv1 you'll never get 64-bit values, since SNMPv1 didn't support this syntax type. But SNMPv2c should be fine. > Is there any other information that I could provide that would be helpful? Sudden thought. Is the agent running on a 64-bit architecture box? I notice that the diskio.c file is hardcoding the size of the result structure, and this may well be wrong on 64-bit kit. Try the attached patch - does that help any? Dave ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
diskio.diff
(application/octet-stream, 2.8 KB)
Index: diskio.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/ucd-snmp/diskio.c,v
retrieving revision 5.28
diff -u -u -r5.28 diskio.c
--- diskio.c 25 Sep 2006 23:57:52 -0000 5.28
+++ diskio.c 25 Oct 2006 22:21:16 -0000
@@ -282,12 +282,12 @@
long_ret = (uint32_t) kio.nwritten;
return (u_char *) & long_ret;
case DISKIO_NREADX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = kio.nread & 0xffffffff;;
c64_ret.high = kio.nread >> 32;
return (u_char *) & c64_ret;
case DISKIO_NWRITTENX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = kio.nwritten & 0xffffffff;;
c64_ret.high = kio.nwritten >> 32;
return (u_char *) & c64_ret;
@@ -608,7 +608,7 @@
#endif
return (u_char *) & long_ret;
case DISKIO_NREADX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
#if defined(freebsd5) && __FreeBSD_version >= 500107
longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
#else
@@ -618,7 +618,7 @@
c64_ret.high = longlong_ret >> 32;
return (u_char *) & c64_ret;
case DISKIO_NWRITTENX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
#if defined(freebsd5) && __FreeBSD_version >= 500107
longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
#else
@@ -823,12 +823,12 @@
long_ret = head.indices[indx].wio;
return (u_char *) & long_ret;
case DISKIO_NREADX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = head.indices[indx].rsect * 512 & 0xffffffff;
c64_ret.high = head.indices[indx].rsect >> (32 - 9);
return (u_char *) & c64_ret;
case DISKIO_NWRITTENX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = head.indices[indx].wsect * 512 & 0xffffffff;
c64_ret.high = head.indices[indx].wsect >> (32 - 9);
return (u_char *) & c64_ret;
@@ -1149,12 +1149,12 @@
long_ret = (signed long) 0; /* AIX has just one value for read/write transfers */
return (u_char *) & long_ret;
case DISKIO_NREADX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = (ps_disk[indx].rblks * ps_disk[indx].bsize) & 0xffffffff;;
c64_ret.high = (ps_disk[indx].rblks * ps_disk[indx].bsize) >> 32;
return (u_char *) & c64_ret;
case DISKIO_NWRITTENX:
- *var_len = 8;
+ *var_len = sizeof(struct counter64);
c64_ret.low = (ps_disk[indx].wblks * ps_disk[indx].bsize) & 0xffffffff;;
c64_ret.high = (ps_disk[indx].wblks * ps_disk[indx].bsize) >> 32;
return (u_char *) & c64_ret;