Skip to content

Commit 74e8bea

Browse files
pavel-shirshovlguohan
authored andcommitted
[snmp]: Stop spamming logs with statfs permission denied log message (#1668)
1 parent e082cd6 commit 74e8bea

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/snmpd/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
2323
dpkg-source -x net-snmp_$(SNMPD_VERSION_FULL).dsc
2424

2525
pushd net-snmp-$(SNMPD_VERSION)
26+
patch -p0 < ../statfs_error.patch
2627
fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary
2728
popd
2829

src/snmpd/statfs_error.patch

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- agent/mibgroup/hardware/fsys/fsys_mntctl.c.old 2018-04-30 23:26:58.097636453 +0000
2+
+++ agent/mibgroup/hardware/fsys/fsys_mntctl.c 2018-04-30 23:27:36.189499479 +0000
3+
@@ -163,8 +163,6 @@
4+
continue;
5+
6+
if ( statfs( entry->path, &stat_buf ) < 0 ) {
7+
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
8+
- snmp_log_perror( tmpbuf );
9+
continue;
10+
}
11+
entry->units = stat_buf.f_bsize;
12+
--- agent/mibgroup/hardware/fsys/fsys_mntent.c.old 2018-04-30 23:26:54.569649140 +0000
13+
+++ agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-04-30 23:27:22.001550497 +0000
14+
@@ -238,8 +238,6 @@
15+
if ( NSFS_STATFS( entry->path, &stat_buf ) < 0 )
16+
#endif
17+
{
18+
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
19+
- snmp_log_perror( tmpbuf );
20+
continue;
21+
}
22+
entry->units = stat_buf.NSFS_SIZE;

0 commit comments

Comments
 (0)