Set-VMHostSnmp
This cmdlet modifies the host SNMP configuration. If specified, adds or removes a trap target (removing can be specified by either TrapTargetToRemove parameter or by any of the following parameters (or combination of them): TargetCommunity, TargetHost, TargetPort). If the user passes $null, an empty array or string to the ReadOnlyCommunities parameter, the old values of this property are erased. This results in a NULL value of this property of the output object.
Syntax
[-Enabled <Boolean>]
[-Port <Int32>]
[-ReadOnlyCommunity <String[]>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
VmHostSnmp[] | named |
|
Specifies the host Snmp object you want to modify. | optional |
|
Boolean | named |
|
Indicates that the SNMP feature is enabled on the specified host. | optional |
|
Int32 | named |
|
Specifies the port on which the host listens to SNMP messages. | optional |
|
String[] | named |
|
Provide a list of communities, identifying who is able to send SNMP requests to that host. If $null, an empty array or string are passed to this parameter, its old values are erased and the output object for the ReadOnlyCommunity property is an empty array. In PowerShell an empty array is defined by @(). |
-HostSnmp <VmHostSnmp[]>
-TargetCommunity <String>
-TargetHost <String>
[-Enabled <Boolean>]
[-Port <Int32>]
[-ReadOnlyCommunity <String[]>]
[-TargetPort <Int32>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
SwitchParameter | named |
|
Indicates that you want to add a new trap target to the host SNMP configuration. A trap target consists of three elements - Community (mandatory), HostName (mandatory), Port (optional - defaults to 162), specified by the TargetCommunity, TargetHost, and TargetPort parameters. | required |
|
VmHostSnmp[] | named |
|
Specifies the host Snmp object you want to modify. | required |
|
String | named |
|
Specifies the community identifier of the trap target. | required |
|
String | named |
|
Specifies the identifier of the target host - a host name or an IP address. | optional |
|
Boolean | named |
|
Indicates that the SNMP feature is enabled on the specified host. | optional |
|
Int32 | named |
|
Specifies the port on which the host listens to SNMP messages. | optional |
|
String[] | named |
|
Provide a list of communities, identifying who is able to send SNMP requests to that host. If $null, an empty array or string are passed to this parameter, its old values are erased and the output object for the ReadOnlyCommunity property is an empty array. In PowerShell an empty array is defined by @(). | optional |
|
Int32 | named |
|
Specifies the port on which the target host listens to SNMP messages. |
-RemoveTarget
[-Enabled <Boolean>]
[-Port <Int32>]
[-ReadOnlyCommunity <String[]>]
[-TargetCommunity <String>]
[-TargetHost <String>]
[-TargetPort <Int32>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
VmHostSnmp[] | named |
|
Specifies the host Snmp object you want to modify. | required |
|
SwitchParameter | named |
|
Indicates that you want to remove a trap target from the host SNMP configuration. There are two ways to specify a trap target: * Pass the trap target to the TrapTargetToRemove parameter. * Use a combination of the TargetCommunity, TargetHost, and TargetPort parameters to specify a criteria (for example, remove all trap targets that are using port 162). | optional |
|
Boolean | named |
|
Indicates that the SNMP feature is enabled on the specified host. | optional |
|
Int32 | named |
|
Specifies the port on which the host listens to SNMP messages. | optional |
|
String[] | named |
|
Provide a list of communities, identifying who is able to send SNMP requests to that host. If $null, an empty array or string are passed to this parameter, its old values are erased and the output object for the ReadOnlyCommunity property is an empty array. In PowerShell an empty array is defined by @(). | optional |
|
String | named |
|
Specifies the community identifier of the trap target. | optional |
|
String | named |
|
Specifies the identifier of the target host - a host name or an IP address. | optional |
|
Int32 | named |
|
Specifies the port on which the target host listens to SNMP messages. |
-TrapTargetToRemove <TrapTarget>
[-Enabled <Boolean>]
[-Port <Int32>]
[-ReadOnlyCommunity <String[]>]
[-RemoveTarget]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
VmHostSnmp[] | named |
|
Specifies the host Snmp object you want to modify. | required |
|
TrapTarget | named |
|
Specifies the trap target you want to remove. The trap target can be obtained from the "TrapTargets" property of the HostSNMP object (an array of TrapTarget objects). | optional |
|
Boolean | named |
|
Indicates that the SNMP feature is enabled on the specified host. | optional |
|
Int32 | named |
|
Specifies the port on which the host listens to SNMP messages. | optional |
|
String[] | named |
|
Provide a list of communities, identifying who is able to send SNMP requests to that host. If $null, an empty array or string are passed to this parameter, its old values are erased and the output object for the ReadOnlyCommunity property is an empty array. In PowerShell an empty array is defined by @(). | optional |
|
SwitchParameter | named |
|
Indicates that you want to remove a trap target from the host SNMP configuration. There are two ways to specify a trap target: * Pass the trap target to the TrapTargetToRemove parameter. * Use a combination of the TargetCommunity, TargetHost, and TargetPort parameters to specify a criteria (for example, remove all trap targets that are using port 162). |
Output
VMware.VimAutomation.ViCore.Types.V1.Host.VmHostSnmp
Examples
Example 1
Enables SNMP on a virtual machine host.
Example 2
Sets the virtual machine host SNMP by erasing the old value of the ReadOnlyCommunity parameter.
Related Commands
VMHost
VMHostAccount
VMHostAdvancedConfiguration
VMHostAuthentication
VMHostAvailableTimeZone
VMHostDiagnosticPartition
VMHostDisk
VMHostDiskPartition
VMHostFirewallDefaultPolicy
VMHostFirewallException
VMHostFirmware
VMHostHardware
VMHostHba
VMHostModule
VMHostNetwork
VMHostNetworkAdapter
VMHostNetworkStack
VMHostNtpServer
VMHostPatch
VMHostPciDevice
VMHostProfile
VMHostProfileCompliance
VMHostProfileImageCacheConfiguration
VMHostProfileRequiredInput
VMHostProfileStorageDeviceConfiguration
VMHostProfileUserConfiguration
VMHostProfileVmPortGroupConfiguration
VMHostRoute
VMHostService
VMHostSnmp
VMHostStartPolicy
VMHostStorage