Hy! 내가 내 자신의 그물 - SNMP MIB 모듈을 작성하려고하지만 약간의 문제가 ... :) 나는 www.net-snmp.org 사이트에 문서를 참조하십시오. 내가 한 단계 :MIB 모듈을 작성하는 Net-snmp
- 나는 그렇게 NET-SNMP-예-MIB를 컴파일하려고합니다.
1) mib2c -c mib2c.scalar.conf의 netSnmpExampleScalars - 지금은 내가 디렉토리를
2 ../agent/mibgroup에 복사 것을하는이 .c과 .H 파일을 가져)
./configure \
--with-ldflags="" \
--with-cflags="-I/usr/src/net-snmp-5.4.4/agent/mibgroup" \
--enable-mini-agent \
--with-logfile="/var/log/snmpd.log" \
--with-default-snmp-version=2 \
[email protected] \
--with-sys-location=HU/Sze \
--disable-applications \
--disable-debugging \
--disable-manuals \
--with-mib-modules="netSnmpExampleScalars" \
--disable-scripts \
--without-perl-modules \
--disable-embedded-perl \
--without-python-modules \
--without-libwrap \
--without-openssl \
--without-rpm \
--without-zlib
3) ./myconfig
SNMP Versions Supported: 1 2c 3
Building for: linux
Net-SNMP Version: 5.7.3
Network transport support: Callback Unix Alias TCP UDP IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase
SNMPv3 Security Modules: usm
Agent MIB code: default_modules netSnmpExampleScalars => snmpv3mibs mibII/snmp_mib mibII/system_mib mibII/sysORTable mibII/vacm_vars mibII/vacm_conf
MYSQL Trap Logging: unavailable
Embedded Perl support: disabled
SNMP Perl modules: disabled
SNMP Python modules: disabled
Crypto support from:
Authentication support: MD5
Encryption support:
Local DNSSEC validation: disabled
4. 실행) 실행 명령
합니다 내가 설정 스크립트를 작성 6,netSnmpExampleScalars.c: In function 'handle_netSnmpExampleInteger':
netSnmpExampleScalars.c:55:90: error: expected expression before ',' token
netSnmpExampleScalars.c:75:58: error: expected expression before ')' token
netSnmpExampleScalars.c:88:34: error: expected expression before ')' token
netSnmpExampleScalars.c:95:34: error: expected expression before ')' token
netSnmpExampleScalars.c:103:34: error: expected expression before ')' token
netSnmpExampleScalars.c: In function 'handle_netSnmpExampleSleeper':
netSnmpExampleScalars.c:134:90: error: expected expression before ',' token
netSnmpExampleScalars.c:154:58: error: expected expression before ')' token
netSnmpExampleScalars.c:167:34: error: expected expression before ')' token
netSnmpExampleScalars.c:174:34: error: expected expression before ')' token
netSnmpExampleScalars.c:182:34: error: expected expression before ')' token
netSnmpExampleScalars.c: In function 'handle_netSnmpExampleString':
netSnmpExampleScalars.c:213:90: error: expected expression before ',' token
netSnmpExampleScalars.c:233:58: error: expected expression before ')' token
netSnmpExampleScalars.c:246:34: error: expected expression before ')' token
netSnmpExampleScalars.c:253:34: error: expected expression before ')' token
netSnmpExampleScalars.c:261:34: error: expected expression before ')' token
make[2]: *** [netSnmpExampleScalars.lo] Error 1
make[2]: Leaving directory `/usr/src/net-snmp-5.7.3/agent/mibgroup'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/usr/src/net-snmp-5.7.3/agent
make: *** [subdirs] Error 1
아직도 나는 mib2c 생성 된 C 파일을 편집해야합니다 = 아니면 다른 .conf
파일을 사용해야합니까? 또한 구성 스크립트가 올바른지 또는 올바르지 않은지 알 수 없습니다. Leaving directory error로 무엇을 할 수 있습니까?
생성 된 c 파일에 구문 오류가 있습니다. 컴파일러는 거짓말을하지 않습니다. =) MIB 파일이나 생성 된 .c 및 .h 파일을 보지 않고서는 여기에서 무슨 일이 일어나는지 알기가 어렵습니다. – Jolta