📄 c-config1.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Configuring the WindNet SNMPv1/v2c Agent </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="c-config.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-config.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-config2.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="83423">5.1 Configuring VxWorks for Use with WindNet SNMP</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83424"> </a>Many WindNet SNMP facilities can be configured into VxWorks by defining the various configuration constants presented in this section. </p><dd><p class="Body"><a name="83655"> </a>The default location of these INCLUDE options is the EXCLUDED FACILITIES section of the configuration file <b class="file">$WIND_BASE/target/config/all/configAll.h</b>. To define them, move them to the INCLUDED FACILITIES section.</p></dl></dl><dl class="margin"><dd><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><a name="83664"><br></a><img border="0" alt="*" src="icons/note.gif"> </td><td><div class="Note"><hr><b class="symbol_UC">NOTE: </b>VxWorks is not SNMP-capable unless you reconfigure <b class="file">configAll.h</b> and rebuild VxWorks as shown here.<hr></div></td></tr></table><dl class="margin"><dd><p class="Body"><a name="83665"> </a>For general information on configuring VxWorks, see the <i class="title">VxWorks Programmer's Guide: Configuration</i>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83426">5.1.1 Standard Included Facilities</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83430"> </a>The constants <b class="symbol_UC">INCLUDE_SNMPD</b> and <b class="symbol_UC">INCLUDE_MIB2_ALL</b>, listed in <a href="c-config1.html#83437">Table 5-1</a>, configure VxWorks for running an SNMP agent that offers all MIB- II services. These are the default services shipped with WindNet SNMPv1/v2c. <p class="table"><h4 class="EntityTitle"><a name="83437"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 5-1: WindNet SNMP Configuration Constants</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83441"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Constant</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83443"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Facility Included</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83445"> </a><b class="symbol_UC">INCLUDE_SNMPD</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83447"> </a>SNMP agent</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83449"> </a><b class="symbol_UC">INCLUDE_MIB2_ALL</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83451"> </a>All MIB-II groups</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="83455"> </a>WindNet SNMPv1/v2c features MIB extensibility. If you desire a configuration other than the default, you must rebuild the SNMP agent to support only the wanted MIB groups. If you do not need all of the provided MIB-II variables, you can define a subset by including or excluding variables by group (see <a href="c-config1.html#83461"><i class="title">5.1.2 Scalability and MIB-II Facilities</i></a>). </p><dd><p class="Body"><a name="83459"> </a>For information about VxWorks MIB-II system interface routines, see the manual entry for mib2Lib in the <i class="title">VxWorks Reference Manual</i>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83461">5.1.2 Scalability and MIB-II Facilities</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83465"> </a>The WindNet SNMPv1/v2c agent is shipped with a default configuration that includes all MIB-II groups. (Note that this does <i class="emphasis">not</i> automatically configure VxWorks for SNMP; to use SNMPv1/v2c with VxWorks, you <i class="emphasis">must</i> define<b class="symbol_UC"> INCLUDE_MIB2_ALL</b> in <b class="file">configAll.h</b>.)</p><dd><p class="Body"><a name="83653"> </a>Because WindNet SNMPv1/v2c is a scalable product, you can include or exclude from the agent any of the MIB-II groups defined by the constants listed in <a href="c-config1.html#83475">Table 5-2</a>.<p class="table"><h4 class="EntityTitle"><a name="83475"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 5-2: MIB-II Facilities Constants</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83479"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Constant</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="83481"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Facility Included</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83483"> </a><b class="symbol_UC">INCLUDE_MIB2_SYSTEM</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83485"> </a>MIB-II system group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83487"> </a><b class="symbol_UC">INCLUDE_MIB2_IF</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83489"> </a>MIB-II interface group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83491"> </a><b class="symbol_UC">INCLUDE_MIB2_AT</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83493"> </a>MIB-II AT group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83495"> </a><b class="symbol_UC">INCLUDE_MIB2_IP</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83497"> </a>MIB-II IP group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83499"> </a><b class="symbol_UC">INCLUDE_MIB2_ICMP</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83501"> </a>MIB-II ICMP group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83503"> </a><b class="symbol_UC">INCLUDE_MIB2_UDP</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83505"> </a>MIB-II UDP group</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="83507"> </a><b class="symbol_UC">INCLUDE_MIB2_TCP</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="83509"> </a>MIB-II TCP group</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="83510"> </a>By performing the following steps, you can specify the MIB-II services available in your agent MIB:</p></dl><dl class="margin"><p><ol class="List"><li value="1."><a name="83511"> </a>Move those MIB-II constants associated with services you want available in your agent MIB to the INCLUDED FACILITIES section of <b>configAll.h</b>. </li></ol></p><p><ol class="List"><li value="2."><a name="83512"> </a>Make sure <b class="symbol_UC">INCLUDE_SNMPD</b> resides in the INCLUDED FACILITIES section of <b>configAll.h</b>. </li></ol></p><p><ol class="List"><li value="3."><a name="83513"> </a>Move <b class="symbol_UC">INCLUDE_MIB2_ALL</b> to the EXCLUDED FACILITIES section of <b>configAll.h</b>.</li></ol></p><p><ol class="List"><li value="4."><a name="83514"> </a>Whenever a group is scaled out of the SNMP agent, the agent, as well as the BSP for the target, needs to be rebuilt. To build the agent, you must edit the file <b class="file">snmpMib2.mib</b> in the directory <b>$WIND_BASE/target/src/snmpv1/agent</b> in order to exclude variables from the MIB. For example, to exclude the MIB-II system group, edit <b class="file">snmpMib2.mib</b> by adding the keyword <b class="keyword">EXCLUDE</b> and the name of the group as shown:</li></ol></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="83515">--EXCLUDE system</a></b></pre></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -