yes i got three alerts 
in my case i dit 
# In prometheus.yml
# Global config
global:
  scrape_interval:     1m # Set the scrape interval to every 15 seconds. 
Default is every 1 minute.
  evaluation_interval: 1m # Evaluate rules every 15 seconds. The default is 
every 1 minute.
  scrape_timeout: 15s  # scrape_timeout is set to the global default (10s).

rule_files:
 - 'alert.rules.yml'

# A scrape configuration containing exactly one endpoint to scrape:# Here 
it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries 
scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090','localhost:9115','localhost:9182']


# /etc/prometheus/alert.rules.yml
groups:
- name: example
  rules:
  - alert: SSLCertExpiringSoon

    expr: probe_ssl_earliest_cert_expiry{job="blackbox"} - time() < 86400 * 
30

    for: 10s

    labels:

      severity: critical CASE sifast Sites

    annotations:

       summary: 'SSL certificat should be renewed as soon as possible '

#in /etc/alertmanager/alertmanager.yml
global:
  smtp_smarthost: 'mx2.sot.com:25'
  smtp_from: '[email protected]'
  smtp_require_tls: false
  smtp_hello: 'alertmanager'
  smtp_auth_username: 'username'
  smtp_auth_password: 'password'

  slack_api_url: 
'https://hooks.slack.com/services/TRW96G4KX/B93488/9IAupDUOiRI0ERqMDMLs0ka'

route:
  group_by: ['instance', 'alert']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 5d
  receiver: so

receivers:
  - name: 'so'
    email_configs:
      - to: '[email protected]'
    slack_configs:
      # https://prometheus.io/docs/alerting/configuration/#slack_config
      - channel: 'monitoring'
      - username: 'AlertManager-user'
      - icon_emoji: ':joy:'
i recongise that alerts duplicated comes with 2 differents usernames 
''AlertManager-user" and "alertmanager"



Le jeudi 1 octobre 2020 15:39:23 UTC+1, Brian Candler a écrit :
>
> I think we're getting off topic here; we are now just into general system 
> administration. Briefly:
>
> * "systemctl stop alertmanager" will stop the systemd-managed version of 
> alertmanager, so you can run a separate instance at the CLI.
>
> * The file which contains the systemd config depends on where you (or your 
> packager) put it.  It might be /etc/systemd/system/alertmanager.service. 
> After editing this file, you need to do "systemctl daemon-reload" to pick 
> up the changes.
>
> Your logs show a single alert at 14:16:15 and another single alert at 
> 14:18:15.  Did you get three copies of both of these delivered?
>
> I'm afraid I don't really have any idea what's happening.  Your system 
> sends out alerts 3 times; my system (and apparently everybody else's) only 
> sends out alerts once.
>
> I can only suggest that you check the whole of your prometheus 
> configuration from top to bottom.  Could you be installing three separate 
> alerting rules, all of which alert on the same condition?? The problem will 
> be something silly like that.
>
> FWIW, I have alerts very similar to yours:
>
> # In prometheus.yml
> rule_files:
>   - /etc/prometheus/rules.d/*.yml
>
> # /etc/prometheus/rules.d/alert-certificate.yml
> groups:
>   - name: Certificates
>     interval: 1m
>     rules:
>       - alert: CertificateInvalid
>         expr: probe_success{module="certificate"} != 1
>         for: 3m
>         labels:
>           severity: critical
>         annotations:
>           summary: 'Certificate is invalid or service could not be reached'
>   - name: CertificateLifetime
>     interval: 60m
>     rules:
>       - alert: CertificateExpiring
>         expr: (probe_ssl_earliest_cert_expiry - time())/86400 < 14
>         for: 120m
>         labels:
>           severity: warning
>         annotations:
>           summary: 'Certificate is expiring soon: {{ $value }} days'
>
> and I don't get duplicates.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ece0135f-5f47-4184-bbe2-d39af516e816o%40googlegroups.com.

Reply via email to