Commit 05323361 by 陶腾飞

删除郑州信息,添加阿波罗组信息

parent 1502af8b
...@@ -13,7 +13,6 @@ const Cmdb_Mac string = "Mac" ...@@ -13,7 +13,6 @@ const Cmdb_Mac string = "Mac"
const Cmdb_Position string = "Position" const Cmdb_Position string = "Position"
const Cmdb_Position_7 string = "7" const Cmdb_Position_7 string = "7"
const Cmdb_Position_12 string = "12" const Cmdb_Position_12 string = "12"
const Cmdb_Position_zhengzhou string = "zhengzhou"
const Cmdb_Ip string = "ip" const Cmdb_Ip string = "ip"
type CIRecordReq struct { type CIRecordReq struct {
...@@ -136,42 +135,45 @@ func (cir *CIRecordStartup) GetHardWare() { ...@@ -136,42 +135,45 @@ func (cir *CIRecordStartup) GetHardWare() {
wg.Wait() wg.Wait()
} }
func GetCMDBPosition(location, dept string) string { func GetCMDBPosition(location, dept string) string {
const cmdbPosition1 string = "7" const cmdbPosition7 string = "7"
const cmdbPosition2 string = "12" const cmdbPosition12 string = "12"
const cmdbPosition3 string = "zhengzhou"
var resutlt string var resutlt string
switch location { switch location {
case "NB": case "NB":
switch dept { switch dept {
case "JL": case "JL":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "ZJ": case "ZJ":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "MT": case "MT":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "DD": case "DD":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "JR": case "JR":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "TXHD": case "TXHD":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "TXWJ": case "TXWJ":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "JS": case "JS":
resutlt = cmdbPosition2 resutlt = cmdbPosition12
case "DY":
resutlt = cmdbPosition7
case "BD":
resutlt = cmdbPosition7
case "ABL":
resutlt = cmdbPosition7
case "JD": case "JD":
resutlt = cmdbPosition1 resutlt = cmdbPosition7
case "HW": case "HW":
resutlt = cmdbPosition1 resutlt = cmdbPosition7
case "BGYJ": case "BGYJ":
resutlt = cmdbPosition1 resutlt = cmdbPosition7
default: default:
resutlt = ERROR resutlt = ERROR
} }
case "ZZ":
resutlt = cmdbPosition3
default: default:
resutlt = ERROR resutlt = ERROR
......
...@@ -31,16 +31,14 @@ const Dept_zw_qbbm_dy_string = "抖音" ...@@ -31,16 +31,14 @@ const Dept_zw_qbbm_dy_string = "抖音"
const Dept_zw_qbbm_bd_string = "百度" const Dept_zw_qbbm_bd_string = "百度"
const Dept_zw_qbbm_bgyj_string = "报告研究中心" const Dept_zw_qbbm_bgyj_string = "报告研究中心"
const Dept_zw_qbbm_xmglwyh_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_12 = "宁波-12"
const Dept_ldap_nb_7 = "宁波-704" const Dept_ldap_nb_7 = "宁波-704"
const Dept_ldap_zz_1613 = "郑州-1613"
var Dept_qbbm_cmdb_ldap map[string]string = map[string]string{ var Dept_qbbm_cmdb_ldap map[string]string = map[string]string{
Cmdb_Position_12: Dept_ldap_nb_12, Cmdb_Position_12: Dept_ldap_nb_12,
Cmdb_Position_7: Dept_ldap_nb_7, Cmdb_Position_7: Dept_ldap_nb_7,
Cmdb_Position_zhengzhou: Dept_ldap_zz_1613,
} }
var Dept_zw_qbbm_map map[string]string = map[string]string{ 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{ ...@@ -55,6 +53,7 @@ var Dept_zw_qbbm_map map[string]string = map[string]string{
"赫贝尔Hebe(度)": Dept_zw_qbbm_bd_string, "赫贝尔Hebe(度)": Dept_zw_qbbm_bd_string,
"雅典娜Athena(巨)": Dept_zw_qbbm_jl_string, "雅典娜Athena(巨)": Dept_zw_qbbm_jl_string,
"赫斯提亚Hestia(研)": Dept_zw_qbbm_bgyj_string, "赫斯提亚Hestia(研)": Dept_zw_qbbm_bgyj_string,
"阿波罗Apollo": Dept_zw_qbbm_apollo_string,
"宙斯Zeus": Dept_zw_jishu, "宙斯Zeus": Dept_zw_jishu,
} }
var Dept_zw_region_array = []string{Region_nb, Region_zz} var Dept_zw_region_array = []string{Region_nb, Region_zz}
...@@ -66,8 +65,6 @@ func GetPostationFromHostname(hostname string) (string, error) { ...@@ -66,8 +65,6 @@ func GetPostationFromHostname(hostname string) (string, error) {
return Cmdb_Position_12, nil return Cmdb_Position_12, nil
case Host_thserver: case Host_thserver:
return Cmdb_Position_7, nil return Cmdb_Position_7, nil
case Host_zzserver:
return Cmdb_Position_zhengzhou, nil
} }
part, err := GetHostnamePart(hostname) part, err := GetHostnamePart(hostname)
if err != nil { if err != nil {
...@@ -90,6 +87,9 @@ func GetPostationFromHostname(hostname string) (string, error) { ...@@ -90,6 +87,9 @@ func GetPostationFromHostname(hostname string) (string, error) {
return Cmdb_Position_12, nil return Cmdb_Position_12, nil
case HOST_Dept_TXHD: case HOST_Dept_TXHD:
return Cmdb_Position_12, nil return Cmdb_Position_12, nil
case HOST_dept_ABL:
return Cmdb_Position_12, nil
case HOST_Dept_BGYJ: case HOST_Dept_BGYJ:
return Cmdb_Position_7, nil return Cmdb_Position_7, nil
case HOST_Dept_HW: case HOST_Dept_HW:
...@@ -103,8 +103,6 @@ func GetPostationFromHostname(hostname string) (string, error) { ...@@ -103,8 +103,6 @@ func GetPostationFromHostname(hostname string) (string, error) {
default: default:
return "", fmt.Errorf("%s 不是预定的情报部门的格式", hostname) return "", fmt.Errorf("%s 不是预定的情报部门的格式", hostname)
} }
case HOST_Region_ZZ:
return Cmdb_Position_zhengzhou, nil
default: default:
return "", fmt.Errorf("%s 不是预定的情报部门的格式", hostname) return "", fmt.Errorf("%s 不是预定的情报部门的格式", hostname)
...@@ -125,8 +123,6 @@ func GetQBBMdeptFromHostname(host, region string) (string, error) { ...@@ -125,8 +123,6 @@ func GetQBBMdeptFromHostname(host, region string) (string, error) {
case Cmdb_Position_7: case Cmdb_Position_7:
r = Dept_ldap_nb_7 r = Dept_ldap_nb_7
} }
case Region_zz:
r = Dept_ldap_zz_1613
} }
return r, err return r, err
} }
......
...@@ -533,9 +533,6 @@ func (wake *MJwake) MsgDeal() interface{} { ...@@ -533,9 +533,6 @@ func (wake *MJwake) MsgDeal() interface{} {
case Cmdb_Position_12: case Cmdb_Position_12:
LOG(INFO, "WAKE_REQ", fmt.Sprintf("server:%s,mac:%s", Host_adserver, wake.MACAddress)) LOG(INFO, "WAKE_REQ", fmt.Sprintf("server:%s,mac:%s", Host_adserver, wake.MACAddress))
SendADMsg(Msg_Wake, wake) 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{} { ...@@ -560,9 +557,6 @@ func (wake *MJwake) MsgDeal() interface{} {
case Cmdb_Position_12: case Cmdb_Position_12:
LOG(INFO, "WAKE_REQ", fmt.Sprintf("server:%s,mac:%s", Host_adserver, wake.MACAddress)) LOG(INFO, "WAKE_REQ", fmt.Sprintf("server:%s,mac:%s", Host_adserver, wake.MACAddress))
SendADMsg(Msg_Wake, wake) 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 wake.Instruction = Msg_Wake_Status_Over
...@@ -1070,11 +1064,6 @@ func WXAuth(query string) string { ...@@ -1070,11 +1064,6 @@ func WXAuth(query string) string {
LOG(INFO, logtype, fmt.Sprintf("%s 所属 %s", wi.Name, strings.Join(deptlist, SymbolDH))) LOG(INFO, logtype, fmt.Sprintf("%s 所属 %s", wi.Name, strings.Join(deptlist, SymbolDH)))
region := Region_nb 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) l := fmt.Sprintf("%s\n地区:%s\n部门:%s\n姓名:%s\n主机名:%s", WxWorkInteraction_SignUP, region, dept_output, wi.Name, hostname)
LOG(INFO, logtype, l) LOG(INFO, logtype, l)
SendADMsg(Msg_Report, GJreportPlusString(Msg_Report_SignUPUser, l, wi.Userid)) SendADMsg(Msg_Report, GJreportPlusString(Msg_Report_SignUPUser, l, wi.Userid))
......
...@@ -244,8 +244,6 @@ func GetSendServer(hostname string) func(msgtype string, v interface{}) { ...@@ -244,8 +244,6 @@ func GetSendServer(hostname string) func(msgtype string, v interface{}) {
sendserver = SendTHMsg sendserver = SendTHMsg
case Cmdb_Position_12: case Cmdb_Position_12:
sendserver = SendADMsg sendserver = SendADMsg
case Cmdb_Position_zhengzhou:
sendserver = SendZZMsg
} }
return sendserver return sendserver
} }
......
...@@ -24,6 +24,7 @@ const HOST_Dept_HW string = "HW" ...@@ -24,6 +24,7 @@ const HOST_Dept_HW string = "HW"
const HOST_Dept_JD string = "JD" const HOST_Dept_JD string = "JD"
const HOST_Dept_DY string = "DY" const HOST_Dept_DY string = "DY"
const HOST_Dept_BD string = "BD" const HOST_Dept_BD string = "BD"
const HOST_dept_ABL string = "ABL"
// os // os
const ( const (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment