当每次产生任何事件消息时由AuxEsxiServer服务器采用异步通知到指定的URL或者TCP客户端,关于数据签名介绍如下:

HTTP方式接收通知:

  • 服务器采用POST方式请求,字符编码均使用UTF-8编码,Content-Type 类型为 application/x-www-form-urlencoded

  • 服务器将签名数据放置到 headers请求头部分,参数分别为:Cx-Timestamp,Cx-Signmethod,Cx-Signnonce,Cx-Sign,数据签名方式参考《接口鉴权》 方法相同只是参数不同。

  • 如果鉴权失败时参考AuxEsxiServer服务器日志类似如下,快速找到问题纠正错误。

[http/notice] Signature string: Cx-Signmethod%3DMD5%26Cx-Signnonce%3D8pw3zVQqljY98V9ux6SeB4cSvnmLdy5r%26Cx-Timestamp%3D2023-12-03%2013%3A58%3A47&Skey=B83DPZdfDHzjJ4F4w3x8asmCzcyydzpp


TCP方式接收通知





事件名称事件描述携带数据参考
EVENT_SERVER_ONLINE服务器上线
{
    "Content":{
        "task":{
            "event_name":"事件名称"
        },
        "hostname":"主机名",
        "ipaddress":"服务器IP",
        "hostid":"主机唯一ID",
        "serverid":"服务器ID",
        "edition_buildno":"版本号",
        "http_port":"WEB服务端口",
        "tcp_port":"通讯服务端口",
        "edition_version":"创建号"
    },
    "Describe":"服务器上线",
    "ExpireTime":1602208589,
    "InsertTime":1602122189,
    "ServerID":"服务器ID",
    "TaskID":"任务ID",
    "UpdateTime":1602122189
}


EVENT_SERVER_OFFLINE服务器离线
{
    "Content":{
        "task":{
            "event_name":"事件名称"
        },
        "hostid":"主机唯一ID"
    },
    "Describe":"服务器离线",
    "ExpireTime":1602208589,
    "InsertTime":1602122189,
    "ServerID":"服务器ID",
    "TaskID":"任务ID",
    "UpdateTime":1602122189
}


EVENT_AGENT_ONLINE代理客户端上线
{
    "Content":{
        "task":{
            "event_name":"事件名称"
        },
        "clientHostName":"客户端主机名",
        "clientAddr":"客户端IP",
        "clientVmCount":"客户端虚拟机数量",
        "clientid":"代理客户端ID"
    },
    "Describe":"代理客户端上线",
    "ExpireTime":1602208589,
    "InsertTime":1602122189,
    "ServerID":"服务器ID",
    "TaskID":"任务ID",
    "UpdateTime":1602122189
}


EVENT_AGENT_OFFLINE代理客户端离线
{
    "Content":{
        "task":{
            "event_name":"事件名称"
        },
        "clientid":"代理客户端ID"
    },
    "Describe":"代理客户端离线",
    "ExpireTime":1602208589,
    "InsertTime":1602122189,
    "ServerID":"服务器ID",
    "TaskID":"任务ID",
    "UpdateTime":1602122189
}


EVENT_VM_CREATE创建虚拟机
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "config_progress_bar":"100%",
            "config_progress_describe":"已自动处理问题消息ID:61321810",
            "config_progress_type":"vm_poweron",
            "event_name":"EVENT_VM_CREATE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "extend_params":"e16dd90967e412248d097cd38b770909",
            "vm_data_disk_size":"0",
            "vm_data_name":"data_1t",
            "vm_disk":"e16dd90967e412248d097cd38b770909.vmdk",
            "vm_id":"228",
            "vm_mem_size":"8192",
            "vm_name":"e16dd90967e412248d097cd38b770909",
            "vm_numv_cpus":"2",
            "vm_path":"\/vmfs\/volumes\/5e5b23b2-a4e7fb00-8d08-c4834f165c2c\/770909",
            "vm_problem_messageid":"61321810",
            "vm_problem_state":"success",
            "vm_state":"10",
            "vm_tpl_name":"win7",
            "vm_vmx":"\/vmfs\/volumes\/5e5b23b2-a4e7fb00-8d08-c4834f165c2c\/770909.vmx"
        }
    },
    "Describe":"创建虚拟机 - e16dd90967e412248d097cd38b770909",
    "ExpireTime":1702792168,
    "InsertTime":1702705768,
    "ServerID":"1",
    "TaskID":"3000ed4c1e4a14338d85a888b3cae4f2",
    "UpdateTime":1702705804
}
EVENT_HOST_CLOSE关闭/重启主机
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_HOST_CLOSE",
            "task_errcode":"200",
            "task_errmsg":"success",
            "type":"0"
        },
        "vm":{
            "vmid":"228"
        }
    },
    "Describe":"关闭虚拟机(ID:228)",
    "ExpireTime":1702793530,
    "InsertTime":1702707130,
    "ServerID":"1",
    "TaskID":"f692d7f2ad71be3609cc24cc0b5b432f",
    "UpdateTime":1702707131
}
EVENT_VM_POWER_ON打开虚拟机电源
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_POWER_ON",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "vm_state":"4",
            "vmid":"228"
        }
    },
    "Describe":"打开虚拟机电源(ID:228)",
    "ExpireTime":1702792809,
    "InsertTime":1702706409,
    "ServerID":"1",
    "TaskID":"9fcb34edc48aa8468d18343cc83791b8",
    "UpdateTime":1702706495
}
EVENT_VM_POWER_OFF关闭虚拟机电源
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_POWER_OFF",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "vm_state":"33",
            "vmid":"228"
        }
    },
    "Describe":"关闭虚拟机电源(ID:228)",
    "ExpireTime":1702794180,
    "InsertTime":1702707780,
    "ServerID":"1",
    "TaskID":"39c8b64a1512475cc5df2e7321eb1de7",
    "UpdateTime":1702707781
}
EVENT_VM_DELETE删除虚拟机
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_DELETE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "vmid":"228"
        }
    },
    "Describe":"删除虚拟机(ID:228)",
    "ExpireTime":1702796981,
    "InsertTime":1702710581,
    "ServerID":"1",
    "TaskID":"df2bce65c19950b8385f637d807e9468",
    "UpdateTime":1702710586
}
EVENT_VM_SNAPSHOT_ADD创建虚拟机快照
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_SNAPSHOT_ADD",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "snapshot_describe":"3333",
            "snapshot_name":"快照名称2",
            "snapshotid":"2",
            "vmid":"229"
        }
    },
    "Describe":"创建虚拟机快照(ID:229)",
    "ExpireTime":1702811431,
    "InsertTime":1702725031,
    "ServerID":"1",
    "TaskID":"a939a277ba7c38417320be2aa556a2ff",
    "UpdateTime":1702725033
}
EVENT_VM_SNAPSHOT_DELETE删除/清空虚拟机快照
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_SNAPSHOT_DELETE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "isclear":"1",
            "snapshotid":"2",
            "vmid":"229"
        }
    },
    "Describe":"删除虚拟机快照(ID:229)",
    "ExpireTime":1702811882,
    "InsertTime":1702725482,
    "ServerID":"1",
    "TaskID":"0422f5e9dbb7f43247b660c39ac58ec6",
    "UpdateTime":1702725484
}
EVENT_VM_SNAPSHOT_REVERT还原虚拟机快照
{
    "Content":{
        "client":{
            "id":"3e1d64ceb02dcd5ec8a0166242d53947"
        },
        "task":{
            "event_name":"EVENT_VM_SNAPSHOT_REVERT",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "snapshotid":"3",
            "vmid":"229"
        }
    },
    "Describe":"还原虚拟机快照(ID:229)",
    "ExpireTime":1702812256,
    "InsertTime":1702725856,
    "ServerID":"1",
    "TaskID":"96524df4ac619cfb513aaf44d573ff4f",
    "UpdateTime":1702725857
}
EVENT_AGENT_VMCOUNT代理客户端虚拟机数量
{
    "Content":{
        "clientid":"3e1d64ceb02dcd5ec8a0166242d53947",
        "task":{
            "event_name":"EVENT_AGENT_VMCOUNT",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm_count":"8"
    },
    "Describe":"代理客户端虚拟机数量(ID:3e1d64ceb02dcd5ec8a0166242d53947)",
    "ExpireTime":1702814659,
    "InsertTime":1702728259,
    "ServerID":"1",
    "TaskID":"5d550c2e578dc64b6800e1f7ad43daf8",
    "UpdateTime":1702728259
}
EVENT_VM_CHANGE虚拟机动态事项改变,包含(虚拟机IP、电源状态、主机名)等事项
{
    "TaskID":"78accadd21c360d5953d79a9237f1047",
    "Describe":"虚拟机动态事项改变(ID:195)",
    "Content":{
        "clientid":"3e1d64ceb02dcd5ec8a0166242d53947",
        "task":{
            "event_name":"EVENT_VM_CHANGE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "hostname":"win7-PC",
            "ipaddress":"192.168.0.149",
            "vm_state":"31",
            "vmid":"195"
        }
    },
    "InsertTime":1702731458,
    "UpdateTime":1702731458,
    "ExpireTime":1702817858
}
EVENT_HOST_CLIENT_ONLINE主机被控端上线
{
    "Content":{
        "clientid":"3e1d64ceb02dcd5ec8a0166242d53947",
        "task":{
            "event_name":"EVENT_HOST_CLIENT_ONLINE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "hostname":"pc-yun-158",
            "ipaddress":"192.168.0.236",
            "vm_state":"31",
            "vmid":"158"
        }
    },
    "Describe":"代理客户端主机上线(ID:158)",
    "ExpireTime":1702883782,
    "InsertTime":1702797382,
    "ServerID":"1",
    "TaskID":"0d65ec4e075e77dc7aa4bdd779e24ade",
    "UpdateTime":1702797382
}
EVENT_HOST_CLIENT_CLOSE主机被控端离线,不代表虚拟机电源关闭,需要自行确认
{
    "Content":{
        "clientid":"3e1d64ceb02dcd5ec8a0166242d53947",
        "task":{
            "event_name":"EVENT_HOST_CLIENT_CLOSE",
            "task_errcode":"200",
            "task_errmsg":"success"
        },
        "vm":{
            "hostname":"pc-yun-158",
            "ipaddress":"192.168.0.236",
            "vm_state":"31",
            "vmid":"158"
        }
    },
    "Describe":"代理客户端主机离线(ID:158)",
    "ExpireTime":1702883782,
    "InsertTime":1702797382,
    "ServerID":"1",
    "TaskID":"0d65ec4e075e77dc7aa4bdd779e24ade",
    "UpdateTime":1702797382
}
N更多

注:通过调试获得更多事件通知内容