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
05323361
Commit
05323361
authored
Apr 15, 2024
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除郑州信息,添加阿波罗组信息
parent
1502af8b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
41 deletions
+27
-41
public/cmdbjson.go
+19
-17
public/dept.go
+7
-11
public/msg_deal.go
+0
-11
public/send.go
+0
-2
public/user.go
+1
-0
No files found.
public/cmdbjson.go
View file @
05323361
...
...
@@ -13,7 +13,6 @@ const Cmdb_Mac string = "Mac"
const
Cmdb_Position
string
=
"Position"
const
Cmdb_Position_7
string
=
"7"
const
Cmdb_Position_12
string
=
"12"
const
Cmdb_Position_zhengzhou
string
=
"zhengzhou"
const
Cmdb_Ip
string
=
"ip"
type
CIRecordReq
struct
{
...
...
@@ -136,42 +135,45 @@ func (cir *CIRecordStartup) GetHardWare() {
wg
.
Wait
()
}
func
GetCMDBPosition
(
location
,
dept
string
)
string
{
const
cmdbPosition1
string
=
"7"
const
cmdbPosition2
string
=
"12"
const
cmdbPosition3
string
=
"zhengzhou"
const
cmdbPosition7
string
=
"7"
const
cmdbPosition12
string
=
"12"
var
resutlt
string
switch
location
{
case
"NB"
:
switch
dept
{
case
"JL"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"ZJ"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"MT"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"DD"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"JR"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"TXHD"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"TXWJ"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"JS"
:
resutlt
=
cmdbPosition2
resutlt
=
cmdbPosition
1
2
case
"DY"
:
resutlt
=
cmdbPosition7
case
"BD"
:
resutlt
=
cmdbPosition7
case
"ABL"
:
resutlt
=
cmdbPosition7
case
"JD"
:
resutlt
=
cmdbPosition
1
resutlt
=
cmdbPosition
7
case
"HW"
:
resutlt
=
cmdbPosition
1
resutlt
=
cmdbPosition
7
case
"BGYJ"
:
resutlt
=
cmdbPosition
1
resutlt
=
cmdbPosition
7
default
:
resutlt
=
ERROR
}
case
"ZZ"
:
resutlt
=
cmdbPosition3
default
:
resutlt
=
ERROR
...
...
public/dept.go
View file @
05323361
...
...
@@ -31,16 +31,14 @@ const Dept_zw_qbbm_dy_string = "抖音"
const
Dept_zw_qbbm_bd_string
=
"百度"
const
Dept_zw_qbbm_bgyj_string
=
"报告研究中心"
const
Dept_zw_qbbm_xmglwyh_string
=
"项目管理委员会"
const
Dept_zw_
zztd
=
"郑州团队
"
const
Dept_zw_
qbbm_apollo_string
=
"阿波罗
"
const
Dept_ldap_nb_12
=
"宁波-12"
const
Dept_ldap_nb_7
=
"宁波-704"
const
Dept_ldap_zz_1613
=
"郑州-1613"
var
Dept_qbbm_cmdb_ldap
map
[
string
]
string
=
map
[
string
]
string
{
Cmdb_Position_12
:
Dept_ldap_nb_12
,
Cmdb_Position_7
:
Dept_ldap_nb_7
,
Cmdb_Position_zhengzhou
:
Dept_ldap_zz_1613
,
Cmdb_Position_12
:
Dept_ldap_nb_12
,
Cmdb_Position_7
:
Dept_ldap_nb_7
,
}
var
Dept_zw_qbbm_map
map
[
string
]
string
=
map
[
string
]
string
{
...
...
@@ -55,6 +53,7 @@ var Dept_zw_qbbm_map map[string]string = map[string]string{
"赫贝尔Hebe(度)"
:
Dept_zw_qbbm_bd_string
,
"雅典娜Athena(巨)"
:
Dept_zw_qbbm_jl_string
,
"赫斯提亚Hestia(研)"
:
Dept_zw_qbbm_bgyj_string
,
"阿波罗Apollo"
:
Dept_zw_qbbm_apollo_string
,
"宙斯Zeus"
:
Dept_zw_jishu
,
}
var
Dept_zw_region_array
=
[]
string
{
Region_nb
,
Region_zz
}
...
...
@@ -66,8 +65,6 @@ func GetPostationFromHostname(hostname string) (string, error) {
return
Cmdb_Position_12
,
nil
case
Host_thserver
:
return
Cmdb_Position_7
,
nil
case
Host_zzserver
:
return
Cmdb_Position_zhengzhou
,
nil
}
part
,
err
:=
GetHostnamePart
(
hostname
)
if
err
!=
nil
{
...
...
@@ -90,6 +87,9 @@ func GetPostationFromHostname(hostname string) (string, error) {
return
Cmdb_Position_12
,
nil
case
HOST_Dept_TXHD
:
return
Cmdb_Position_12
,
nil
case
HOST_dept_ABL
:
return
Cmdb_Position_12
,
nil
case
HOST_Dept_BGYJ
:
return
Cmdb_Position_7
,
nil
case
HOST_Dept_HW
:
...
...
@@ -103,8 +103,6 @@ func GetPostationFromHostname(hostname string) (string, error) {
default
:
return
""
,
fmt
.
Errorf
(
"%s 不是预定的情报部门的格式"
,
hostname
)
}
case
HOST_Region_ZZ
:
return
Cmdb_Position_zhengzhou
,
nil
default
:
return
""
,
fmt
.
Errorf
(
"%s 不是预定的情报部门的格式"
,
hostname
)
...
...
@@ -125,8 +123,6 @@ func GetQBBMdeptFromHostname(host, region string) (string, error) {
case
Cmdb_Position_7
:
r
=
Dept_ldap_nb_7
}
case
Region_zz
:
r
=
Dept_ldap_zz_1613
}
return
r
,
err
}
...
...
public/msg_deal.go
View file @
05323361
...
...
@@ -533,9 +533,6 @@ func (wake *MJwake) MsgDeal() interface{} {
case
Cmdb_Position_12
:
LOG
(
INFO
,
"WAKE_REQ"
,
fmt
.
Sprintf
(
"server:%s,mac:%s"
,
Host_adserver
,
wake
.
MACAddress
))
SendADMsg
(
Msg_Wake
,
wake
)
case
Cmdb_Position_zhengzhou
:
LOG
(
INFO
,
"WAKE_REQ"
,
fmt
.
Sprintf
(
"server:%s,mac:%s"
,
Host_zzserver
,
wake
.
MACAddress
))
SendZZMsg
(
Msg_Wake
,
wake
)
}
}
}
...
...
@@ -560,9 +557,6 @@ func (wake *MJwake) MsgDeal() interface{} {
case
Cmdb_Position_12
:
LOG
(
INFO
,
"WAKE_REQ"
,
fmt
.
Sprintf
(
"server:%s,mac:%s"
,
Host_adserver
,
wake
.
MACAddress
))
SendADMsg
(
Msg_Wake
,
wake
)
case
Cmdb_Position_zhengzhou
:
LOG
(
INFO
,
"WAKE_REQ"
,
fmt
.
Sprintf
(
"server:%s,mac:%s"
,
Host_zzserver
,
wake
.
MACAddress
))
SendZZMsg
(
Msg_Wake
,
wake
)
}
}
wake
.
Instruction
=
Msg_Wake_Status_Over
...
...
@@ -1070,11 +1064,6 @@ func WXAuth(query string) string {
LOG
(
INFO
,
logtype
,
fmt
.
Sprintf
(
"%s 所属 %s"
,
wi
.
Name
,
strings
.
Join
(
deptlist
,
SymbolDH
)))
region
:=
Region_nb
for
_
,
j
:=
range
deptlist
{
if
j
==
Dept_zw_zztd
{
region
=
Region_zz
}
}
l
:=
fmt
.
Sprintf
(
"%s
\n
地区:%s
\n
部门:%s
\n
姓名:%s
\n
主机名:%s"
,
WxWorkInteraction_SignUP
,
region
,
dept_output
,
wi
.
Name
,
hostname
)
LOG
(
INFO
,
logtype
,
l
)
SendADMsg
(
Msg_Report
,
GJreportPlusString
(
Msg_Report_SignUPUser
,
l
,
wi
.
Userid
))
...
...
public/send.go
View file @
05323361
...
...
@@ -244,8 +244,6 @@ func GetSendServer(hostname string) func(msgtype string, v interface{}) {
sendserver
=
SendTHMsg
case
Cmdb_Position_12
:
sendserver
=
SendADMsg
case
Cmdb_Position_zhengzhou
:
sendserver
=
SendZZMsg
}
return
sendserver
}
...
...
public/user.go
View file @
05323361
...
...
@@ -24,6 +24,7 @@ const HOST_Dept_HW string = "HW"
const
HOST_Dept_JD
string
=
"JD"
const
HOST_Dept_DY
string
=
"DY"
const
HOST_Dept_BD
string
=
"BD"
const
HOST_dept_ABL
string
=
"ABL"
// os
const
(
...
...
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