add added files
[bcm963xx.git] / userapps / broadcom / cfm / html / snmpconfig.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation
4 -->
5 <html>
6 <head>
7         <title>Device &raquo; SNMP</title>
8
9         <link href="usr_main.css" rel="stylesheet" type="text/css">
10         <script src="usr_menus.js" type="text/javascript"></script>
11         <script src="usr_common.js" type="text/javascript"></script>
12
13    <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14
15         <script type="text/javascript" src="util.js"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWl(wlInterface)%>");
19
20 var state = '<%ejGet(snmpRefresh)%>';
21 if ( state == '1' ) {
22    var code = 'location.assign("snmpconfig.cgi?snmpRefresh=0")';
23    eval(code);
24 }
25
26 function frmLoad() {
27    with ( document.forms[0] ) {
28       status[<%ejGet(snmpStatus)%>].checked = true;
29       rocommunity.value = '<%ejGet(snmpRoCommunity)%>';
30       rwcommunity.value = '<%ejGet(snmpRwCommunity)%>';
31       sysName.value = '<%ejGet(snmpSysName)%>';
32       sysContact.value = '<%ejGet(snmpSysContact)%>';
33       sysLocation.value = '<%ejGet(snmpSysLocation)%>';
34       trapIp.value = '<%ejGet(snmpTrapIp)%>';
35    }
36 }
37
38 function btnApply() {
39    var loc = 'snmpconfig.cgi?';
40    with ( document.forms[0] ) {
41       if (rocommunity.value == '') {
42          alert('Read community is required.');
43          return;
44       }
45       if (rwcommunity.value == '') {
46          alert('Set community is required.');
47          return;
48       }
49       if ( status[1].checked == true )
50          loc += 'snmpStatus=1';
51       else
52          loc += 'snmpStatus=0';
53       if (rocommunity.value.length > 15) {
54          alert('The length of read community (' + rocommunity.value.length + ') is too long [0-15].');
55          return;
56       }
57       loc += '&snmpRoCommunity=' + encodeUrl(rocommunity.value);
58       if (rwcommunity.value.length > 15) {
59          alert('The length of set community (' + rwcommunity.value.length + ') is too long [0-15].');
60          return;
61       }
62       loc += '&snmpRwCommunity=' + encodeUrl(rwcommunity.value);
63       if (sysName.value.length > 15) {
64          alert('The length of sysName (' + sysName.value.length + ') is too long [0-15].');
65          return;
66       }
67       loc += '&snmpSysName=' + encodeUrl(sysName.value);
68       if (sysContact.value.length > 15) {
69          alert('The length of sysContact (' + sysContact.value.length + ') is too long [0-15].');
70          return;
71       }
72       loc += '&snmpSysContact=' + encodeUrl(sysContact.value);
73       if (sysLocation.value.length > 15) {
74          alert('The length of sysLocation (' + sysLocation.value.length + ') is too long [0-15].');
75          return;
76       }
77       loc += '&snmpSysLocation=' + encodeUrl(sysLocation.value);
78       if ( isValidIpAddress(trapIp.value) == false &&  trapIp.value != '0.0.0.0') {
79          alert('Trap Management IP address "' + trapIp.value + '" is invalid IP address.');
80          return;
81       }
82       loc += '&snmpTrapIp=' + trapIp.value;
83    }
84    var code = 'location.assign("' + loc + '")';
85    eval(code);
86 }
87
88 // done hiding -->
89 </script>
90    </head>
91    <body onload="initMenu('idMenu'); frmLoad();">
92
93 <script type="text/javascript">
94         writeHeader("Device", "<%ejGet(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWl(wlInterface)%>", <%ejGet(enblQos)%>);
95 </script>
96
97 <h3>SNMP</h3>
98
99 <p>Simple Network Management Protocol (SNMP) allows a management application to
100 retrieve statistics and status from the SNMP agent in this device.</p>
101
102 <p>Select the desired values and press <b>Apply</b> to configure the SNMP options.</p>
103
104 <form>
105         <p>
106             <input name='status' id="optSNMPDisable" type='radio'> <label for="optSNMPDisable">Disable SNMP agent</label><br>
107             <input name='status' id="optSNMPEnable" type='radio'> <label for="optSNMPEnsable">Enable SNMP agent</label>
108         </p>
109
110    <table border="0" cellpadding="0" cellspacing="0">
111       <tr>
112          <td><label for="rocommunity">Read community:</label></td>
113          <td><input type='text' name='rocommunity' id='rocommunity' size="20"></td>
114       </tr>
115       <tr>
116          <td><label for="rwcommunity">Set community:</label></td>
117          <td><input type='text' name='rwcommunity' id='rwcommunity' size="20"></td>
118       </tr>
119       <tr>
120          <td><label for="sysName">System name:</label></td>
121          <td><input type='text' name='sysName' id='sysName' size="20"></td>
122       </tr>
123       <tr>
124          <td><label for="sysLocation">System location:</label></td>
125          <td><input type='text' name='sysLocation' id='sysLocation' size="20"></td>
126       </tr>
127       <tr>
128          <td><label for="sysContact">System contact:</label></td>
129          <td><input type='text' name='sysContact' id='sysContact' size="20"></td>
130       </tr>
131       <tr>
132          <td><label for="trapIp">Trap manager IP:</label></td>
133          <td><input type='text' name='trapIp' id='trapIp' size="20"></td>
134       </tr>
135    </table>
136
137    <p><input type='button' onClick='btnApply()' value='Apply'></p>
138 </form>
139
140
141 <script type="text/javascript">
142         writeFooter();
143 </script>
144
145 </body>
146 </html>