1 <%@ page import="org.ultramonkey.l7.model.*, org.ultramonkey.l7.controller.*, org.ultramonkey.l7.view.*, java.util.*"
2 language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
9 MessageView error = new MessageView(41398, LogCategorySet.GUI_USER_AUTHENTICATION,
10 Message.INVALID_SESSSION);
11 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
12 response.sendRedirect(RedirectPages.LOGIN);
19 MessageView message = (MessageView) session.getAttribute(SessionKeys.RESULT_MESSAGE);
20 String errorMessage = null;
23 if ( (message != null) && (errorMessage != null) ) {
24 errorMessage = message.getMessage();
25 errorNumber = message.getErrno();
26 category = message.getCategory();
27 session.setAttribute(SessionKeys.RESULT_MESSAGE, null);
31 * get l7vsadm data from L7guiFramework
33 L7guiFramework framework = new L7guiFramework();
34 L7vsAdmData admDataList = framework.getAdmData();
35 if (admDataList == null) {
36 MessageView error = new MessageView(41399, LogCategorySet.GUI_VIRTUALSERVICE,
37 Message.UNEXPECTED_ERROR);
38 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
39 response.sendRedirect(RedirectPages.LOGIN);
44 * get directord data from L7guiFramework
46 DirectorData dd = framework.getDirectorData();
48 MessageView error = new MessageView(41400, LogCategorySet.GUI_IO_FILE,
49 Message.CLUSTER_DATA_ERROR);
50 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
51 response.sendRedirect(RedirectPages.LOGIN);
55 String checkTimeout = dd.checkTimeOut;
56 if ( (checkTimeout == null) || (checkTimeout.length() == 0) )
59 checkTimeout = checkTimeout + " [sec]";
61 String negotiateTimeOut = dd.negotiateTimeOut;
62 if ( (negotiateTimeOut == null) || (negotiateTimeOut.length() == 0) )
63 negotiateTimeOut = "-";
65 negotiateTimeOut = negotiateTimeOut + " [sec]";
67 String checkInterval = dd.checkInterval;
68 if ( (checkInterval == null) || (checkInterval.length() == 0) )
71 checkInterval = checkInterval + " [sec]";
73 String checkCount = dd.checkCount;
74 if ( (checkCount == null) || (checkCount.length() == 0) )
77 checkCount = checkCount + " [times]";
79 String callback = dd.callback;
80 if ( (callback == null) || (callback.length() == 0) )
83 String fallback = dd.fallback;
84 if ( (fallback == null) || (fallback.length() == 0) )
87 String logFile = dd.logfile;
88 if ( (logFile == null) || (logFile.length() == 0) )
90 String execute = dd.execute;
91 if ( (execute == null) || (execute.length() == 0) )
94 String supervised = dd.supervised;
95 if ( (supervised == null) || (supervised.length() == 0) )
98 String quiescent = dd.quiescent;
99 if ( (quiescent == null) || (quiescent.length() == 0) )
104 * get cluster status and fix css seat
106 ClusterData cd = framework.getClusterData();
108 MessageView error = new MessageView(41401, LogCategorySet.GUI_IO_COMMAND,
109 Message.CLUSTER_DATA_ERROR);
110 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
111 response.sendRedirect(RedirectPages.LOGIN);
116 String selfIp = cd.self_ip;
117 String otherIp = cd.other_ip;
119 if ( selfIp == null )
121 if (otherIp == null )
128 SnmpAgentData snmp = framework.getSnmpAgentData();
129 if ( snmp == null ) {
130 MessageView error = new MessageView(41402, LogCategorySet.GUI_IO_COMMAND,
131 Message.UNEXPECTED_ERROR);
132 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
133 response.sendRedirect(RedirectPages.LOGIN);
136 int query = snmp.interval;
137 String queryUnit = "[msec]";
139 query = query / 1000 ;
144 * get replication Data
146 ReplicationData rep = framework.getReplicationData();
148 MessageView error = new MessageView(41403, LogCategorySet.GUI_IO_COMMAND,
149 Message.UNEXPECTED_ERROR);
150 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
151 response.sendRedirect(RedirectPages.LOGIN);
154 ReplicationStatus repStatus = rep.replicationMode;
155 String printRepStatus = null;
158 printRepStatus = "Master Running";
161 printRepStatus = "Slave Running";
164 printRepStatus = "Master Stopped";
167 printRepStatus = "Slave Stopped";
170 printRepStatus = "Replication Invalid";
173 printRepStatus = "In Starting Replication";
176 MessageView error = new MessageView(41404, LogCategorySet.GUI_IO_COMMAND,
177 Message.UNEXPECTED_ERROR);
178 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
179 response.sendRedirect(RedirectPages.LOGIN);
188 String l7vsdStatus = "Out of Service";
189 String l7vsdClass = "error";
190 String l7direcotordStatus = "Out of Service";
191 String l7directordClass = "error";
192 String snmpAgentStatus = "Out of Service";
193 String snmpAgentClass = "error" ;
194 String replicationStatus = "Out of Service";
195 String replicationClass = "side_error";
196 String clusterStatus = null;
197 String clusterClass = "error";
200 if ( framework.getL7vsdProcessStatus() ){
201 l7vsdStatus = "In Service";
205 // fix l7direcotord Status
206 if ( framework.getL7directordProcessStatus() ){
207 l7direcotordStatus = "In Service";
208 l7directordClass = "ins";
211 // fix snmpAgent Status
212 if ( snmp.status == SnmpAgentStatus.CONNECTING ){
213 snmpAgentStatus = "In Service";
214 snmpAgentClass = "ins";
217 // fix replication Status
218 if ( rep.replicationMode != ReplicationStatus.SINGLE && rep.replicationMode != ReplicationStatus.OUT ){
219 replicationStatus = "In Service";
220 replicationClass = "side_ins";
223 // fix Cluster Status
224 if ( (cd.self_status.equals(ClusterStatus.ACTIVE)) || (cd.self_status.equals(ClusterStatus.STANDBY)) ){
225 clusterStatus = "In Service";
226 if (cd.self_status.equals(ClusterStatus.ACTIVE) )
227 clusterClass = "ins";
234 String cssSeat = "l7gui_single_style.css";
235 if ( cd.self_status == ClusterStatus.ACTIVE ){
236 cssSeat = "l7gui_act_style.css";
238 else if ( cd.self_status == ClusterStatus.STANDBY ){
239 cssSeat = "l7gui_sby_style.css";
245 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
248 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
249 <meta http-equiv="Content-Script-Type" content="text/javascript" />
250 <meta http-equiv="Content-Style-Type" content="text/css" />
251 <meta http-equiv="Pragma" content="no-cache">
252 <meta http-equiv="Cache-Control" content="no-cache">
253 <meta http-equiv="Expires" content="0">
254 <script src="l7gui.js" type="text/javascript"></script>
256 <meta http-equiv="refresh" content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>"/>
258 <link rel="stylesheet" type="text/css" href="<%=cssSeat %>" />
259 <link rel="shortcut icon" href="images/favicon.ico" />
260 <title>GUI Console TOP</title>
264 <body class="normal">
265 <jsp:include page="menu.jsp" flush="false"/>
270 <h1>GUI Console TOP</h1>
271 <h2> UltraMonkey-L7 Service</h2>
274 <legend>UltraMoneky-L7 Service : Current status</legend>
276 <table class="infotable">
278 if (clusterStatus != null){
281 <th class="head" colspan="4">
282 <label for="UltraMoneky-L7">UltraMoneky-L7</label>
285 <label for="HA Cluster">HA Cluster</label>
293 <label for="l7vsdStatus">l7vsd</label>
296 <label for="l7directord">l7directord</label>
299 <label for="SNMPAgent">SNMPAgent</label>
302 <label for="Replication">Replication</label>
305 if (clusterStatus != null){
308 <label for="Heartbeat2">Heartbeat2</label>
315 <td class="<%=l7vsdClass %>"><%=l7vsdStatus %></td>
316 <td class="<%=l7directordClass %>"><%=l7direcotordStatus %></td>
317 <td class="<%=snmpAgentClass %>"><%=snmpAgentStatus %></td>
318 <td class="<%=replicationClass %>"><%=replicationStatus %></td>
319 <% if (cd.self_status == ClusterStatus.ACTIVE || cd.self_status == ClusterStatus.STANDBY){
321 <td class="<%=clusterClass %>"><%= clusterStatus %></td>
332 <legend>Redundancy : Current Status</legend>
334 <table class="infotable">
337 <label for="empty"></label>
340 <label for="nodeStatus">Node Status</label>
343 <label for="realIp">Real IP Address</label>
347 <td class="left_point">
351 <%= cd.self_status %>
357 <% if (cd.self_status != ClusterStatus.SINGLE){
360 <td class="left_point">
364 <%= cd.other_status %>
376 <h2> VirtualService</h2>
377 <% if ( (cd.self_status.equals(ClusterStatus.ACTIVE)) || (cd.self_status.equals(ClusterStatus.SINGLE) )){
381 * get VirtualService data from L7guiFramework
383 Vector<VirtualSetting> vsList = new Vector<VirtualSetting>();
384 vsList = admDataList.virtualSettings;
385 ArrayList<String> vsNameList = new ArrayList<String>();
389 String vsPort = null;
390 String vsProtomod = null;
391 String vsOption = null;
392 String vsSchedule = null;
394 String rsPort = null;
396 long activeConnections = 0;
397 long inactiveConnections = 0;
398 String vsSorryFlag = null;
400 if ( vsList.size() > 0 ){
403 <legend>VirtualService : Current Status</legend>
404 <table class="infotable" cellspacing="0">
406 <th class="head" colspan="5">
407 <label for="VirtualService">VirtualService</label>
409 <th class="head" colspan="5">
410 <label for="RealServices">RealServer</label>
413 <label for="SorryFlag">Sorry Flag</label>
418 <label for="VirtualIP Address">VirtualIP Address</label>
421 <label for="Port Number">Port Number</label>
424 <label for="Persistence Type">Persistence Type</label>
427 <label for="Module option">Module Option</label>
430 <label for="Scheduler Type">Scheduler Type</label>
433 <label for="RealServer IP Address">IP Address</label>
436 <label for="RealServer Port Number">Port Number</label>
439 <label for="RealServer weight">Weight</label>
442 <label for="ActiveConnections">Active Connections</label>
445 <label for="InactiveConnections">Inactive Connections</label>
449 for (int i = 0; i < vsList.size(); i++) {
451 VirtualSetting getVirtualSetting = vsList.get(i);
453 vsIp = getVirtualSetting.virtual.host;
454 vsPort = getVirtualSetting.virtual.port;
455 vsProtomod = getVirtualSetting.protomod;
456 vsOption = getVirtualSetting.option;
457 vsSchedule = getVirtualSetting.sched;
459 Vector<EndPoint> getRsList =getVirtualSetting.real;
460 int rsNumber = getRsList.size();
465 boolean vsSorry = getVirtualSetting.sorryflag;
467 if ( (vsIp == null) || (vsProtomod == null) || (vsOption == null) ){
468 MessageView error = new MessageView(41405, LogCategorySet.GUI_VIRTUALSERVICE,
469 Message.UNEXPECTED_ERROR);
470 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
471 response.sendRedirect(RedirectPages.LOGIN);
476 <td class="center" rowspan="<%=rsNumber %>"><%=vsIp%></td>
477 <td class="center" rowspan="<%=rsNumber %>"><%=vsPort%></td>
478 <td class="center" rowspan="<%=rsNumber %>"><%=vsProtomod%></td>
479 <td class="center" rowspan="<%=rsNumber %>"><%=vsOption%></td>
480 <td class="point" rowspan="<%=rsNumber %>"><%=vsSchedule%></td>
484 <td class="center">-</td>
485 <td class="center">-</td>
486 <td class="center">-</td>
487 <td class="center">-</td>
488 <td class="point">-</td>
492 EndPoint getRs = getRsList.get(0);
495 rsWeight = getRs.weight;
496 activeConnections = getRs.actConn;
497 inactiveConnections = getRs.inActConn;
499 <td class="center"><%=rsIP%></td>
500 <td class="center"><%=rsPort%></td>
501 <td class="center"><%=rsWeight%></td>
502 <td class="center"><%=activeConnections%></td>
503 <td class="point"><%=inactiveConnections%></td>
513 <td class="center" rowspan="<%=rsNumber %>"><%=vsSorryFlag %></td>
516 for ( int j = 1; j < rsNumber; j++ ){
517 EndPoint addedGetRs = getRsList.get(j);
518 rsIP = addedGetRs.host;
519 rsPort = addedGetRs.port;
520 rsWeight = addedGetRs.weight;
521 activeConnections = addedGetRs.actConn;
522 inactiveConnections = addedGetRs.inActConn;
525 <td class="center"><%=rsIP%></td>
526 <td class="center"><%=rsPort%></td>
527 <td class="center"><%=rsWeight%></td>
528 <td class="center"><%=activeConnections%></td>
529 <td class="point"><%=inactiveConnections%></td>
536 }catch(NullPointerException e){
537 MessageView error = new MessageView(41406, LogCategorySet.GUI_VIRTUALSERVICE,
538 Message.UNEXPECTED_ERROR);
539 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
540 response.sendRedirect(RedirectPages.LOGIN);
551 <p class="error">No VirtualService List</p>
557 <p class="error">No VirtualService List</p>
564 <legend>Monitor : Current Status</legend>
565 <table class="infotable">
568 <label for="checkTimeOut">CheckTimeOut</label>
571 <label for="negotiateTimeOut">NegotiateTimeOut</label>
574 <label for="checkInterval">CheckInterval</label>
577 <label for="checkCount">CheckCount</label>
580 <label for="quiescent">Quiescent</label>
584 <td class="center"><%=checkTimeout%></td>
585 <td class="center"><%=negotiateTimeOut%></td>
586 <td class="center"><%=checkInterval%></td>
587 <td class="center"><%=checkCount%></td>
588 <td class="center"><%=quiescent%></td>
595 if (snmp.status == SnmpAgentStatus.CONNECTING) {
599 <legend>SNMP Agent : Current Status</legend>
600 <table class="infotable">
603 <label for="queryInterval">Query Interval</label>
607 <td class="center"><%=query %> <%=queryUnit %></td>
616 if ( rep.replicationMode != ReplicationStatus.SINGLE ){
620 <legend>Replication : Current Status</legend>
621 <table class="infotable">
624 <label for="Replication Mode">Replication Mode</label>
627 <label for="Interval">Interval</label>
631 <td class="center"><%=printRepStatus %></td>
632 <td class="center"><%=rep.interval %> [µsec]</td>