Toggle navigation
Toggle navigation
This project
Loading...
Sign in
guizhou-monitorV2.0.1
/
agent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangmingm
8 years ago
Commit
4f916c8fb68c75ce382ca9e831462fee015f3188
1 parent
3ed9be2d
修改getSnmpState方法。
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
src/com/sitech/ismp/coll/centercoll/CollWindows.java
src/com/sitech/ismp/coll/centercoll/CollWindows.java
View file @
4f916c8
...
...
@@ -65,7 +65,7 @@ public class CollWindows implements CollWindowsMBean {
/**
* 获取连接状态
* 获取连接状态
,在进行连接之前,检查该设备是否能ping通,如果为down就不执行操作了。
* @param params
* @return
*/
...
...
@@ -73,30 +73,32 @@ public class CollWindows implements CollWindowsMBean {
public
Vector
<
TblATO_KPIDETAIL
>
getSnmpState
(
HashMap
<
String
,
String
>
params
){
Vector
<
TblATO_KPIDETAIL
>
v
=
new
Vector
<
TblATO_KPIDETAIL
>();
String
ip
=
params
.
get
(
"IP"
);
if
(!
StringUtils
.
isEmpty
(
ip
)){
String
kpiId
=
"FM-00-10-001-998"
;
// Windows 设备登录状态
ParamterBean
bean
=
new
ParamterBean
();
String
tempPort
=
params
.
get
(
"PORT"
);
String
community
=
params
.
get
(
"COMMUNITY"
);
int
port
=
Integer
.
parseInt
(
tempPort
);
String
hostName
=
params
.
get
(
"HOST_NAME"
);
log
.
info
(
"******ip "
+
ip
+
"**port "
+
tempPort
+
"****hostName "
+
hostName
+
"*****"
);
bean
.
setDEVICE_IP
(
ip
);
bean
.
setPROTOCOL_PORT
(
port
);
bean
.
setCOMMUNITY
(
community
);
String
state
=
server
.
getConnectionState4Snmp
(
bean
);
String
unitId
=
kbpClass
+
":"
+
hostName
+
"-total"
;
TblATO_KPIDETAIL
kpidetail
=
new
TblATO_KPIDETAIL
();
try
{
kpidetail
.
setKPI_ID
(
kpiId
);
kpidetail
.
setUNIT_ID
(
unitId
);
kpidetail
.
setKPI_VALUE
(
state
);
kpidetail
.
setCLL_TIME
(
new
Date
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
String
result
=
server
.
getPingResultByIp
(
ip
);
if
(!
StringUtils
.
isEmpty
(
result
)
&&
"UP"
.
equals
(
result
)){
String
kpiId
=
"FM-00-10-001-998"
;
// Windows 设备登录状态
ParamterBean
bean
=
new
ParamterBean
();
String
tempPort
=
params
.
get
(
"PORT"
);
String
community
=
params
.
get
(
"COMMUNITY"
);
int
port
=
Integer
.
parseInt
(
tempPort
);
String
hostName
=
params
.
get
(
"HOST_NAME"
);
log
.
info
(
"******ip "
+
ip
+
"**port "
+
tempPort
+
"****hostName "
+
hostName
+
"*****"
);
bean
.
setDEVICE_IP
(
ip
);
bean
.
setPROTOCOL_PORT
(
port
);
bean
.
setCOMMUNITY
(
community
);
String
state
=
server
.
getConnectionState4Snmp
(
bean
);
String
unitId
=
kbpClass
+
":"
+
hostName
+
"-total"
;
TblATO_KPIDETAIL
kpidetail
=
new
TblATO_KPIDETAIL
();
try
{
kpidetail
.
setKPI_ID
(
kpiId
);
kpidetail
.
setUNIT_ID
(
unitId
);
kpidetail
.
setKPI_VALUE
(
state
);
kpidetail
.
setCLL_TIME
(
new
Date
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
v
.
add
(
kpidetail
);
}
v
.
add
(
kpidetail
);
}
return
v
;
}
...
...
Please
register
or
login
to post a comment