|
本帖最后由 yunonly 于 2011-12-29 15:44 编辑
回复 14# szyszy2000
确实uuid这个参数值需要做关联~!
但我关联时遇到了如下问题:
查看脚本在response body里发现了uuid的值,具体返回如下:
{"success":true,"message":"[etl@localhost.localdomain/10.200.2.84 ~]$ ","primary":"0c63eb8a-e52b-4c2a-87bb-dbf1cb448600"}
于是我在web_submit_data前增加了关联函数,具体如下:
web_url("remoteConnect.jsp", "URL=http://10.200.2.84:9080/portal/page/monitor/g_remote/remoteConnect.jsp?ip=10.200.2.84&port=7838&=Thu%20Dec%2029%2009:05:24%20UTC+0800%202011",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.200.2.84:9080/portal/HomePage/Main.jsp",
"Snapshot=t29.inf",
"Mode=HTML",
EXTRARES,
"URL=/portal/js/extjs/resources/images/default/panel/tool-sprites.gif", "Referer=http://10.200.2.84:9080/portal/page/monitor/g_remote/remoteConnect.jsp?ip=10.200.2.84&port=7838&=Thu Dec 29 09:05:24 UTC+0800 2011", ENDITEM,
"URL=/portal/css/images/icon/cd.png", "Referer=http://10.200.2.84:9080/portal/page/monitor/g_remote/remoteConnect.jsp?ip=10.200.2.84&port=7838&=Thu Dec 29 09:05:24 UTC+0800 2011", ENDITEM,
LAST);
web_reg_save_param("uuid",
"LB=primary\":\"",
"RB=\"}",
"Search=All",
LAST);
web_submit_data("connect.form",
"Action=http://10.200.2.84:9080/portal/g_action/monitor/remote/telnetClient/connect.form",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.200.2.84:9080/portal/page/monitor/g_remote/remoteConnect.jsp?ip=10.200.2.84&port=7838&=Thu Dec 29 09:05:24 UTC+0800 2011",
"Snapshot=t30.inf",
"Mode=HTML",
ITEMDATA,
"Name=hostIp", "Value=10.200.2.84", ENDITEM,
"Name=port", "Value=7838", ENDITEM,
"Name=type", "Value=reuse", ENDITEM,
LAST);
web_custom_request("execute.form",
"URL=http://10.200.2.84:9080/portal/g_action/monitor/remote/telnetClient/execute.form",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.200.2.84:9080/portal/page/monitor/g_remote/remoteConnect.jsp?ip=10.200.2.84&port=7838&=Thu Dec 29 09:05:24 UTC+0800 2011",
"Snapshot=t31.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=GBK",
"Body=hostIp=10.200.2.84&port=7838&command=touch%20zz.txt&uuid={uuid}",
LAST);
但执行报错:
Action.c(31): Error -26377: No match found for the requested parameter "uuid". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(31): web_submit_data("connect.form") highest severity level was "ERROR", 99 body bytes, 190 header bytes, 11 chunking overhead bytes [MsgId: MMSG-26387]
疑问:我认为通过上面关联函数的左右边界限制可以刚好取得uuid的值,这个值的长度应该不会超过256才对,为何报错,关联函数是否有误? |
|