Commit 05323361 by 陶腾飞

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

parent 1502af8b
......@@ -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 = cmdbPosition12
case "ZJ":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "MT":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "DD":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "JR":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "TXHD":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "TXWJ":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "JS":
resutlt = cmdbPosition2
resutlt = cmdbPosition12
case "DY":
resutlt = cmdbPosition7
case "BD":
resutlt = cmdbPosition7
case "ABL":
resutlt = cmdbPosition7
case "JD":
resutlt = cmdbPosition1
resutlt = cmdbPosition7
case "HW":
resutlt = cmdbPosition1
resutlt = cmdbPosition7
case "BGYJ":
resutlt = cmdbPosition1
resutlt = cmdbPosition7
default:
resutlt = ERROR
}
case "ZZ":
resutlt = cmdbPosition3
default:
resutlt = ERROR
......
......@@ -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
}
......
......@@ -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))
......
......@@ -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
}
......
......@@ -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 (
......
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