服务器监控平台的设计与实现

详细功能需求描述:

监控系统需要能够自动采集windows服务器的实时状态数据,并能将这些状态信息分析,归类,存储,并按照要求呈现出来。同时,在数据异常的情况下通过邮件方式通知。

(1)数据采集功能

通过一个客户端,负责收集并整理服务器性能以及运行状态数据,并将分析好的数据存入数据库汇总,为服务器的有效监控提供底层数据依据。在服务器运行过程中,数据采集模块将会每隔单位时间对服务器运行状态进行一次数据采集,单位时间为一秒。然后数据采集模块将对采集到的数据进行分析,汇总并且进行数据封装,最后将封装完的数据存入对应数据库中,为其他的功能模块提供有效的数据基础。

(2)监控数据可视化

数据监控可视化提供可视化页面,将数据实时传递给用户。

1.设置监控功能

 设备监控主要负责向用户展现一台或几台设备的运行状态。主要包括windows服务器的cup使用率,内存占用率,各个磁盘的空间,,端口等运行情况。

2.网络监控功能

网络监控,能向用户展示服务器所处的网络环境。能不能访问,是否有延时,以及丢包。

3.登陆验证功能

通过登陆验证功能,用户可以获取系统的使用权限。

(3)报警功能

1.报警信息功能

 报警信息系统功能负责根据报警级别分别统计windows服务器的报警信息,并将报警信息以可视化形式展示给用户,同时,按照报警级别的不同进行,分为灾难,严重,警报三个级别将统计结果以柱状图的方式展示到页面上。报警详细信息查询为用户提供报警的详细信息,包括报警名称,报警时间,报警类型,报警原因,报警级别等信息。通过查询报警详细信息功能,用户可以对监控系统的报警情况一目了然。

2.报警配置功能

通过报警规则配置,设置网络监控和设备监控相关数据的报警范围,报警阈值,报警频率和报警时间段。

3.报警功能

当系统根据用户配置的报警规则发现某一监控项数据异常,则系统触发报警功能,根据用配置的报警规则将报警信息通过邮件方式发送到相应的邮箱,使邮件接收者发现并处理问题。

服务器监控平台的设计与实现登录注册界面

服务器监控平台的设计与实现mysql数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '超级管理员账号',
	password varchar(100) comment '超级管理员密码'
) comment '超级管理员';
insert into t_admin(username,password) values('admin','123456');

用户表创建语句如下:


create table t_customer(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '账号',
	password varchar(100) comment '密码 ',
	customerName varchar(100) comment '姓名',
	age varchar(100) comment '年龄',
	sex varchar(100) comment '性别',
	phone varchar(100) comment '电话',
	pic varchar(100) comment '头像'
) comment '用户';

告警表创建语句如下:


create table t_gj(
	id int primary key auto_increment comment '主键',
	gjName varchar(100) comment '告警名称',
	gjlx varchar(100) comment '告警类型',
	jb varchar(100) comment '级别',
	gjyy varchar(100) comment '告警原因',
	insertDate datetime comment '告警时间',
	ipaddress varchar(100) comment ''
) comment '告警';

告警阈值表创建语句如下:


create table t_gjpz(
	id int primary key auto_increment comment '主键',
	gjlx varchar(100) comment '告警类型',
	z1 int comment '灾难',
	z2 int comment '严重',
	z3 int comment '警报'
) comment '告警阈值';

监控数据表创建语句如下:


create table t_message(
	id int primary key auto_increment comment '主键',
	v1 int comment 'cpu使用率',
	v2 int comment '内存使用率',
	v3 int comment 'c盘使用率',
	v4 int comment '丢包数',
	v5 int comment '接收数',
	v6 int comment '发送数',
	insertDate datetime comment '日期',
	ipaddress varchar(100) comment ''
) comment '监控数据';

服务器监控平台的设计与实现oracle数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id integer,
	username varchar(100),
	password varchar(100)
);
insert into t_admin(id,username,password) values(1,'admin','123456');
--超级管理员字段加注释
comment on column t_admin.id is '主键';
comment on column t_admin.username is '超级管理员账号';
comment on column t_admin.password is '超级管理员密码';
--超级管理员表加注释
comment on table t_admin is '超级管理员';

用户表创建语句如下:


create table t_customer(
	id integer,
	username varchar(100),
	password varchar(100),
	customerName varchar(100),
	age varchar(100),
	sex varchar(100),
	phone varchar(100),
	pic varchar(100)
);
--用户字段加注释
comment on column t_customer.id is '主键';
comment on column t_customer.username is '账号';
comment on column t_customer.password is '密码 ';
comment on column t_customer.customerName is '姓名';
comment on column t_customer.age is '年龄';
comment on column t_customer.sex is '性别';
comment on column t_customer.phone is '电话';
comment on column t_customer.pic is '头像';
--用户表加注释
comment on table t_customer is '用户';

告警表创建语句如下:


create table t_gj(
	id integer,
	gjName varchar(100),
	gjlx varchar(100),
	jb varchar(100),
	gjyy varchar(100),
	insertDate datetime,
	ipaddress varchar(100)
);
--告警字段加注释
comment on column t_gj.id is '主键';
comment on column t_gj.gjName is '告警名称';
comment on column t_gj.gjlx is '告警类型';
comment on column t_gj.jb is '级别';
comment on column t_gj.gjyy is '告警原因';
comment on column t_gj.insertDate is '告警时间';
comment on column t_gj.ipaddress is '';
--告警表加注释
comment on table t_gj is '告警';

告警阈值表创建语句如下:


create table t_gjpz(
	id integer,
	gjlx varchar(100),
	z1 int,
	z2 int,
	z3 int
);
--告警阈值字段加注释
comment on column t_gjpz.id is '主键';
comment on column t_gjpz.gjlx is '告警类型';
comment on column t_gjpz.z1 is '灾难';
comment on column t_gjpz.z2 is '严重';
comment on column t_gjpz.z3 is '警报';
--告警阈值表加注释
comment on table t_gjpz is '告警阈值';

监控数据表创建语句如下:


create table t_message(
	id integer,
	v1 int,
	v2 int,
	v3 int,
	v4 int,
	v5 int,
	v6 int,
	insertDate datetime,
	ipaddress varchar(100)
);
--监控数据字段加注释
comment on column t_message.id is '主键';
comment on column t_message.v1 is 'cpu使用率';
comment on column t_message.v2 is '内存使用率';
comment on column t_message.v3 is 'c盘使用率';
comment on column t_message.v4 is '丢包数';
comment on column t_message.v5 is '接收数';
comment on column t_message.v6 is '发送数';
comment on column t_message.insertDate is '日期';
comment on column t_message.ipaddress is '';
--监控数据表加注释
comment on table t_message is '监控数据';

oracle特有,对应序列如下:


create sequence s_t_customer;
create sequence s_t_gj;
create sequence s_t_gjpz;
create sequence s_t_message;

服务器监控平台的设计与实现sqlserver数据库版本源码:

超级管理员表创建语句如下:


--超级管理员
create table t_admin(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--超级管理员账号
	password varchar(100)--超级管理员密码
);
insert into t_admin(username,password) values('admin','123456');

用户表创建语句如下:


--用户表注释
create table t_customer(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--账号
	password varchar(100),--密码 
	customerName varchar(100),--姓名
	age varchar(100),--年龄
	sex varchar(100),--性别
	phone varchar(100),--电话
	pic varchar(100)--头像
);

告警表创建语句如下:


--告警表注释
create table t_gj(
	id int identity(1,1) primary key not null,--主键
	gjName varchar(100),--告警名称
	gjlx varchar(100),--告警类型
	jb varchar(100),--级别
	gjyy varchar(100),--告警原因
	insertDate datetime,--告警时间
	ipaddress varchar(100)--
);

告警阈值表创建语句如下:


--告警阈值表注释
create table t_gjpz(
	id int identity(1,1) primary key not null,--主键
	gjlx varchar(100),--告警类型
	z1 int,--灾难
	z2 int,--严重
	z3 int--警报
);

监控数据表创建语句如下:


--监控数据表注释
create table t_message(
	id int identity(1,1) primary key not null,--主键
	v1 int,--cpu使用率
	v2 int,--内存使用率
	v3 int,--c盘使用率
	v4 int,--丢包数
	v5 int,--接收数
	v6 int,--发送数
	insertDate datetime,--日期
	ipaddress varchar(100)--
);

服务器监控平台的设计与实现登录后主页

服务器监控平台的设计与实现spring+springMVC+hibernate框架对象(javaBean,pojo)设计:

用户javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//用户
@Table(name = "t_customer")
public class Customer {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码 
private String password;
//姓名
private String customerName;
//年龄
private String age;
//性别
private String sex;
//电话
private String phone;
//头像
private String pic;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
}

告警javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//告警
@Table(name = "t_gj")
public class Gj {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//告警名称
private String gjName;
//告警类型
private String gjlx;
//级别
private String jb;
//告警原因
private String gjyy;
//告警时间
private Date insertDate;
//
private String ipaddress;
public String getGjName() {return gjName;}
public void setGjName(String gjName) {this.gjName = gjName;}
public String getGjlx() {return gjlx;}
public void setGjlx(String gjlx) {this.gjlx = gjlx;}
public String getJb() {return jb;}
public void setJb(String jb) {this.jb = jb;}
public String getGjyy() {return gjyy;}
public void setGjyy(String gjyy) {this.gjyy = gjyy;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
public String getIpaddress() {return ipaddress;}
public void setIpaddress(String ipaddress) {this.ipaddress = ipaddress;}
}

告警阈值javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//告警阈值
@Table(name = "t_gjpz")
public class Gjpz {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//告警类型
private String gjlx;
//灾难
private Integer z1;
//严重
private Integer z2;
//警报
private Integer z3;
public String getGjlx() {return gjlx;}
public void setGjlx(String gjlx) {this.gjlx = gjlx;}
public Integer getZ1() {return z1;}
public void setZ1(Integer z1) {this.z1 = z1;}
public Integer getZ2() {return z2;}
public void setZ2(Integer z2) {this.z2 = z2;}
public Integer getZ3() {return z3;}
public void setZ3(Integer z3) {this.z3 = z3;}
}

监控数据javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//监控数据
@Table(name = "t_message")
public class Message {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//cpu使用率
private Integer v1;
//内存使用率
private Integer v2;
//c盘使用率
private Integer v3;
//丢包数
private Integer v4;
//接收数
private Integer v5;
//发送数
private Integer v6;
//日期
private Date insertDate;
//
private String ipaddress;
public Integer getV1() {return v1;}
public void setV1(Integer v1) {this.v1 = v1;}
public Integer getV2() {return v2;}
public void setV2(Integer v2) {this.v2 = v2;}
public Integer getV3() {return v3;}
public void setV3(Integer v3) {this.v3 = v3;}
public Integer getV4() {return v4;}
public void setV4(Integer v4) {this.v4 = v4;}
public Integer getV5() {return v5;}
public void setV5(Integer v5) {this.v5 = v5;}
public Integer getV6() {return v6;}
public void setV6(Integer v6) {this.v6 = v6;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
public String getIpaddress() {return ipaddress;}
public void setIpaddress(String ipaddress) {this.ipaddress = ipaddress;}
}

服务器监控平台的设计与实现spring+springMVC+mybatis框架对象(javaBean,pojo)设计:

用户javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//用户
public class Customer  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码 
private String password;
//姓名
private String customerName;
//年龄
private String age;
//性别
private String sex;
//电话
private String phone;
//头像
private String pic;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
}

告警javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//告警
public class Gj  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//告警名称
private String gjName;
//告警类型
private String gjlx;
//级别
private String jb;
//告警原因
private String gjyy;
//告警时间
private Date insertDate;
//
private String ipaddress;
public String getGjName() {return gjName;}
public void setGjName(String gjName) {this.gjName = gjName;}
public String getGjlx() {return gjlx;}
public void setGjlx(String gjlx) {this.gjlx = gjlx;}
public String getJb() {return jb;}
public void setJb(String jb) {this.jb = jb;}
public String getGjyy() {return gjyy;}
public void setGjyy(String gjyy) {this.gjyy = gjyy;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
public String getIpaddress() {return ipaddress;}
public void setIpaddress(String ipaddress) {this.ipaddress = ipaddress;}
}

告警阈值javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//告警阈值
public class Gjpz  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//告警类型
private String gjlx;
//灾难
private Integer z1;
//严重
private Integer z2;
//警报
private Integer z3;
public String getGjlx() {return gjlx;}
public void setGjlx(String gjlx) {this.gjlx = gjlx;}
public Integer getZ1() {return z1;}
public void setZ1(Integer z1) {this.z1 = z1;}
public Integer getZ2() {return z2;}
public void setZ2(Integer z2) {this.z2 = z2;}
public Integer getZ3() {return z3;}
public void setZ3(Integer z3) {this.z3 = z3;}
}

监控数据javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//监控数据
public class Message  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//cpu使用率
private Integer v1;
//内存使用率
private Integer v2;
//c盘使用率
private Integer v3;
//丢包数
private Integer v4;
//接收数
private Integer v5;
//发送数
private Integer v6;
//日期
private Date insertDate;
//
private String ipaddress;
public Integer getV1() {return v1;}
public void setV1(Integer v1) {this.v1 = v1;}
public Integer getV2() {return v2;}
public void setV2(Integer v2) {this.v2 = v2;}
public Integer getV3() {return v3;}
public void setV3(Integer v3) {this.v3 = v3;}
public Integer getV4() {return v4;}
public void setV4(Integer v4) {this.v4 = v4;}
public Integer getV5() {return v5;}
public void setV5(Integer v5) {this.v5 = v5;}
public Integer getV6() {return v6;}
public void setV6(Integer v6) {this.v6 = v6;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
public String getIpaddress() {return ipaddress;}
public void setIpaddress(String ipaddress) {this.ipaddress = ipaddress;}
}

源代码下载点这里

评论