Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jfV5fwqjk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
管理员
jfV5fwqjk
Commits
e33dd557
Commit
e33dd557
authored
Jul 06, 2018
by
liuyz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新监控服务
parent
4bca35ac
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
49 deletions
+89
-49
applicationContext-business.xml
...ent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
+3
-3
hostTab.js
WebContent/monitoring/pages/host/js/hostTab.js
+32
-11
warningTab.js
WebContent/monitoring/pages/warning/js/warningTab.js
+17
-2
quartz_service.properties
src/quartz_service.properties
+4
-3
HostBusinessImpl.java
src_monitoring/com/gaowj/business/host/HostBusinessImpl.java
+4
-4
TriggerBusinessImpl.java
...oring/com/gaowj/business/trigger/TriggerBusinessImpl.java
+22
-22
WarningBusinessImpl.java
...oring/com/gaowj/business/warning/WarningBusinessImpl.java
+2
-2
actAction.java
src_monitoring/com/gaowj/trigger/action/actAction.java
+2
-1
actAction.java
src_monitoring/com/gaowj/usergroup/action/actAction.java
+3
-1
No files found.
WebContent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
View file @
e33dd557
...
...
@@ -127,9 +127,9 @@
<!-- 增加数据源dataSource-zabbix -->
<bean
id=
"dataSource-zabbix"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
142
:3306/zabbix?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"
root
"
/>
<property
name=
"password"
value=
"
mysql_root_password
"
/>
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
204
:3306/zabbix?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"
zabbix
"
/>
<property
name=
"password"
value=
"
zabbix
"
/>
<property
name=
"driverClassName"
value=
"com.mysql.jdbc.Driver"
/>
<!-- 配置初始化大小、最小、最大 -->
...
...
WebContent/monitoring/pages/host/js/hostTab.js
View file @
e33dd557
...
...
@@ -61,37 +61,48 @@ var ls_title="服务器列表";
var
is_column
=
[
[
{
field
:
'NAME'
,
title
:
'主机名'
,
width
:
100
,
align
:
'center'
},
{
field
:
'DESCRIPTION'
,
title
:
'主机描述'
,
width
:
20
0
,
align
:
'center'
{
field
:
'DESCRIPTION'
,
title
:
'主机描述'
,
width
:
15
0
,
align
:
'center'
},
{
field
:
'IP'
,
title
:
'MAC/IP'
,
width
:
280
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
var
json
=
eval
(
'('
+
row
.
VALUE
+
')'
);
var
ips
=
json
.
ip
;
var
ipText
=
''
;
for
(
var
i
=
0
;
i
<
ips
.
length
;
i
++
){
var
ip
=
ips
[
i
];
if
(
ips
[
i
].
ip
!=
''
){
ipText
+=
ips
[
i
].
ifname
+
":"
+
ips
[
i
].
ip
;
ipText
+=
'
\
n'
;
}
// ipText = ipText.substring(0, ipText.lastIndexOf('\n'));
/*var ip=ips[i];
for(k in ip){
if(ipText!=''){
ipText+='\n';
}
ipText+=k+":"+ip[k];
}*/
}
}
ipText
=
ipText
.
substring
(
0
,
ipText
.
lastIndexOf
(
'
\
n'
));
return
ipText
;
}
},
{
field
:
'DISK'
,
title
:
'硬盘'
,
width
:
8
0
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
{
field
:
'DISK'
,
title
:
'硬盘'
,
width
:
12
0
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
var
json
=
eval
(
'('
+
row
.
VALUE
+
')'
);
var
disks
=
json
.
disk
;
var
text
=
''
;
for
(
var
i
=
0
;
i
<
disks
.
length
;
i
++
){
var
disk
=
disks
[
i
];
if
(
disks
[
i
].
size
!=
''
){
text
+=
disks
[
i
].
devicename
+
":"
+
disks
[
i
].
size
;
text
+=
'
\
n'
;
}
/*var disk=disks[i];
for(k in disk){
if(text!=''){
text+='\n';
}
text+=k+":"+disk[k];
}*/
}
}
text
=
text
.
substring
(
0
,
text
.
lastIndexOf
(
'
\
n'
));
return
text
;
}
},
...
...
@@ -103,7 +114,7 @@ var is_column = [ [
return
text
;
}
},
{
field
:
'MEMORY'
,
title
:
'内存'
,
width
:
8
0
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
{
field
:
'MEMORY'
,
title
:
'内存'
,
width
:
6
0
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
var
json
=
eval
(
'('
+
row
.
VALUE
+
')'
);
var
memory
=
json
.
memory
;
var
text
=
''
;
...
...
@@ -242,27 +253,37 @@ function updateUrlOnloadCallback(is_row){
var
disks
=
json
.
disk
;
var
diskText
=
''
;
for
(
var
i
=
0
;
i
<
disks
.
length
;
i
++
){
var
disk
=
disks
[
i
];
if
(
disks
[
i
].
size
!=
''
){
diskText
+=
disks
[
i
].
devicename
+
":"
+
disks
[
i
].
size
;
diskText
+=
','
;
}
/* var disk=disks[i];
for(k in disk){
if(diskText!=''){
diskText+=',';
}
diskText+=k+":"+disk[k];
}*/
}
}
diskText
=
diskText
.
substring
(
0
,
diskText
.
lastIndexOf
(
','
));
is_row
.
DISK_INFO
=
diskText
;
var
ips
=
json
.
ip
;
var
ipText
=
''
;
for
(
var
i
=
0
;
i
<
ips
.
length
;
i
++
){
var
ip
=
ips
[
i
];
if
(
ips
[
i
].
ip
!=
''
){
ipText
+=
ips
[
i
].
ifname
+
":"
+
ips
[
i
].
ip
;
ipText
+=
','
;
}
/*var ip=ips[i];
for(k in ip){
if(ipText!=''){
ipText+=',';
}
ipText+=k+":"+ip[k];
}*/
}
}
ipText
=
ipText
.
substring
(
0
,
ipText
.
lastIndexOf
(
','
));
is_row
.
IP_INFO
=
ipText
;
$
(
"#inputForm"
).
form
(
'load'
,
is_row
);
}
...
...
WebContent/monitoring/pages/warning/js/warningTab.js
View file @
e33dd557
...
...
@@ -39,6 +39,21 @@ function resetQueryData(){
var
v_value_data
=
[{
CODE_ID
:
'0'
,
CODE_NAME
:
'正常'
},{
CODE_ID
:
'1'
,
CODE_NAME
:
'问题'
}];
//加载主机列表
var
v_host_data
=
hostModule
.
data
.
listAll
().
rowSet
;
$
(
'#FIELD_VALUE'
).
combobox
({
data
:
v_value_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
$
(
'#FIELD_HOSTID'
).
combobox
({
data
:
v_host_data
,
valueField
:
'HOSTID'
,
textField
:
'NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
//加载是否提醒数据
var
v_status_data
=
[{
CODE_ID
:
'0'
,
CODE_NAME
:
'未发送'
},{
CODE_ID
:
'1'
,
CODE_NAME
:
'已发送'
}];
...
...
@@ -87,7 +102,7 @@ var is_column = [ [
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
$
(
'#FIELD_VALUE'
).
combobox
({
/*
$('#FIELD_VALUE').combobox({
data : v_value_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
...
...
@@ -101,7 +116,7 @@ function dataOnLoadSuccess(){
textField : 'NAME',
editable:false,
panelHeight:'auto'
});
});
*/
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
...
...
src/quartz_service.properties
View file @
e33dd557
...
...
@@ -6,8 +6,8 @@ userDefaultPass = 0000
uploadPath
=
c:/temp/
uploadMaxSize
=
10485760
#------------license----------------------------
licensenumber
=
A01000000
2
licensedsoftware
=
A04000000
2
licensenumber
=
A01000000
3
licensedsoftware
=
A04000000
7
licensemaccharset
=
gbk
licensemacshowcmd
=
false
licensemacadress
=
00-21-CC-C9-D2-29
...
...
@@ -21,4 +21,4 @@ downloadFilenameEncode1 = gbk
downloadFilenameEncode2
=
iso8859-1
#------------test_env----------------------
test_env
=
true
zabbixIp
=
http://192.168.1.204:8081/api_jsonrpc.php
\ No newline at end of file
src_monitoring/com/gaowj/business/host/HostBusinessImpl.java
View file @
e33dd557
...
...
@@ -46,7 +46,7 @@ public class HostBusinessImpl implements HostBusiness {
page
.
setCount
(
count
);
page
.
setItems
(
items
);
String
test_env
=
PropUtil
.
getValue
(
"test_env"
,
"quartz_service"
,
"false"
);
/*
String test_env = PropUtil.getValue("test_env", "quartz_service", "false");
if ("true".equals(test_env)) {
List<Map<String, Object>> listFake = new ArrayList<Map<String, Object>>() {
public boolean add(String hostName, String description, String info) {
...
...
@@ -79,10 +79,10 @@ public class HostBusinessImpl implements HostBusiness {
add("kqnhl server","管理kqnhl服务",makeInfo(getRandomIp(), new Random().nextInt(10) + 1 + ""));
add("yqhtk server","管理yqhtk服务",makeInfo(getRandomIp(), new Random().nextInt(10) + 1 + ""));
add("vnrvt server","管理vnrvt服务",makeInfo(getRandomIp(), new Random().nextInt(10) + 1 + ""));
/*
for (int i = 0; i <= 20; i++) {
for (int i = 0; i <= 20; i++) {
add(i + 100000, makeName() + " server",
makeInfo(getRandomIp(), new Random().nextInt(10) + 1 + ""));
}
*/
}
}
};
if (pageNo == 1 && items.size() < 20) {
...
...
@@ -96,7 +96,7 @@ public class HostBusinessImpl implements HostBusiness {
}
page.setCount(23);
}
}
}
*/
return
page
;
}
...
...
src_monitoring/com/gaowj/business/trigger/TriggerBusinessImpl.java
View file @
e33dd557
...
...
@@ -45,7 +45,7 @@ public class TriggerBusinessImpl implements TriggerBusiness {
page
.
setCount
(
count
);
page
.
setItems
(
items
);
String
test_env
=
PropUtil
.
getValue
(
"test_env"
,
"quartz_service"
,
"false"
);
/*
String test_env = PropUtil.getValue("test_env", "quartz_service", "false");
if("true".equals(test_env)){
List<Map<String, Object>> listFake = new ArrayList<Map<String, Object>>() {
public boolean add(int priority, String comments, String expression) {
...
...
@@ -58,26 +58,26 @@ public class TriggerBusinessImpl implements TriggerBusiness {
}
{
add
(
4
,
"使用空间监控"
,
"{
jfgitlab
:vfs.fs.size[/,used].last()}>1G"
);
add
(
4
,
"剩余使用空间监控"
,
"{
jfgitlab
:vfs.fs.size[/,free].last()}<800M"
);
add
(
1
,
"sda挂载盘io读取监控"
,
"{
jfgitlab
:disk.status[sda,rKBps].last()}>100"
);
add
(
1
,
"sda挂载盘io写入监控"
,
"{
jfgitlab
:disk.status[sda,wKBps].last()}>400"
);
add
(
2
,
"磁盘空间小于870M"
,
"{
jfgitlab
:vfs.fs.size[/boot,free].last()}<870M"
);
add
(
3
,
"剩余磁盘空间百分比监控"
,
"{
jfgitlab
:vfs.fs.size[/boot,pfree].last()}<20%"
);
add
(
4
,
"可用内存监控"
,
"{
jfgitlab
:vm.memory.size[available].last()}>70"
);
add
(
1
,
"v
eth30b22dd输出流量监控"
,
"{jfgitlab:net.if.out[veth30b22dd
].last()}>400000"
);
add
(
1
,
"v
eth30b22dd输入流量监控"
,
"{jfgitlab:net.if.in[veth30b22dd
].last()}>700000"
);
add
(
1
,
"e
ns33输出流量监控"
,
"{jfgitlab:net.if.out[ens3
3].last()}>500000"
);
add
(
1
,
"sda挂载盘io读取监控"
,
"{
jfgitlab
:disk.status[sda,rKBps].last()}>200"
);
add
(
1
,
"sda挂载盘io写入监控"
,
"{
jfgitlab
:disk.status[sda,wKBps].last()}>500"
);
add
(
2
,
"磁盘空间小于950M"
,
"{
jfgitlab
:vfs.fs.size[/boot,free].last()}<950M"
);
add
(
1
,
"
veth399f0a6输出流量监控"
,
"{jfgitlab:net.if.out[veth399f0a6
].last()}>400000"
);
add
(
1
,
"
veth399f0a6输入流量监控"
,
"{jfgitlab:net.if.in[veth399f0a6
].last()}>700000"
);
add
(
3
,
"磁盘使用空间大于200M"
,
"{
jfgitlab
:vfs.fs.size[/boot,total].last()}>200M"
);
add
(
1
,
"
br-035628d874f9输出流量监控"
,
"{jfgitlab
:net.if.out[br-035628d874f9].last()}>700000"
);
add
(
1
,
"
br-035628d874f9输入流量监控"
,
"{jfgitlab
:net.if.in[br-035628d874f9].last()}>700000"
);
add
(
1
,
"
docker0输入流量监控"
,
"{jfgitlab:net.if.in[docker
0].last()}>500000"
);
add
(
1
,
"
docker0输出流量监控"
,
"{jfgitlab:net.if.out[docker
0].last()}>500000"
);
add(4,"使用空间监控","{
192.168.1.201
:vfs.fs.size[/,used].last()}>1G");
add(4,"剩余使用空间监控","{
192.168.1.202
:vfs.fs.size[/,free].last()}<800M");
add(1,"sda挂载盘io读取监控","{
192.168.1.203
:disk.status[sda,rKBps].last()}>100");
add(1,"sda挂载盘io写入监控","{
192.168.1.203
:disk.status[sda,wKBps].last()}>400");
add(2,"磁盘空间小于870M","{
192.168.1.204
:vfs.fs.size[/boot,free].last()}<870M");
add(3,"剩余磁盘空间百分比监控","{
192.168.1.204
:vfs.fs.size[/boot,pfree].last()}<20%");
add(4,"可用内存监控","{
192.168.1.211
:vm.memory.size[available].last()}>70");
add(1,"v
net2输出流量监控","{192.168.1.211:net.if.out[vnet2
].last()}>400000");
add(1,"v
net2输入流量监控","{192.168.1.211:net.if.in[vnet2
].last()}>700000");
add(1,"e
m3输出流量监控","{192.168.1.212:net.if.out[em
3].last()}>500000");
add(1,"sda挂载盘io读取监控","{
192.168.1.212
:disk.status[sda,rKBps].last()}>200");
add(1,"sda挂载盘io写入监控","{
192.168.1.212
:disk.status[sda,wKBps].last()}>500");
add(2,"磁盘空间小于950M","{
192.168.1.213
:vfs.fs.size[/boot,free].last()}<950M");
add(1,"
eth0输出流量监控","{192.168.1.213:net.if.out[eth0
].last()}>400000");
add(1,"
eth0输入流量监控","{192.168.1.213:net.if.in[eth0
].last()}>700000");
add(3,"磁盘使用空间大于200M","{
192.168.1.213
:vfs.fs.size[/boot,total].last()}>200M");
add(1,"
eth0输出流量监控","{192.168.1.232
:net.if.out[br-035628d874f9].last()}>700000");
add(1,"
eth0输入流量监控","{192.168.1.232
:net.if.in[br-035628d874f9].last()}>700000");
add(1,"
eth0输入流量监控","{192.168.1.250:net.if.in[eth
0].last()}>500000");
add(1,"
eth0输出流量监控","{192.168.1.250:net.if.out[eth
0].last()}>500000");
}
};
...
...
@@ -94,7 +94,7 @@ public class TriggerBusinessImpl implements TriggerBusiness {
page.setCount(25);
}
}
}
}
*/
return
page
;
}
...
...
src_monitoring/com/gaowj/business/warning/WarningBusinessImpl.java
View file @
e33dd557
...
...
@@ -43,7 +43,7 @@ public class WarningBusinessImpl implements WarningBusiness{
page
.
setCount
(
count
);
page
.
setItems
(
items
);
String
test_env
=
PropUtil
.
getValue
(
"test_env"
,
"quartz_service"
,
"false"
);
/*
String test_env = PropUtil.getValue("test_env", "quartz_service", "false");
if("true".equals(test_env)){
List<Map<String, Object>> listFake = new ArrayList<Map<String, Object>>() {
public boolean add(String name, String host_description,String description, int value,String clock,int status) {
...
...
@@ -88,7 +88,7 @@ public class WarningBusinessImpl implements WarningBusiness{
}
page.setCount(22);
}
}
}
*/
return
page
;
}
...
...
src_monitoring/com/gaowj/trigger/action/actAction.java
View file @
e33dd557
...
...
@@ -13,6 +13,7 @@ import com.gaowj.business.UsergroupBusiness;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.PropUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.Status
;
import
com.zabbix4j.ZabbixApi
;
...
...
@@ -55,7 +56,7 @@ public class actAction extends BasicAction {
private
static
ZabbixApi
zabbixApi
;
static
{
String
url
=
"http://192.168.1.142/api_jsonrpc.php"
;
String
url
=
PropUtil
.
getValue
(
"zabbixIp"
,
"quartz_service"
,
"false"
)
;
zabbixApi
=
new
ZabbixApi
(
url
);
try
{
...
...
src_monitoring/com/gaowj/usergroup/action/actAction.java
View file @
e33dd557
...
...
@@ -6,6 +6,7 @@ import java.util.Map;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.PropUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.Status
;
import
com.zabbix4j.ZabbixApi
;
...
...
@@ -36,7 +37,8 @@ public class actAction extends BasicAction {
private
static
ZabbixApi
zabbixApi
;
static
{
String
url
=
"http://192.168.1.142/api_jsonrpc.php"
;
String
url
=
PropUtil
.
getValue
(
"zabbixIp"
,
"quartz_service"
,
"false"
);
//String url = "http://192.168.1.142/api_jsonrpc.php";
zabbixApi
=
new
ZabbixApi
(
url
);
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment