CPU LOAD MONITOR Tommy
    CPU LOAD MONITOR Synametrics Support
        CPU LOAD MONITOR Tommy
            CPU LOAD MONITOR Tommy

From: Tommy
Date: 12/23/17 2:07 AM
Topic: CPU LOAD MONITOR
Type: General Discussions
Post a follow up

How to view the CPU load from the control panel? I see that there is a page: CPUStats.jsp,but can not run.

An error occurred at line: 27 in the jsp file: /CPUStats.jsp

Line 27 is:
27: CPUMonitor cm = new CPUMonitor();
Top

From: Synametrics Support
Date: 12/23/17 3:19 AM
Topic: CPU LOAD MONITOR
Type: General Discussions
Post a follow up

There is no way to check CPU load from Xeam's web interface. It can only be done at the OS level. The CPUStats.jsp is an experimental file that will not load. I will forward this message to our dev. team and they will try to add this feature in a future release. 

 

 
Top

From: Tommy
Date: 12/23/17 5:08 AM
Topic: CPU LOAD MONITOR
Type: General Discussions
Post a follow up

I find a way to settle,write to log,then read from log,include at newfooter.jsp,so that when admin login,can know the CPU LOAD

<%
String cmds= "uptime>/opt/Xeams/logs/cpuload.log";
String[] command = { "/bin/sh", "-c", cmds };
Process ps = Runtime.getRuntime().exec(command );
%>

Top

From: Tommy
Date: 12/23/17 9:25 AM
Topic: CPU LOAD MONITOR
Type: General Discussions
Post a follow up

1: Create  cpuload.jsp,the content is as below:

<%
String cmds= "uptime>/opt/Xeams/logs/cpuload.log";
String[] command = { "/bin/sh", "-c", cmds };
Process ps = Runtime.getRuntime().exec(command );
%>

2: add below at the first line of NewPageFooter.jsp

<%@ include file="cpuload.jsp" %>

3: add below at the NewPageHeader.jsp after String helpSite = "http://www.xeams.com/"; then it will be as below:

String helpSite = "http://www.xeams.com/";
String cpufilter = "";
String cpuload = ResourceBean.displayFileTail("/opt/Xeams/logs/cpuload.log",1,cpufilter);
int authorizationLevel = ResourceBean.AL_NOT_LOGGED_IN;

4: add below at MainMenu.jsp after <%=GlobalFuncs.formatDate(AppConfig.SERVER_START_TIME)%>,it will be like:

<div class="text-center">
<span class="well" style="display:inline-table; padding:3px 5px; color:#555;"><span class="glyphicon glyphicon-time"></span> Running Since: <%=GlobalFuncs.formatDate(AppConfig.SERVER_START_TIME)%> || <%=cpuload%> </span>
</div>

Finally,when you login the control panel,you will see as below:

Running Since: 12/23/17 8:55 PM || 22:21:42 up 1:26, 0 users, load average: 0.00, 0.00, 0.00

Top