< Back

Set-ZabbixMediaType

Sun Jan 19, 2020 6:15 pm

NAME Set-ZabbixMediaType



SYNOPSIS

Set media types





SYNTAX

Set-ZabbixMediaType [[-mediatypeid] <String>] [[-Description] <String>] [[-Type] <Int32>] [[-EmailAddressFrom]

<String>] [[-SMTPServerHostName] <String>] [[-SMTPServerIPorFQDN] <String>] [[-SMTPServerPort] <String>]

[[-SMTPServerAuthentication] <Int32>] [[-SMTPServerConnectionSecurity] <Int32>]

[[-SMTPServerConnectionSecurityVerifyPeer] <Int32>] [[-SMTPServerConnectionSecurityVerifyHost] <Int32>] [[-status]

<Int32>] [[-Username] <String>] [[-Passwd] <String>] [[-GsmModem] <String>] [[-ExecScriptName] <String>]

[[-ExecScriptParams] <String>] [[-MaxAlertSendSessions] <Int32>] [[-MaxAlertSendAttempts] <Int32>]

[[-AlertSendRetryInterval] <String>] [[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>] [[-URL]

<String>] [<CommonParameters>]





DESCRIPTION

Set media types





PARAMETERS

-mediatypeid <String>



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Description <String>



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Type <Int32>

Transport used by the media type. Possible values: 0 - e-mail; 1 - script; 2 - SMS; 3 - Jabber; 100 - Ez

Texting.



Required? false

Position? 3

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-EmailAddressFrom <String>

Email address from which notifications will be sent. Required for email media types.



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerHostName <String>

SMTP HELO. Required for email media types.



Required? false

Position? 5

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerIPorFQDN <String>

SMTP server. Required for email media types.



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerPort <String>

SMTP server port.



Required? false

Position? 7

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerAuthentication <Int32>

SMTP server authentication required. Possible values: 0 - (default) disabled; 1 - enabled



Required? false

Position? 8

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerConnectionSecurity <Int32>

SMTP server connection security. Possible values: 0 - (default) disabled; 1 - StartTLS; 2 - SSL/TLS



Required? false

Position? 9

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerConnectionSecurityVerifyPeer <Int32>

SMTP server connection security. Possible values: 0 - (default) disabled; 1 - enabled



Required? false

Position? 10

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SMTPServerConnectionSecurityVerifyHost <Int32>

SMTP server connection security. Possible values: 0 - (default) disabled; 1 - enabled



Required? false

Position? 11

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-status <Int32>

Whether the media type is enabled. Possible values: 0 - (default) enabled; 1 - disabled.



Required? false

Position? 12

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Username <String>

Username or Jabber identifier. Required for Jabber and Ez Texting media types.



Required? false

Position? 13

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Passwd <String>

Authentication password.



Required? false

Position? 14

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-GsmModem <String>

Serial device name of the GSM modem. Required for SMS media types.



Required? false

Position? 15

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ExecScriptName <String>

For script media types exec_path contains the name of the executed script.



Required? false

Position? 16

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ExecScriptParams <String>

Script parameters. Each parameter ends with a new line feed.



Required? false

Position? 17

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-MaxAlertSendSessions <Int32>

The maximum number of alerts that can be processed in parallel. Possible values for SMS: 1 - (default)

Possible values for other media types: 0-100



Required? false

Position? 18

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-MaxAlertSendAttempts <Int32>

The maximum number of attempts to send an alert. Possible values: 1-10 Default value: 3



Required? false

Position? 19

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-AlertSendRetryInterval <String>

The interval between retry attempts. Accepts seconds and time unit with suffix. Possible values: 0-60s Default

value: 10s



Required? false

Position? 20

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 21

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? false

Accept wildcard characters? false



-session <String>



Required? false

Position? 22

Default value ($global:zabSessionParams.session)

Accept pipeline input? false

Accept wildcard characters? false



-id <String>



Required? false

Position? 23

Default value ($global:zabSessionParams.id)

Accept pipeline input? false

Accept wildcard characters? false



-URL <String>



Required? false

Position? 24

Default value ($global:zabSessionParams.url)

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ZabbixMediatype | ? name -eq EmailMediaType-01 | Set-ZabbixMediaType -status 1



Disable the media type









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ZabbixMediatype | ? name -like *email* | Set-ZabbixMediaType -AlertSendRetryInterval "7s"

-EmailAddressFrom "zabbix-02@example.com"



Update all media types, contain "email" in the description field









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$EmailMediaTypeCreateParams=@{



Description="EmailMediaType-01"

Type=0

MaxAlertSendSessions=5

MaxAlertSendAttempts=5

AlertSendRetryInterval="12s"

SMTPServerIPorFQDN="mail.example.com"

SMTPServerPort=25

SMTPServerHostName="mail"

EmailAddressFrom="zabbix-01@example.com"

SMTPServerAuthentication=1

Username="testUser"

Passwd="TestUser"

SMTPServerConnectionSecurity=""

SMTPServerConnectionSecurityVerifyPeer=""

SMTPServerConnectionSecurityVerifyHost=""

}

Get-ZabbixMediaType | ? Description -like *email* | Set-ZabbixMediaType @EmailMediaTypeCreateParams

Update settings in multiple media types









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$PushMediaTypeCreateParams=@{



Description="Push notifications - 01"

Type=1

status=1

MaxAlertSendSessions=3

MaxAlertSendAttempts=3

AlertSendRetryInterval="7s"

ExecScriptName="push-notification.sh"

ExecScriptParams="{ALERT.SENDTO}\\n{ALERT.SUBJECT}\\n{ALERT.MESSAGE}\\n"

}

Get-ZabbixMediaType | ? Description -like *push* | Set-ZabbixMediaType @PushMediaTypeCreateParams

Update multiple media types











RELATED LINKS