freebsd + net-snmp 安装手册

1. 安装包下载
http://net-snmp.sourceforge.com

版本 5.1.1

安装主机
Freebsd4.5
IP : 192.168.0.70
Domain Name : freebsd.nanjing-fnst.com
其他: openssl需要

2. 安装net-snmp

#tar -zxvf net-snmp-5.1.1.tar.gz

3. patches 补丁

[1] agent/mibgroup/mibII/tcpTable.c

720行

#if    0    /* replaced by zhangfl 2004.02.26 - start - */
    nnew->state = StateMap[((struct xinpcb *) xig)->xt_tp.t_state];
        
        if (nnew->state == 5 /* established */ ||
            nnew->state == 8 /*  closeWait  */ )
            tcp_estab++;
        memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xt_inp),
                           sizeof(struct inpcb));
#else
#if defined(__FreeBSD__)
    memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xi_inp),
                            sizeof(struct inpcb));
#else
    nnew->state = StateMap[((struct xinpcb *) xig)->xt_tp.t_state];
        
        if (nnew->state == 5 /* established */ ||
            nnew->state == 8 /*  closeWait  */ )
            tcp_estab++;
        memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xt_inp),
                           sizeof(struct inpcb));
#endif
#endif        /* replaced by zhangfl 2004.02.26 - end - */



[2] agent/mibgroup/mibII/udpTable.c

#if    1    /* added by zhangfl 2004.02.26 -start- */
#if defined(__FreeBSD__)
#undef  INP_NEXT_SYMBOL
#define INP_NEXT_SYMBOL inp_next
#endif
#endif        /* added by zhangfl 2004.02.26 - end - */


udpTable_next_entry()
{
...

#if    0    /* replaced by zhangfl 2004.02.26 - start - */
    *loop_context = (void*)entry->INP_NEXT_SYMBOL;
#else
    *loop_context = LIST_NEXT(entry, inp_list);
#endif        /* replaced by zhangfl 2004.02.26 - end - */

...

}

udpTable_free()
{
...

#if    0    /* replaced by zhangfl 2004.02.26 - start - */
        udp_head = udp_head->INP_NEXT_SYMBOL;
#else
        udp_head = LIST_NEXT(udp_head, inp_list);
#endif        /* replaced by zhangfl 2004.02.26 - end - */

...
}


udpTable_load()
{
...

#if    0    /* replaced by zhangfl 2004.02.26 - start - */
        memcpy(nnew, ((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
    nnew->next = udp_head;        /* XXX - ?? Check 'next' pointer */
#else
    memcpy(nnew, &(((struct xinpcb *) xig)->xi_inp),
                            sizeof(struct inpcb));
    LIST_NEXT(nnew, inp_list) = udp_head;
#endif/* replaced by zhangfl 2004.02.26 - end - */

...


}


#cd net-snmp-5.1.1
#./configure --enable-ipv6 --with-perl-modules --with-mib-modules="suizu"

*** Default SNMP Version:

        Starting with Net-SNMP 5.0, you can choose the default version of
the SNMP protocol to use when no version is given explicitly on the
command line, or via an 'snmp.conf' file.  In the past this was set to
SNMPv1, but you can use this to switch to SNMPv3 if desired.  SNMPv3
will provide a more secure management environment (and thus you're
encouraged to switch to SNMPv3), but may break existing scripts that
rely on the old behaviour.  (Though such scripts will probably need to
be changed to use the '-c' community flag anyway, as the SNMPv1
command line usage has changed as well.).
   At this prompt you can select "1", "2" (for SNMPv2c), or "3" as
the default version for the command tools (snmpget, ...) to use.  This
can always be overridden at runtime using the -v flag to the tools, or
by using the "defVersion" token in your snmp.conf file.
   Providing the --with-default-snmp-version="x" parameter to ./configure
will avoid this prompt.

Default version of SNMP to use (3): 回车


*** System Contact Information:

        Describes who should be contacted about the host the agent is
running on.  This information is available in the MIB-II tree.  This
can also be over-ridden using the "syscontact" syntax in the agent's
configuration files.
  Providing the --with-sys-contact="contact" parameter to ./configure
will avoid this prompt.

System Contact Information (root@nanjing-fnst.com): root@freebsd.nanjing-fnst.com 回车


*** System Location:

        Describes the location of the system.  This information is
available in the MIB-II tree.  this can also be over-ridden using the
"syslocation" syntax in the agent's configuration files.
  Providing the --with-sys-location="location" parameter to ./configure
will avoid this prompt.

System Location (Unknown):回车


*** Logfile location:

        Enter the default location for the snmpd agent to dump
information & errors to.  If not defined (enter the keyword "none"
at the prompt below) the agent will use stdout and stderr instead.
(Note: This value can be over-ridden using command line options.)
  Providing the --with-logfile="path" parameter to ./configure
will avoid this prompt.

Location to write logfile (/var/log/snmpd.log):回车


*** snmpd persistent storage location:

        Enter a directory for the SNMP library to store persistent
data in the form of a configuration file.  This default location is
different than the old default location (which was for ucd-snmp).  If
you stay with the new path, I'll ask you in a second if you wish to
copy your files over to the new location (once only).  If you pick
some other path than the default, you'll have to copy them yourself.
There is nothing wrong with picking the old path (/var/ucd-snmp) if
you'd rather.
  Providing the --with-persistent-directory="path" parameter to
./configure will avoid this prompt.

Location to write persistent information (/var/net-snmp):回车

#make
#make install

4. 如果需要安装SNMP.pm perl模块

#cd net-snmp/perl
#perl Makefile.PL -NET-SNMP-CONFIG="sh ../../net-snmp-config" -NET-SNMP-IN-SOURCE=true
#make
#make test
#make install
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值