管理組件問題
發佈時間: 2016年3月
適用於: System Center 2012 R2 Operations Manager, System Center 2012 - Operations Manager, System Center 2012 SP1 - Operations Manager
本主題說明管理組件和模組特有的問題。
ExecuteCommand 不支援管線運算子或別名
當您將別名或管線運算子搭配使用 ExecuteCommand 參數時,命令將會失敗。ExecuteCommand 參數不支援管線運算子、別名和殼層專用語法。
在設計為用來管理 UNIX 和 Linux 電腦的 System Center Operations Manager 管理組件中,ExecuteCommand 參數不會啟動殼層處理,因而導致自訂動作失敗。
針對下列每一種自訂動作類型,請使用 ExecuteCommand 參數或 ExecuteShellCommand 參數指定叫用命令引數的方式:
Microsoft.Unix.WSMan.Invoke.ProbeAction
Microsoft.Unix.WSMan.Invoke.WriteAction
Microsoft.Unix.WSMan.Invoke.Privileged.ProbeAction
Microsoft.Unix.WSMan.Invoke.Privileged.WriteAction
ExecuteCommand 參數會將命令列引數傳遞到主控台,但不會啟動殼層處理。
ExecuteShellCommand 參數會使用使用者的預設殼層,將命令列引數傳遞到殼層處理;這個殼層可支援管線、別名和殼層專用語法。
注意事項 |
---|
ExecuteShellCommand 參數會使用執行命令之使用者的預設殼層。 如果您需要特定殼層,請使用 ExecuteCommand 參數,並以需要的殼層作為命令引數的首碼。 |
下列範例顯示如何使用 ExecuteCommand 和 ExecuteShellCommand 參數:
若要將命令列引數傳遞到主控台而不啟動殼層處理:
<p:ExecuteCommand_INPUT xmlns:p="https://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem"> <p:Command> service syslog status </p:Command> <p:timeout>10</p:timeout> </p:ExecuteCommand_INPUT>
若要將命令列引數傳遞到參照明確殼層的殼層處理:
<p:ExecuteCommand_INPUT xmlns:p="https://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem"> <p:Command> /bin/sh ps -ef syslog | grep -v grep </p:Command> <p:timeout>10</p:timeout> </p:ExecuteCommand_INPUT>
若要將命令列引數傳遞到使用使用者的預設殼層的殼層處理:
<p:ExecuteShellCommand_INPUT xmlns:p="https://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem"> <p:Command> uptime | awk '{print $10}' |awk -F"," '{print $1}' </p:Command> <p:timeout>10</p:timeout> </p:ExecuteShellCommand_INPUT>
請參閱
使用範本以進一步監視 UNIX 和 Linux
疑難排解 UNIX 和 Linux 監視
Accessing UNIX and Linux Computers in Operations Manager (在 Operations Manager 中存取 UNIX 和 Linux 電腦)
UNIX 和 Linux 帳戶的必要功能
憑證問題
作業系統問題
記錄與偵錯
管理 UNIX 和 Linux 電腦的憑證
Managing Resource Pools for UNIX and Linux Computers (管理 UNIX 和 Linux 電腦的資源集區)
使用探索精靈在 UNIX 和 Linux 上安裝代理程式