public class LinuxSystemCommander extends AbstractSystemCommander
| Constructor and Description |
|---|
LinuxSystemCommander() |
| Modifier and Type | Method and Description |
|---|---|
String |
buildKill(int pid)
构建kill 命令
|
String |
emptyLogFile(File file)
清空文件内容
|
com.alibaba.fastjson.JSONObject |
getAllMonitor()
获取整个服务器监控信息
|
static String |
getLinuxCpu(String info)
获取占用cpu信息
|
ProcessModel |
getPidInfo(int pid)
获取指定进程的 内存信息
|
List<ProcessModel> |
getProcessList(String processName)
获取当前服务器的所有进程列表
|
boolean |
getServiceStatus(String serviceName)
查询服务状态
|
String |
startService(String serviceName)
启动服务
|
String |
stopService(String serviceName)
关闭服务
|
getHardDisk, getInstance, killpublic com.alibaba.fastjson.JSONObject getAllMonitor()
AbstractSystemCommandergetAllMonitor in class AbstractSystemCommanderpublic List<ProcessModel> getProcessList(String processName)
AbstractSystemCommandergetProcessList in class AbstractSystemCommanderprocessName - 进程名称public ProcessModel getPidInfo(int pid)
AbstractSystemCommandergetPidInfo in class AbstractSystemCommanderpid - 进程idpublic String emptyLogFile(File file)
AbstractSystemCommanderemptyLogFile in class AbstractSystemCommanderfile - 文件public static String getLinuxCpu(String info)
info - cpu信息public boolean getServiceStatus(String serviceName)
AbstractSystemCommandergetServiceStatus in class AbstractSystemCommanderserviceName - 服务名称public String startService(String serviceName)
AbstractSystemCommanderstartService in class AbstractSystemCommanderserviceName - 服务名称public String stopService(String serviceName)
AbstractSystemCommanderstopService in class AbstractSystemCommanderserviceName - 服务名称public String buildKill(int pid)
AbstractSystemCommanderbuildKill in class AbstractSystemCommanderpid - 进程编号Copyright © 2017–2022. All rights reserved.