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, kill
public com.alibaba.fastjson.JSONObject getAllMonitor()
AbstractSystemCommander
getAllMonitor
in class AbstractSystemCommander
public List<ProcessModel> getProcessList(String processName)
AbstractSystemCommander
getProcessList
in class AbstractSystemCommander
processName
- 进程名称public ProcessModel getPidInfo(int pid)
AbstractSystemCommander
getPidInfo
in class AbstractSystemCommander
pid
- 进程idpublic String emptyLogFile(File file)
AbstractSystemCommander
emptyLogFile
in class AbstractSystemCommander
file
- 文件public static String getLinuxCpu(String info)
info
- cpu信息public boolean getServiceStatus(String serviceName)
AbstractSystemCommander
getServiceStatus
in class AbstractSystemCommander
serviceName
- 服务名称public String startService(String serviceName)
AbstractSystemCommander
startService
in class AbstractSystemCommander
serviceName
- 服务名称public String stopService(String serviceName)
AbstractSystemCommander
stopService
in class AbstractSystemCommander
serviceName
- 服务名称public String buildKill(int pid)
AbstractSystemCommander
buildKill
in class AbstractSystemCommander
pid
- 进程编号Copyright © 2017–2022. All rights reserved.