【monitor】新增monitor运维模块

pull/3/head
fengshuonan 2021-01-31 22:38:29 +08:00
parent 040336006c
commit 7bcf1d729e
16 changed files with 272 additions and 24 deletions

View File

@ -0,0 +1 @@
系统监控模块

View File

@ -0,0 +1 @@
监控模块的api

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-o-monitor</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>monitor-api</artifactId>
<packaging>jar</packaging>
<dependencies>
</dependencies>
</project>

View File

@ -0,0 +1,21 @@
package cn.stylefeng.roses.kernel.monitor.api.constants;
/**
*
*
* @author fengshuonan
* @date 2021/1/31 22:33
*/
public interface MonitorConstants {
/**
*
*/
String MONITOR_MODULE_NAME = "kernel-o-monitor";
/**
*
*/
String MONITOR_EXCEPTION_STEP_CODE = "27";
}

View File

@ -0,0 +1,19 @@
package cn.stylefeng.roses.kernel.monitor.api.exception;
import cn.stylefeng.roses.kernel.monitor.api.constants.MonitorConstants;
import cn.stylefeng.roses.kernel.rule.abstracts.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
/**
*
*
* @author fengshuonan
* @date 2021/1/31 22:35
*/
public class MonitorException extends ServiceException {
public MonitorException(AbstractExceptionEnum exception) {
super(MonitorConstants.MONITOR_MODULE_NAME, exception);
}
}

View File

@ -0,0 +1,37 @@
package cn.stylefeng.roses.kernel.monitor.api.exception.enums;
import cn.stylefeng.roses.kernel.monitor.api.constants.MonitorConstants;
import cn.stylefeng.roses.kernel.rule.abstracts.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import lombok.Getter;
/**
*
*
* @author fengshuonan
* @date 2021/1/31 22:35
*/
@Getter
public enum MonitorExceptionEnum implements AbstractExceptionEnum {
/**
*
*/
DEMO_OPERATE(RuleConstants.BUSINESS_ERROR_TYPE_CODE + MonitorConstants.MONITOR_EXCEPTION_STEP_CODE + "01", "演示环境无法操作!");
/**
*
*/
private final String errorCode;
/**
*
*/
private final String userTip;
MonitorExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}

View File

@ -0,0 +1 @@
监控模块的业务

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-o-monitor</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>monitor-business</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--监控模块的的api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>monitor-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1 @@
监控模块之系统信息监控,硬件,内存空间,磁盘容量等

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-o-monitor</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>monitor-sdk-system-info</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--监控模块的的api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>monitor-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1 @@
监控模块的自动配置

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-o-monitor</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>monitor-spring-boot-starter</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--监控模块的业务-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>monitor-business</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,15 @@
package cn.stylefeng.roses.kernel.monitor.starter;
import org.springframework.context.annotation.Configuration;
/**
*
*
* @author fengshuonan
* @date 2021/1/31 22:37
*/
@Configuration
public class GunsMonitorAutoConfiguration {
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.stylefeng.roses.kernel.monitor.starter.GunsMonitorAutoConfiguration

36
kernel-o-monitor/pom.xml Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>roses-kernel</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>kernel-o-monitor</artifactId>
<packaging>pom</packaging>
<modules>
<module>monitor-api</module>
<module>monitor-business</module>
<module>monitor-sdk-system-info</module>
<module>monitor-spring-boot-starter</module>
</modules>
<dependencies>
<!-- 开发规则 -->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-a-rule</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

52
pom.xml
View File

@ -22,26 +22,20 @@
<!--规则模块,开发规则-->
<module>kernel-a-rule</module>
<!--dao框架-->
<module>kernel-d-db</module>
<!--认证和鉴权模块-->
<module>kernel-d-auth</module>
<!--缓存模块-->
<module>kernel-d-cache</module>
<!--系统配置表-->
<module>kernel-d-config</module>
<!--参数校验模块-->
<module>kernel-d-validator</module>
<!--dao框架-->
<module>kernel-d-db</module>
<!--wrapper包装模块-->
<module>kernel-d-wrapper</module>
<!--jwt模块用于token校验-->
<module>kernel-d-jwt</module>
<!--缓存模块-->
<module>kernel-d-cache</module>
<!--多数据源模块-->
<module>kernel-d-ds-container</module>
<!--邮件发送模块-->
<module>kernel-d-email</module>
@ -55,27 +49,36 @@
<!--文件操作模块-->
<module>kernel-d-i18n</module>
<!--sms模块-->
<module>kernel-d-sms</module>
<!--定时任务模块-->
<module>kernel-d-timer</module>
<!--jwt模块用于token校验-->
<module>kernel-d-jwt</module>
<!--日志记录模块-->
<module>kernel-d-log</module>
<!--多数据源模块-->
<module>kernel-d-ds-container</module>
<!--资源扫描模块-->
<module>kernel-d-scanner</module>
<!--office模块-->
<module>kernel-d-office</module>
<!--拼音工具模块-->
<module>kernel-d-pinyin</module>
<!--资源扫描模块-->
<module>kernel-d-scanner</module>
<!--sms模块-->
<module>kernel-d-sms</module>
<!--定时任务模块-->
<module>kernel-d-timer</module>
<!--参数校验模块-->
<module>kernel-d-validator</module>
<!--wrapper包装模块-->
<module>kernel-d-wrapper</module>
<!--系统监控模块-->
<module>kernel-o-monitor</module>
<!--演示环境-->
<module>kernel-s-demo</module>
@ -87,6 +90,7 @@
<!--系统管理基础业务-->
<module>kernel-s-system</module>
</modules>
<properties>