Zutil updates
This commit is contained in:
parent
7e957bc34e
commit
7bf6896473
22 changed files with 55 additions and 83 deletions
2
src/examples/CpuInfo.java
Normal file → Executable file
2
src/examples/CpuInfo.java
Normal file → Executable file
|
|
@ -20,8 +20,8 @@ package test;
|
|||
|
||||
import org.hyperic.sigar.CpuPerc;
|
||||
import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.SigarLoader;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.SigarLoader;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import org.hyperic.sigar.cmd.SigarCommandBase;
|
||||
|
||||
|
|
|
|||
12
src/examples/Df.java
Normal file → Executable file
12
src/examples/Df.java
Normal file → Executable file
|
|
@ -18,20 +18,14 @@
|
|||
|
||||
package test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.FileSystem;
|
||||
import org.hyperic.sigar.FileSystemMap;
|
||||
import org.hyperic.sigar.FileSystemUsage;
|
||||
import org.hyperic.sigar.NfsFileSystem;
|
||||
|
||||
import org.hyperic.sigar.*;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import org.hyperic.sigar.cmd.SigarCommandBase;
|
||||
import org.hyperic.sigar.shell.FileCompleter;
|
||||
import org.hyperic.sigar.util.GetlineCompleter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Report filesytem disk space usage.
|
||||
*/
|
||||
|
|
|
|||
12
src/examples/Iostat.java
Normal file → Executable file
12
src/examples/Iostat.java
Normal file → Executable file
|
|
@ -18,20 +18,14 @@
|
|||
|
||||
package test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.FileSystem;
|
||||
import org.hyperic.sigar.FileSystemMap;
|
||||
import org.hyperic.sigar.FileSystemUsage;
|
||||
import org.hyperic.sigar.DiskUsage;
|
||||
|
||||
import org.hyperic.sigar.*;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import org.hyperic.sigar.cmd.SigarCommandBase;
|
||||
import org.hyperic.sigar.shell.FileCompleter;
|
||||
import org.hyperic.sigar.util.GetlineCompleter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Report filesytem disk space usage.
|
||||
*/
|
||||
|
|
|
|||
10
src/examples/Netstat.java
Normal file → Executable file
10
src/examples/Netstat.java
Normal file → Executable file
|
|
@ -18,17 +18,17 @@
|
|||
|
||||
package test;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.NetConnection;
|
||||
import org.hyperic.sigar.NetFlags;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.Tcp;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import org.hyperic.sigar.cmd.SigarCommandBase;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Display network connections.
|
||||
*/
|
||||
|
|
|
|||
22
src/examples/ServerStatus.java
Normal file → Executable file
22
src/examples/ServerStatus.java
Normal file → Executable file
|
|
@ -1,27 +1,13 @@
|
|||
package wa.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import org.hyperic.sigar.*;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.hyperic.sigar.CpuPerc;
|
||||
import org.hyperic.sigar.FileSystem;
|
||||
import org.hyperic.sigar.FileSystemUsage;
|
||||
import org.hyperic.sigar.Mem;
|
||||
import org.hyperic.sigar.NetFlags;
|
||||
import org.hyperic.sigar.NetInterfaceConfig;
|
||||
import org.hyperic.sigar.NetInterfaceStat;
|
||||
import org.hyperic.sigar.NetRoute;
|
||||
import org.hyperic.sigar.ProcCpu;
|
||||
import org.hyperic.sigar.ProcUtil;
|
||||
import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.CpuInfo;
|
||||
import org.hyperic.sigar.Swap;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* Generates an XML with the status of the server, extended
|
||||
|
|
|
|||
11
src/examples/Version.java
Normal file → Executable file
11
src/examples/Version.java
Normal file → Executable file
|
|
@ -18,20 +18,19 @@
|
|||
|
||||
package test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import org.hyperic.sigar.OperatingSystem;
|
||||
import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.SigarException;
|
||||
import org.hyperic.sigar.SigarLoader;
|
||||
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import org.hyperic.sigar.cmd.SigarCommandBase;
|
||||
import org.hyperic.sigar.win32.LocaleInfo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* Display Sigar, java and system version information.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import wa.server.page.WAPage;
|
|||
import wa.server.page.struct.WANavigation;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.net.http.HttpPage;
|
||||
import zutil.net.http.HttpPrintStream;
|
||||
import zutil.parser.DataNode;
|
||||
|
|
@ -37,7 +37,9 @@ import zutil.parser.json.JSONWriter;
|
|||
import zutil.plugin.PluginManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
@ -68,7 +70,7 @@ public class WAAbstractPage implements HttpPage{
|
|||
|
||||
@Override
|
||||
public final synchronized void respond(HttpPrintStream out,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) throws IOException {
|
||||
|
|
|
|||
4
src/wa/server/WAConstants.java
Normal file → Executable file
4
src/wa/server/WAConstants.java
Normal file → Executable file
|
|
@ -1,11 +1,11 @@
|
|||
package wa.server;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.osal.OSAbstractionLayer;
|
||||
import zutil.osal.OSAbstractionLayer.OSType;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class WAConstants {
|
||||
|
||||
public static final String DB_FILE_NAME = "webadmin.db";
|
||||
|
|
|
|||
3
src/wa/server/WebAdminServer.java
Normal file → Executable file
3
src/wa/server/WebAdminServer.java
Normal file → Executable file
|
|
@ -1,11 +1,10 @@
|
|||
package wa.server;
|
||||
|
||||
import wa.server.page.StatusPage;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpServer;
|
||||
import zutil.net.http.pages.HttpFilePage;
|
||||
import zutil.net.http.page.HttpFilePage;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import wa.server.plugin.WAConfigEntry;
|
|||
import wa.server.plugin.WAServiceConfig;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.ui.Configurator;
|
||||
|
|
@ -59,7 +59,7 @@ public class ConfigPage implements WAPage{
|
|||
|
||||
@Override
|
||||
public Templator htmlResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
|
@ -108,7 +108,7 @@ public class ConfigPage implements WAPage{
|
|||
|
||||
@Override
|
||||
public DataNode jsonResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ package wa.server.page;
|
|||
|
||||
import wa.server.plugin.WALog;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpPage;
|
||||
import zutil.net.http.HttpPrintStream;
|
||||
import zutil.parser.DataNode;
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ package wa.server.page;
|
|||
|
||||
import wa.server.WAContext;
|
||||
import wa.server.page.struct.WANavigation;
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import wa.server.plugin.WAService;
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
|
@ -80,7 +80,7 @@ public class ServicePage implements WAPage {
|
|||
|
||||
@Override
|
||||
public Templator htmlResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
|
@ -116,7 +116,7 @@ public class ServicePage implements WAPage {
|
|||
}
|
||||
|
||||
public DataNode jsonResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request){
|
||||
|
|
|
|||
6
src/wa/server/page/ServiceStatusPage.java
Normal file → Executable file
6
src/wa/server/page/ServiceStatusPage.java
Normal file → Executable file
|
|
@ -27,7 +27,7 @@ import wa.server.page.struct.WANavigation;
|
|||
import wa.server.plugin.WAServiceStatus;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
|
@ -64,7 +64,7 @@ public class ServiceStatusPage implements WAPage {
|
|||
|
||||
@Override
|
||||
public Templator htmlResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
|
@ -80,7 +80,7 @@ public class ServiceStatusPage implements WAPage {
|
|||
}
|
||||
|
||||
public DataNode jsonResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request){
|
||||
|
|
|
|||
6
src/wa/server/page/StatusPage.java
Normal file → Executable file
6
src/wa/server/page/StatusPage.java
Normal file → Executable file
|
|
@ -25,7 +25,7 @@ package wa.server.page;
|
|||
import wa.server.WAContext;
|
||||
import wa.server.page.struct.WANavigation;
|
||||
import wa.server.plugin.WAStatus;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
|
@ -52,7 +52,7 @@ public class StatusPage implements WAPage {
|
|||
|
||||
@Override
|
||||
public Templator htmlResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
|
@ -65,7 +65,7 @@ public class StatusPage implements WAPage {
|
|||
}
|
||||
|
||||
public DataNode jsonResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request){
|
||||
|
|
|
|||
6
src/wa/server/page/WAPage.java
Normal file → Executable file
6
src/wa/server/page/WAPage.java
Normal file → Executable file
|
|
@ -23,7 +23,7 @@
|
|||
package wa.server.page;
|
||||
|
||||
import wa.server.WAContext;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpHeader;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
|
||||
|
|
@ -35,13 +35,13 @@ import java.util.Map;
|
|||
public interface WAPage {
|
||||
|
||||
public abstract Templator htmlResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request);
|
||||
|
||||
public DataNode jsonResponse(WAContext context,
|
||||
HttpHeaderParser client_info,
|
||||
HttpHeader client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request);
|
||||
|
|
|
|||
2
src/wa/server/page/struct/WAAlert.java
Normal file → Executable file
2
src/wa/server/page/struct/WAAlert.java
Normal file → Executable file
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
package wa.server.page.struct;
|
||||
|
||||
import java.sql.Struct;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-04-03.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ import zutil.db.bean.DBBean.DBTable;
|
|||
import zutil.io.IOUtil;
|
||||
import zutil.ui.Configurator;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
2
src/wa/server/plugin/apache/ApacheStatus.java
Normal file → Executable file
2
src/wa/server/plugin/apache/ApacheStatus.java
Normal file → Executable file
|
|
@ -23,10 +23,10 @@
|
|||
package wa.server.plugin.apache;
|
||||
|
||||
import wa.server.plugin.WAServiceStatus;
|
||||
import zutil.osal.app.linux.Ps;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.osal.OSAbstractionLayer;
|
||||
import zutil.osal.app.linux.Ps;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
|
|||
1
src/wa/server/plugin/hwstatus/HDDStatus.java
Normal file → Executable file
1
src/wa/server/plugin/hwstatus/HDDStatus.java
Normal file → Executable file
|
|
@ -30,7 +30,6 @@ import org.hyperic.sigar.cmd.Shell;
|
|||
import wa.server.plugin.WAStatus;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
|
|||
2
src/wa/server/plugin/hwstatus/NetStatus.java
Normal file → Executable file
2
src/wa/server/plugin/hwstatus/NetStatus.java
Normal file → Executable file
|
|
@ -25,8 +25,8 @@ package wa.server.plugin.hwstatus;
|
|||
import org.hyperic.sigar.*;
|
||||
import org.hyperic.sigar.cmd.Shell;
|
||||
import wa.server.plugin.WAStatus;
|
||||
import zutil.net.ThroughputCalculator;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.net.ThroughputCalculator;
|
||||
import zutil.parser.DataNode;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
*/
|
||||
package wa.server.plugin.tomcat;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import wa.server.plugin.apache.ApacheConfigVirtualHost.ApacheVirtualHostEntry;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
|
||||
public class TomcatConfigApplication {
|
||||
|
||||
|
|
|
|||
6
src/wa/server/util/ConfigFileUtil.java
Normal file → Executable file
6
src/wa/server/util/ConfigFileUtil.java
Normal file → Executable file
|
|
@ -1,11 +1,11 @@
|
|||
package wa.server.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import wa.server.WAConstants;
|
||||
import zutil.io.file.FileUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ConfigFileUtil {
|
||||
|
||||
public static void writeBetweenBoundary(File file, String commentChar, String data) throws IOException{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue