Skip to content

Commit

Permalink
[snmp]: Stop spamming logs with statfs permission denied log message (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-shirshov authored and lguohan committed May 2, 2018
1 parent e082cd6 commit 74e8bea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/snmpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x net-snmp_$(SNMPD_VERSION_FULL).dsc

pushd net-snmp-$(SNMPD_VERSION)
patch -p0 < ../statfs_error.patch
fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary
popd

Expand Down
22 changes: 22 additions & 0 deletions src/snmpd/statfs_error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- agent/mibgroup/hardware/fsys/fsys_mntctl.c.old 2018-04-30 23:26:58.097636453 +0000
+++ agent/mibgroup/hardware/fsys/fsys_mntctl.c 2018-04-30 23:27:36.189499479 +0000
@@ -163,8 +163,6 @@
continue;

if ( statfs( entry->path, &stat_buf ) < 0 ) {
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
- snmp_log_perror( tmpbuf );
continue;
}
entry->units = stat_buf.f_bsize;
--- agent/mibgroup/hardware/fsys/fsys_mntent.c.old 2018-04-30 23:26:54.569649140 +0000
+++ agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-04-30 23:27:22.001550497 +0000
@@ -238,8 +238,6 @@
if ( NSFS_STATFS( entry->path, &stat_buf ) < 0 )
#endif
{
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
- snmp_log_perror( tmpbuf );
continue;
}
entry->units = stat_buf.NSFS_SIZE;

0 comments on commit 74e8bea

Please sign in to comment.