936e0f
diff -urNp oold/agent/mibgroup/hardware/fsys/fsys_mntctl.c nnew/agent/mibgroup/hardware/fsys/fsys_mntctl.c
936e0f
--- oold/agent/mibgroup/hardware/fsys/fsys_mntctl.c	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/hardware/fsys/fsys_mntctl.c	2017-10-31 10:21:53.433280099 +0100
936e0f
@@ -43,8 +43,9 @@ _fsys_type( int type)
936e0f
 
936e0f
         case  MNT_NFS:
936e0f
         case  MNT_NFS3:
936e0f
-        case  MNT_AUTOFS:
936e0f
             return NETSNMP_FS_TYPE_NFS;
936e0f
+        case  MNT_AUTOFS:
936e0f
+            return NETSNMP_FS_TYPE_AUTOFS;
936e0f
 
936e0f
     /*
936e0f
      *  The following code covers selected filesystems
936e0f
@@ -153,10 +154,12 @@ netsnmp_fsys_arch_load( void )
936e0f
 
936e0f
         /*
936e0f
          *  Optionally skip retrieving statistics for remote mounts
936e0f
+         *  AUTOFS is skipped by default
936e0f
          */
936e0f
-        if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) &&
936e0f
+        if ( ((entry->flags & NETSNMP_FS_FLAG_REMOTE) &&
936e0f
             netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
936e0f
-                                   NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
936e0f
+                                   NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) ||
936e0f
+              entry->type == (NETSNMP_FS_TYPE_AUTOFS))
936e0f
             continue;
936e0f
 
936e0f
         if ( statfs( entry->path, &stat_buf ) < 0 ) {
936e0f
diff -urNp oold/agent/mibgroup/hardware/fsys/fsys_mntent.c nnew/agent/mibgroup/hardware/fsys/fsys_mntent.c
936e0f
--- oold/agent/mibgroup/hardware/fsys/fsys_mntent.c	2017-10-30 14:50:41.784743150 +0100
936e0f
+++ nnew/agent/mibgroup/hardware/fsys/fsys_mntent.c	2017-10-31 08:59:08.953114110 +0100
936e0f
@@ -145,6 +145,13 @@ _fsys_type( char *typename )
936e0f
               !strcmp(typename, MNTTYPE_LOFS))
936e0f
        return NETSNMP_FS_TYPE_OTHER;
936e0f
 
936e0f
+    /* Detection of AUTOFS.
936e0f
+     * This file system will be ignored by default
936e0f
+     */ 
936e0f
+    else if ( !strcmp(typename, MNTTYPE_AUTOFS))
936e0f
+        return NETSNMP_FS_TYPE_AUTOFS;
936e0f
+
936e0f
+
936e0f
     /*    
936e0f
      *  All other types are silently skipped
936e0f
      */
936e0f
@@ -239,6 +246,10 @@ netsnmp_fsys_arch_load( void )
936e0f
                                    NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
936e0f
             continue;
936e0f
 
936e0f
+        /* Skip AUTOFS enteries */
936e0f
+        if ( entry->type == (NETSNMP_FS_TYPE_AUTOFS))
936e0f
+            continue;
936e0f
+
936e0f
 #ifdef irix6
936e0f
         if ( NSFS_STATFS( entry->path, &stat_buf, sizeof(struct statfs), 0) < 0 )
936e0f
 #else
936e0f
diff -urNp oold/agent/mibgroup/hardware/fsys/mnttypes.h nnew/agent/mibgroup/hardware/fsys/mnttypes.h
936e0f
--- oold/agent/mibgroup/hardware/fsys/mnttypes.h	2017-10-30 14:50:41.741743139 +0100
936e0f
+++ nnew/agent/mibgroup/hardware/fsys/mnttypes.h	2017-10-31 09:01:40.462427047 +0100
936e0f
@@ -159,6 +159,9 @@
936e0f
 #ifndef MNTTYPE_APP
936e0f
 #define MNTTYPE_APP      "app"
936e0f
 #endif
936e0f
+#ifndef MNTTYPE_AUTOFS
936e0f
+#define MNTTYPE_AUTOFS   "autofs"
936e0f
+#endif
936e0f
 #ifndef MNTTYPE_DEVPTS
936e0f
 #define MNTTYPE_DEVPTS   "devpts"
936e0f
 #endif
936e0f
diff -urNp oold/agent/mibgroup/host/hr_filesys.c nnew/agent/mibgroup/host/hr_filesys.c
936e0f
--- oold/agent/mibgroup/host/hr_filesys.c	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/host/hr_filesys.c	2017-10-31 09:28:46.926093897 +0100
936e0f
@@ -839,6 +839,27 @@ Check_HR_FileSys_NFS (void)
936e0f
     return 0;		/* no NFS file system */
936e0f
 }
936e0f
 
936e0f
+/* This function checks whether current file system is an AutoFs
936e0f
+ * HRFS_entry must be valid prior to calling this function
936e0f
+ * return 1 if AutoFs, 0 otherwise
936e0f
+ */
936e0f
+int
936e0f
+Check_HR_FileSys_AutoFs (void)
936e0f
+{
936e0f
+#if HAVE_GETFSSTAT
936e0f
+    if ( HRFS_entry->HRFS_type != NULL && 
936e0f
+#if defined(MNTTYPE_AUTOFS)
936e0f
+        !strcmp( HRFS_entry->HRFS_type, MNTTYPE_AUTOFS)
936e0f
+#else
936e0f
+        !strcmp( HRFS_entry->HRFS_type, "autofs")
936e0f
+#endif
936e0f
+        )
936e0f
+#endif /* HAVE_GETFSSTAT */
936e0f
+        return 1;  /* AUTOFS */
936e0f
+
936e0f
+    return 0; /* no AUTOFS */
936e0f
+}
936e0f
+
936e0f
 void
936e0f
 End_HR_FileSys(void)
936e0f
 {
936e0f
diff -urNp oold/agent/mibgroup/host/hr_filesys.h nnew/agent/mibgroup/host/hr_filesys.h
936e0f
--- oold/agent/mibgroup/host/hr_filesys.h	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/host/hr_filesys.h	2017-10-31 09:29:44.541837515 +0100
936e0f
@@ -10,6 +10,7 @@ extern void     Init_HR_FileSys(void);
936e0f
 extern FindVarMethod var_hrfilesys;
936e0f
 extern int      Get_Next_HR_FileSys(void);
936e0f
 extern int      Check_HR_FileSys_NFS(void);
936e0f
+extern int      Check_HR_FileSys_AutoFs(void);
936e0f
 
936e0f
 extern int      Get_FSIndex(char *);
936e0f
 extern long     Get_FSSize(char *);     /* Temporary */
936e0f
diff -urNp oold/agent/mibgroup/host/hrh_filesys.c nnew/agent/mibgroup/host/hrh_filesys.c
936e0f
--- oold/agent/mibgroup/host/hrh_filesys.c	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/host/hrh_filesys.c	2017-10-31 09:37:36.787634605 +0100
936e0f
@@ -427,3 +427,9 @@ Check_HR_FileSys_NFS (void)
936e0f
 {
936e0f
     return (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE) ? 1 : 0;
936e0f
 }
936e0f
+
936e0f
+int
936e0f
+Check_HR_FileSys_AutoFs (void)
936e0f
+{
936e0f
+    return (HRFS_entry->type == (NETSNMP_FS_TYPE_AUTOFS)) ? 1 : 0;
936e0f
+}
936e0f
diff -urNp oold/agent/mibgroup/host/hrh_filesys.h nnew/agent/mibgroup/host/hrh_filesys.h
936e0f
--- oold/agent/mibgroup/host/hrh_filesys.h	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/host/hrh_filesys.h	2017-10-31 09:38:00.644616572 +0100
936e0f
@@ -10,6 +10,7 @@ extern void     Init_HR_FileSys(void);
936e0f
 extern FindVarMethod var_hrhfilesys;
936e0f
 extern int      Get_Next_HR_FileSys(void);
936e0f
 extern int      Check_HR_FileSys_NFS(void);
936e0f
+extern int	Check_HR_FileSys_AutoFs(void);
936e0f
 
936e0f
 extern int      Get_FSIndex(char *);
936e0f
 extern long     Get_FSSize(char *);     /* Temporary */
936e0f
diff -urNp oold/agent/mibgroup/host/hrh_storage.c nnew/agent/mibgroup/host/hrh_storage.c
936e0f
--- oold/agent/mibgroup/host/hrh_storage.c	2017-10-30 14:50:41.766743146 +0100
936e0f
+++ nnew/agent/mibgroup/host/hrh_storage.c	2017-10-31 10:08:25.482217951 +0100
936e0f
@@ -368,9 +368,10 @@ really_try_next:
936e0f
         store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ];
936e0f
         if (HRFS_entry &&
936e0f
 	    store_idx > NETSNMP_MEM_TYPE_MAX &&
936e0f
-            netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
936e0f
+            ((netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
936e0f
                                    NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
936e0f
-            Check_HR_FileSys_NFS())
936e0f
+            Check_HR_FileSys_NFS()) ||
936e0f
+            Check_HR_FileSys_AutoFs()))
936e0f
             return NULL;
936e0f
         if (store_idx <= NETSNMP_MEM_TYPE_MAX ) {
936e0f
 	    mem = (netsnmp_memory_info*)ptr;
936e0f
@@ -509,7 +510,8 @@ Get_Next_HR_Store(void)
936e0f
 		if (HRS_index >= 0) {
936e0f
 			if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, 
936e0f
 							NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && 
936e0f
-						Check_HR_FileSys_NFS())) {
936e0f
+						Check_HR_FileSys_NFS()) &&
936e0f
+                         !Check_HR_FileSys_AutoFs()) {
936e0f
 				return HRS_index + NETSNMP_MEM_TYPE_MAX;	
936e0f
 			}
936e0f
 		} else {
936e0f
diff -urNp oold/agent/mibgroup/host/hr_storage.c nnew/agent/mibgroup/host/hr_storage.c
936e0f
--- oold/agent/mibgroup/host/hr_storage.c	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/agent/mibgroup/host/hr_storage.c	2017-10-31 10:11:41.161064352 +0100
936e0f
@@ -545,9 +545,10 @@ really_try_next:
936e0f
 
936e0f
         store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ];
936e0f
         if (store_idx > NETSNMP_MEM_TYPE_MAX ) {
936e0f
-            if ( netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
936e0f
+            if ( (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
936e0f
                                         NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
936e0f
-                 Check_HR_FileSys_NFS())
936e0f
+                 Check_HR_FileSys_NFS()) ||
936e0f
+                 Check_HR_FileSys_AutoFs())
936e0f
                 return NULL;  /* or goto try_next; */
936e0f
 	    if (HRFS_statfs(HRFS_entry->HRFS_mount, &stat_buf) < 0) {
936e0f
 		snmp_log_perror(HRFS_entry->HRFS_mount);
936e0f
@@ -688,7 +689,8 @@ Get_Next_HR_Store(void)
936e0f
 		if (HRS_index >= 0) {
936e0f
 			if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, 
936e0f
 							NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && 
936e0f
-						Check_HR_FileSys_NFS())) {
936e0f
+						Check_HR_FileSys_NFS()) &&
936e0f
+                            !Check_HR_FileSys_AutoFs()) {
936e0f
 				return HRS_index + NETSNMP_MEM_TYPE_MAX;	
936e0f
 			}
936e0f
 		} else {
936e0f
diff -urNp oold/include/net-snmp/agent/hardware/fsys.h nnew/include/net-snmp/agent/hardware/fsys.h
936e0f
--- oold/include/net-snmp/agent/hardware/fsys.h	2012-10-10 00:28:58.000000000 +0200
936e0f
+++ nnew/include/net-snmp/agent/hardware/fsys.h	2017-10-31 10:14:59.560581680 +0100
936e0f
@@ -41,6 +41,7 @@ typedef struct netsnmp_fsys_info_s netsn
936e0f
 #define NETSNMP_FS_TYPE_SYSFS	   4 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
936e0f
 #define NETSNMP_FS_TYPE_TMPFS	   5 | _NETSNMP_FS_TYPE_LOCAL
936e0f
 #define NETSNMP_FS_TYPE_USBFS	   6 | _NETSNMP_FS_TYPE_LOCAL
936e0f
+#define NETSNMP_FS_TYPE_AUTOFS     7 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT
936e0f
 
936e0f
 #define NETSNMP_FS_FLAG_ACTIVE   0x01
936e0f
 #define NETSNMP_FS_FLAG_REMOTE   0x02