new1234.jpg

Archive

Posts Tagged ‘Firewall’

VMware: Configure vSphere hosts to VMware Syslog Collector with PowerCLI

December 18th, 2013 2 comments

PowerCLI script:

 

#====================================================================#
#   SCRIPT:        PowerCLI_configure_syslog_settings_host.ps1       #
#   FUNCTION:      Add remote syslog server, settings and  open      #
#                  firewall ports in cluster                         #
#   OWNER:         Sander Daems                                      #
#   VSPHERE:       5.5 build 1331820                                 #
#   CREATED:       18/12/2013                                        #
#   MODIFIED:      18/12/2013                                        #
#   VERSION:       v.1.0                                             #
#====================================================================#
#   CHANGELOG:                                                       #
#                                                                    #
#    v.1.0                                                           #
#    - Script created;                                               #
#                                                                    #
#====================================================================#
# CUSTOM DEFINITIONS                                                 #
#====================================================================#
$vCenterServer = Read-Host "Enter vCenter Hostname / IP"
$vmhost = Get-VMHost
#====================================================================#
# HOST - Specify host and connect                                    #
#====================================================================#
Connect-VIServer $vCenterServer
#====================================================================#
# SCRIPT - SYSLOG - Update Syslog settings                           #
#====================================================================#
$vmhost | Set-VMHostAdvancedConfiguration -NameValue @{'Config.HostAgent.log.level'='info';'Vpx.Vpxa.config.log.level'='info';'Syslog.global.logHost'='udp://10.180.200.18:514'}
#====================================================================#
# SCRIPT - FIREWALL - Open ESXi firewall port                        #
#====================================================================#
$vmhost | Get-VMHostFirewallException -VMhost $vmhost -name syslog | Set-VMHostFirewallException -Enabled $true
#====================================================================#

 

vCenter Syslog Collector settings:

 

image


Script result:

image

image

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn