From 74e8beaa12f0d252b9fbca8f931a0c45ed0c5aee Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 1 May 2018 22:41:58 -0700 Subject: [PATCH] [snmp]: Stop spamming logs with statfs permission denied log message (#1668) --- src/snmpd/Makefile | 1 + src/snmpd/statfs_error.patch | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/snmpd/statfs_error.patch diff --git a/src/snmpd/Makefile b/src/snmpd/Makefile index 457cd2ef05..b372f0d224 100644 --- a/src/snmpd/Makefile +++ b/src/snmpd/Makefile @@ -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 diff --git a/src/snmpd/statfs_error.patch b/src/snmpd/statfs_error.patch new file mode 100644 index 0000000000..a07b59bc91 --- /dev/null +++ b/src/snmpd/statfs_error.patch @@ -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;