author | gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM> |
Tue, 14 May 2013 22:57:32 -0700 | |
changeset 1301 | 636f7c363f41 |
parent 1126 | a7e552aeef46 |
child 1306 | 11b376b53ac1 |
permissions | -rw-r--r-- |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
1 |
/* |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
2 |
* Version 2 - Modified the patch file to make it work for the newer |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
3 |
* revision in net-snmp 5.7.2. Some fragments of the patch had gone |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
4 |
* into the community net-snmp source. So this patch file has been |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
5 |
* updated with the correct diffs. |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
6 |
* |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
7 |
* This patch fixes the performance issue observed while retrieving the |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
8 |
* hrStorage parameters in systems with large number of mountpoints |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
9 |
* parameters using snmpwalk. |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
10 |
* |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
11 |
* This issue is happening due to the overhead of large number of |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
12 |
* ioctl() system calls in getmntent() function called by the |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
13 |
* Get_Next_HR_FileSys() function. |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
14 |
* |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
15 |
* We see that in the Get_Next_HR_FileSys() function, inorder to access |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
16 |
* the last mountpoint, the /etc/mnttab is opened and we walk through |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
17 |
* all the mnttab entries for all filesystems till the end. This is the |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
18 |
* reason we find a large number of the MNTIOC_GETMNTENT ioctl() calls. |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
19 |
* |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
20 |
* To reduce the overhead of the getmntent() calls, we maintain a cache |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
21 |
* of all the /etc/mnttab entries and walk through the cache instead of |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
22 |
* opening /etc/mnttab and walking all the entries for each mountpoint. |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
23 |
* This functionality is provided by the load_mnttab_cache_solaris() |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
24 |
* function called from the Init_HR_FileSys() function. |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
25 |
*/ |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
26 |
|
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
27 |
--- net-snmp/agent/mibgroup/host/hr_filesys.c Sun Dec 30 22:37:05 2012 |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
28 |
+++ net-snmp/agent/mibgroup/host/hr_filesys.c Mon Dec 31 00:55:29 2012 |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
29 |
@@ -46,6 +46,10 @@ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
30 |
#include <sys/mount.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
31 |
#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
32 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
33 |
+#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
34 |
+#include <sys/stat.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
35 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
36 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
37 |
#include <ctype.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
38 |
#if HAVE_STRING_H |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
39 |
#include <string.h> |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
40 |
@@ -108,7 +112,11 @@ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
41 |
#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
42 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
43 |
struct mnttab HRFS_entry_struct; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
44 |
-struct mnttab *HRFS_entry = &HRFS_entry_struct; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
45 |
+struct mnttab *HRFS_entry; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
46 |
+struct mnttab *HRFS_list; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
47 |
+static int fscount; |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
48 |
+static time_t last_access=-1; |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
49 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
50 |
#define HRFS_name mnt_special |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
51 |
#define HRFS_mount mnt_mountp |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
52 |
#define HRFS_type mnt_fstype |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
53 |
@@ -619,6 +627,12 @@ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
54 |
void |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
55 |
Init_HR_FileSys(void) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
56 |
{ |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
57 |
+#ifdef solaris2 |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
58 |
+ char buf[512]={NULL}; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
59 |
+ int lines=0, i=0; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
60 |
+ struct stat file_stat; |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
61 |
+#endif |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
62 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
63 |
#if HAVE_GETFSSTAT |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
64 |
#if defined(HAVE_STATVFS) && defined(__NetBSD__) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
65 |
fscount = getvfsstat(NULL, 0, ST_NOWAIT); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
66 |
@@ -662,7 +676,59 @@ |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
67 |
HRFS_index = 1; |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
68 |
if (fp != NULL) |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
69 |
fclose(fp); |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
70 |
- fp = fopen(ETC_MNTTAB, "r"); |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
71 |
+#ifdef solaris2 |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
72 |
+ HRFS_index = 0; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
73 |
+ stat(ETC_MNTTAB, &file_stat); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
74 |
+ if (last_access == -1 || last_access != file_stat.st_mtime) { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
75 |
+ fp = fopen(ETC_MNTTAB, "r"); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
76 |
+ if(fp == NULL) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
77 |
+ { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
78 |
+ DEBUGMSGTL(("host/hr_filesys", "fopen failed for mnttab.\n")); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
79 |
+ return; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
80 |
+ } |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
81 |
+ |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
82 |
+ while ( (fgets((char *)&buf,sizeof(buf),fp)) != NULL) { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
83 |
+ lines++; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
84 |
+ } |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
85 |
+ fclose(fp); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
86 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
87 |
+ HRFS_list = (struct mnttab *) malloc (sizeof(struct mnttab) * lines); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
88 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
89 |
+ if(HRFS_list == NULL) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
90 |
+ { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
91 |
+ DEBUGMSGTL(("host/hr_filesys", "Memory allocation for mnttab cache failed.\n")); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
92 |
+ return; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
93 |
+ } |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
94 |
+ |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
95 |
+ fp = fopen(ETC_MNTTAB, "r"); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
96 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
97 |
+ if(fp == NULL) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
98 |
+ { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
99 |
+ DEBUGMSGTL(("host/hr_filesys", "fopen failed for mnttab.\n")); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
100 |
+ free(HRFS_list); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
101 |
+ return; |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
102 |
+ } |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
103 |
+ |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
104 |
+ fscount = lines; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
105 |
+ while (i < fscount) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
106 |
+ { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
107 |
+ if (getmntent(fp, &HRFS_entry_struct) == 0) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
108 |
+ { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
109 |
+ HRFS_list[i].mnt_special = strdup(HRFS_entry_struct.mnt_special); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
110 |
+ HRFS_list[i].mnt_mountp = strdup(HRFS_entry_struct.mnt_mountp); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
111 |
+ HRFS_list[i].mnt_fstype = strdup(HRFS_entry_struct.mnt_fstype); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
112 |
+ HRFS_list[i].mnt_mntopts = strdup(HRFS_entry_struct.mnt_mntopts); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
113 |
+ i++; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
114 |
+ } |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
115 |
+ } |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
116 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
117 |
+ HRFS_entry = HRFS_list; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
118 |
+ last_access = file_stat.st_mtime; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
119 |
+ } |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
120 |
+#else |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
121 |
+ fp = fopen(ETC_MNTTAB, "r"); |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
122 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
123 |
+ |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
124 |
if (!fp) { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
125 |
netsnmp_config_error("Can't open mnttab %s\n", ETC_MNTTAB); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
126 |
} |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
127 |
@@ -758,17 +824,20 @@ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
128 |
#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
129 |
const char **cpp; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
130 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
131 |
- if (fp == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
132 |
- return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
133 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
134 |
#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
135 |
- if (getmntent(fp, HRFS_entry) != 0) |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
136 |
- return -1; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
137 |
+ |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
138 |
+ if (HRFS_index >= fscount) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
139 |
+ return -1; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
140 |
+ HRFS_entry = &HRFS_list[HRFS_index]; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
141 |
+ return ++HRFS_index; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
142 |
+ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
143 |
#else |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
144 |
+ if (fp == NULL) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
145 |
+ return -1; |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
146 |
HRFS_entry = getmntent(fp); |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
147 |
if (HRFS_entry == NULL) |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
148 |
return -1; |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
149 |
-#endif /* solaris2 */ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
150 |
|
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
151 |
for (cpp = HRFS_ignores; *cpp != NULL; ++cpp) |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
152 |
if (!strcmp(HRFS_entry->HRFS_type, *cpp)) |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
153 |
@@ -787,6 +856,8 @@ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
154 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
155 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
156 |
return HRFS_index++; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
157 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
158 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
159 |
#endif /* HAVE_GETFSSTAT */ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
160 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
161 |
|
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
162 |
@@ -854,10 +925,24 @@ |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
163 |
HRFS_entry = NULL; |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
164 |
} |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
165 |
#else |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
166 |
+ int i=0; |
1126
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
167 |
if (fp != NULL) |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
168 |
fclose(fp); |
a7e552aeef46
15818955 SUNBT7201487 snmpd cores multiple times during walk with service ending in maint
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
964
diff
changeset
|
169 |
fp = NULL; |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
170 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
171 |
+#ifdef solaris2 |
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
172 |
+ while (i < fscount) { |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
173 |
+ free(HRFS_list[i].mnt_special); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
174 |
+ free(HRFS_list[i].mnt_mountp); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
175 |
+ free(HRFS_list[i].mnt_fstype); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
176 |
+ free(HRFS_list[i].mnt_mntopts); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
177 |
+ i++; |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
178 |
+ } |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
179 |
+ if (HRFS_list != NULL) |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
180 |
+ free(HRFS_list); |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
181 |
#endif |
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
182 |
+ |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
183 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
184 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
185 |
|
1301
636f7c363f41
15685782 SUNBT7005330 NET-SNMP upgrade to latest stable version
gowtham thommandra - Sun Microsystems - Bangalore India <Gowtham.Thommandra@Sun.COM>
parents:
1126
diff
changeset
|
186 |