`
isiqi
  • 浏览: 16029787 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

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行

#if0/* 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

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


udpTable_next_entry()
{
...

#if0/* 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()
{
...

#if0/* 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()
{
...

#if0/* 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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics