J81.NSToolkit.Config/Public/ns-functions-config-snmp.ps1
function Invoke-NSUpdateSnmpalarm { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for alarm resource. .PARAMETER Trapname Name of the SNMP alarm. This parameter is required for identifying the SNMP alarm and cannot be modified. Possible values = CPU-USAGE, AVERAGE-CPU, MEMORY, MGMT-CPU-USAGE, SYNFLOOD, TCP-SYNFLOOD, VSERVER-REQRATE, SERVICE-REQRATE, ENTITY-RXRATE, ENTITY-TXRATE, ENTITY-SYNFLOOD, SERVICE-MAXCLIENTS, HA-STATE-CHANGE, ENTITY-STATE, CONFIG-CHANGE, CONFIG-SAVE, SERVICEGROUP-MEMBER-REQRATE, SERVICEGROUP-MEMBER-MAXCLIENTS, MONITOR-RTO-THRESHOLD, LOGIN-FAILURE, SSL-CERT-EXPIRY, FAN-SPEED-LOW, VOLTAGE-LOW, VOLTAGE-HIGH, TEMPERATURE-HIGH, CPU-TEMPERATURE-HIGH, POWER-SUPPLY-FAILURE, DISK-USAGE-HIGH, INTERFACE-THROUGHPUT-LOW, MON_PROBE_FAILED, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, INTERFACE-BW-USAGE, RATE-LIMIT-THRESHOLD-EXCEEDED, ENTITY-NAME-CHANGE, HA-PROP-FAILURE, IP-CONFLICT, PF-RL-RATE-THRESHOLD, PF-RL-PPS-THRESHOLD, PF-RL-RATE-PKTS-DROPPED, PF-RL-PPS-PKTS-DROPPED, APPFW-START-URL, APPFW-DENY-URL, APPFW-VIOLATIONS-TYPE, APPFW-REFERER-HEADER, APPFW-CSRF-TAG, APPFW-COOKIE, APPFW-FIELD-CONSISTENCY, APPFW-BUFFER-OVERFLOW, APPFW-FIELD-FORMAT, APPFW-FILE-UPLOAD-TYPE, APPFW-GRPC, APPFW-GRPC-WEB-JSON, APPFW-GRPC-WEB-TEXT, APPFW-JSON-DOS, APPFW-JSON-SQL, APPFW-JSON-XSS, APPFW-SAFE-COMMERCE, APPFW-SAFE-OBJECT, APPFW-SESSION-LIMIT, APPFW-SIGNATURE-MATCH, APPFW-POLICY-HIT, APPFW-XSS, APPFW-XML-XSS, APPFW-SQL, APPFW-XML-SQL, APPFW-XML-ATTACHMENT, APPFW-XML-DOS, APPFW-XML-VALIDATION, APPFW-XML-WSI, APPFW-XML-SCHEMA-COMPILE, APPFW-XML-SOAP-FAULT, APPFW-NEW-SIGNATURE-ADDED, APPFW-DEPLOY-RELAXATION-DP, APPFW-LEARNED-RULE-APPLIED-DYN-PROF, APPFW-CMD, APPFW-REST-VALIDATION, APPFW-GRPC-VALIDATION, APPFW-POSTBODYLIMIT, APPFW-JSON-CMD, APPFW-SQL-GRAM, APPFW-JSON-SQL-GRAM, APPFW-CMD-GRAM, APPFW-JSON-CMD-GRAM, APPFW-BLOCK-KEYWORD, APPFW-JSON-BLOCKKEYWORD, APPFW-BYPASS-LIST, APPFW-DENY-LIST, DNSKEY-EXPIRY, HA-LICENSE-MISMATCH, SSL-CARD-FAILED, SSL-CARD-NORMAL, WARM-RESTART-EVENT, HARD-DISK-DRIVE-ERRORS, COMPACT-FLASH-ERRORS, CALLHOME-UPLOAD-EVENT, 1024KEY-EXCHANGE-RATE, 2048KEY-EXCHANGE-RATE, 4096KEY-EXCHANGE-RATE, SSL-CUR-SESSION-INUSE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-CCO-CHANGE, CLUSTER-OVS-CHANGE, CLUSTER-SYNC-FAILURE, CLUSTER-SYNC-PARTIAL-SUCCESS, CLUSTER-PROP-FAILURE, CLUSTER-PROP-EXEC-FAILURE, HA-STICKY-PRIMARY, INBAND-PROTOCOL-VERSION-MISMATCH, SSL-CHIP-REINIT, VRID-STATE-CHANGE, PORT-ALLOC-FAILED, LLDP-REMOTE-CHANGE, DUPLICATE-IPV6, PARTITION-CONFIG-EVENT, PARTITION-SWITCHED, LSN-PORTALLOC-FAILED, LSN-PORTQUOTA-EXCEED, LSN-SESSIONQUOTA-EXCEED, LSN-MEM-RECOVERY-KICKEDIN, VSERVER-SPILLOVER, INCONSISTENT-CONFIGURATION-IN-PPES, PARTITION-RATE-LIMIT, POOLED-LICENSE-ONGRACE, POOLED-LICENSE-PARTIAL, CLUSTER-BACKPLANE-HB-MISSING, GSLB-SITE-MEP-FLAP, DNS-MAXNEGCACHE-USAGE, DNS-MAXCACHE-USAGE, NS-LICENSE-EXPIRY, PKT-RATELIMITING-ATTACK, GSLB-SYNC-STATUS-FLIP, URLFILT-DB-UPDATE-STATUS, URLFILT-INIT-SDK, POOLED-LICENSE-CHECKOUT-FAILURE, MIGRATION-STARTED, MIGRATION-COMPLETE, ECDHE-EXCHANGE-RATE, BOT-SIGNATURE-UPDATE, APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH, PORT-ALLOC-EXCEED, KEK_UPDATE_SUCCESS, KEK_UPDATE_FAILURE, ADC-ANOMALY, SYSLOG-CONNECTION-DROPPED, NSROOT_PASSWORD_EXPIRY_WARNING .PARAMETER Thresholdvalue Value for the high threshold. The Citrix ADC generates an SNMP trap message when the value of the attribute associated with the alarm is greater than or equal to the specified high threshold value. .PARAMETER Normalvalue Value for the normal threshold. A trap message is generated if the value of the respective attribute falls to or below this value after exceeding the high threshold. .PARAMETER Time Interval, in seconds, at which the Citrix ADC generates SNMP trap messages when the conditions specified in the SNMP alarm are met.Can be specified for the following alarms: SYNFLOOD, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS,HA-BAD-SECONDARY-STATE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-BKHB-FAILED, PORT-ALLOC-FAILED, COMPACT-FLASH-ERRORS, HARD-DISK-DRIVE-ERRORS and APPFW traps. Default trap time intervals: SYNFLOOD and APPFW traps = 1sec, PORT-ALLOC-FAILED = 3600sec(1 hour), PORT-ALLOC-EXCEED = 3600sec(1 hour), SYSLOG-CONNECTION-DROPPED = 3600sec(1 hour), Other Traps = 86400sec(1 day). .PARAMETER State Current state of the SNMP alarm. The Citrix ADC generates trap messages only for SNMP alarms that are enabled. Some alarms are enabled by default, but you can disable them. Possible values = ENABLED, DISABLED .PARAMETER Severity Severity level assigned to trap messages generated by this alarm. The severity levels are, in increasing order of severity, Informational, Warning, Minor, Major, and Critical. This parameter is useful when you want the Citrix ADC to send trap messages to a trap listener on the basis of severity level. Trap messages with a severity level lower than the specified level (in the trap listener entry) are not sent. Possible values = Critical, Major, Minor, Warning, Informational .PARAMETER Logging Logging status of the alarm. When logging is enabled, the Citrix ADC logs every trap message that is generated for this alarm. Possible values = ENABLED, DISABLED .PARAMETER PassThru Return details about the created snmpalarm item. .EXAMPLE PS C:\>Invoke-NSUpdateSnmpalarm -trapname <string> An example how to update snmpalarm config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpalarm Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpalarm/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('CPU-USAGE', 'AVERAGE-CPU', 'MEMORY', 'MGMT-CPU-USAGE', 'SYNFLOOD', 'TCP-SYNFLOOD', 'VSERVER-REQRATE', 'SERVICE-REQRATE', 'ENTITY-RXRATE', 'ENTITY-TXRATE', 'ENTITY-SYNFLOOD', 'SERVICE-MAXCLIENTS', 'HA-STATE-CHANGE', 'ENTITY-STATE', 'CONFIG-CHANGE', 'CONFIG-SAVE', 'SERVICEGROUP-MEMBER-REQRATE', 'SERVICEGROUP-MEMBER-MAXCLIENTS', 'MONITOR-RTO-THRESHOLD', 'LOGIN-FAILURE', 'SSL-CERT-EXPIRY', 'FAN-SPEED-LOW', 'VOLTAGE-LOW', 'VOLTAGE-HIGH', 'TEMPERATURE-HIGH', 'CPU-TEMPERATURE-HIGH', 'POWER-SUPPLY-FAILURE', 'DISK-USAGE-HIGH', 'INTERFACE-THROUGHPUT-LOW', 'MON_PROBE_FAILED', 'HA-VERSION-MISMATCH', 'HA-SYNC-FAILURE', 'HA-NO-HEARTBEATS', 'HA-BAD-SECONDARY-STATE', 'INTERFACE-BW-USAGE', 'RATE-LIMIT-THRESHOLD-EXCEEDED', 'ENTITY-NAME-CHANGE', 'HA-PROP-FAILURE', 'IP-CONFLICT', 'PF-RL-RATE-THRESHOLD', 'PF-RL-PPS-THRESHOLD', 'PF-RL-RATE-PKTS-DROPPED', 'PF-RL-PPS-PKTS-DROPPED', 'APPFW-START-URL', 'APPFW-DENY-URL', 'APPFW-VIOLATIONS-TYPE', 'APPFW-REFERER-HEADER', 'APPFW-CSRF-TAG', 'APPFW-COOKIE', 'APPFW-FIELD-CONSISTENCY', 'APPFW-BUFFER-OVERFLOW', 'APPFW-FIELD-FORMAT', 'APPFW-FILE-UPLOAD-TYPE', 'APPFW-GRPC', 'APPFW-GRPC-WEB-JSON', 'APPFW-GRPC-WEB-TEXT', 'APPFW-JSON-DOS', 'APPFW-JSON-SQL', 'APPFW-JSON-XSS', 'APPFW-SAFE-COMMERCE', 'APPFW-SAFE-OBJECT', 'APPFW-SESSION-LIMIT', 'APPFW-SIGNATURE-MATCH', 'APPFW-POLICY-HIT', 'APPFW-XSS', 'APPFW-XML-XSS', 'APPFW-SQL', 'APPFW-XML-SQL', 'APPFW-XML-ATTACHMENT', 'APPFW-XML-DOS', 'APPFW-XML-VALIDATION', 'APPFW-XML-WSI', 'APPFW-XML-SCHEMA-COMPILE', 'APPFW-XML-SOAP-FAULT', 'APPFW-NEW-SIGNATURE-ADDED', 'APPFW-DEPLOY-RELAXATION-DP', 'APPFW-LEARNED-RULE-APPLIED-DYN-PROF', 'APPFW-CMD', 'APPFW-REST-VALIDATION', 'APPFW-GRPC-VALIDATION', 'APPFW-POSTBODYLIMIT', 'APPFW-JSON-CMD', 'APPFW-SQL-GRAM', 'APPFW-JSON-SQL-GRAM', 'APPFW-CMD-GRAM', 'APPFW-JSON-CMD-GRAM', 'APPFW-BLOCK-KEYWORD', 'APPFW-JSON-BLOCKKEYWORD', 'APPFW-BYPASS-LIST', 'APPFW-DENY-LIST', 'DNSKEY-EXPIRY', 'HA-LICENSE-MISMATCH', 'SSL-CARD-FAILED', 'SSL-CARD-NORMAL', 'WARM-RESTART-EVENT', 'HARD-DISK-DRIVE-ERRORS', 'COMPACT-FLASH-ERRORS', 'CALLHOME-UPLOAD-EVENT', '1024KEY-EXCHANGE-RATE', '2048KEY-EXCHANGE-RATE', '4096KEY-EXCHANGE-RATE', 'SSL-CUR-SESSION-INUSE', 'CLUSTER-NODE-HEALTH', 'CLUSTER-NODE-QUORUM', 'CLUSTER-VERSION-MISMATCH', 'CLUSTER-CCO-CHANGE', 'CLUSTER-OVS-CHANGE', 'CLUSTER-SYNC-FAILURE', 'CLUSTER-SYNC-PARTIAL-SUCCESS', 'CLUSTER-PROP-FAILURE', 'CLUSTER-PROP-EXEC-FAILURE', 'HA-STICKY-PRIMARY', 'INBAND-PROTOCOL-VERSION-MISMATCH', 'SSL-CHIP-REINIT', 'VRID-STATE-CHANGE', 'PORT-ALLOC-FAILED', 'LLDP-REMOTE-CHANGE', 'DUPLICATE-IPV6', 'PARTITION-CONFIG-EVENT', 'PARTITION-SWITCHED', 'LSN-PORTALLOC-FAILED', 'LSN-PORTQUOTA-EXCEED', 'LSN-SESSIONQUOTA-EXCEED', 'LSN-MEM-RECOVERY-KICKEDIN', 'VSERVER-SPILLOVER', 'INCONSISTENT-CONFIGURATION-IN-PPES', 'PARTITION-RATE-LIMIT', 'POOLED-LICENSE-ONGRACE', 'POOLED-LICENSE-PARTIAL', 'CLUSTER-BACKPLANE-HB-MISSING', 'GSLB-SITE-MEP-FLAP', 'DNS-MAXNEGCACHE-USAGE', 'DNS-MAXCACHE-USAGE', 'NS-LICENSE-EXPIRY', 'PKT-RATELIMITING-ATTACK', 'GSLB-SYNC-STATUS-FLIP', 'URLFILT-DB-UPDATE-STATUS', 'URLFILT-INIT-SDK', 'POOLED-LICENSE-CHECKOUT-FAILURE', 'MIGRATION-STARTED', 'MIGRATION-COMPLETE', 'ECDHE-EXCHANGE-RATE', 'BOT-SIGNATURE-UPDATE', 'APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH', 'PORT-ALLOC-EXCEED', 'KEK_UPDATE_SUCCESS', 'KEK_UPDATE_FAILURE', 'ADC-ANOMALY', 'SYSLOG-CONNECTION-DROPPED', 'NSROOT_PASSWORD_EXPIRY_WARNING')] [string]$Trapname, [double]$Thresholdvalue, [double]$Normalvalue, [double]$Time, [ValidateSet('ENABLED', 'DISABLED')] [string]$State, [ValidateSet('Critical', 'Major', 'Minor', 'Warning', 'Informational')] [string]$Severity, [ValidateSet('ENABLED', 'DISABLED')] [string]$Logging, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateSnmpalarm: Starting" } process { try { $payload = @{ trapname = $trapname } if ( $PSBoundParameters.ContainsKey('thresholdvalue') ) { $payload.Add('thresholdvalue', $thresholdvalue) } if ( $PSBoundParameters.ContainsKey('normalvalue') ) { $payload.Add('normalvalue', $normalvalue) } if ( $PSBoundParameters.ContainsKey('time') ) { $payload.Add('time', $time) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('severity') ) { $payload.Add('severity', $severity) } if ( $PSBoundParameters.ContainsKey('logging') ) { $payload.Add('logging', $logging) } if ( $PSCmdlet.ShouldProcess("snmpalarm", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpalarm -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpalarm -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpalarm: Finished" } } function Invoke-NSUnsetSnmpalarm { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for alarm resource. .PARAMETER Trapname Name of the SNMP alarm. This parameter is required for identifying the SNMP alarm and cannot be modified. Possible values = CPU-USAGE, AVERAGE-CPU, MEMORY, MGMT-CPU-USAGE, SYNFLOOD, TCP-SYNFLOOD, VSERVER-REQRATE, SERVICE-REQRATE, ENTITY-RXRATE, ENTITY-TXRATE, ENTITY-SYNFLOOD, SERVICE-MAXCLIENTS, HA-STATE-CHANGE, ENTITY-STATE, CONFIG-CHANGE, CONFIG-SAVE, SERVICEGROUP-MEMBER-REQRATE, SERVICEGROUP-MEMBER-MAXCLIENTS, MONITOR-RTO-THRESHOLD, LOGIN-FAILURE, SSL-CERT-EXPIRY, FAN-SPEED-LOW, VOLTAGE-LOW, VOLTAGE-HIGH, TEMPERATURE-HIGH, CPU-TEMPERATURE-HIGH, POWER-SUPPLY-FAILURE, DISK-USAGE-HIGH, INTERFACE-THROUGHPUT-LOW, MON_PROBE_FAILED, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, INTERFACE-BW-USAGE, RATE-LIMIT-THRESHOLD-EXCEEDED, ENTITY-NAME-CHANGE, HA-PROP-FAILURE, IP-CONFLICT, PF-RL-RATE-THRESHOLD, PF-RL-PPS-THRESHOLD, PF-RL-RATE-PKTS-DROPPED, PF-RL-PPS-PKTS-DROPPED, APPFW-START-URL, APPFW-DENY-URL, APPFW-VIOLATIONS-TYPE, APPFW-REFERER-HEADER, APPFW-CSRF-TAG, APPFW-COOKIE, APPFW-FIELD-CONSISTENCY, APPFW-BUFFER-OVERFLOW, APPFW-FIELD-FORMAT, APPFW-FILE-UPLOAD-TYPE, APPFW-GRPC, APPFW-GRPC-WEB-JSON, APPFW-GRPC-WEB-TEXT, APPFW-JSON-DOS, APPFW-JSON-SQL, APPFW-JSON-XSS, APPFW-SAFE-COMMERCE, APPFW-SAFE-OBJECT, APPFW-SESSION-LIMIT, APPFW-SIGNATURE-MATCH, APPFW-POLICY-HIT, APPFW-XSS, APPFW-XML-XSS, APPFW-SQL, APPFW-XML-SQL, APPFW-XML-ATTACHMENT, APPFW-XML-DOS, APPFW-XML-VALIDATION, APPFW-XML-WSI, APPFW-XML-SCHEMA-COMPILE, APPFW-XML-SOAP-FAULT, APPFW-NEW-SIGNATURE-ADDED, APPFW-DEPLOY-RELAXATION-DP, APPFW-LEARNED-RULE-APPLIED-DYN-PROF, APPFW-CMD, APPFW-REST-VALIDATION, APPFW-GRPC-VALIDATION, APPFW-POSTBODYLIMIT, APPFW-JSON-CMD, APPFW-SQL-GRAM, APPFW-JSON-SQL-GRAM, APPFW-CMD-GRAM, APPFW-JSON-CMD-GRAM, APPFW-BLOCK-KEYWORD, APPFW-JSON-BLOCKKEYWORD, APPFW-BYPASS-LIST, APPFW-DENY-LIST, DNSKEY-EXPIRY, HA-LICENSE-MISMATCH, SSL-CARD-FAILED, SSL-CARD-NORMAL, WARM-RESTART-EVENT, HARD-DISK-DRIVE-ERRORS, COMPACT-FLASH-ERRORS, CALLHOME-UPLOAD-EVENT, 1024KEY-EXCHANGE-RATE, 2048KEY-EXCHANGE-RATE, 4096KEY-EXCHANGE-RATE, SSL-CUR-SESSION-INUSE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-CCO-CHANGE, CLUSTER-OVS-CHANGE, CLUSTER-SYNC-FAILURE, CLUSTER-SYNC-PARTIAL-SUCCESS, CLUSTER-PROP-FAILURE, CLUSTER-PROP-EXEC-FAILURE, HA-STICKY-PRIMARY, INBAND-PROTOCOL-VERSION-MISMATCH, SSL-CHIP-REINIT, VRID-STATE-CHANGE, PORT-ALLOC-FAILED, LLDP-REMOTE-CHANGE, DUPLICATE-IPV6, PARTITION-CONFIG-EVENT, PARTITION-SWITCHED, LSN-PORTALLOC-FAILED, LSN-PORTQUOTA-EXCEED, LSN-SESSIONQUOTA-EXCEED, LSN-MEM-RECOVERY-KICKEDIN, VSERVER-SPILLOVER, INCONSISTENT-CONFIGURATION-IN-PPES, PARTITION-RATE-LIMIT, POOLED-LICENSE-ONGRACE, POOLED-LICENSE-PARTIAL, CLUSTER-BACKPLANE-HB-MISSING, GSLB-SITE-MEP-FLAP, DNS-MAXNEGCACHE-USAGE, DNS-MAXCACHE-USAGE, NS-LICENSE-EXPIRY, PKT-RATELIMITING-ATTACK, GSLB-SYNC-STATUS-FLIP, URLFILT-DB-UPDATE-STATUS, URLFILT-INIT-SDK, POOLED-LICENSE-CHECKOUT-FAILURE, MIGRATION-STARTED, MIGRATION-COMPLETE, ECDHE-EXCHANGE-RATE, BOT-SIGNATURE-UPDATE, APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH, PORT-ALLOC-EXCEED, KEK_UPDATE_SUCCESS, KEK_UPDATE_FAILURE, ADC-ANOMALY, SYSLOG-CONNECTION-DROPPED, NSROOT_PASSWORD_EXPIRY_WARNING .PARAMETER Thresholdvalue Value for the high threshold. The Citrix ADC generates an SNMP trap message when the value of the attribute associated with the alarm is greater than or equal to the specified high threshold value. .PARAMETER Normalvalue Value for the normal threshold. A trap message is generated if the value of the respective attribute falls to or below this value after exceeding the high threshold. .PARAMETER Time Interval, in seconds, at which the Citrix ADC generates SNMP trap messages when the conditions specified in the SNMP alarm are met.Can be specified for the following alarms: SYNFLOOD, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS,HA-BAD-SECONDARY-STATE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-BKHB-FAILED, PORT-ALLOC-FAILED, COMPACT-FLASH-ERRORS, HARD-DISK-DRIVE-ERRORS and APPFW traps. Default trap time intervals: SYNFLOOD and APPFW traps = 1sec, PORT-ALLOC-FAILED = 3600sec(1 hour), PORT-ALLOC-EXCEED = 3600sec(1 hour), SYSLOG-CONNECTION-DROPPED = 3600sec(1 hour), Other Traps = 86400sec(1 day). .PARAMETER State Current state of the SNMP alarm. The Citrix ADC generates trap messages only for SNMP alarms that are enabled. Some alarms are enabled by default, but you can disable them. Possible values = ENABLED, DISABLED .PARAMETER Severity Severity level assigned to trap messages generated by this alarm. The severity levels are, in increasing order of severity, Informational, Warning, Minor, Major, and Critical. This parameter is useful when you want the Citrix ADC to send trap messages to a trap listener on the basis of severity level. Trap messages with a severity level lower than the specified level (in the trap listener entry) are not sent. Possible values = Critical, Major, Minor, Warning, Informational .PARAMETER Logging Logging status of the alarm. When logging is enabled, the Citrix ADC logs every trap message that is generated for this alarm. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUnsetSnmpalarm -trapname <string> An example how to unset snmpalarm config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpalarm Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpalarm Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CPU-USAGE', 'AVERAGE-CPU', 'MEMORY', 'MGMT-CPU-USAGE', 'SYNFLOOD', 'TCP-SYNFLOOD', 'VSERVER-REQRATE', 'SERVICE-REQRATE', 'ENTITY-RXRATE', 'ENTITY-TXRATE', 'ENTITY-SYNFLOOD', 'SERVICE-MAXCLIENTS', 'HA-STATE-CHANGE', 'ENTITY-STATE', 'CONFIG-CHANGE', 'CONFIG-SAVE', 'SERVICEGROUP-MEMBER-REQRATE', 'SERVICEGROUP-MEMBER-MAXCLIENTS', 'MONITOR-RTO-THRESHOLD', 'LOGIN-FAILURE', 'SSL-CERT-EXPIRY', 'FAN-SPEED-LOW', 'VOLTAGE-LOW', 'VOLTAGE-HIGH', 'TEMPERATURE-HIGH', 'CPU-TEMPERATURE-HIGH', 'POWER-SUPPLY-FAILURE', 'DISK-USAGE-HIGH', 'INTERFACE-THROUGHPUT-LOW', 'MON_PROBE_FAILED', 'HA-VERSION-MISMATCH', 'HA-SYNC-FAILURE', 'HA-NO-HEARTBEATS', 'HA-BAD-SECONDARY-STATE', 'INTERFACE-BW-USAGE', 'RATE-LIMIT-THRESHOLD-EXCEEDED', 'ENTITY-NAME-CHANGE', 'HA-PROP-FAILURE', 'IP-CONFLICT', 'PF-RL-RATE-THRESHOLD', 'PF-RL-PPS-THRESHOLD', 'PF-RL-RATE-PKTS-DROPPED', 'PF-RL-PPS-PKTS-DROPPED', 'APPFW-START-URL', 'APPFW-DENY-URL', 'APPFW-VIOLATIONS-TYPE', 'APPFW-REFERER-HEADER', 'APPFW-CSRF-TAG', 'APPFW-COOKIE', 'APPFW-FIELD-CONSISTENCY', 'APPFW-BUFFER-OVERFLOW', 'APPFW-FIELD-FORMAT', 'APPFW-FILE-UPLOAD-TYPE', 'APPFW-GRPC', 'APPFW-GRPC-WEB-JSON', 'APPFW-GRPC-WEB-TEXT', 'APPFW-JSON-DOS', 'APPFW-JSON-SQL', 'APPFW-JSON-XSS', 'APPFW-SAFE-COMMERCE', 'APPFW-SAFE-OBJECT', 'APPFW-SESSION-LIMIT', 'APPFW-SIGNATURE-MATCH', 'APPFW-POLICY-HIT', 'APPFW-XSS', 'APPFW-XML-XSS', 'APPFW-SQL', 'APPFW-XML-SQL', 'APPFW-XML-ATTACHMENT', 'APPFW-XML-DOS', 'APPFW-XML-VALIDATION', 'APPFW-XML-WSI', 'APPFW-XML-SCHEMA-COMPILE', 'APPFW-XML-SOAP-FAULT', 'APPFW-NEW-SIGNATURE-ADDED', 'APPFW-DEPLOY-RELAXATION-DP', 'APPFW-LEARNED-RULE-APPLIED-DYN-PROF', 'APPFW-CMD', 'APPFW-REST-VALIDATION', 'APPFW-GRPC-VALIDATION', 'APPFW-POSTBODYLIMIT', 'APPFW-JSON-CMD', 'APPFW-SQL-GRAM', 'APPFW-JSON-SQL-GRAM', 'APPFW-CMD-GRAM', 'APPFW-JSON-CMD-GRAM', 'APPFW-BLOCK-KEYWORD', 'APPFW-JSON-BLOCKKEYWORD', 'APPFW-BYPASS-LIST', 'APPFW-DENY-LIST', 'DNSKEY-EXPIRY', 'HA-LICENSE-MISMATCH', 'SSL-CARD-FAILED', 'SSL-CARD-NORMAL', 'WARM-RESTART-EVENT', 'HARD-DISK-DRIVE-ERRORS', 'COMPACT-FLASH-ERRORS', 'CALLHOME-UPLOAD-EVENT', '1024KEY-EXCHANGE-RATE', '2048KEY-EXCHANGE-RATE', '4096KEY-EXCHANGE-RATE', 'SSL-CUR-SESSION-INUSE', 'CLUSTER-NODE-HEALTH', 'CLUSTER-NODE-QUORUM', 'CLUSTER-VERSION-MISMATCH', 'CLUSTER-CCO-CHANGE', 'CLUSTER-OVS-CHANGE', 'CLUSTER-SYNC-FAILURE', 'CLUSTER-SYNC-PARTIAL-SUCCESS', 'CLUSTER-PROP-FAILURE', 'CLUSTER-PROP-EXEC-FAILURE', 'HA-STICKY-PRIMARY', 'INBAND-PROTOCOL-VERSION-MISMATCH', 'SSL-CHIP-REINIT', 'VRID-STATE-CHANGE', 'PORT-ALLOC-FAILED', 'LLDP-REMOTE-CHANGE', 'DUPLICATE-IPV6', 'PARTITION-CONFIG-EVENT', 'PARTITION-SWITCHED', 'LSN-PORTALLOC-FAILED', 'LSN-PORTQUOTA-EXCEED', 'LSN-SESSIONQUOTA-EXCEED', 'LSN-MEM-RECOVERY-KICKEDIN', 'VSERVER-SPILLOVER', 'INCONSISTENT-CONFIGURATION-IN-PPES', 'PARTITION-RATE-LIMIT', 'POOLED-LICENSE-ONGRACE', 'POOLED-LICENSE-PARTIAL', 'CLUSTER-BACKPLANE-HB-MISSING', 'GSLB-SITE-MEP-FLAP', 'DNS-MAXNEGCACHE-USAGE', 'DNS-MAXCACHE-USAGE', 'NS-LICENSE-EXPIRY', 'PKT-RATELIMITING-ATTACK', 'GSLB-SYNC-STATUS-FLIP', 'URLFILT-DB-UPDATE-STATUS', 'URLFILT-INIT-SDK', 'POOLED-LICENSE-CHECKOUT-FAILURE', 'MIGRATION-STARTED', 'MIGRATION-COMPLETE', 'ECDHE-EXCHANGE-RATE', 'BOT-SIGNATURE-UPDATE', 'APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH', 'PORT-ALLOC-EXCEED', 'KEK_UPDATE_SUCCESS', 'KEK_UPDATE_FAILURE', 'ADC-ANOMALY', 'SYSLOG-CONNECTION-DROPPED', 'NSROOT_PASSWORD_EXPIRY_WARNING')] [string]$Trapname, [Boolean]$thresholdvalue, [Boolean]$normalvalue, [Boolean]$time, [Boolean]$state, [Boolean]$severity, [Boolean]$logging ) begin { Write-Verbose "Invoke-NSUnsetSnmpalarm: Starting" } process { try { $payload = @{ trapname = $trapname } if ( $PSBoundParameters.ContainsKey('thresholdvalue') ) { $payload.Add('thresholdvalue', $thresholdvalue) } if ( $PSBoundParameters.ContainsKey('normalvalue') ) { $payload.Add('normalvalue', $normalvalue) } if ( $PSBoundParameters.ContainsKey('time') ) { $payload.Add('time', $time) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('severity') ) { $payload.Add('severity', $severity) } if ( $PSBoundParameters.ContainsKey('logging') ) { $payload.Add('logging', $logging) } if ( $PSCmdlet.ShouldProcess("$trapname", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpalarm -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpalarm: Finished" } } function Invoke-NSEnableSnmpalarm { <# .SYNOPSIS Enable SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for alarm resource. .PARAMETER Trapname Name of the SNMP alarm. This parameter is required for identifying the SNMP alarm and cannot be modified. Possible values = CPU-USAGE, AVERAGE-CPU, MEMORY, MGMT-CPU-USAGE, SYNFLOOD, TCP-SYNFLOOD, VSERVER-REQRATE, SERVICE-REQRATE, ENTITY-RXRATE, ENTITY-TXRATE, ENTITY-SYNFLOOD, SERVICE-MAXCLIENTS, HA-STATE-CHANGE, ENTITY-STATE, CONFIG-CHANGE, CONFIG-SAVE, SERVICEGROUP-MEMBER-REQRATE, SERVICEGROUP-MEMBER-MAXCLIENTS, MONITOR-RTO-THRESHOLD, LOGIN-FAILURE, SSL-CERT-EXPIRY, FAN-SPEED-LOW, VOLTAGE-LOW, VOLTAGE-HIGH, TEMPERATURE-HIGH, CPU-TEMPERATURE-HIGH, POWER-SUPPLY-FAILURE, DISK-USAGE-HIGH, INTERFACE-THROUGHPUT-LOW, MON_PROBE_FAILED, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, INTERFACE-BW-USAGE, RATE-LIMIT-THRESHOLD-EXCEEDED, ENTITY-NAME-CHANGE, HA-PROP-FAILURE, IP-CONFLICT, PF-RL-RATE-THRESHOLD, PF-RL-PPS-THRESHOLD, PF-RL-RATE-PKTS-DROPPED, PF-RL-PPS-PKTS-DROPPED, APPFW-START-URL, APPFW-DENY-URL, APPFW-VIOLATIONS-TYPE, APPFW-REFERER-HEADER, APPFW-CSRF-TAG, APPFW-COOKIE, APPFW-FIELD-CONSISTENCY, APPFW-BUFFER-OVERFLOW, APPFW-FIELD-FORMAT, APPFW-FILE-UPLOAD-TYPE, APPFW-GRPC, APPFW-GRPC-WEB-JSON, APPFW-GRPC-WEB-TEXT, APPFW-JSON-DOS, APPFW-JSON-SQL, APPFW-JSON-XSS, APPFW-SAFE-COMMERCE, APPFW-SAFE-OBJECT, APPFW-SESSION-LIMIT, APPFW-SIGNATURE-MATCH, APPFW-POLICY-HIT, APPFW-XSS, APPFW-XML-XSS, APPFW-SQL, APPFW-XML-SQL, APPFW-XML-ATTACHMENT, APPFW-XML-DOS, APPFW-XML-VALIDATION, APPFW-XML-WSI, APPFW-XML-SCHEMA-COMPILE, APPFW-XML-SOAP-FAULT, APPFW-NEW-SIGNATURE-ADDED, APPFW-DEPLOY-RELAXATION-DP, APPFW-LEARNED-RULE-APPLIED-DYN-PROF, APPFW-CMD, APPFW-REST-VALIDATION, APPFW-GRPC-VALIDATION, APPFW-POSTBODYLIMIT, APPFW-JSON-CMD, APPFW-SQL-GRAM, APPFW-JSON-SQL-GRAM, APPFW-CMD-GRAM, APPFW-JSON-CMD-GRAM, APPFW-BLOCK-KEYWORD, APPFW-JSON-BLOCKKEYWORD, APPFW-BYPASS-LIST, APPFW-DENY-LIST, DNSKEY-EXPIRY, HA-LICENSE-MISMATCH, SSL-CARD-FAILED, SSL-CARD-NORMAL, WARM-RESTART-EVENT, HARD-DISK-DRIVE-ERRORS, COMPACT-FLASH-ERRORS, CALLHOME-UPLOAD-EVENT, 1024KEY-EXCHANGE-RATE, 2048KEY-EXCHANGE-RATE, 4096KEY-EXCHANGE-RATE, SSL-CUR-SESSION-INUSE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-CCO-CHANGE, CLUSTER-OVS-CHANGE, CLUSTER-SYNC-FAILURE, CLUSTER-SYNC-PARTIAL-SUCCESS, CLUSTER-PROP-FAILURE, CLUSTER-PROP-EXEC-FAILURE, HA-STICKY-PRIMARY, INBAND-PROTOCOL-VERSION-MISMATCH, SSL-CHIP-REINIT, VRID-STATE-CHANGE, PORT-ALLOC-FAILED, LLDP-REMOTE-CHANGE, DUPLICATE-IPV6, PARTITION-CONFIG-EVENT, PARTITION-SWITCHED, LSN-PORTALLOC-FAILED, LSN-PORTQUOTA-EXCEED, LSN-SESSIONQUOTA-EXCEED, LSN-MEM-RECOVERY-KICKEDIN, VSERVER-SPILLOVER, INCONSISTENT-CONFIGURATION-IN-PPES, PARTITION-RATE-LIMIT, POOLED-LICENSE-ONGRACE, POOLED-LICENSE-PARTIAL, CLUSTER-BACKPLANE-HB-MISSING, GSLB-SITE-MEP-FLAP, DNS-MAXNEGCACHE-USAGE, DNS-MAXCACHE-USAGE, NS-LICENSE-EXPIRY, PKT-RATELIMITING-ATTACK, GSLB-SYNC-STATUS-FLIP, URLFILT-DB-UPDATE-STATUS, URLFILT-INIT-SDK, POOLED-LICENSE-CHECKOUT-FAILURE, MIGRATION-STARTED, MIGRATION-COMPLETE, ECDHE-EXCHANGE-RATE, BOT-SIGNATURE-UPDATE, APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH, PORT-ALLOC-EXCEED, KEK_UPDATE_SUCCESS, KEK_UPDATE_FAILURE, ADC-ANOMALY, SYSLOG-CONNECTION-DROPPED, NSROOT_PASSWORD_EXPIRY_WARNING .EXAMPLE PS C:\>Invoke-NSEnableSnmpalarm -trapname <string> An example how to enable snmpalarm config Object(s). .NOTES File Name : Invoke-NSEnableSnmpalarm Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpalarm/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('CPU-USAGE', 'AVERAGE-CPU', 'MEMORY', 'MGMT-CPU-USAGE', 'SYNFLOOD', 'TCP-SYNFLOOD', 'VSERVER-REQRATE', 'SERVICE-REQRATE', 'ENTITY-RXRATE', 'ENTITY-TXRATE', 'ENTITY-SYNFLOOD', 'SERVICE-MAXCLIENTS', 'HA-STATE-CHANGE', 'ENTITY-STATE', 'CONFIG-CHANGE', 'CONFIG-SAVE', 'SERVICEGROUP-MEMBER-REQRATE', 'SERVICEGROUP-MEMBER-MAXCLIENTS', 'MONITOR-RTO-THRESHOLD', 'LOGIN-FAILURE', 'SSL-CERT-EXPIRY', 'FAN-SPEED-LOW', 'VOLTAGE-LOW', 'VOLTAGE-HIGH', 'TEMPERATURE-HIGH', 'CPU-TEMPERATURE-HIGH', 'POWER-SUPPLY-FAILURE', 'DISK-USAGE-HIGH', 'INTERFACE-THROUGHPUT-LOW', 'MON_PROBE_FAILED', 'HA-VERSION-MISMATCH', 'HA-SYNC-FAILURE', 'HA-NO-HEARTBEATS', 'HA-BAD-SECONDARY-STATE', 'INTERFACE-BW-USAGE', 'RATE-LIMIT-THRESHOLD-EXCEEDED', 'ENTITY-NAME-CHANGE', 'HA-PROP-FAILURE', 'IP-CONFLICT', 'PF-RL-RATE-THRESHOLD', 'PF-RL-PPS-THRESHOLD', 'PF-RL-RATE-PKTS-DROPPED', 'PF-RL-PPS-PKTS-DROPPED', 'APPFW-START-URL', 'APPFW-DENY-URL', 'APPFW-VIOLATIONS-TYPE', 'APPFW-REFERER-HEADER', 'APPFW-CSRF-TAG', 'APPFW-COOKIE', 'APPFW-FIELD-CONSISTENCY', 'APPFW-BUFFER-OVERFLOW', 'APPFW-FIELD-FORMAT', 'APPFW-FILE-UPLOAD-TYPE', 'APPFW-GRPC', 'APPFW-GRPC-WEB-JSON', 'APPFW-GRPC-WEB-TEXT', 'APPFW-JSON-DOS', 'APPFW-JSON-SQL', 'APPFW-JSON-XSS', 'APPFW-SAFE-COMMERCE', 'APPFW-SAFE-OBJECT', 'APPFW-SESSION-LIMIT', 'APPFW-SIGNATURE-MATCH', 'APPFW-POLICY-HIT', 'APPFW-XSS', 'APPFW-XML-XSS', 'APPFW-SQL', 'APPFW-XML-SQL', 'APPFW-XML-ATTACHMENT', 'APPFW-XML-DOS', 'APPFW-XML-VALIDATION', 'APPFW-XML-WSI', 'APPFW-XML-SCHEMA-COMPILE', 'APPFW-XML-SOAP-FAULT', 'APPFW-NEW-SIGNATURE-ADDED', 'APPFW-DEPLOY-RELAXATION-DP', 'APPFW-LEARNED-RULE-APPLIED-DYN-PROF', 'APPFW-CMD', 'APPFW-REST-VALIDATION', 'APPFW-GRPC-VALIDATION', 'APPFW-POSTBODYLIMIT', 'APPFW-JSON-CMD', 'APPFW-SQL-GRAM', 'APPFW-JSON-SQL-GRAM', 'APPFW-CMD-GRAM', 'APPFW-JSON-CMD-GRAM', 'APPFW-BLOCK-KEYWORD', 'APPFW-JSON-BLOCKKEYWORD', 'APPFW-BYPASS-LIST', 'APPFW-DENY-LIST', 'DNSKEY-EXPIRY', 'HA-LICENSE-MISMATCH', 'SSL-CARD-FAILED', 'SSL-CARD-NORMAL', 'WARM-RESTART-EVENT', 'HARD-DISK-DRIVE-ERRORS', 'COMPACT-FLASH-ERRORS', 'CALLHOME-UPLOAD-EVENT', '1024KEY-EXCHANGE-RATE', '2048KEY-EXCHANGE-RATE', '4096KEY-EXCHANGE-RATE', 'SSL-CUR-SESSION-INUSE', 'CLUSTER-NODE-HEALTH', 'CLUSTER-NODE-QUORUM', 'CLUSTER-VERSION-MISMATCH', 'CLUSTER-CCO-CHANGE', 'CLUSTER-OVS-CHANGE', 'CLUSTER-SYNC-FAILURE', 'CLUSTER-SYNC-PARTIAL-SUCCESS', 'CLUSTER-PROP-FAILURE', 'CLUSTER-PROP-EXEC-FAILURE', 'HA-STICKY-PRIMARY', 'INBAND-PROTOCOL-VERSION-MISMATCH', 'SSL-CHIP-REINIT', 'VRID-STATE-CHANGE', 'PORT-ALLOC-FAILED', 'LLDP-REMOTE-CHANGE', 'DUPLICATE-IPV6', 'PARTITION-CONFIG-EVENT', 'PARTITION-SWITCHED', 'LSN-PORTALLOC-FAILED', 'LSN-PORTQUOTA-EXCEED', 'LSN-SESSIONQUOTA-EXCEED', 'LSN-MEM-RECOVERY-KICKEDIN', 'VSERVER-SPILLOVER', 'INCONSISTENT-CONFIGURATION-IN-PPES', 'PARTITION-RATE-LIMIT', 'POOLED-LICENSE-ONGRACE', 'POOLED-LICENSE-PARTIAL', 'CLUSTER-BACKPLANE-HB-MISSING', 'GSLB-SITE-MEP-FLAP', 'DNS-MAXNEGCACHE-USAGE', 'DNS-MAXCACHE-USAGE', 'NS-LICENSE-EXPIRY', 'PKT-RATELIMITING-ATTACK', 'GSLB-SYNC-STATUS-FLIP', 'URLFILT-DB-UPDATE-STATUS', 'URLFILT-INIT-SDK', 'POOLED-LICENSE-CHECKOUT-FAILURE', 'MIGRATION-STARTED', 'MIGRATION-COMPLETE', 'ECDHE-EXCHANGE-RATE', 'BOT-SIGNATURE-UPDATE', 'APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH', 'PORT-ALLOC-EXCEED', 'KEK_UPDATE_SUCCESS', 'KEK_UPDATE_FAILURE', 'ADC-ANOMALY', 'SYSLOG-CONNECTION-DROPPED', 'NSROOT_PASSWORD_EXPIRY_WARNING')] [string]$Trapname ) begin { Write-Verbose "Invoke-NSEnableSnmpalarm: Starting" } process { try { $payload = @{ trapname = $trapname } if ( $PSCmdlet.ShouldProcess($Name, "Enable SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpalarm -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableSnmpalarm: Finished" } } function Invoke-NSDisableSnmpalarm { <# .SYNOPSIS Disable SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for alarm resource. .PARAMETER Trapname Name of the SNMP alarm. This parameter is required for identifying the SNMP alarm and cannot be modified. Possible values = CPU-USAGE, AVERAGE-CPU, MEMORY, MGMT-CPU-USAGE, SYNFLOOD, TCP-SYNFLOOD, VSERVER-REQRATE, SERVICE-REQRATE, ENTITY-RXRATE, ENTITY-TXRATE, ENTITY-SYNFLOOD, SERVICE-MAXCLIENTS, HA-STATE-CHANGE, ENTITY-STATE, CONFIG-CHANGE, CONFIG-SAVE, SERVICEGROUP-MEMBER-REQRATE, SERVICEGROUP-MEMBER-MAXCLIENTS, MONITOR-RTO-THRESHOLD, LOGIN-FAILURE, SSL-CERT-EXPIRY, FAN-SPEED-LOW, VOLTAGE-LOW, VOLTAGE-HIGH, TEMPERATURE-HIGH, CPU-TEMPERATURE-HIGH, POWER-SUPPLY-FAILURE, DISK-USAGE-HIGH, INTERFACE-THROUGHPUT-LOW, MON_PROBE_FAILED, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, INTERFACE-BW-USAGE, RATE-LIMIT-THRESHOLD-EXCEEDED, ENTITY-NAME-CHANGE, HA-PROP-FAILURE, IP-CONFLICT, PF-RL-RATE-THRESHOLD, PF-RL-PPS-THRESHOLD, PF-RL-RATE-PKTS-DROPPED, PF-RL-PPS-PKTS-DROPPED, APPFW-START-URL, APPFW-DENY-URL, APPFW-VIOLATIONS-TYPE, APPFW-REFERER-HEADER, APPFW-CSRF-TAG, APPFW-COOKIE, APPFW-FIELD-CONSISTENCY, APPFW-BUFFER-OVERFLOW, APPFW-FIELD-FORMAT, APPFW-FILE-UPLOAD-TYPE, APPFW-GRPC, APPFW-GRPC-WEB-JSON, APPFW-GRPC-WEB-TEXT, APPFW-JSON-DOS, APPFW-JSON-SQL, APPFW-JSON-XSS, APPFW-SAFE-COMMERCE, APPFW-SAFE-OBJECT, APPFW-SESSION-LIMIT, APPFW-SIGNATURE-MATCH, APPFW-POLICY-HIT, APPFW-XSS, APPFW-XML-XSS, APPFW-SQL, APPFW-XML-SQL, APPFW-XML-ATTACHMENT, APPFW-XML-DOS, APPFW-XML-VALIDATION, APPFW-XML-WSI, APPFW-XML-SCHEMA-COMPILE, APPFW-XML-SOAP-FAULT, APPFW-NEW-SIGNATURE-ADDED, APPFW-DEPLOY-RELAXATION-DP, APPFW-LEARNED-RULE-APPLIED-DYN-PROF, APPFW-CMD, APPFW-REST-VALIDATION, APPFW-GRPC-VALIDATION, APPFW-POSTBODYLIMIT, APPFW-JSON-CMD, APPFW-SQL-GRAM, APPFW-JSON-SQL-GRAM, APPFW-CMD-GRAM, APPFW-JSON-CMD-GRAM, APPFW-BLOCK-KEYWORD, APPFW-JSON-BLOCKKEYWORD, APPFW-BYPASS-LIST, APPFW-DENY-LIST, DNSKEY-EXPIRY, HA-LICENSE-MISMATCH, SSL-CARD-FAILED, SSL-CARD-NORMAL, WARM-RESTART-EVENT, HARD-DISK-DRIVE-ERRORS, COMPACT-FLASH-ERRORS, CALLHOME-UPLOAD-EVENT, 1024KEY-EXCHANGE-RATE, 2048KEY-EXCHANGE-RATE, 4096KEY-EXCHANGE-RATE, SSL-CUR-SESSION-INUSE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-CCO-CHANGE, CLUSTER-OVS-CHANGE, CLUSTER-SYNC-FAILURE, CLUSTER-SYNC-PARTIAL-SUCCESS, CLUSTER-PROP-FAILURE, CLUSTER-PROP-EXEC-FAILURE, HA-STICKY-PRIMARY, INBAND-PROTOCOL-VERSION-MISMATCH, SSL-CHIP-REINIT, VRID-STATE-CHANGE, PORT-ALLOC-FAILED, LLDP-REMOTE-CHANGE, DUPLICATE-IPV6, PARTITION-CONFIG-EVENT, PARTITION-SWITCHED, LSN-PORTALLOC-FAILED, LSN-PORTQUOTA-EXCEED, LSN-SESSIONQUOTA-EXCEED, LSN-MEM-RECOVERY-KICKEDIN, VSERVER-SPILLOVER, INCONSISTENT-CONFIGURATION-IN-PPES, PARTITION-RATE-LIMIT, POOLED-LICENSE-ONGRACE, POOLED-LICENSE-PARTIAL, CLUSTER-BACKPLANE-HB-MISSING, GSLB-SITE-MEP-FLAP, DNS-MAXNEGCACHE-USAGE, DNS-MAXCACHE-USAGE, NS-LICENSE-EXPIRY, PKT-RATELIMITING-ATTACK, GSLB-SYNC-STATUS-FLIP, URLFILT-DB-UPDATE-STATUS, URLFILT-INIT-SDK, POOLED-LICENSE-CHECKOUT-FAILURE, MIGRATION-STARTED, MIGRATION-COMPLETE, ECDHE-EXCHANGE-RATE, BOT-SIGNATURE-UPDATE, APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH, PORT-ALLOC-EXCEED, KEK_UPDATE_SUCCESS, KEK_UPDATE_FAILURE, ADC-ANOMALY, SYSLOG-CONNECTION-DROPPED, NSROOT_PASSWORD_EXPIRY_WARNING .EXAMPLE PS C:\>Invoke-NSDisableSnmpalarm -trapname <string> An example how to disable snmpalarm config Object(s). .NOTES File Name : Invoke-NSDisableSnmpalarm Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpalarm/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('CPU-USAGE', 'AVERAGE-CPU', 'MEMORY', 'MGMT-CPU-USAGE', 'SYNFLOOD', 'TCP-SYNFLOOD', 'VSERVER-REQRATE', 'SERVICE-REQRATE', 'ENTITY-RXRATE', 'ENTITY-TXRATE', 'ENTITY-SYNFLOOD', 'SERVICE-MAXCLIENTS', 'HA-STATE-CHANGE', 'ENTITY-STATE', 'CONFIG-CHANGE', 'CONFIG-SAVE', 'SERVICEGROUP-MEMBER-REQRATE', 'SERVICEGROUP-MEMBER-MAXCLIENTS', 'MONITOR-RTO-THRESHOLD', 'LOGIN-FAILURE', 'SSL-CERT-EXPIRY', 'FAN-SPEED-LOW', 'VOLTAGE-LOW', 'VOLTAGE-HIGH', 'TEMPERATURE-HIGH', 'CPU-TEMPERATURE-HIGH', 'POWER-SUPPLY-FAILURE', 'DISK-USAGE-HIGH', 'INTERFACE-THROUGHPUT-LOW', 'MON_PROBE_FAILED', 'HA-VERSION-MISMATCH', 'HA-SYNC-FAILURE', 'HA-NO-HEARTBEATS', 'HA-BAD-SECONDARY-STATE', 'INTERFACE-BW-USAGE', 'RATE-LIMIT-THRESHOLD-EXCEEDED', 'ENTITY-NAME-CHANGE', 'HA-PROP-FAILURE', 'IP-CONFLICT', 'PF-RL-RATE-THRESHOLD', 'PF-RL-PPS-THRESHOLD', 'PF-RL-RATE-PKTS-DROPPED', 'PF-RL-PPS-PKTS-DROPPED', 'APPFW-START-URL', 'APPFW-DENY-URL', 'APPFW-VIOLATIONS-TYPE', 'APPFW-REFERER-HEADER', 'APPFW-CSRF-TAG', 'APPFW-COOKIE', 'APPFW-FIELD-CONSISTENCY', 'APPFW-BUFFER-OVERFLOW', 'APPFW-FIELD-FORMAT', 'APPFW-FILE-UPLOAD-TYPE', 'APPFW-GRPC', 'APPFW-GRPC-WEB-JSON', 'APPFW-GRPC-WEB-TEXT', 'APPFW-JSON-DOS', 'APPFW-JSON-SQL', 'APPFW-JSON-XSS', 'APPFW-SAFE-COMMERCE', 'APPFW-SAFE-OBJECT', 'APPFW-SESSION-LIMIT', 'APPFW-SIGNATURE-MATCH', 'APPFW-POLICY-HIT', 'APPFW-XSS', 'APPFW-XML-XSS', 'APPFW-SQL', 'APPFW-XML-SQL', 'APPFW-XML-ATTACHMENT', 'APPFW-XML-DOS', 'APPFW-XML-VALIDATION', 'APPFW-XML-WSI', 'APPFW-XML-SCHEMA-COMPILE', 'APPFW-XML-SOAP-FAULT', 'APPFW-NEW-SIGNATURE-ADDED', 'APPFW-DEPLOY-RELAXATION-DP', 'APPFW-LEARNED-RULE-APPLIED-DYN-PROF', 'APPFW-CMD', 'APPFW-REST-VALIDATION', 'APPFW-GRPC-VALIDATION', 'APPFW-POSTBODYLIMIT', 'APPFW-JSON-CMD', 'APPFW-SQL-GRAM', 'APPFW-JSON-SQL-GRAM', 'APPFW-CMD-GRAM', 'APPFW-JSON-CMD-GRAM', 'APPFW-BLOCK-KEYWORD', 'APPFW-JSON-BLOCKKEYWORD', 'APPFW-BYPASS-LIST', 'APPFW-DENY-LIST', 'DNSKEY-EXPIRY', 'HA-LICENSE-MISMATCH', 'SSL-CARD-FAILED', 'SSL-CARD-NORMAL', 'WARM-RESTART-EVENT', 'HARD-DISK-DRIVE-ERRORS', 'COMPACT-FLASH-ERRORS', 'CALLHOME-UPLOAD-EVENT', '1024KEY-EXCHANGE-RATE', '2048KEY-EXCHANGE-RATE', '4096KEY-EXCHANGE-RATE', 'SSL-CUR-SESSION-INUSE', 'CLUSTER-NODE-HEALTH', 'CLUSTER-NODE-QUORUM', 'CLUSTER-VERSION-MISMATCH', 'CLUSTER-CCO-CHANGE', 'CLUSTER-OVS-CHANGE', 'CLUSTER-SYNC-FAILURE', 'CLUSTER-SYNC-PARTIAL-SUCCESS', 'CLUSTER-PROP-FAILURE', 'CLUSTER-PROP-EXEC-FAILURE', 'HA-STICKY-PRIMARY', 'INBAND-PROTOCOL-VERSION-MISMATCH', 'SSL-CHIP-REINIT', 'VRID-STATE-CHANGE', 'PORT-ALLOC-FAILED', 'LLDP-REMOTE-CHANGE', 'DUPLICATE-IPV6', 'PARTITION-CONFIG-EVENT', 'PARTITION-SWITCHED', 'LSN-PORTALLOC-FAILED', 'LSN-PORTQUOTA-EXCEED', 'LSN-SESSIONQUOTA-EXCEED', 'LSN-MEM-RECOVERY-KICKEDIN', 'VSERVER-SPILLOVER', 'INCONSISTENT-CONFIGURATION-IN-PPES', 'PARTITION-RATE-LIMIT', 'POOLED-LICENSE-ONGRACE', 'POOLED-LICENSE-PARTIAL', 'CLUSTER-BACKPLANE-HB-MISSING', 'GSLB-SITE-MEP-FLAP', 'DNS-MAXNEGCACHE-USAGE', 'DNS-MAXCACHE-USAGE', 'NS-LICENSE-EXPIRY', 'PKT-RATELIMITING-ATTACK', 'GSLB-SYNC-STATUS-FLIP', 'URLFILT-DB-UPDATE-STATUS', 'URLFILT-INIT-SDK', 'POOLED-LICENSE-CHECKOUT-FAILURE', 'MIGRATION-STARTED', 'MIGRATION-COMPLETE', 'ECDHE-EXCHANGE-RATE', 'BOT-SIGNATURE-UPDATE', 'APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH', 'PORT-ALLOC-EXCEED', 'KEK_UPDATE_SUCCESS', 'KEK_UPDATE_FAILURE', 'ADC-ANOMALY', 'SYSLOG-CONNECTION-DROPPED', 'NSROOT_PASSWORD_EXPIRY_WARNING')] [string]$Trapname ) begin { Write-Verbose "Invoke-NSDisableSnmpalarm: Starting" } process { try { $payload = @{ trapname = $trapname } if ( $PSCmdlet.ShouldProcess($Name, "Disable SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpalarm -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableSnmpalarm: Finished" } } function Invoke-NSGetSnmpalarm { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for alarm resource. .PARAMETER Trapname Name of the SNMP alarm. This parameter is required for identifying the SNMP alarm and cannot be modified. Possible values = CPU-USAGE, AVERAGE-CPU, MEMORY, MGMT-CPU-USAGE, SYNFLOOD, TCP-SYNFLOOD, VSERVER-REQRATE, SERVICE-REQRATE, ENTITY-RXRATE, ENTITY-TXRATE, ENTITY-SYNFLOOD, SERVICE-MAXCLIENTS, HA-STATE-CHANGE, ENTITY-STATE, CONFIG-CHANGE, CONFIG-SAVE, SERVICEGROUP-MEMBER-REQRATE, SERVICEGROUP-MEMBER-MAXCLIENTS, MONITOR-RTO-THRESHOLD, LOGIN-FAILURE, SSL-CERT-EXPIRY, FAN-SPEED-LOW, VOLTAGE-LOW, VOLTAGE-HIGH, TEMPERATURE-HIGH, CPU-TEMPERATURE-HIGH, POWER-SUPPLY-FAILURE, DISK-USAGE-HIGH, INTERFACE-THROUGHPUT-LOW, MON_PROBE_FAILED, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, INTERFACE-BW-USAGE, RATE-LIMIT-THRESHOLD-EXCEEDED, ENTITY-NAME-CHANGE, HA-PROP-FAILURE, IP-CONFLICT, PF-RL-RATE-THRESHOLD, PF-RL-PPS-THRESHOLD, PF-RL-RATE-PKTS-DROPPED, PF-RL-PPS-PKTS-DROPPED, APPFW-START-URL, APPFW-DENY-URL, APPFW-VIOLATIONS-TYPE, APPFW-REFERER-HEADER, APPFW-CSRF-TAG, APPFW-COOKIE, APPFW-FIELD-CONSISTENCY, APPFW-BUFFER-OVERFLOW, APPFW-FIELD-FORMAT, APPFW-FILE-UPLOAD-TYPE, APPFW-GRPC, APPFW-GRPC-WEB-JSON, APPFW-GRPC-WEB-TEXT, APPFW-JSON-DOS, APPFW-JSON-SQL, APPFW-JSON-XSS, APPFW-SAFE-COMMERCE, APPFW-SAFE-OBJECT, APPFW-SESSION-LIMIT, APPFW-SIGNATURE-MATCH, APPFW-POLICY-HIT, APPFW-XSS, APPFW-XML-XSS, APPFW-SQL, APPFW-XML-SQL, APPFW-XML-ATTACHMENT, APPFW-XML-DOS, APPFW-XML-VALIDATION, APPFW-XML-WSI, APPFW-XML-SCHEMA-COMPILE, APPFW-XML-SOAP-FAULT, APPFW-NEW-SIGNATURE-ADDED, APPFW-DEPLOY-RELAXATION-DP, APPFW-LEARNED-RULE-APPLIED-DYN-PROF, APPFW-CMD, APPFW-REST-VALIDATION, APPFW-GRPC-VALIDATION, APPFW-POSTBODYLIMIT, APPFW-JSON-CMD, APPFW-SQL-GRAM, APPFW-JSON-SQL-GRAM, APPFW-CMD-GRAM, APPFW-JSON-CMD-GRAM, APPFW-BLOCK-KEYWORD, APPFW-JSON-BLOCKKEYWORD, APPFW-BYPASS-LIST, APPFW-DENY-LIST, DNSKEY-EXPIRY, HA-LICENSE-MISMATCH, SSL-CARD-FAILED, SSL-CARD-NORMAL, WARM-RESTART-EVENT, HARD-DISK-DRIVE-ERRORS, COMPACT-FLASH-ERRORS, CALLHOME-UPLOAD-EVENT, 1024KEY-EXCHANGE-RATE, 2048KEY-EXCHANGE-RATE, 4096KEY-EXCHANGE-RATE, SSL-CUR-SESSION-INUSE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, CLUSTER-CCO-CHANGE, CLUSTER-OVS-CHANGE, CLUSTER-SYNC-FAILURE, CLUSTER-SYNC-PARTIAL-SUCCESS, CLUSTER-PROP-FAILURE, CLUSTER-PROP-EXEC-FAILURE, HA-STICKY-PRIMARY, INBAND-PROTOCOL-VERSION-MISMATCH, SSL-CHIP-REINIT, VRID-STATE-CHANGE, PORT-ALLOC-FAILED, LLDP-REMOTE-CHANGE, DUPLICATE-IPV6, PARTITION-CONFIG-EVENT, PARTITION-SWITCHED, LSN-PORTALLOC-FAILED, LSN-PORTQUOTA-EXCEED, LSN-SESSIONQUOTA-EXCEED, LSN-MEM-RECOVERY-KICKEDIN, VSERVER-SPILLOVER, INCONSISTENT-CONFIGURATION-IN-PPES, PARTITION-RATE-LIMIT, POOLED-LICENSE-ONGRACE, POOLED-LICENSE-PARTIAL, CLUSTER-BACKPLANE-HB-MISSING, GSLB-SITE-MEP-FLAP, DNS-MAXNEGCACHE-USAGE, DNS-MAXCACHE-USAGE, NS-LICENSE-EXPIRY, PKT-RATELIMITING-ATTACK, GSLB-SYNC-STATUS-FLIP, URLFILT-DB-UPDATE-STATUS, URLFILT-INIT-SDK, POOLED-LICENSE-CHECKOUT-FAILURE, MIGRATION-STARTED, MIGRATION-COMPLETE, ECDHE-EXCHANGE-RATE, BOT-SIGNATURE-UPDATE, APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH, PORT-ALLOC-EXCEED, KEK_UPDATE_SUCCESS, KEK_UPDATE_FAILURE, ADC-ANOMALY, SYSLOG-CONNECTION-DROPPED, NSROOT_PASSWORD_EXPIRY_WARNING .PARAMETER GetAll Retrieve all snmpalarm object(s). .PARAMETER Count If specified, the count of the snmpalarm object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpalarm Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpalarm -GetAll Get all snmpalarm data. .EXAMPLE PS C:\>Invoke-NSGetSnmpalarm -Count Get the number of snmpalarm objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpalarm -name <string> Get snmpalarm object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpalarm -Filter @{ 'name'='<value>' } Get snmpalarm data with a filter. .NOTES File Name : Invoke-NSGetSnmpalarm Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpalarm/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateSet('CPU-USAGE', 'AVERAGE-CPU', 'MEMORY', 'MGMT-CPU-USAGE', 'SYNFLOOD', 'TCP-SYNFLOOD', 'VSERVER-REQRATE', 'SERVICE-REQRATE', 'ENTITY-RXRATE', 'ENTITY-TXRATE', 'ENTITY-SYNFLOOD', 'SERVICE-MAXCLIENTS', 'HA-STATE-CHANGE', 'ENTITY-STATE', 'CONFIG-CHANGE', 'CONFIG-SAVE', 'SERVICEGROUP-MEMBER-REQRATE', 'SERVICEGROUP-MEMBER-MAXCLIENTS', 'MONITOR-RTO-THRESHOLD', 'LOGIN-FAILURE', 'SSL-CERT-EXPIRY', 'FAN-SPEED-LOW', 'VOLTAGE-LOW', 'VOLTAGE-HIGH', 'TEMPERATURE-HIGH', 'CPU-TEMPERATURE-HIGH', 'POWER-SUPPLY-FAILURE', 'DISK-USAGE-HIGH', 'INTERFACE-THROUGHPUT-LOW', 'MON_PROBE_FAILED', 'HA-VERSION-MISMATCH', 'HA-SYNC-FAILURE', 'HA-NO-HEARTBEATS', 'HA-BAD-SECONDARY-STATE', 'INTERFACE-BW-USAGE', 'RATE-LIMIT-THRESHOLD-EXCEEDED', 'ENTITY-NAME-CHANGE', 'HA-PROP-FAILURE', 'IP-CONFLICT', 'PF-RL-RATE-THRESHOLD', 'PF-RL-PPS-THRESHOLD', 'PF-RL-RATE-PKTS-DROPPED', 'PF-RL-PPS-PKTS-DROPPED', 'APPFW-START-URL', 'APPFW-DENY-URL', 'APPFW-VIOLATIONS-TYPE', 'APPFW-REFERER-HEADER', 'APPFW-CSRF-TAG', 'APPFW-COOKIE', 'APPFW-FIELD-CONSISTENCY', 'APPFW-BUFFER-OVERFLOW', 'APPFW-FIELD-FORMAT', 'APPFW-FILE-UPLOAD-TYPE', 'APPFW-GRPC', 'APPFW-GRPC-WEB-JSON', 'APPFW-GRPC-WEB-TEXT', 'APPFW-JSON-DOS', 'APPFW-JSON-SQL', 'APPFW-JSON-XSS', 'APPFW-SAFE-COMMERCE', 'APPFW-SAFE-OBJECT', 'APPFW-SESSION-LIMIT', 'APPFW-SIGNATURE-MATCH', 'APPFW-POLICY-HIT', 'APPFW-XSS', 'APPFW-XML-XSS', 'APPFW-SQL', 'APPFW-XML-SQL', 'APPFW-XML-ATTACHMENT', 'APPFW-XML-DOS', 'APPFW-XML-VALIDATION', 'APPFW-XML-WSI', 'APPFW-XML-SCHEMA-COMPILE', 'APPFW-XML-SOAP-FAULT', 'APPFW-NEW-SIGNATURE-ADDED', 'APPFW-DEPLOY-RELAXATION-DP', 'APPFW-LEARNED-RULE-APPLIED-DYN-PROF', 'APPFW-CMD', 'APPFW-REST-VALIDATION', 'APPFW-GRPC-VALIDATION', 'APPFW-POSTBODYLIMIT', 'APPFW-JSON-CMD', 'APPFW-SQL-GRAM', 'APPFW-JSON-SQL-GRAM', 'APPFW-CMD-GRAM', 'APPFW-JSON-CMD-GRAM', 'APPFW-BLOCK-KEYWORD', 'APPFW-JSON-BLOCKKEYWORD', 'APPFW-BYPASS-LIST', 'APPFW-DENY-LIST', 'DNSKEY-EXPIRY', 'HA-LICENSE-MISMATCH', 'SSL-CARD-FAILED', 'SSL-CARD-NORMAL', 'WARM-RESTART-EVENT', 'HARD-DISK-DRIVE-ERRORS', 'COMPACT-FLASH-ERRORS', 'CALLHOME-UPLOAD-EVENT', '1024KEY-EXCHANGE-RATE', '2048KEY-EXCHANGE-RATE', '4096KEY-EXCHANGE-RATE', 'SSL-CUR-SESSION-INUSE', 'CLUSTER-NODE-HEALTH', 'CLUSTER-NODE-QUORUM', 'CLUSTER-VERSION-MISMATCH', 'CLUSTER-CCO-CHANGE', 'CLUSTER-OVS-CHANGE', 'CLUSTER-SYNC-FAILURE', 'CLUSTER-SYNC-PARTIAL-SUCCESS', 'CLUSTER-PROP-FAILURE', 'CLUSTER-PROP-EXEC-FAILURE', 'HA-STICKY-PRIMARY', 'INBAND-PROTOCOL-VERSION-MISMATCH', 'SSL-CHIP-REINIT', 'VRID-STATE-CHANGE', 'PORT-ALLOC-FAILED', 'LLDP-REMOTE-CHANGE', 'DUPLICATE-IPV6', 'PARTITION-CONFIG-EVENT', 'PARTITION-SWITCHED', 'LSN-PORTALLOC-FAILED', 'LSN-PORTQUOTA-EXCEED', 'LSN-SESSIONQUOTA-EXCEED', 'LSN-MEM-RECOVERY-KICKEDIN', 'VSERVER-SPILLOVER', 'INCONSISTENT-CONFIGURATION-IN-PPES', 'PARTITION-RATE-LIMIT', 'POOLED-LICENSE-ONGRACE', 'POOLED-LICENSE-PARTIAL', 'CLUSTER-BACKPLANE-HB-MISSING', 'GSLB-SITE-MEP-FLAP', 'DNS-MAXNEGCACHE-USAGE', 'DNS-MAXCACHE-USAGE', 'NS-LICENSE-EXPIRY', 'PKT-RATELIMITING-ATTACK', 'GSLB-SYNC-STATUS-FLIP', 'URLFILT-DB-UPDATE-STATUS', 'URLFILT-INIT-SDK', 'POOLED-LICENSE-CHECKOUT-FAILURE', 'MIGRATION-STARTED', 'MIGRATION-COMPLETE', 'ECDHE-EXCHANGE-RATE', 'BOT-SIGNATURE-UPDATE', 'APPFW-XMLPAYLOAD-CONTENT-TYPE-MISMATCH', 'PORT-ALLOC-EXCEED', 'KEK_UPDATE_SUCCESS', 'KEK_UPDATE_FAILURE', 'ADC-ANOMALY', 'SYSLOG-CONNECTION-DROPPED', 'NSROOT_PASSWORD_EXPIRY_WARNING')] [string]$Trapname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpalarm: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpalarm objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpalarm -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpalarm objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpalarm -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpalarm objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpalarm -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpalarm configuration for property 'trapname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpalarm -NitroPath nitro/v1/config -Resource $trapname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving snmpalarm configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpalarm -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpalarm: Ended" } } function Invoke-NSAddSnmpcommunity { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for community resource. .PARAMETER Communityname The SNMP community string. Can consist of 1 to 31 characters that include uppercase and lowercase letters,numbers and special characters. .PARAMETER Permissions The SNMP V1 or V2 query-type privilege that you want to associate with this SNMP community. Possible values = GET, GET_NEXT, GET_BULK, SET, ALL .PARAMETER PassThru Return details about the created snmpcommunity item. .EXAMPLE PS C:\>Invoke-NSAddSnmpcommunity -communityname <string> -permissions <string> An example how to add snmpcommunity config Object(s). .NOTES File Name : Invoke-NSAddSnmpcommunity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpcommunity/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Communityname, [Parameter(Mandatory)] [ValidateSet('GET', 'GET_NEXT', 'GET_BULK', 'SET', 'ALL')] [string]$Permissions, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddSnmpcommunity: Starting" } process { try { $payload = @{ communityname = $communityname permissions = $permissions } if ( $PSCmdlet.ShouldProcess("snmpcommunity", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpcommunity -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpcommunity -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmpcommunity: Finished" } } function Invoke-NSDeleteSnmpcommunity { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for community resource. .PARAMETER Communityname The SNMP community string. Can consist of 1 to 31 characters that include uppercase and lowercase letters,numbers and special characters. .EXAMPLE PS C:\>Invoke-NSDeleteSnmpcommunity -Communityname <string> An example how to delete snmpcommunity config Object(s). .NOTES File Name : Invoke-NSDeleteSnmpcommunity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpcommunity/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Communityname ) begin { Write-Verbose "Invoke-NSDeleteSnmpcommunity: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$communityname", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmpcommunity -NitroPath nitro/v1/config -Resource $communityname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmpcommunity: Finished" } } function Invoke-NSGetSnmpcommunity { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for community resource. .PARAMETER Communityname The SNMP community string. Can consist of 1 to 31 characters that include uppercase and lowercase letters,numbers and special characters. .PARAMETER GetAll Retrieve all snmpcommunity object(s). .PARAMETER Count If specified, the count of the snmpcommunity object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpcommunity Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpcommunity -GetAll Get all snmpcommunity data. .EXAMPLE PS C:\>Invoke-NSGetSnmpcommunity -Count Get the number of snmpcommunity objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpcommunity -name <string> Get snmpcommunity object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpcommunity -Filter @{ 'name'='<value>' } Get snmpcommunity data with a filter. .NOTES File Name : Invoke-NSGetSnmpcommunity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpcommunity/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Communityname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpcommunity: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpcommunity objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpcommunity -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpcommunity objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpcommunity -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpcommunity objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpcommunity -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpcommunity configuration for property 'communityname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpcommunity -NitroPath nitro/v1/config -Resource $communityname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving snmpcommunity configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpcommunity -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpcommunity: Ended" } } function Invoke-NSUpdateSnmpengineid { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP engine id resource. .PARAMETER Engineid A hexadecimal value of at least 10 characters, uniquely identifying the engineid. .PARAMETER Ownernode ID of the cluster node for which you are setting the engineid. Maximum value = 31 .PARAMETER PassThru Return details about the created snmpengineid item. .EXAMPLE PS C:\>Invoke-NSUpdateSnmpengineid -engineid <string> An example how to update snmpengineid config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpengineid Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpengineid/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(10, 31)] [string]$Engineid, [double]$Ownernode, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateSnmpengineid: Starting" } process { try { $payload = @{ engineid = $engineid } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("snmpengineid", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpengineid -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpengineid -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpengineid: Finished" } } function Invoke-NSUnsetSnmpengineid { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP engine id resource. .PARAMETER Ownernode ID of the cluster node for which you are setting the engineid. Maximum value = 31 .EXAMPLE PS C:\>Invoke-NSUnsetSnmpengineid An example how to unset snmpengineid config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpengineid Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpengineid Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$ownernode ) begin { Write-Verbose "Invoke-NSUnsetSnmpengineid: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("snmpengineid", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpengineid -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpengineid: Finished" } } function Invoke-NSGetSnmpengineid { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP engine id resource. .PARAMETER Ownernode ID of the cluster node for which you are setting the engineid. Maximum value = 31 .PARAMETER GetAll Retrieve all snmpengineid object(s). .PARAMETER Count If specified, the count of the snmpengineid object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpengineid Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpengineid -GetAll Get all snmpengineid data. .EXAMPLE PS C:\>Invoke-NSGetSnmpengineid -Count Get the number of snmpengineid objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpengineid -name <string> Get snmpengineid object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpengineid -Filter @{ 'name'='<value>' } Get snmpengineid data with a filter. .NOTES File Name : Invoke-NSGetSnmpengineid Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpengineid/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Ownernode, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpengineid: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpengineid objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpengineid -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpengineid objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpengineid -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpengineid objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpengineid -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpengineid configuration for property 'ownernode'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpengineid -NitroPath nitro/v1/config -Resource $ownernode -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving snmpengineid configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpengineid -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpengineid: Ended" } } function Invoke-NSAddSnmpgroup { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP group resource. .PARAMETER Name Name for the SNMPv3 group. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 group. .PARAMETER Securitylevel Security level required for communication between the Citrix ADC and the SNMPv3 users who belong to the group. Specify one of the following options: noAuthNoPriv. Require neither authentication nor encryption. authNoPriv. Require authentication but no encryption. authPriv. Require authentication and encryption. Note: If you specify authentication, you must specify an encryption algorithm when you assign an SNMPv3 user to the group. If you also specify encryption, you must assign both an authentication and an encryption algorithm for each group member. Possible values = noAuthNoPriv, authNoPriv, authPriv .PARAMETER Readviewname Name of the configured SNMPv3 view that you want to bind to this SNMPv3 group. An SNMPv3 user bound to this group can access the subtrees that are bound to this SNMPv3 view as type INCLUDED, but cannot access the ones that are type EXCLUDED. If the Citrix ADC has multiple SNMPv3 view entries with the same name, all such entries are associated with the SNMPv3 group. .EXAMPLE PS C:\>Invoke-NSAddSnmpgroup -name <string> -securitylevel <string> -readviewname <string> An example how to add snmpgroup config Object(s). .NOTES File Name : Invoke-NSAddSnmpgroup Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpgroup/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateSet('noAuthNoPriv', 'authNoPriv', 'authPriv')] [string]$Securitylevel, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Readviewname ) begin { Write-Verbose "Invoke-NSAddSnmpgroup: Starting" } process { try { $payload = @{ name = $name securitylevel = $securitylevel readviewname = $readviewname } if ( $PSCmdlet.ShouldProcess("snmpgroup", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpgroup -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmpgroup: Finished" } } function Invoke-NSDeleteSnmpgroup { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP group resource. .PARAMETER Name Name for the SNMPv3 group. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 group. .PARAMETER Securitylevel Security level required for communication between the Citrix ADC and the SNMPv3 users who belong to the group. Specify one of the following options: noAuthNoPriv. Require neither authentication nor encryption. authNoPriv. Require authentication but no encryption. authPriv. Require authentication and encryption. Note: If you specify authentication, you must specify an encryption algorithm when you assign an SNMPv3 user to the group. If you also specify encryption, you must assign both an authentication and an encryption algorithm for each group member. Possible values = noAuthNoPriv, authNoPriv, authPriv .EXAMPLE PS C:\>Invoke-NSDeleteSnmpgroup -Name <string> An example how to delete snmpgroup config Object(s). .NOTES File Name : Invoke-NSDeleteSnmpgroup Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpgroup/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [string]$Securitylevel ) begin { Write-Verbose "Invoke-NSDeleteSnmpgroup: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Securitylevel') ) { $arguments.Add('securitylevel', $Securitylevel) } if ( $PSCmdlet.ShouldProcess("$name", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmpgroup -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmpgroup: Finished" } } function Invoke-NSUpdateSnmpgroup { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP group resource. .PARAMETER Name Name for the SNMPv3 group. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 group. .PARAMETER Securitylevel Security level required for communication between the Citrix ADC and the SNMPv3 users who belong to the group. Specify one of the following options: noAuthNoPriv. Require neither authentication nor encryption. authNoPriv. Require authentication but no encryption. authPriv. Require authentication and encryption. Note: If you specify authentication, you must specify an encryption algorithm when you assign an SNMPv3 user to the group. If you also specify encryption, you must assign both an authentication and an encryption algorithm for each group member. Possible values = noAuthNoPriv, authNoPriv, authPriv .PARAMETER Readviewname Name of the configured SNMPv3 view that you want to bind to this SNMPv3 group. An SNMPv3 user bound to this group can access the subtrees that are bound to this SNMPv3 view as type INCLUDED, but cannot access the ones that are type EXCLUDED. If the Citrix ADC has multiple SNMPv3 view entries with the same name, all such entries are associated with the SNMPv3 group. .EXAMPLE PS C:\>Invoke-NSUpdateSnmpgroup -name <string> -securitylevel <string> -readviewname <string> An example how to update snmpgroup config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpgroup Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpgroup/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateSet('noAuthNoPriv', 'authNoPriv', 'authPriv')] [string]$Securitylevel, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Readviewname ) begin { Write-Verbose "Invoke-NSUpdateSnmpgroup: Starting" } process { try { $payload = @{ name = $name securitylevel = $securitylevel readviewname = $readviewname } if ( $PSCmdlet.ShouldProcess("snmpgroup", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpgroup -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpgroup: Finished" } } function Invoke-NSGetSnmpgroup { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP group resource. .PARAMETER GetAll Retrieve all snmpgroup object(s). .PARAMETER Count If specified, the count of the snmpgroup object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpgroup Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpgroup -GetAll Get all snmpgroup data. .EXAMPLE PS C:\>Invoke-NSGetSnmpgroup -Count Get the number of snmpgroup objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpgroup -name <string> Get snmpgroup object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpgroup -Filter @{ 'name'='<value>' } Get snmpgroup data with a filter. .NOTES File Name : Invoke-NSGetSnmpgroup Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpgroup/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpgroup: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpgroup objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpgroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpgroup objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpgroup -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpgroup objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpgroup -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpgroup configuration for property ''" } else { Write-Verbose "Retrieving snmpgroup configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpgroup -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpgroup: Ended" } } function Invoke-NSAddSnmpmanager { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for manager resource. .PARAMETER Ipaddress IP address of the SNMP manager. Can be an IPv4 or IPv6 address. You can instead specify an IPv4 network address or IPv6 network prefix if you want the Citrix ADC to respond to SNMP queries from any device on the specified network. Alternatively, instead of an IPv4 address, you can specify a host name that has been assigned to an SNMP manager. If you do so, you must add a DNS name server that resolves the host name of the SNMP manager to its IP address. Note: The Citrix ADC does not support host names for SNMP managers that have IPv6 addresses. .PARAMETER Netmask Subnet mask associated with an IPv4 network address. If the IP address specifies the address or host name of a specific host, accept the default value of 255.255.255.255. .PARAMETER Domainresolveretry Amount of time, in seconds, for which the Citrix ADC waits before sending another DNS query to resolve the host name of the SNMP manager if the last query failed. This parameter is valid for host-name based SNMP managers only. After a query succeeds, the TTL determines the wait time. The minimum and default value is 5. Maximum value = 20939 .EXAMPLE PS C:\>Invoke-NSAddSnmpmanager -ipaddress <string> An example how to add snmpmanager config Object(s). .NOTES File Name : Invoke-NSAddSnmpmanager Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmanager/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 255)] [string]$Ipaddress, [string]$Netmask, [int]$Domainresolveretry ) begin { Write-Verbose "Invoke-NSAddSnmpmanager: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('domainresolveretry') ) { $payload.Add('domainresolveretry', $domainresolveretry) } if ( $PSCmdlet.ShouldProcess("snmpmanager", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpmanager -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmpmanager: Finished" } } function Invoke-NSDeleteSnmpmanager { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for manager resource. .PARAMETER Ipaddress IP address of the SNMP manager. Can be an IPv4 or IPv6 address. You can instead specify an IPv4 network address or IPv6 network prefix if you want the Citrix ADC to respond to SNMP queries from any device on the specified network. Alternatively, instead of an IPv4 address, you can specify a host name that has been assigned to an SNMP manager. If you do so, you must add a DNS name server that resolves the host name of the SNMP manager to its IP address. Note: The Citrix ADC does not support host names for SNMP managers that have IPv6 addresses. .PARAMETER Netmask Subnet mask associated with an IPv4 network address. If the IP address specifies the address or host name of a specific host, accept the default value of 255.255.255.255. .EXAMPLE PS C:\>Invoke-NSDeleteSnmpmanager -Ipaddress <string> An example how to delete snmpmanager config Object(s). .NOTES File Name : Invoke-NSDeleteSnmpmanager Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmanager/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Ipaddress, [string]$Netmask ) begin { Write-Verbose "Invoke-NSDeleteSnmpmanager: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Netmask') ) { $arguments.Add('netmask', $Netmask) } if ( $PSCmdlet.ShouldProcess("$ipaddress", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmpmanager -NitroPath nitro/v1/config -Resource $ipaddress -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmpmanager: Finished" } } function Invoke-NSUpdateSnmpmanager { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for manager resource. .PARAMETER Ipaddress IP address of the SNMP manager. Can be an IPv4 or IPv6 address. You can instead specify an IPv4 network address or IPv6 network prefix if you want the Citrix ADC to respond to SNMP queries from any device on the specified network. Alternatively, instead of an IPv4 address, you can specify a host name that has been assigned to an SNMP manager. If you do so, you must add a DNS name server that resolves the host name of the SNMP manager to its IP address. Note: The Citrix ADC does not support host names for SNMP managers that have IPv6 addresses. .PARAMETER Netmask Subnet mask associated with an IPv4 network address. If the IP address specifies the address or host name of a specific host, accept the default value of 255.255.255.255. .PARAMETER Domainresolveretry Amount of time, in seconds, for which the Citrix ADC waits before sending another DNS query to resolve the host name of the SNMP manager if the last query failed. This parameter is valid for host-name based SNMP managers only. After a query succeeds, the TTL determines the wait time. The minimum and default value is 5. Maximum value = 20939 .EXAMPLE PS C:\>Invoke-NSUpdateSnmpmanager -ipaddress <string> An example how to update snmpmanager config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpmanager Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmanager/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 255)] [string]$Ipaddress, [string]$Netmask, [int]$Domainresolveretry ) begin { Write-Verbose "Invoke-NSUpdateSnmpmanager: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('domainresolveretry') ) { $payload.Add('domainresolveretry', $domainresolveretry) } if ( $PSCmdlet.ShouldProcess("snmpmanager", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpmanager -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpmanager: Finished" } } function Invoke-NSUnsetSnmpmanager { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for manager resource. .PARAMETER Ipaddress IP address of the SNMP manager. Can be an IPv4 or IPv6 address. You can instead specify an IPv4 network address or IPv6 network prefix if you want the Citrix ADC to respond to SNMP queries from any device on the specified network. Alternatively, instead of an IPv4 address, you can specify a host name that has been assigned to an SNMP manager. If you do so, you must add a DNS name server that resolves the host name of the SNMP manager to its IP address. Note: The Citrix ADC does not support host names for SNMP managers that have IPv6 addresses. .PARAMETER Netmask Subnet mask associated with an IPv4 network address. If the IP address specifies the address or host name of a specific host, accept the default value of 255.255.255.255. .PARAMETER Domainresolveretry Amount of time, in seconds, for which the Citrix ADC waits before sending another DNS query to resolve the host name of the SNMP manager if the last query failed. This parameter is valid for host-name based SNMP managers only. After a query succeeds, the TTL determines the wait time. The minimum and default value is 5. Maximum value = 20939 .EXAMPLE PS C:\>Invoke-NSUnsetSnmpmanager -ipaddress <string> An example how to unset snmpmanager config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpmanager Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmanager Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateLength(1, 255)] [string]$Ipaddress, [Boolean]$netmask, [Boolean]$domainresolveretry ) begin { Write-Verbose "Invoke-NSUnsetSnmpmanager: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('domainresolveretry') ) { $payload.Add('domainresolveretry', $domainresolveretry) } if ( $PSCmdlet.ShouldProcess("$ipaddress", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpmanager -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpmanager: Finished" } } function Invoke-NSGetSnmpmanager { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for manager resource. .PARAMETER GetAll Retrieve all snmpmanager object(s). .PARAMETER Count If specified, the count of the snmpmanager object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpmanager Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpmanager -GetAll Get all snmpmanager data. .EXAMPLE PS C:\>Invoke-NSGetSnmpmanager -Count Get the number of snmpmanager objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpmanager -name <string> Get snmpmanager object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpmanager -Filter @{ 'name'='<value>' } Get snmpmanager data with a filter. .NOTES File Name : Invoke-NSGetSnmpmanager Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmanager/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpmanager: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpmanager objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmanager -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpmanager objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmanager -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpmanager objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmanager -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpmanager configuration for property ''" } else { Write-Verbose "Retrieving snmpmanager configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmanager -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpmanager: Ended" } } function Invoke-NSUpdateSnmpmib { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP mib resource. .PARAMETER Contact Name of the administrator for this Citrix ADC. Along with the name, you can include information on how to contact this person, such as a phone number or an email address. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Name Name for this Citrix ADC. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the Citrix ADC appliance. .PARAMETER Location Physical location of the Citrix ADC. For example, you can specify building name, lab number, and rack number. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Customid Custom identification number for the Citrix ADC. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a custom identification that helps identify the Citrix ADC appliance. .PARAMETER Ownernode ID of the cluster node for which we are setting the mib. This is a mandatory argument to set snmp mib on CLIP. Maximum value = 31 .PARAMETER PassThru Return details about the created snmpmib item. .EXAMPLE PS C:\>Invoke-NSUpdateSnmpmib An example how to update snmpmib config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpmib Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmib/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Contact, [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Location, [ValidateScript({ $_.Length -gt 1 })] [string]$Customid, [double]$Ownernode, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateSnmpmib: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('contact') ) { $payload.Add('contact', $contact) } if ( $PSBoundParameters.ContainsKey('name') ) { $payload.Add('name', $name) } if ( $PSBoundParameters.ContainsKey('location') ) { $payload.Add('location', $location) } if ( $PSBoundParameters.ContainsKey('customid') ) { $payload.Add('customid', $customid) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("snmpmib", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpmib -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpmib -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpmib: Finished" } } function Invoke-NSUnsetSnmpmib { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP mib resource. .PARAMETER Contact Name of the administrator for this Citrix ADC. Along with the name, you can include information on how to contact this person, such as a phone number or an email address. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Name Name for this Citrix ADC. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the Citrix ADC appliance. .PARAMETER Location Physical location of the Citrix ADC. For example, you can specify building name, lab number, and rack number. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Customid Custom identification number for the Citrix ADC. Can consist of 1 to 127 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a custom identification that helps identify the Citrix ADC appliance. .PARAMETER Ownernode ID of the cluster node for which we are setting the mib. This is a mandatory argument to set snmp mib on CLIP. Maximum value = 31 .EXAMPLE PS C:\>Invoke-NSUnsetSnmpmib An example how to unset snmpmib config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpmib Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmib Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$contact, [Boolean]$name, [Boolean]$location, [Boolean]$customid, [Boolean]$ownernode ) begin { Write-Verbose "Invoke-NSUnsetSnmpmib: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('contact') ) { $payload.Add('contact', $contact) } if ( $PSBoundParameters.ContainsKey('name') ) { $payload.Add('name', $name) } if ( $PSBoundParameters.ContainsKey('location') ) { $payload.Add('location', $location) } if ( $PSBoundParameters.ContainsKey('customid') ) { $payload.Add('customid', $customid) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("snmpmib", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpmib -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpmib: Finished" } } function Invoke-NSGetSnmpmib { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP mib resource. .PARAMETER Ownernode ID of the cluster node for which we are setting the mib. This is a mandatory argument to set snmp mib on CLIP. Maximum value = 31 .PARAMETER GetAll Retrieve all snmpmib object(s). .PARAMETER Count If specified, the count of the snmpmib object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpmib Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpmib -GetAll Get all snmpmib data. .EXAMPLE PS C:\>Invoke-NSGetSnmpmib -Count Get the number of snmpmib objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpmib -name <string> Get snmpmib object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpmib -Filter @{ 'name'='<value>' } Get snmpmib data with a filter. .NOTES File Name : Invoke-NSGetSnmpmib Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpmib/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Ownernode, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpmib: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpmib objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmib -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpmib objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmib -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpmib objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmib -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpmib configuration for property 'ownernode'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmib -NitroPath nitro/v1/config -Resource $ownernode -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving snmpmib configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpmib -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpmib: Ended" } } function Invoke-NSGetSnmpoid { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP Object Identifier resource. .PARAMETER Entitytype The type of entity whose SNMP OIDs you want to displayType of entity whose SNMP OIDs you want the Citrix ADC to display. Possible values = VSERVER, SERVICE, SERVICEGROUP .PARAMETER Name Name of the entity whose SNMP OID you want the Citrix ADC to display. .PARAMETER GetAll Retrieve all snmpoid object(s). .PARAMETER Count If specified, the count of the snmpoid object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpoid Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpoid -GetAll Get all snmpoid data. .EXAMPLE PS C:\>Invoke-NSGetSnmpoid -Count Get the number of snmpoid objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpoid -name <string> Get snmpoid object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpoid -Filter @{ 'name'='<value>' } Get snmpoid data with a filter. .NOTES File Name : Invoke-NSGetSnmpoid Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpoid/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('VSERVER', 'SERVICE', 'SERVICEGROUP')] [string]$Entitytype, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpoid: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpoid objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoid -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpoid objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoid -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpoid objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('entitytype') ) { $arguments.Add('entitytype', $entitytype) } if ( $PSBoundParameters.ContainsKey('name') ) { $arguments.Add('name', $name) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoid -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpoid configuration for property ''" } else { Write-Verbose "Retrieving snmpoid configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoid -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpoid: Ended" } } function Invoke-NSUpdateSnmpoption { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP option resource. .PARAMETER Snmpset Accept SNMP SET requests sent to the Citrix ADC, and allow SNMP managers to write values to MIB objects that are configured for write access. Possible values = ENABLED, DISABLED .PARAMETER Snmptraplogging Log any SNMP trap events (for SNMP alarms in which logging is enabled) even if no trap listeners are configured. With the default setting, SNMP trap events are logged if at least one trap listener is configured on the appliance. Possible values = ENABLED, DISABLED .PARAMETER Partitionnameintrap Send partition name as a varbind in traps. By default the partition names are not sent as a varbind. Possible values = ENABLED, DISABLED .PARAMETER Snmptraplogginglevel Audit log level of SNMP trap logs. The default value is INFORMATIONAL. Possible values = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFORMATIONAL, DEBUG .PARAMETER Severityinfointrap By default, the severity level info of the trap is not mentioned in the trap message. Enable this option to send severity level of trap as one of the varbind in the trap message. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUpdateSnmpoption An example how to update snmpoption config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpoption Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpoption/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmpset, [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmptraplogging, [ValidateSet('ENABLED', 'DISABLED')] [string]$Partitionnameintrap, [ValidateSet('EMERGENCY', 'ALERT', 'CRITICAL', 'ERROR', 'WARNING', 'NOTICE', 'INFORMATIONAL', 'DEBUG')] [string]$Snmptraplogginglevel, [ValidateSet('ENABLED', 'DISABLED')] [string]$Severityinfointrap ) begin { Write-Verbose "Invoke-NSUpdateSnmpoption: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('snmpset') ) { $payload.Add('snmpset', $snmpset) } if ( $PSBoundParameters.ContainsKey('snmptraplogging') ) { $payload.Add('snmptraplogging', $snmptraplogging) } if ( $PSBoundParameters.ContainsKey('partitionnameintrap') ) { $payload.Add('partitionnameintrap', $partitionnameintrap) } if ( $PSBoundParameters.ContainsKey('snmptraplogginglevel') ) { $payload.Add('snmptraplogginglevel', $snmptraplogginglevel) } if ( $PSBoundParameters.ContainsKey('severityinfointrap') ) { $payload.Add('severityinfointrap', $severityinfointrap) } if ( $PSCmdlet.ShouldProcess("snmpoption", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpoption -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpoption: Finished" } } function Invoke-NSUnsetSnmpoption { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP option resource. .PARAMETER Snmpset Accept SNMP SET requests sent to the Citrix ADC, and allow SNMP managers to write values to MIB objects that are configured for write access. Possible values = ENABLED, DISABLED .PARAMETER Snmptraplogging Log any SNMP trap events (for SNMP alarms in which logging is enabled) even if no trap listeners are configured. With the default setting, SNMP trap events are logged if at least one trap listener is configured on the appliance. Possible values = ENABLED, DISABLED .PARAMETER Partitionnameintrap Send partition name as a varbind in traps. By default the partition names are not sent as a varbind. Possible values = ENABLED, DISABLED .PARAMETER Snmptraplogginglevel Audit log level of SNMP trap logs. The default value is INFORMATIONAL. Possible values = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFORMATIONAL, DEBUG .PARAMETER Severityinfointrap By default, the severity level info of the trap is not mentioned in the trap message. Enable this option to send severity level of trap as one of the varbind in the trap message. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUnsetSnmpoption An example how to unset snmpoption config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpoption Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpoption Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$snmpset, [Boolean]$snmptraplogging, [Boolean]$partitionnameintrap, [Boolean]$snmptraplogginglevel, [Boolean]$severityinfointrap ) begin { Write-Verbose "Invoke-NSUnsetSnmpoption: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('snmpset') ) { $payload.Add('snmpset', $snmpset) } if ( $PSBoundParameters.ContainsKey('snmptraplogging') ) { $payload.Add('snmptraplogging', $snmptraplogging) } if ( $PSBoundParameters.ContainsKey('partitionnameintrap') ) { $payload.Add('partitionnameintrap', $partitionnameintrap) } if ( $PSBoundParameters.ContainsKey('snmptraplogginglevel') ) { $payload.Add('snmptraplogginglevel', $snmptraplogginglevel) } if ( $PSBoundParameters.ContainsKey('severityinfointrap') ) { $payload.Add('severityinfointrap', $severityinfointrap) } if ( $PSCmdlet.ShouldProcess("snmpoption", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpoption -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpoption: Finished" } } function Invoke-NSGetSnmpoption { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP option resource. .PARAMETER GetAll Retrieve all snmpoption object(s). .PARAMETER Count If specified, the count of the snmpoption object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpoption Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpoption -GetAll Get all snmpoption data. .EXAMPLE PS C:\>Invoke-NSGetSnmpoption -name <string> Get snmpoption object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpoption -Filter @{ 'name'='<value>' } Get snmpoption data with a filter. .NOTES File Name : Invoke-NSGetSnmpoption Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpoption/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetSnmpoption: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpoption objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoption -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpoption objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoption -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpoption objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoption -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpoption configuration for property ''" } else { Write-Verbose "Retrieving snmpoption configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpoption -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpoption: Ended" } } function Invoke-NSAddSnmptrap { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for snmp trap resource. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Destport UDP port at which the trap listener listens for trap messages. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Maximum value = 65534 .PARAMETER Communityname Password (string) sent with the trap messages, so that the trap listener can authenticate them. Can include 1 to 31 uppercase or lowercase letters, numbers, and hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore (_) characters. You must specify the same community string on the trap listener device. Otherwise, the trap listener drops the trap messages. .PARAMETER Srcip IPv4 or IPv6 address that the Citrix ADC inserts as the source IP address in all SNMP trap messages that it sends to this trap listener. By default this is the appliance's NSIP or NSIP6 address, but you can specify an IPv4 MIP or SNIP/SNIP6 address. In cluster setup, the default value is the individual node's NSIP, but it can be set to CLIP or Striped SNIP address. In non default partition, this parameter must be set to the SNIP/SNIP6 address. .PARAMETER Severity Severity level at or above which the Citrix ADC sends trap messages to this trap listener. The severity levels, in increasing order of severity, are Informational, Warning, Minor, Major, Critical. This parameter can be set for trap listeners of type SPECIFIC only. The default is to send all levels of trap messages. Important: Trap messages are not assigned severity levels unless you specify severity levels when configuring SNMP alarms. Possible values = Critical, Major, Minor, Warning, Informational .PARAMETER Allpartitions Send traps of all partitions to this destination. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSAddSnmptrap -trapclass <string> -trapdestination <string> An example how to add snmptrap config Object(s). .NOTES File Name : Invoke-NSAddSnmptrap Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('generic', 'specific')] [string]$Trapclass, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [ValidateSet('V1', 'V2', 'V3')] [string]$Version = 'V2', [double]$Td, [int]$Destport = '162', [string]$Communityname, [ValidateScript({ $_.Length -gt 1 })] [string]$Srcip, [ValidateSet('Critical', 'Major', 'Minor', 'Warning', 'Informational')] [string]$Severity = 'Unknown', [ValidateSet('ENABLED', 'DISABLED')] [string]$Allpartitions = 'DISABLED' ) begin { Write-Verbose "Invoke-NSAddSnmptrap: Starting" } process { try { $payload = @{ trapclass = $trapclass trapdestination = $trapdestination } if ( $PSBoundParameters.ContainsKey('version') ) { $payload.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('communityname') ) { $payload.Add('communityname', $communityname) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('severity') ) { $payload.Add('severity', $severity) } if ( $PSBoundParameters.ContainsKey('allpartitions') ) { $payload.Add('allpartitions', $allpartitions) } if ( $PSCmdlet.ShouldProcess("snmptrap", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmptrap -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmptrap: Finished" } } function Invoke-NSDeleteSnmptrap { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for snmp trap resource. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDeleteSnmptrap -Trapclass <string> An example how to delete snmptrap config Object(s). .NOTES File Name : Invoke-NSDeleteSnmptrap Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Trapclass, [string]$Trapdestination, [string]$Version, [double]$Td ) begin { Write-Verbose "Invoke-NSDeleteSnmptrap: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Trapdestination') ) { $arguments.Add('trapdestination', $Trapdestination) } if ( $PSBoundParameters.ContainsKey('Version') ) { $arguments.Add('version', $Version) } if ( $PSBoundParameters.ContainsKey('Td') ) { $arguments.Add('td', $Td) } if ( $PSCmdlet.ShouldProcess("$trapclass", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmptrap -NitroPath nitro/v1/config -Resource $trapclass -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmptrap: Finished" } } function Invoke-NSUpdateSnmptrap { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for snmp trap resource. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Destport UDP port at which the trap listener listens for trap messages. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Maximum value = 65534 .PARAMETER Communityname Password (string) sent with the trap messages, so that the trap listener can authenticate them. Can include 1 to 31 uppercase or lowercase letters, numbers, and hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore (_) characters. You must specify the same community string on the trap listener device. Otherwise, the trap listener drops the trap messages. .PARAMETER Srcip IPv4 or IPv6 address that the Citrix ADC inserts as the source IP address in all SNMP trap messages that it sends to this trap listener. By default this is the appliance's NSIP or NSIP6 address, but you can specify an IPv4 MIP or SNIP/SNIP6 address. In cluster setup, the default value is the individual node's NSIP, but it can be set to CLIP or Striped SNIP address. In non default partition, this parameter must be set to the SNIP/SNIP6 address. .PARAMETER Severity Severity level at or above which the Citrix ADC sends trap messages to this trap listener. The severity levels, in increasing order of severity, are Informational, Warning, Minor, Major, Critical. This parameter can be set for trap listeners of type SPECIFIC only. The default is to send all levels of trap messages. Important: Trap messages are not assigned severity levels unless you specify severity levels when configuring SNMP alarms. Possible values = Critical, Major, Minor, Warning, Informational .PARAMETER Allpartitions Send traps of all partitions to this destination. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUpdateSnmptrap -trapclass <string> -trapdestination <string> An example how to update snmptrap config Object(s). .NOTES File Name : Invoke-NSUpdateSnmptrap Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('generic', 'specific')] [string]$Trapclass, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [ValidateSet('V1', 'V2', 'V3')] [string]$Version, [double]$Td, [int]$Destport, [string]$Communityname, [ValidateScript({ $_.Length -gt 1 })] [string]$Srcip, [ValidateSet('Critical', 'Major', 'Minor', 'Warning', 'Informational')] [string]$Severity, [ValidateSet('ENABLED', 'DISABLED')] [string]$Allpartitions ) begin { Write-Verbose "Invoke-NSUpdateSnmptrap: Starting" } process { try { $payload = @{ trapclass = $trapclass trapdestination = $trapdestination } if ( $PSBoundParameters.ContainsKey('version') ) { $payload.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('communityname') ) { $payload.Add('communityname', $communityname) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('severity') ) { $payload.Add('severity', $severity) } if ( $PSBoundParameters.ContainsKey('allpartitions') ) { $payload.Add('allpartitions', $allpartitions) } if ( $PSCmdlet.ShouldProcess("snmptrap", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmptrap -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmptrap: Finished" } } function Invoke-NSUnsetSnmptrap { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for snmp trap resource. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Destport UDP port at which the trap listener listens for trap messages. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Maximum value = 65534 .PARAMETER Communityname Password (string) sent with the trap messages, so that the trap listener can authenticate them. Can include 1 to 31 uppercase or lowercase letters, numbers, and hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore (_) characters. You must specify the same community string on the trap listener device. Otherwise, the trap listener drops the trap messages. .PARAMETER Srcip IPv4 or IPv6 address that the Citrix ADC inserts as the source IP address in all SNMP trap messages that it sends to this trap listener. By default this is the appliance's NSIP or NSIP6 address, but you can specify an IPv4 MIP or SNIP/SNIP6 address. In cluster setup, the default value is the individual node's NSIP, but it can be set to CLIP or Striped SNIP address. In non default partition, this parameter must be set to the SNIP/SNIP6 address. .PARAMETER Severity Severity level at or above which the Citrix ADC sends trap messages to this trap listener. The severity levels, in increasing order of severity, are Informational, Warning, Minor, Major, Critical. This parameter can be set for trap listeners of type SPECIFIC only. The default is to send all levels of trap messages. Important: Trap messages are not assigned severity levels unless you specify severity levels when configuring SNMP alarms. Possible values = Critical, Major, Minor, Warning, Informational .PARAMETER Allpartitions Send traps of all partitions to this destination. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUnsetSnmptrap -trapclass <string> -trapdestination <string> An example how to unset snmptrap config Object(s). .NOTES File Name : Invoke-NSUnsetSnmptrap Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('generic', 'specific')] [string]$Trapclass, [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [Boolean]$version, [Boolean]$td, [Boolean]$destport, [Boolean]$communityname, [Boolean]$srcip, [Boolean]$severity, [Boolean]$allpartitions ) begin { Write-Verbose "Invoke-NSUnsetSnmptrap: Starting" } process { try { $payload = @{ trapclass = $trapclass trapdestination = $trapdestination } if ( $PSBoundParameters.ContainsKey('version') ) { $payload.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('communityname') ) { $payload.Add('communityname', $communityname) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('severity') ) { $payload.Add('severity', $severity) } if ( $PSBoundParameters.ContainsKey('allpartitions') ) { $payload.Add('allpartitions', $allpartitions) } if ( $PSCmdlet.ShouldProcess("$trapclass trapdestination", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmptrap -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmptrap: Finished" } } function Invoke-NSGetSnmptrap { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for snmp trap resource. .PARAMETER GetAll Retrieve all snmptrap object(s). .PARAMETER Count If specified, the count of the snmptrap object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmptrap Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrap -GetAll Get all snmptrap data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrap -Count Get the number of snmptrap objects. .EXAMPLE PS C:\>Invoke-NSGetSnmptrap -name <string> Get snmptrap object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmptrap -Filter @{ 'name'='<value>' } Get snmptrap data with a filter. .NOTES File Name : Invoke-NSGetSnmptrap Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmptrap: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmptrap objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmptrap objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmptrap objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmptrap configuration for property ''" } else { Write-Verbose "Retrieving snmptrap configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmptrap: Ended" } } function Invoke-NSGetSnmptrapBinding { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to snmptrap. .PARAMETER Trapdestination IP address specified in the trap listener entry. .PARAMETER Version The SNMP version of the trap specified in the trap listener entry. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Trapclass Trap type specified in the trap listener entry. Possible values = generic, specific .PARAMETER GetAll Retrieve all snmptrap_binding object(s). .PARAMETER Count If specified, the count of the snmptrap_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapBinding -GetAll Get all snmptrap_binding data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapBinding -name <string> Get snmptrap_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapBinding -Filter @{ 'name'='<value>' } Get snmptrap_binding data with a filter. .NOTES File Name : Invoke-NSGetSnmptrapBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('V1', 'V2', 'V3')] [string]$Version, [Parameter(ParameterSetName = 'GetByArgument')] [double]$Td, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('generic', 'specific')] [string]$Trapclass, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetSnmptrapBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all snmptrap_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmptrap_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmptrap_binding objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('trapdestination') ) { $arguments.Add('trapdestination', $trapdestination) } if ( $PSBoundParameters.ContainsKey('version') ) { $arguments.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('td') ) { $arguments.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('trapclass') ) { $arguments.Add('trapclass', $trapclass) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmptrap_binding configuration for property ''" } else { Write-Verbose "Retrieving snmptrap_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmptrapBinding: Ended" } } function Invoke-NSAddSnmptrapSnmpuserBinding { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Binding object showing the snmpuser that can be bound to snmptrap. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Username Name of the SNMP user that will send the SNMPv3 traps. .PARAMETER Securitylevel Security level of the SNMPv3 trap. Possible values = noAuthNoPriv, authNoPriv, authPriv .PARAMETER PassThru Return details about the created snmptrap_snmpuser_binding item. .EXAMPLE PS C:\>Invoke-NSAddSnmptrapSnmpuserBinding -trapclass <string> -trapdestination <string> -username <string> An example how to add snmptrap_snmpuser_binding config Object(s). .NOTES File Name : Invoke-NSAddSnmptrapSnmpuserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap_snmpuser_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('generic', 'specific')] [string]$Trapclass, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [double]$Td, [ValidateSet('V1', 'V2', 'V3')] [string]$Version = 'V3', [Parameter(Mandatory)] [string]$Username, [ValidateSet('noAuthNoPriv', 'authNoPriv', 'authPriv')] [string]$Securitylevel = 'authNoPriv', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddSnmptrapSnmpuserBinding: Starting" } process { try { $payload = @{ trapclass = $trapclass trapdestination = $trapdestination username = $username } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('version') ) { $payload.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('securitylevel') ) { $payload.Add('securitylevel', $securitylevel) } if ( $PSCmdlet.ShouldProcess("snmptrap_snmpuser_binding", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmptrap_snmpuser_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmptrapSnmpuserBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmptrapSnmpuserBinding: Finished" } } function Invoke-NSDeleteSnmptrapSnmpuserBinding { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Binding object showing the snmpuser that can be bound to snmptrap. .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Username Name of the SNMP user that will send the SNMPv3 traps. .EXAMPLE PS C:\>Invoke-NSDeleteSnmptrapSnmpuserBinding -Trapclass <string> An example how to delete snmptrap_snmpuser_binding config Object(s). .NOTES File Name : Invoke-NSDeleteSnmptrapSnmpuserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap_snmpuser_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Trapclass, [string]$Trapdestination, [double]$Td, [string]$Version, [string]$Username ) begin { Write-Verbose "Invoke-NSDeleteSnmptrapSnmpuserBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Trapdestination') ) { $arguments.Add('trapdestination', $Trapdestination) } if ( $PSBoundParameters.ContainsKey('Td') ) { $arguments.Add('td', $Td) } if ( $PSBoundParameters.ContainsKey('Version') ) { $arguments.Add('version', $Version) } if ( $PSBoundParameters.ContainsKey('Username') ) { $arguments.Add('username', $Username) } if ( $PSCmdlet.ShouldProcess("$trapclass", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmptrap_snmpuser_binding -NitroPath nitro/v1/config -Resource $trapclass -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmptrapSnmpuserBinding: Finished" } } function Invoke-NSGetSnmptrapSnmpuserBinding { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Binding object showing the snmpuser that can be bound to snmptrap. .PARAMETER Trapdestination IPv4 or the IPv6 address of the trap listener to which the Citrix ADC is to send SNMP trap messages. .PARAMETER Version SNMP version, which determines the format of trap messages sent to the trap listener. This setting must match the setting on the trap listener. Otherwise, the listener drops the trap messages. Possible values = V1, V2, V3 .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Trapclass Type of trap messages that the Citrix ADC sends to the trap listener: Generic or the enterprise-specific messages defined in the MIB file. Possible values = generic, specific .PARAMETER GetAll Retrieve all snmptrap_snmpuser_binding object(s). .PARAMETER Count If specified, the count of the snmptrap_snmpuser_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapSnmpuserBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapSnmpuserBinding -GetAll Get all snmptrap_snmpuser_binding data. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapSnmpuserBinding -Count Get the number of snmptrap_snmpuser_binding objects. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapSnmpuserBinding -name <string> Get snmptrap_snmpuser_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmptrapSnmpuserBinding -Filter @{ 'name'='<value>' } Get snmptrap_snmpuser_binding data with a filter. .NOTES File Name : Invoke-NSGetSnmptrapSnmpuserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmptrap_snmpuser_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Trapdestination, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('V1', 'V2', 'V3')] [string]$Version, [Parameter(ParameterSetName = 'GetByArgument')] [double]$Td, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('generic', 'specific')] [string]$Trapclass, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetSnmptrapSnmpuserBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all snmptrap_snmpuser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_snmpuser_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmptrap_snmpuser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_snmpuser_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmptrap_snmpuser_binding objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('trapdestination') ) { $arguments.Add('trapdestination', $trapdestination) } if ( $PSBoundParameters.ContainsKey('version') ) { $arguments.Add('version', $version) } if ( $PSBoundParameters.ContainsKey('td') ) { $arguments.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('trapclass') ) { $arguments.Add('trapclass', $trapclass) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_snmpuser_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmptrap_snmpuser_binding configuration for property ''" } else { Write-Verbose "Retrieving snmptrap_snmpuser_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmptrap_snmpuser_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmptrapSnmpuserBinding: Ended" } } function Invoke-NSAddSnmpuser { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP user resource. .PARAMETER Name Name for the SNMPv3 user. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Group Name of the configured SNMPv3 group to which to bind this SNMPv3 user. The access rights (bound SNMPv3 views) and security level set for this group are assigned to this user. .PARAMETER Authtype Authentication algorithm used by the Citrix ADC and the SNMPv3 user for authenticating the communication between them. You must specify the same authentication algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = MD5, SHA .PARAMETER Authpasswd Plain-text pass phrase to be used by the authentication algorithm specified by the authType (Authentication Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Privtype Encryption algorithm used by the Citrix ADC and the SNMPv3 user for encrypting the communication between them. You must specify the same encryption algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = DES, AES .PARAMETER Privpasswd Encryption key to be used by the encryption algorithm specified by the privType (Encryption Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER PassThru Return details about the created snmpuser item. .EXAMPLE PS C:\>Invoke-NSAddSnmpuser -name <string> -group <string> An example how to add snmpuser config Object(s). .NOTES File Name : Invoke-NSAddSnmpuser Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpuser/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Group, [ValidateSet('MD5', 'SHA')] [string]$Authtype, [ValidateScript({ $_.Length -gt 1 })] [string]$Authpasswd, [ValidateSet('DES', 'AES')] [string]$Privtype, [ValidateScript({ $_.Length -gt 1 })] [string]$Privpasswd, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddSnmpuser: Starting" } process { try { $payload = @{ name = $name group = $group } if ( $PSBoundParameters.ContainsKey('authtype') ) { $payload.Add('authtype', $authtype) } if ( $PSBoundParameters.ContainsKey('authpasswd') ) { $payload.Add('authpasswd', $authpasswd) } if ( $PSBoundParameters.ContainsKey('privtype') ) { $payload.Add('privtype', $privtype) } if ( $PSBoundParameters.ContainsKey('privpasswd') ) { $payload.Add('privpasswd', $privpasswd) } if ( $PSCmdlet.ShouldProcess("snmpuser", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpuser -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpuser -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmpuser: Finished" } } function Invoke-NSDeleteSnmpuser { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP user resource. .PARAMETER Name Name for the SNMPv3 user. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .EXAMPLE PS C:\>Invoke-NSDeleteSnmpuser -Name <string> An example how to delete snmpuser config Object(s). .NOTES File Name : Invoke-NSDeleteSnmpuser Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpuser/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteSnmpuser: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmpuser -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmpuser: Finished" } } function Invoke-NSUpdateSnmpuser { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP user resource. .PARAMETER Name Name for the SNMPv3 user. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Group Name of the configured SNMPv3 group to which to bind this SNMPv3 user. The access rights (bound SNMPv3 views) and security level set for this group are assigned to this user. .PARAMETER Authtype Authentication algorithm used by the Citrix ADC and the SNMPv3 user for authenticating the communication between them. You must specify the same authentication algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = MD5, SHA .PARAMETER Authpasswd Plain-text pass phrase to be used by the authentication algorithm specified by the authType (Authentication Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Privtype Encryption algorithm used by the Citrix ADC and the SNMPv3 user for encrypting the communication between them. You must specify the same encryption algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = DES, AES .PARAMETER Privpasswd Encryption key to be used by the encryption algorithm specified by the privType (Encryption Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER PassThru Return details about the created snmpuser item. .EXAMPLE PS C:\>Invoke-NSUpdateSnmpuser -name <string> An example how to update snmpuser config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpuser Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpuser/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Group, [ValidateSet('MD5', 'SHA')] [string]$Authtype, [ValidateScript({ $_.Length -gt 1 })] [string]$Authpasswd, [ValidateSet('DES', 'AES')] [string]$Privtype, [ValidateScript({ $_.Length -gt 1 })] [string]$Privpasswd, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateSnmpuser: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('group') ) { $payload.Add('group', $group) } if ( $PSBoundParameters.ContainsKey('authtype') ) { $payload.Add('authtype', $authtype) } if ( $PSBoundParameters.ContainsKey('authpasswd') ) { $payload.Add('authpasswd', $authpasswd) } if ( $PSBoundParameters.ContainsKey('privtype') ) { $payload.Add('privtype', $privtype) } if ( $PSBoundParameters.ContainsKey('privpasswd') ) { $payload.Add('privpasswd', $privpasswd) } if ( $PSCmdlet.ShouldProcess("snmpuser", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpuser -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetSnmpuser -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpuser: Finished" } } function Invoke-NSUnsetSnmpuser { <# .SYNOPSIS Unset SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for SNMP user resource. .PARAMETER Name Name for the SNMPv3 user. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Authtype Authentication algorithm used by the Citrix ADC and the SNMPv3 user for authenticating the communication between them. You must specify the same authentication algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = MD5, SHA .PARAMETER Privtype Encryption algorithm used by the Citrix ADC and the SNMPv3 user for encrypting the communication between them. You must specify the same encryption algorithm when you configure the SNMPv3 user in the SNMP manager. Possible values = DES, AES .PARAMETER Authpasswd Plain-text pass phrase to be used by the authentication algorithm specified by the authType (Authentication Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER Privpasswd Encryption key to be used by the encryption algorithm specified by the privType (Encryption Type) parameter. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .EXAMPLE PS C:\>Invoke-NSUnsetSnmpuser -name <string> An example how to unset snmpuser config Object(s). .NOTES File Name : Invoke-NSUnsetSnmpuser Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpuser Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$authtype, [Boolean]$privtype, [Boolean]$authpasswd, [Boolean]$privpasswd ) begin { Write-Verbose "Invoke-NSUnsetSnmpuser: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('authtype') ) { $payload.Add('authtype', $authtype) } if ( $PSBoundParameters.ContainsKey('privtype') ) { $payload.Add('privtype', $privtype) } if ( $PSBoundParameters.ContainsKey('authpasswd') ) { $payload.Add('authpasswd', $authpasswd) } if ( $PSBoundParameters.ContainsKey('privpasswd') ) { $payload.Add('privpasswd', $privpasswd) } if ( $PSCmdlet.ShouldProcess("$name", "Unset SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type snmpuser -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetSnmpuser: Finished" } } function Invoke-NSGetSnmpuser { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for SNMP user resource. .PARAMETER Name Name for the SNMPv3 user. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. .PARAMETER GetAll Retrieve all snmpuser object(s). .PARAMETER Count If specified, the count of the snmpuser object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpuser Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpuser -GetAll Get all snmpuser data. .EXAMPLE PS C:\>Invoke-NSGetSnmpuser -Count Get the number of snmpuser objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpuser -name <string> Get snmpuser object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpuser -Filter @{ 'name'='<value>' } Get snmpuser data with a filter. .NOTES File Name : Invoke-NSGetSnmpuser Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpuser/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpuser: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpuser objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpuser -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpuser objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpuser -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpuser objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpuser -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpuser configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpuser -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving snmpuser configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpuser -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpuser: Ended" } } function Invoke-NSAddSnmpview { <# .SYNOPSIS Add SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for view resource. .PARAMETER Name Name for the SNMPv3 view. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 view. .PARAMETER Subtree A particular branch (subtree) of the MIB tree that you want to associate with this SNMPv3 view. You must specify the subtree as an SNMP OID. .PARAMETER Type Include or exclude the subtree, specified by the subtree parameter, in or from this view. This setting can be useful when you have included a subtree, such as A, in an SNMPv3 view and you want to exclude a specific subtree of A, such as B, from the SNMPv3 view. Possible values = included, excluded .EXAMPLE PS C:\>Invoke-NSAddSnmpview -name <string> -subtree <string> -type <string> An example how to add snmpview config Object(s). .NOTES File Name : Invoke-NSAddSnmpview Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpview/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Subtree, [Parameter(Mandatory)] [ValidateSet('included', 'excluded')] [string]$Type ) begin { Write-Verbose "Invoke-NSAddSnmpview: Starting" } process { try { $payload = @{ name = $name subtree = $subtree type = $type } if ( $PSCmdlet.ShouldProcess("snmpview", "Add SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type snmpview -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddSnmpview: Finished" } } function Invoke-NSDeleteSnmpview { <# .SYNOPSIS Delete SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for view resource. .PARAMETER Name Name for the SNMPv3 view. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 view. .PARAMETER Subtree A particular branch (subtree) of the MIB tree that you want to associate with this SNMPv3 view. You must specify the subtree as an SNMP OID. .EXAMPLE PS C:\>Invoke-NSDeleteSnmpview -Name <string> An example how to delete snmpview config Object(s). .NOTES File Name : Invoke-NSDeleteSnmpview Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpview/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [string]$Subtree ) begin { Write-Verbose "Invoke-NSDeleteSnmpview: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Subtree') ) { $arguments.Add('subtree', $Subtree) } if ( $PSCmdlet.ShouldProcess("$name", "Delete SNMP(Simple Network Management Protocol) configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type snmpview -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteSnmpview: Finished" } } function Invoke-NSUpdateSnmpview { <# .SYNOPSIS Update SNMP(Simple Network Management Protocol) configuration. config Object. .DESCRIPTION Configuration for view resource. .PARAMETER Name Name for the SNMPv3 view. Can consist of 1 to 31 characters that include uppercase and lowercase letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) characters. You should choose a name that helps identify the SNMPv3 view. .PARAMETER Subtree A particular branch (subtree) of the MIB tree that you want to associate with this SNMPv3 view. You must specify the subtree as an SNMP OID. .PARAMETER Type Include or exclude the subtree, specified by the subtree parameter, in or from this view. This setting can be useful when you have included a subtree, such as A, in an SNMPv3 view and you want to exclude a specific subtree of A, such as B, from the SNMPv3 view. Possible values = included, excluded .EXAMPLE PS C:\>Invoke-NSUpdateSnmpview -name <string> -subtree <string> -type <string> An example how to update snmpview config Object(s). .NOTES File Name : Invoke-NSUpdateSnmpview Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpview/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Subtree, [Parameter(Mandatory)] [ValidateSet('included', 'excluded')] [string]$Type ) begin { Write-Verbose "Invoke-NSUpdateSnmpview: Starting" } process { try { $payload = @{ name = $name subtree = $subtree type = $type } if ( $PSCmdlet.ShouldProcess("snmpview", "Update SNMP(Simple Network Management Protocol) configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type snmpview -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateSnmpview: Finished" } } function Invoke-NSGetSnmpview { <# .SYNOPSIS Get SNMP(Simple Network Management Protocol) configuration. config object(s). .DESCRIPTION Configuration for view resource. .PARAMETER GetAll Retrieve all snmpview object(s). .PARAMETER Count If specified, the count of the snmpview object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetSnmpview Get data. .EXAMPLE PS C:\>Invoke-NSGetSnmpview -GetAll Get all snmpview data. .EXAMPLE PS C:\>Invoke-NSGetSnmpview -Count Get the number of snmpview objects. .EXAMPLE PS C:\>Invoke-NSGetSnmpview -name <string> Get snmpview object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetSnmpview -Filter @{ 'name'='<value>' } Get snmpview data with a filter. .NOTES File Name : Invoke-NSGetSnmpview Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmpview/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetSnmpview: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all snmpview objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpview -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for snmpview objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpview -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving snmpview objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpview -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving snmpview configuration for property ''" } else { Write-Verbose "Retrieving snmpview configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type snmpview -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetSnmpview: Ended" } } # SIG # Begin signature block # MIIkmgYJKoZIhvcNAQcCoIIkizCCJIcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA3thpxath6Qi3C # T1EwUY3SWKdJyf8BicSG29MilGPWxKCCHl4wggTzMIID26ADAgECAhAsJ03zZBC0 # i/247uUvWN5TMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAkdCMRswGQYDVQQI # ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoT # D1NlY3RpZ28gTGltaXRlZDEkMCIGA1UEAxMbU2VjdGlnbyBSU0EgQ29kZSBTaWdu # aW5nIENBMB4XDTIxMDUwNTAwMDAwMFoXDTI0MDUwNDIzNTk1OVowWzELMAkGA1UE # BhMCTkwxEjAQBgNVBAcMCVZlbGRob3ZlbjEbMBkGA1UECgwSSm9oYW5uZXMgQmls # bGVrZW5zMRswGQYDVQQDDBJKb2hhbm5lcyBCaWxsZWtlbnMwggEiMA0GCSqGSIb3 # DQEBAQUAA4IBDwAwggEKAoIBAQCsfgRG81keOHalHfCUgxOa1Qy4VNO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