{"id":96849,"date":"2020-04-26T21:31:56","date_gmt":"2020-04-26T13:31:56","guid":{"rendered":"http:\/\/4563.org\/?p=96849"},"modified":"2020-04-26T21:31:56","modified_gmt":"2020-04-26T13:31:56","slug":"%e6%b1%82%e5%8a%a9%ef%bc%8c%e5%a6%82%e4%bd%95%e8%99%9a%e6%8b%9f%e6%9c%ba-windows-%e4%bd%bf%e7%94%a8-apc-powerchute-business-edition-%e8%bd%af%e4%bb%b6%e5%85%b3%e9%97%ad-esxi-%e4%b8%bb%e6%9c%ba","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=96849","title":{"rendered":"\u6c42\u52a9\uff0c\u5982\u4f55\u865a\u62df\u673a windows \u4f7f\u7528 apc PowerChute Business Edition \u8f6f\u4ef6\u5173\u95ed esxi \u4e3b\u673a\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u52a9\uff0c\u5982\u4f55\u865a\u62df\u673a windows \u4f7f\u7528 apc PowerChute Business Edition \u8f6f\u4ef6\u5173\u95ed esxi \u4e3b\u673a\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : moneycwq <\/span>  <span><i><\/i> 63<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u4f7f\u7528 esxi \u865a\u62df\u7684 windows 2019 \u8fd0\u884c apc PowerChute Business Edition\uff0c\u53ef\u4ee5\u8bc6\u522b\u5230 ups\uff0c\u8be5\u8f6f\u4ef6\u53ef\u4ee5\u5728\u65ad\u7535\u540e\u542f\u52a8\u4e00\u4e2a\u6279\u5904\u7406\u547d\u4ee4\uff0c\u4f46\u662f\u8fd9\u4e2a\u6279\u5904\u7406\u4e0d\u80fd\u8fdb\u884c\u684c\u9762\u4ea4\u4e92\u3002\u6211\u5728 esxi \u4e3b\u673a\u91cc\u505a\u4e86\u4e00\u4e2a sh\uff0c\u6211\u60f3\u901a\u8fc7 cmd \u6a21\u5f0f\u7684 ssh \u94fe\u63a5 esxi \u4e3b\u673a\uff0c\u8fd0\u884c\u8fd9\u4e2a sh\uff0c\u8fd9\u4e2a sh \u6279\u5904\u7406\u5173\u95ed\u4e3b\u673a\u4e0b\u7684\u5168\u90e8\u865a\u62df\u673a\uff0c\u6700\u540e\u5728\u5173\u95ed esxi\u3002\u4e3a\u6b64\u505a\u4e86\u4e00\u4e2a vbs \u6765\u5b8c\u6210\uff0c\u81ea\u52a8 ssh \u94fe\u63a5 esxi \u4e3b\u673a\uff0c\u81ea\u52a8\u542f\u7528 sh\u3002\u5355\u72ec\u70b9\u51fb\u8fd9\u4e2a vbs \u90fd\u53ef\u4ee5\u5b8c\u6210\u4efb\u52a1\uff0c\u4f46\u662f\u901a\u8fc7 apc PowerChute Business Edition \u7684\u8f6f\u4ef6\u542f\u52a8\u6279\u5904\u7406\u5c31\u65e0\u6cd5\u8fd0\u884c\u3002\u5f88\u56f0\u60d1\u3002\u4e0d\u77e5\u9053\u54ea\u4f4d\u53ef\u4ee5\u6307\u70b9\u8ff7\u6d25\uff0c\u8ba9\u6211\u53ef\u4ee5\u5728\u65ad\u7535\u540e\u81ea\u52a8\u5173\u95ed\u5168\u90e8\u865a\u62df\u673a\uff0c\u5e76\u5173\u95ed esxi \u4e3b\u673a\u3002 ssh \u4f7f\u7528 openssh\uff0cvbs \u6211\u8fd9\u6837\u5199\u7684\uff0c\u4e0d\u77e5\u9053\u5bf9\u4e0d\u5bf9\u3002\u662f\u4e0d\u662f\u5fc5\u987b\u8981\u7f16\u5199\u6210\u6279\u5904\u7406\u624d\u53ef\u4ee5\uff1f\u4f46\u662f\u6211\u4e0d\u61c2 cmd \u6a21\u5f0f\u4e0b\u7684\u6279\u5904\u7406\uff0c\u4e0d\u77e5\u9053\u600e\u4e48\u7f16\u5199\u3002\u5e0c\u671b\u5f97\u5230\u5e2e\u52a9\uff0c\u8c22\u8c22<\/p>\n<p>\u6211\u5199\u7684 vbs Dim WshShell<\/p>\n<p>Set WshShell=WScript.CreateObject(&#8220;WScript.Shell&#8221;)<\/p>\n<p>WshShell.Run &#8220;cmd.exe&#8221;<\/p>\n<p>WScript.Sleep 1500<\/p>\n<p>WshShell.SendKeys &#8220;ssh [email&#160;protected]&#8221;<\/p>\n<p>WshShell.SendKeys &#8220;{ENTER}&#8221;<\/p>\n<p>WScript.Sleep 1500<\/p>\n<p>WshShell.SendKeys &#8220;12345678&#8221;<\/p>\n<p>WshShell.SendKeys &#8220;{ENTER}&#8221;<\/p>\n<p>WScript.Sleep 1500<\/p>\n<p>WshShell.SendKeys &#8220;cd \/vmfs\/volumes\/datastore\/UPS&#8221;<\/p>\n<p>WshShell.SendKeys &#8220;{ENTER}&#8221;<\/p>\n<p>WScript.Sleep 1500<\/p>\n<p>WshShell.SendKeys &#8220;sh test.sh&#8221;<\/p>\n<p>WshShell.SendKeys &#8220;{ENTER}&#8221;<\/p>\n<p>apc \u81ea\u5df1\u5e26\u7684\u4e00\u4e2a\u9ed8\u8ba4\u7684 cmd \u6587\u4ef6\u91cc\u9762\u89e3\u91ca\u5982\u4e0b\uff1a rem This command file provides examples of proper command file syntax<\/p>\n<p>rem \u6b64\u547d\u4ee4\u6587\u4ef6\u63d0\u4f9b\u4e86\u6b63\u786e\u7684\u547d\u4ee4\u6587\u4ef6\u89c4\u5219\u7684\u8303\u4f8b<\/p>\n<p>rem Command Files run by PowerChute Business Edition must be placed in this directory.<\/p>\n<p>rem \u8fd0\u884c PowerChute Business Edition \u7684\u547d\u4ee4\u6587\u4ef6\u5fc5\u987b\u653e\u5728\u6b64\u6587\u4ef6\u76ee\u5f55\u4e0b<\/p>\n<p>rem Use the full path name of executable programs and external command files.<\/p>\n<p>rem \u8bf7\u91c7\u7528\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5916\u90e8\u547d\u4ee4\u6587\u4ef6\u540d\u79f0\uff08\u542b\u6240\u6709\u76ee\u5f55\u8def\u5f84\uff09<\/p>\n<p>rem The @START command must be used to run executable programs (see example below).<\/p>\n<p>rem @START \u5f00\u59cb\u547d\u4ee4\u5fc5\u987b\u7528\u4e8e\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\uff08\u5982\u4e0b\u6240\u793a\uff09<\/p>\n<p>rem For the @START command, path names that include spaces must be enclosed in quotes;<\/p>\n<p>rem arguments for the executable must be outside the quotes. A double quote must<\/p>\n<p>rem precede the quoted path name. For example, to execute a command file in<\/p>\n<p>rem c:Program FilesAPCPowerChute Business Editionagentcmdfiles called myShut.exe,<\/p>\n<p>rem the following line should be entered in the command file:<\/p>\n<p>rem \u5bf9\u4e8e @START \u5f00\u59cb\u547d\u4ee4\uff0c \u6709\u7a7a\u683c\u7684\u8def\u5f84\u540d\u79f0\u5fc5\u987b\u5305\u542b\u5728\u5f15\u7528\u5185\uff0c\u53ef\u6267\u884c\u7684\u5fc5\u987b\u653e\u5230\u5f15\u7528\u5916.<\/p>\n<p>rem \u53cc\u91cd\u5f15\u7528\u5fc5\u987b\u4f18\u5148\u4e8e\u5f15\u7528\u8def\u5f84\u540d\u79f0\uff0c\u4f8b\u5982\uff0c\u8fd0\u884c c:Program FilesAPCPowerChute Business Editionagentcmdfiles \u76ee\u5f55\u4e0b\u7684\u547d\u4ee4\u6587\u4ef6 myShut.exe<\/p>\n<p>rem \u4ee5\u4e0b\u884c\u5e94\u8f93\u5165\u5230\u547d\u4ee4\u6587\u4ef6\u4e2d<\/p>\n<p>rem @START &#8220;&#8221; &#8220;c:Program FilesAPCPowerChute Business EditionagentcmdfilesmyShut.exe&#8221;<\/p>\n<p>rem time \/T &gt;&gt; C:apctestcmdtest.txt<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>1<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"892324\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : moneycwq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6392\u7248\u95ee\u9898\uff0c\u6211\u5355\u72ec\u5199\u4e00\u4e0b\u5199\u7684 vbs \u5185\u5bb9<br \/>Dim WshShell <br \/>Set WshShell=WScript.CreateObject(&#8220;WScript.Shell&#8221;) <br \/>WshShell.Run &#8220;cmd.exe&#8221;<br \/>WScript.Sleep 1500 <br \/>WshShell.SendKeys &#8220;ssh [email&#160;protected]&#8221;<br \/>WshShell.SendKeys &#8220;{ENTER}&#8221;<br \/>WScript.Sleep 1500 <br \/>WshShell.SendKeys &#8220;CHENyyrui*102437&#8221;<br \/>WshShell.SendKeys &#8220;{ENTER}&#8221;<br \/>WScript.Sleep 1500 <br \/>WshShell.SendKeys &#8220;cd \/vmfs\/volumes\/datastore\/UPS&#8221;<br \/>WshShell.SendKeys &#8220;{ENTER}&#8221;<br \/>WScript.Sleep 1500 <br \/>WshShell.SendKeys &#8220;sh test.sh&#8221;<br \/>WshShell.SendKeys &#8220;{ENTER}&#8221;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u52a9\uff0c\u5982\u4f55\u865a\u62df\u673a windows &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96849"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96849"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96849\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96849"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}