github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/cli/kbcli_alert_add-receiver.md (about)

     1  ---
     2  title: kbcli alert add-receiver
     3  ---
     4  
     5  Add alert receiver, such as email, slack, webhook and so on.
     6  
     7  ```
     8  kbcli alert add-receiver [flags]
     9  ```
    10  
    11  ### Examples
    12  
    13  ```
    14    # add webhook receiver without token, for example feishu
    15    kbcli alert add-receiver --webhook='url=https://open.feishu.cn/open-apis/bot/v2/hook/foo'
    16    
    17    # add webhook receiver with token, for example feishu
    18    kbcli alert add-receiver --webhook='url=https://open.feishu.cn/open-apis/bot/v2/hook/foo,token=XXX'
    19    
    20    # add email receiver
    21    kbcli alert add-receiver --email='user1@kubeblocks.io,user2@kubeblocks.io'
    22    
    23    # add email receiver, and only receive alert from cluster mycluster
    24    kbcli alert add-receiver --email='user1@kubeblocks.io,user2@kubeblocks.io' --cluster=mycluster
    25    
    26    # add email receiver, and only receive alert from cluster mycluster and alert severity is warning
    27    kbcli alert add-receiver --email='user1@kubeblocks.io,user2@kubeblocks.io' --cluster=mycluster --severity=warning
    28    
    29    # add slack receiver
    30    kbcli alert add-receiver --slack api_url=https://hooks.slackConfig.com/services/foo,channel=monitor,username=kubeblocks-alert-bot
    31  ```
    32  
    33  ### Options
    34  
    35  ```
    36        --cluster stringArray    Cluster name, such as mycluster, more than one cluster can be specified, such as mycluster1,mycluster2
    37        --email stringArray      Add email address, such as user@kubeblocks.io, more than one emailConfig can be specified separated by comma
    38    -h, --help                   help for add-receiver
    39        --severity stringArray   Alert severity level, critical, warning or info, more than one severity level can be specified, such as critical,warning
    40        --slack stringArray      Add slack receiver, such as api_url=https://hooks.slackConfig.com/services/foo,channel=monitor,username=kubeblocks-alert-bot
    41        --webhook stringArray    Add webhook receiver, such as url=https://open.feishu.cn/open-apis/bot/v2/hook/foo,token=xxxxx
    42  ```
    43  
    44  ### Options inherited from parent commands
    45  
    46  ```
    47        --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
    48        --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
    49        --as-uid string                  UID to impersonate for the operation.
    50        --cache-dir string               Default cache directory (default "$HOME/.kube/cache")
    51        --certificate-authority string   Path to a cert file for the certificate authority
    52        --client-certificate string      Path to a client certificate file for TLS
    53        --client-key string              Path to a client key file for TLS
    54        --context string                 The name of the kubeconfig context to use
    55        --disable-compression            If true, opt-out of response compression for all requests to the server
    56        --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
    57        --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
    58        --match-server-version           Require server version to match client version
    59    -n, --namespace string               If present, the namespace scope for this CLI request
    60        --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
    61    -s, --server string                  The address and port of the Kubernetes API server
    62        --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
    63        --token string                   Bearer token for authentication to the API server
    64        --user string                    The name of the kubeconfig user to use
    65  ```
    66  
    67  ### SEE ALSO
    68  
    69  * [kbcli alert](kbcli_alert.md)	 - Manage alert receiver, include add, list and delete receiver.
    70  
    71  #### Go Back to [CLI Overview](cli.md) Homepage.
    72