{%
    local rmcp = {}
    local rmcp_plus = {}
    echo(string.format('%-15s | %-15s | %s', 'service name', 'state', 'port'))
    for i, service in pairs(service_table) do
        local state = service.Enabled and 'Enabled' or 'Disabled'
        local port =  service.PortCount == 1 and tostring(service.Port) or tostring(service.Port .. ',' .. service.SparePort)
        local service_name = service.Name 
        if service.Name == 'KVMIP' and IsMultihost == 'Multihost' then
            goto continue
        elseif service.Name == 'KVMIP' and IsMultihost ~= 'Multihost' then
            service_name = 'KVM'
        end

        if service.Name == 'VirtualMedia' and IsMultihost == 'Multihost' then
            goto continue
        elseif service.Name == 'VirtualMedia' and IsMultihost ~= 'Multihost' then
            service_name = 'VMM'
        end

        if service.Name == 'VNC' and IsMultihost == 'Multihost' then
            goto continue
        elseif service.Name == 'Video' and IsMultihost == 'Multihost' then
            goto continue
        end

        if service.Name == 'RMCP' then
            rmcp.name = 'RMCP'
            rmcp.state = state
            rmcp.port = port
            rmcp_plus.port = port  -- rmcp和rmcp_plus共享端口
        elseif service.Name == 'RMCPPlus' then
            rmcp_plus.name = 'RMCP+'
            rmcp_plus.state = state
        else
            echo(string.format('\n%-15s | %-15s | %s', service_name, state, port))
        end
        ::continue::
    end
    echo(string.format('\n%-15s | %-15s | %s', rmcp.name, rmcp.state, rmcp.port))
    echo(string.format('\n%-15s | %-15s | %s', rmcp_plus.name, rmcp_plus.state, rmcp_plus.port))
%}