1,引入
netsnmp-5.9.1使用snmpd.conf中可以使用dlmod去动态加载我们自己的oid节点库,这看起来很通用和灵活,这次就在官网上找了个例子简单的验证了一下这个功能。
2,netsnmp-5.9.1编译
编译选项:
./configure --prefix=/home/net-snmp-5.9.1/installs --enable-shared --disable-static --with-defaults --enable-applications --disable-ipv6 --without-libwrap --without-rpm --without-zlib --disable-embedded-perl --disable-as-needed --without-perl-modules --with-mib-modules=ucd_snmp
注:
必须的选项:--enable-shared --with-mib-modules=ucd_snmp (ucd支持)
make && make install
3,在官网获取example文件
TUT:Writing a Dynamically Loadable Object - Net-SNMP Wiki
mib库也在其中下载:NET-SNMP-TUTORIAL-MIB.txt
nstAgentPluginObject.h
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.int_watch.conf,v 5.0 2002/04/20 07:30:13 hardaker Exp $
*/
#ifndef NSTAGENTPLUGINOBJECT_H
#define NSTAGENTPLUGINOBJECT_H
/*
* function declarations
*/
void init_nstAgentPluginObject(void);
#endif


1318

被折叠的 条评论
为什么被折叠?



