<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding Syslog logging level possible? in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Adding-Syslog-logging-level-possible/m-p/501528#M15583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help you can provide, I already have a cool bit of PowerCLI that will configure the host Syslog servers in my environment.&amp;nbsp; I was however wondering if anyone is aware of how I can add to this and also tweak amend the logging level effectively editing the config.xml (which is required from my understanding ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pubs.vmware.com/vsphere-6-5/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc%2FPG_Appx_Diagnostics.20.4.html" title="https://pubs.vmware.com/vsphere-6-5/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc%2FPG_Appx_Diagnostics.20.4.html"&gt;VMware vSphere 6.5 Documentation Library&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I have been using to add add a specific syslog server ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write-Host "Loading Automation Tools"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add-PSSnapin VMware.VimAutomation.Core&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Establish Connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer -Server SecretServer.co.uk -User Luke@SecretDomain -Password TopSecretIWouldHaveToKillYouIfYouSawMe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($vmhost in (get-vmhost))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$esxcli = Get-EsxCli -vmhost $vmhost&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.config.get()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($vmhost in (get-vmhost))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$esxcli = Get-EsxCli -vmhost $vmhost&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.config.set($null, $null , $null, $null, $null, $null, $null, $null, “udp://Blah:514,udp://Blah:514,udp://svr0123:514”, $null, $null);&lt;/P&gt;&lt;P&gt;$esxcli.network.firewall.ruleset.set($null, $true, “syslog”)&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.reload()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2019 10:54:56 GMT</pubDate>
    <dc:creator>lukeglazebrook</dc:creator>
    <dc:date>2019-02-04T10:54:56Z</dc:date>
    <item>
      <title>Adding Syslog logging level possible?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Adding-Syslog-logging-level-possible/m-p/501528#M15583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help you can provide, I already have a cool bit of PowerCLI that will configure the host Syslog servers in my environment.&amp;nbsp; I was however wondering if anyone is aware of how I can add to this and also tweak amend the logging level effectively editing the config.xml (which is required from my understanding ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pubs.vmware.com/vsphere-6-5/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc%2FPG_Appx_Diagnostics.20.4.html" title="https://pubs.vmware.com/vsphere-6-5/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc%2FPG_Appx_Diagnostics.20.4.html"&gt;VMware vSphere 6.5 Documentation Library&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I have been using to add add a specific syslog server ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write-Host "Loading Automation Tools"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add-PSSnapin VMware.VimAutomation.Core&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Establish Connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer -Server SecretServer.co.uk -User Luke@SecretDomain -Password TopSecretIWouldHaveToKillYouIfYouSawMe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($vmhost in (get-vmhost))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$esxcli = Get-EsxCli -vmhost $vmhost&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.config.get()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($vmhost in (get-vmhost))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$esxcli = Get-EsxCli -vmhost $vmhost&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.config.set($null, $null , $null, $null, $null, $null, $null, $null, “udp://Blah:514,udp://Blah:514,udp://svr0123:514”, $null, $null);&lt;/P&gt;&lt;P&gt;$esxcli.network.firewall.ruleset.set($null, $true, “syslog”)&lt;/P&gt;&lt;P&gt;$esxcli.system.syslog.reload()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:54:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Adding-Syslog-logging-level-possible/m-p/501528#M15583</guid>
      <dc:creator>lukeglazebrook</dc:creator>
      <dc:date>2019-02-04T10:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Syslog logging level possible?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Adding-Syslog-logging-level-possible/m-p/501529#M15584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not with a direct command afaik.&lt;BR /&gt;You have to edit the config.xml file.&lt;/P&gt;&lt;P&gt;I normally do that via a SSH connection and the &lt;A href="https://www.powershellgallery.com/packages/Posh-SSH/2.0.2"&gt;Posh-Ssh&lt;/A&gt; module, with a sed command.&lt;/P&gt;&lt;P&gt;This changes the loglevel from warning to error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cmdSub&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;sed -i -e ''s?&amp;lt;logLevel&amp;gt; warning &amp;lt;/logLevel&amp;gt;?&amp;lt;logLevel&amp;gt; error &amp;lt;/logLevel&amp;gt;?g'' /etc/vmware/hostd/config.xml&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;MyEsx&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cred&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Get-Credential&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Message &lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;SSH crdentials for ESXi node &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;New-SSHSession&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;ComputerName &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Credential &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cred&lt;/SPAN&gt; –AcceptKey&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;result&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Invoke-SSHCommand&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;SSHSession &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Command &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cmdSub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Remove-SSHSession&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;SSHSession &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;|&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Out-Null&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2019 11:45:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Adding-Syslog-logging-level-possible/m-p/501529#M15584</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-02-04T11:45:56Z</dc:date>
    </item>
  </channel>
</rss>

