Enable notifications through the Push Notification service

Enable notifications through the Push Notification serviceΒΆ

Warning

The DevOps Portal has been deprecated in the Q4`18 MCP release tagged with the 2019.2.0 Build ID.

This section describes how to enable StackLight LMA to send notifications to email, Salesforce or to both notification channels using the Push Notification service of the DevOps Portal.

To enable StackLight LMA to send notifications through the Push Notification Service:

  1. Log in to the Salt Master node.

  2. Open the classes/cluster/cluster_name/stacklight/server.yml file of the Reclass model for editing.

  3. Add the following classes:

    classes:
     [...]
    - system.prometheus.alertmanager.notification.pushkin
    - system.prometheus.server.alert.labels_add.route
    
  4. Define the following variables:

    parameters:
      _param:
        alertmanager_notification_pushkin_host: ${_param:haproxy_pushkin_bind_host}
        alertmanager_notification_pushkin_port: ${_param:haproxy_pushkin_bind_port}
        alertmanager_notification_pushkin_host: 172.16.10.101
        alertmanager_notification_pushkin_port: 16666
    
  5. Set one or multiple notification channels by using the _param:prometheus_server_alert_label_route parameter. The default value is email, which means that email notifications will be sent.

    Example:

    parameters:
      _param:
        prometheus_server_alert_label_route: email;salesforce;
    
  6. Configure email or Salesforce integration:

    • For deployments with the DevOps Portal, follow the procedure described in MCP Deployment Guide: Configure Salesforce integration for OSS manually or MCP Deployment Guide: Configure email integration for OSS manually.

    • For deployments without the DevOps Portal, modify the classes/cluster/cluster_name/stacklight/server.yml file to configure the Push Notification service, including:

      • Docker stack for the Push Notification service

      • PostgreSQL database for the Push Notification service

      • GlusterFS volumes to synchronize the data between monitoring nodes

      Example:

      classes:
        [...]
      #Glusterfs configuration for Push Notification Service
      - system.linux.system.repo.glusterfs
      - system.glusterfs.client.cluster
      - system.glusterfs.server.cluster
      - system.glusterfs.server.volume.postgresql
      - system.glusterfs.server.volume.pushkin
      - system.glusterfs.client.volume.postgresql
      - system.glusterfs.client.volume.pushkin
      
      #Docker stack and network configurations
      - system.docker.swarm.stack.pushkin
      - system.docker.swarm.stack.postgresql
      - system.docker.swarm.network.oss_backend
      
      # Haproxy for Push Notification service
      - system.haproxy.proxy.listen.oss.pushkin
      - system.haproxy.proxy.listen.oss.postgresql
      
      # Postgresql configuration for Push Notification Service
      - system.postgresql.client.pushkin
      - system.postgresql.client.sfdc
      
      parameters:
        _param:
          [...]
      #Glusterfs configuration for Push Notification Service
          glusterfs_service_host: ${_param:stacklight_monitor_address}
          glusterfs_node01_address: ${_param:stacklight_monitor_node01_address}
          glusterfs_node02_address: ${_param:stacklight_monitor_node02_address}
          glusterfs_node03_address: ${_param:stacklight_monitor_node03_address}
      
      # Postgresql configuration for Push Notification Service
          postgresql_client_user: 'postgres'
          postgresql_client_password: 'postgrespassword'
      
      # Email configuration for Push Notification Service
          pushkin_smtp_host: smtp.gmail.com
          pushkin_smtp_port: 587
          webhook_from: your_sender@mail.com
          pushkin_email_sender_password: your_sender_password
          webhook_recipients: "recepient1@mail.com,recepient2@mail.com"
          webhook_login_id: 14
          webhook_application_id: 4
      
      # Salesforce configuration for Push Notification Service
          sfdc_auth_url: ''
          sfdc_username: ''
          sfdc_password: ''
          sfdc_consumer_key: ''
          sfdc_consumer_secret: ''
          environment: ''
          environment_id: ''
          sfdc_environment_id: ''
          sfdc_organization_id: ''
          sfdc_sandbox_enabled: False
      
      # Alertmanager configuration for Push Notification Service
          alertmanager_notification_pushkin_host: ${_param:stacklight_monitor_address}
          alertmanager_notification_pushkin_port: 8887
      

      Note

      For Salesforce parameters definition, see MCP Deployment Guide: OSS parameters.

  7. Apply the Salt formulas:

    salt -C 'I@glusterfs:server' state.sls glusterfs.server.service
    salt -C 'I@glusterfs:server' state.sls glusterfs.server.setup
    salt -C 'I@glusterfs:client' state.sls glusterfs.client
    salt -C 'I@docker:swarm:role:master and I@prometheus:server' state.sls docker.client
    salt -C 'I@postgresql:client' state.sls postgresql.client
    salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.server -b1
    salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.alertmanager -b 1