【问题标题】:How to check if VMHost is configured with Syslog forwarding如何检查 VMHost 是否配置了 Syslog 转发
【发布时间】:2018-06-19 17:51:03
【问题描述】:

我想检查 VMHost 是否配置了 Syslog 转发

我已经编写了以下 cmdlet,但它没有给出“系统日志转发”状态。

$esxcli = Get-EsxCli -VMHost abc.com
$esxcli.system.syslog | Select-Object *

$esxcli.system.syslog | gm 正在返回错误

gm :您必须为 Get-Member cmdlet 指定一个对象。 在行:1 字符:25 + $esxcli.system.syslog |通用汽车 + ~~ + CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

$esxcli.system.syslog.config.get() 正在返回错误:

您不能在空值表达式上调用方法。
在行:1 字符:1
+ $esxcli.system.syslog.config.get()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

【问题讨论】:

  • 谢谢...这就是我要找的东西

标签: powershell vmware powershell-4.0 powercli vcenter


【解决方案1】:

PowerCLI 包含 Get-VMHostSysLogServer cmdlet。在您的问题的上下文中,此命令将返回 VMHost abc.com 的系统日志服务器:

Get-VMHostSysLogServer -VMHost abc.com

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-05
    • 1970-01-01
    • 1970-01-01
    • 2012-08-06
    • 2013-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多