Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
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
陶腾飞
AD-Control-Golang
Commits
3e334cfd
Commit
3e334cfd
authored
Apr 14, 2022
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/04/11 v2.3.2
parent
1c3dee1f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
12 deletions
+32
-12
README.MD
+1
-0
adct/adct.go
+5
-8
public/env.go
+1
-1
public/msg_deal.go
+6
-0
public/win.go
+19
-1
public/wxmsg.go
+0
-2
No files found.
README.MD
View file @
3e334cfd
...
@@ -93,6 +93,7 @@
...
@@ -93,6 +93,7 @@
-
2022/04/09 v2.2.5 修复IP地址、MAC地址获取失败的问题,添加cmdb信息更新时间字段,优化log日志,开机时将确定主机位置,修复DDR4的判断超过速率字段出现的场景导致无法判断DDR4的问题,小工具菜单名优化,远程唤醒优化
-
2022/04/09 v2.2.5 修复IP地址、MAC地址获取失败的问题,添加cmdb信息更新时间字段,优化log日志,开机时将确定主机位置,修复DDR4的判断超过速率字段出现的场景导致无法判断DDR4的问题,小工具菜单名优化,远程唤醒优化
-
2022/04/11 v2.3.0 添加无用户登录时的工位活动检测
-
2022/04/11 v2.3.0 添加无用户登录时的工位活动检测
-
2022/04/11 v2.3.1 修复运行时无法检测环境变量问题
-
2022/04/11 v2.3.1 修复运行时无法检测环境变量问题
-
2022/04/11 v2.3.2 添加对用户注销、登录时log记录与转发
## 四、其他说明
## 四、其他说明
...
...
adct/adct.go
View file @
3e334cfd
...
@@ -121,6 +121,11 @@ func flag_report(s string) {
...
@@ -121,6 +121,11 @@ func flag_report(s string) {
LOG
(
ERROR
,
s
,
err
.
Error
())
LOG
(
ERROR
,
s
,
err
.
Error
())
os
.
Exit
(
-
1
)
os
.
Exit
(
-
1
)
}
}
case
pub
.
Msg_Report_WillLogInUser
:
d
=
[]
byte
(
pub
.
User_name_display
)
case
pub
.
Msg_Report_LogOutUser
:
d
=
[]
byte
(
pub
.
User_name_display
)
}
}
pub
.
SendADMsg
(
pub
.
Msg_Report
,
pub
.
GJreportString
(
s
,
string
(
d
)))
pub
.
SendADMsg
(
pub
.
Msg_Report
,
pub
.
GJreportString
(
s
,
string
(
d
)))
}
}
...
@@ -134,15 +139,7 @@ func hour() {
...
@@ -134,15 +139,7 @@ func hour() {
}
}
}
}
func
hourUserActivitydetection
()
{
func
hourUserActivitydetection
()
{
// r2, err := pub.Execcmd_waitOutput("cmd /c query user")
// if err != nil {
// fmt.Printf("err %v\n", err)
// }
// fmt.Printf("return %s\n", string(r2))
// r := pub.Execcmd_outputIgnoreError("cmd /c query user")
// if len(r) == 0 {
pub
.
SendADMsg
(
pub
.
Msg_Exec
,
pub
.
GJexec
(
pub
.
Msg_Exec_UserActivitydetection
,
"0"
))
pub
.
SendADMsg
(
pub
.
Msg_Exec
,
pub
.
GJexec
(
pub
.
Msg_Exec_UserActivitydetection
,
"0"
))
// }
}
}
//直接指定mac地址,不带主机名参数
//直接指定mac地址,不带主机名参数
...
...
public/env.go
View file @
3e334cfd
...
@@ -11,7 +11,7 @@ const SymbolHostname = "-"
...
@@ -11,7 +11,7 @@ const SymbolHostname = "-"
// AD-Control //
// AD-Control //
const
Version
string
=
"2.3.
1
"
const
Version
string
=
"2.3.
2
"
const
Host_adserver
string
=
"ADSERVER"
const
Host_adserver
string
=
"ADSERVER"
const
Host_adserver_ip
string
=
"192.168.0.20"
const
Host_adserver_ip
string
=
"192.168.0.20"
const
Host_thserver
string
=
"THSERVER"
const
Host_thserver
string
=
"THSERVER"
...
...
public/msg_deal.go
View file @
3e334cfd
...
@@ -106,7 +106,13 @@ func (rep *MJreport) MsgDeal() interface{} {
...
@@ -106,7 +106,13 @@ func (rep *MJreport) MsgDeal() interface{} {
}
}
case
Msg_Report_WillLogInUser
:
case
Msg_Report_WillLogInUser
:
l
:=
fmt
.
Sprintf
(
"登陆 %s 在 %s"
,
rep
.
DataStr
,
rep
.
Computername
)
LOG
(
INFO
,
"REP_LOGIN"
,
l
)
SendWxworkTextToAdmins
(
l
)
case
Msg_Report_WillLogOutUser
:
case
Msg_Report_WillLogOutUser
:
l
:=
fmt
.
Sprintf
(
"注销 %s 在 %s"
,
rep
.
DataStr
,
rep
.
Computername
)
LOG
(
INFO
,
"REP_LOGOUT"
,
l
)
SendWxworkTextToAdmins
(
l
)
// 更新主要计算机
// 更新主要计算机
case
Msg_Report_UpdatePrimaryHost
:
case
Msg_Report_UpdatePrimaryHost
:
...
...
public/win.go
View file @
3e334cfd
...
@@ -60,6 +60,24 @@ func execcmd_base(cmdargs string) (string, []string, error) {
...
@@ -60,6 +60,24 @@ func execcmd_base(cmdargs string) (string, []string, error) {
LOG
(
INFO
,
"CMD"
,
cmdargs
)
LOG
(
INFO
,
"CMD"
,
cmdargs
)
return
app
,
appargs
,
nil
return
app
,
appargs
,
nil
}
}
func
execcmd_base_nolog
(
cmdargs
string
)
(
string
,
[]
string
,
error
)
{
if
cmdargs
==
""
{
return
""
,
nil
,
Error_Null_Command
}
var
app
string
var
appargs
[]
string
spaceindex
:=
strings
.
Index
(
cmdargs
,
" "
)
if
spaceindex
!=
-
1
{
app
=
cmdargs
[
:
spaceindex
]
appargs
=
strings
.
Split
(
cmdargs
[
spaceindex
+
1
:
],
" "
)
}
else
{
app
=
cmdargs
appargs
[
0
]
=
""
}
return
app
,
appargs
,
nil
}
func
Execcmd_nowait
(
cmdargs
string
)
error
{
func
Execcmd_nowait
(
cmdargs
string
)
error
{
app
,
appargs
,
err
:=
execcmd_base
(
cmdargs
)
app
,
appargs
,
err
:=
execcmd_base
(
cmdargs
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -122,7 +140,7 @@ func Execcmd_output(cmdargs string) []byte {
...
@@ -122,7 +140,7 @@ func Execcmd_output(cmdargs string) []byte {
return
nil
return
nil
}
}
func
Execcmd_outputIgnoreError
(
cmdargs
string
)
[]
byte
{
func
Execcmd_outputIgnoreError
(
cmdargs
string
)
[]
byte
{
app
,
appargs
,
_
:=
execcmd_base
(
cmdargs
)
app
,
appargs
,
_
:=
execcmd_base
_nolog
(
cmdargs
)
out
,
_
:=
exec
.
Command
(
app
,
appargs
...
)
.
CombinedOutput
()
out
,
_
:=
exec
.
Command
(
app
,
appargs
...
)
.
CombinedOutput
()
outchinese
,
_
:=
simplifiedchinese
.
GBK
.
NewDecoder
()
.
Bytes
(
out
)
outchinese
,
_
:=
simplifiedchinese
.
GBK
.
NewDecoder
()
.
Bytes
(
out
)
...
...
public/wxmsg.go
View file @
3e334cfd
...
@@ -133,8 +133,6 @@ func GetWXWorkToken() (string, error) {
...
@@ -133,8 +133,6 @@ func GetWXWorkToken() (string, error) {
if
wt
.
Errcode
==
0
{
if
wt
.
Errcode
==
0
{
return
wt
.
Access_token
,
nil
return
wt
.
Access_token
,
nil
}
else
{
}
else
{
LOG
(
ERROR
,
NULL
,
err
)
return
""
,
Error_Fail_File_Write
return
""
,
Error_Fail_File_Write
}
}
}
}
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