From nobody@FreeBSD.org  Mon Feb  6 09:20:28 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC4901065670
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  6 Feb 2012 09:20:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B0BA68FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  6 Feb 2012 09:20:28 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q169KSs3031235
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 6 Feb 2012 09:20:28 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q169KSNw031234;
	Mon, 6 Feb 2012 09:20:28 GMT
	(envelope-from nobody)
Message-Id: <201202060920.q169KSNw031234@red.freebsd.org>
Date: Mon, 6 Feb 2012 09:20:28 GMT
From: Rainer Duffner <rainer@ultra-secure.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net-snmp reports some local filesystems as network-filesystems
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164817
>Category:       ports
>Synopsis:       net-mgmt/net-snmp reports some local filesystems as network-filesystems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    zi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 06 09:30:10 UTC 2012
>Closed-Date:    Mon Feb 20 14:23:45 UTC 2012
>Last-Modified:  Mon Feb 20 14:30:10 UTC 2012
>Originator:     Rainer Duffner
>Release:        8.2p6
>Organization:
>Environment:
FreeBSD bla.host.tld 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
I have the following output from a host running

net-snmp-5.7.1_4

(from a mib-browser):

Name/OID: hrStorageType.31; Value (OID): .1.3.6.1.2.1.25.2.1.10
Name/OID: hrStorageType.32; Value (OID): .1.3.6.1.2.1.25.2.1.10
Name/OID: hrStorageType.33; Value (OID): .1.3.6.1.2.1.25.2.1.10
Name/OID: hrStorageType.34; Value (OID): .1.3.6.1.2.1.25.2.1.10
Name/OID: hrStorageType.35; Value (OID): .1.3.6.1.2.1.25.2.1.4
Name/OID: hrStorageType.36; Value (OID): .1.3.6.1.2.1.25.2.1.4


Name/OID: hrStorageDescr.31; Value (OctetString): /
Name/OID: hrStorageDescr.32; Value (OctetString): /var
Name/OID: hrStorageDescr.33; Value (OctetString): /tmp
Name/OID: hrStorageDescr.34; Value (OctetString): /usr
Name/OID: hrStorageDescr.35; Value (OctetString): /dev
Name/OID: hrStorageDescr.36; Value (OctetString): /var/log


According to the table here:

http://nagios.manubulon.com/check_snmp_storage.pl

.10 is a network-filesystem,
.4 should be local

Why it says /var/log is local while it does not recognize the rest is beyond me.


(bla <snmp>) 0 # df -t ufs                                           [10:15]
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/da0s1a   1012974   318038   613900    34%    /
/dev/da0s1f  44005820 17390474 23094882    43%    /usr
/dev/da0s1d   4058062   243438  3489980     7%    /var
/dev/da0s1e   4058062  1659606  2073812    44%    /var/log
/dev/md0      2026030     3850  1860098     0%    /tmp


There's an old PR somewhere that claims it's fixed, but it clearly is not.

It's an annoying problem. I have to keep an old copy of out net-snmpd 5.4 package around and make an exception when portupgrade -PP'ing our packages...



>How-To-Repeat:
see above
>Fix:
not known

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->zi 
Responsible-Changed-By: zi 
Responsible-Changed-When: Thu Feb 9 11:26:40 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164817 
State-Changed-From-To: open->analyzed 
State-Changed-By: zi 
State-Changed-When: Sat Feb 11 03:41:31 UTC 2012 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=164817 

From: Rainer Duffner <rainer@ultra-secure.de>
To: Mel Flynn <rflynn@acsalaska.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems as network-filesystems
Date: Sun, 19 Feb 2012 23:07:24 +0100

 Am 19.02.2012 um 23:03 schrieb Mel Flynn:
 
 > Hi,
 >=20
 > can you confirm or deny that you use the ucd-disk module on the =
 affected partitions? Like:
 > disk /var/log 15%
 >=20
 > Mel
 
 
 Yes, we do that.
 I tried to just omit that, but it didn't help.
 
 
 
 Rainer=

From: Mel Flynn <rflynn@acsalaska.net>
To: bug-followup@FreeBSD.org
Cc: rainer@ultra-secure.de
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems
 as network-filesystems
Date: Sun, 19 Feb 2012 23:03:53 +0100

 Hi,
 
 can you confirm or deny that you use the ucd-disk module on the affected 
 partitions? Like:
 disk /var/log 15%
 
 Mel

From: Mel Flynn <rflynn@acsalaska.net>
To: Rainer Duffner <rainer@ultra-secure.de>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems
 as network-filesystems
Date: Sun, 19 Feb 2012 23:57:13 +0100

 On 2/19/2012 23:07, Rainer Duffner wrote:
 > 
 > Am 19.02.2012 um 23:03 schrieb Mel Flynn:
 > 
 >> Hi,
 >>
 >> can you confirm or deny that you use the ucd-disk module on the affected partitions? Like:
 >> disk /var/log 15%
 >>
 >> Mel
 > 
 > 
 > Yes, we do that.
 > I tried to just omit that, but it didn't help.
 
 It fixes it for me. Can you run snmpd with -Dfsys and show the lines
 matching the filesystems?
 -- 
 Mel

From: Mel Flynn <rflynn@acsalaska.net>
To: Rainer Duffner <rainer@ultra-secure.de>
Cc: bug-followup@FreeBSD.org, zi@FreeBSD.org
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems
 as network-filesystems
Date: Mon, 20 Feb 2012 02:26:37 +0100

 This is a multi-part message in MIME format.
 --------------090701090401080504010007
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 On 2/19/2012 23:07, Rainer Duffner wrote:
 > 
 > Am 19.02.2012 um 23:03 schrieb Mel Flynn:
 > 
 >> Hi,
 >>
 >> can you confirm or deny that you use the ucd-disk module on the affected partitions? Like:
 >> disk /var/log 15%
 >>
 >> Mel
 > 
 > 
 > Yes, we do that.
 > I tried to just omit that, but it didn't help.
 
 The second block in the attached patch fixes my case. I think it's a
 typo from upstream, but if that actually was the intended code, then I
 guess I don't get what the intention /of/ the code is.
 
 -- 
 Mel
 
 --------------090701090401080504010007
 Content-Type: text/plain;
  name="patch-agent__mibgroup__ucd-snmp__disk_hw.c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-agent__mibgroup__ucd-snmp__disk_hw.c"
 
 --- agent/mibgroup/ucd-snmp/disk_hw.c.orig	2011-09-27 20:53:47.000000000 -0800
 +++ agent/mibgroup/ucd-snmp/disk_hw.c	2012-02-19 16:21:29.000000000 -0900
 @@ -137,6 +137,7 @@
    if (disks) {
       free( disks );
       disks = NULL;
 +     maxdisks = numdisks = 0;
    }
    allDisksIncluded = 0;
  }
 @@ -189,7 +190,7 @@
    if ( entry ) {
        entry->minspace   = minspace;
        entry->minpercent = minpercent;
 -      entry->flags     |= ~NETSNMP_FS_FLAG_UCD;
 +      entry->flags     |= NETSNMP_FS_FLAG_UCD;
        disks[numdisks++] = entry;
    }
  }
 @@ -321,7 +322,7 @@
  
      switch (vp->magic) {
      case MIBINDEX:
 -        long_ret = disknum;
 +        long_ret = disknum + 1;
          return ((u_char *) (&long_ret));
      case ERRORNAME:            /* DISKPATH */
          *var_len = strlen(entry->path);
 
 --------------090701090401080504010007--

From: Rainer Duffner <rainer@ultra-secure.de>
To: Mel Flynn <rflynn@acsalaska.net>
Cc: bug-followup@FreeBSD.org, zi@FreeBSD.org
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems
 as network-filesystems
Date: Mon, 20 Feb 2012 10:43:13 +0100

 Am Mon, 20 Feb 2012 02:26:37 +0100
 schrieb Mel Flynn <rflynn@acsalaska.net>:
 
 > On 2/19/2012 23:07, Rainer Duffner wrote:
 > > 
 > > Am 19.02.2012 um 23:03 schrieb Mel Flynn:
 > > 
 > >> Hi,
 > >>
 > >> can you confirm or deny that you use the ucd-disk module on the
 > >> affected partitions? Like: disk /var/log 15%
 > >>
 > >> Mel
 > > 
 > > 
 > > Yes, we do that.
 > > I tried to just omit that, but it didn't help.
 > 
 > The second block in the attached patch fixes my case. I think it's a
 > typo from upstream, but if that actually was the intended code, then I
 > guess I don't get what the intention /of/ the code is.
 > 
 
 
 
 Hi,
 
 yes, this fixes the problem.
 
 
 
 Thanks a lot!
 
 
 Best Regards,
 Rainer

From: Mel Flynn <rflynn@acsalaska.net>
To: Rainer Duffner <rainer@ultra-secure.de>
Cc: bug-followup@FreeBSD.org, zi@FreeBSD.org
Subject: Re: ports/164817: net-mgmt/net-snmp reports some local filesystems
 as network-filesystems
Date: Mon, 20 Feb 2012 13:05:00 +0100

 This is a multi-part message in MIME format.
 --------------040903080802020001070206
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 Hi zi,
 
 the attached patch fixes both the problem in this PR and the additional
 problem that I was seeing (nfs mounts not being seen as remote mounts).
 
 Hope this helps.
 
 -- 
 Mel
 
 --------------040903080802020001070206
 Content-Type: text/plain;
  name="net-mgmt__net-snmp.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="net-mgmt__net-snmp.diff"
 
 Index: net-mgmt/net-snmp/files/patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c
 ===================================================================
 RCS file: /home/ncvs/ports/net-mgmt/net-snmp/files/patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c,v
 retrieving revision 1.4
 diff -u -r1.4 patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c
 --- net-mgmt/net-snmp/files/patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c	7 Dec 2011 22:58:31 -0000	1.4
 +++ net-mgmt/net-snmp/files/patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c	20 Feb 2012 12:00:23 -0000
 @@ -1,5 +1,5 @@
 ---- ./agent/mibgroup/hardware/fsys/fsys_getfsstats.c.orig	2011-09-28 00:53:47.000000000 -0400
 -+++ ./agent/mibgroup/hardware/fsys/fsys_getfsstats.c	2011-12-07 17:33:47.000000000 -0500
 +--- agent/mibgroup/hardware/fsys/fsys_getfsstats.c.orig	2011-09-27 20:53:47.000000000 -0800
 ++++ agent/mibgroup/hardware/fsys/fsys_getfsstats.c	2012-02-20 01:39:38.000000000 -0900
  @@ -150,9 +150,9 @@
           if (!entry)
               continue;
 @@ -12,9 +12,21 @@
           entry->device[sizeof(entry->device)-1] = '\0';
           entry->units = stats[i].f_bsize;    /* or f_frsize */
           entry->size  = stats[i].f_blocks;
 -@@ -175,4 +175,5 @@
 +@@ -164,7 +164,7 @@
 +         entry->type = _fs_type( stats[i].f_fstypename );
 +         entry->flags |= NETSNMP_FS_FLAG_ACTIVE;
 + 
 +-        if (! stats[i].NSFS_FLAGS & MNT_LOCAL ) {
 ++        if (! (stats[i].NSFS_FLAGS & MNT_LOCAL) ) {
 +             entry->flags |= NETSNMP_FS_FLAG_REMOTE;
 +         }
 +         if (  stats[i].NSFS_FLAGS & MNT_RDONLY ) {
 +@@ -174,5 +174,8 @@
 +             entry->flags |= NETSNMP_FS_FLAG_BOOTABLE;
           }
           netsnmp_fsys_calculate32(entry);
 ++	DEBUGMSGTL(("fsys:path", "flags on entry %s: 0x%08x\n", entry->path,
 ++				entry->flags));
       }
  +    free(stats);
   }
 Index: net-mgmt/net-snmp/files/patch-agent__mibgroup__ucd-snmp__disk_hw.c
 ===================================================================
 RCS file: /home/ncvs/ports/net-mgmt/net-snmp/files/patch-agent__mibgroup__ucd-snmp__disk_hw.c,v
 retrieving revision 1.2
 diff -u -r1.2 patch-agent__mibgroup__ucd-snmp__disk_hw.c
 --- net-mgmt/net-snmp/files/patch-agent__mibgroup__ucd-snmp__disk_hw.c	13 Feb 2012 16:16:43 -0000	1.2
 +++ net-mgmt/net-snmp/files/patch-agent__mibgroup__ucd-snmp__disk_hw.c	20 Feb 2012 12:00:23 -0000
 @@ -1,5 +1,5 @@
 ---- ./agent/mibgroup/ucd-snmp/disk_hw.c.orig	2011-09-28 00:53:47.000000000 -0400
 -+++ ./agent/mibgroup/ucd-snmp/disk_hw.c	2012-02-13 11:07:08.000000000 -0500
 +--- agent/mibgroup/ucd-snmp/disk_hw.c.orig	2011-09-27 20:53:47.000000000 -0800
 ++++ agent/mibgroup/ucd-snmp/disk_hw.c	2012-02-19 16:21:29.000000000 -0900
  @@ -137,6 +137,7 @@
     if (disks) {
        free( disks );
 @@ -8,6 +8,15 @@
     }
     allDisksIncluded = 0;
   }
 +@@ -189,7 +190,7 @@
 +   if ( entry ) {
 +       entry->minspace   = minspace;
 +       entry->minpercent = minpercent;
 +-      entry->flags     |= ~NETSNMP_FS_FLAG_UCD;
 ++      entry->flags     |= NETSNMP_FS_FLAG_UCD;
 +       disks[numdisks++] = entry;
 +   }
 + }
  @@ -321,7 +322,7 @@
   
       switch (vp->magic) {
 
 --------------040903080802020001070206--
State-Changed-From-To: analyzed->closed 
State-Changed-By: zi 
State-Changed-When: Mon Feb 20 14:23:44 UTC 2012 
State-Changed-Why:  
Thank you for the report and thanks to Mel Flynn for the patch! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164817 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/164817: commit references a PR
Date: Mon, 20 Feb 2012 14:22:31 +0000 (UTC)

 zi          2012-02-20 14:22:17 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/net-snmp    Makefile 
     net-mgmt/net-snmp/files 
                             patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c 
                             patch-agent__mibgroup__ucd-snmp__disk_hw.c 
   Log:
   - Resolve issue where local filesystems were displayed as remote file systems.
   
   PR:             ports/164817
   Submitted by:   Rainer Duffner <rainer@ultra-secure.de>
   Obtained from:  Mel Flynn <rflynn@acsalaska.net>
   
   Revision  Changes    Path
   1.205     +1 -1      ports/net-mgmt/net-snmp/Makefile
   1.5       +15 -3     ports/net-mgmt/net-snmp/files/patch-agent-mibgroup-hardware-fsys-fsys_getfsstats.c
   1.3       +11 -2     ports/net-mgmt/net-snmp/files/patch-agent__mibgroup__ucd-snmp__disk_hw.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
