CastawayLabs / cachet-monitor

Distributed monitoring plugin for CachetHQ
https://castawaylabs.github.io/cachet-monitor/
MIT License
439 stars 127 forks source link

monitor down 100.00%/80.00% #67

Closed irfanops closed 7 years ago

irfanops commented 7 years ago

When I test a site using Cachet monitor, it is always down no matter how much I change the config... Tried using json/yml formats yet no change. I am getting the same error for all the sites.Please help me out!

Error INFO[0003] monitor down 100.00%/80.00% monitor=google time="27/03/2017 19:45 UTC"

My config.yml

api:
  url: http://myapi.com/api/v1
  token: SECRET
  insecure: true
date_format: 02/01/2006 15:04 UTC
monitors:
  - name: google
    target: "https://www.google.com"
    strict: true
    method: POST
    component_id: 3
    metric_id: 1
    template:
      investigating:
        subject: "{{ .Monitor.Name }}"
        message: "{{ .Monitor.Name }} check **failed** (server time: {{ .now }})\n\n{{ .FailReason }}"
      fixed:
        subject: "I HAVE BEEN FIXED"
    interval: 1
    timeout: 1
    threshold: 80
    headers:
      Authorization: Basic <hash>
    expected_status_code: 200
    expected_body: "P.*NG"
matejkramny commented 7 years ago

Google's responses are typically 302 and do not have PONG in the body as the regular expression expects. This is an example configuration.

Here's a monitor that will work given the config

monitors:
  - name: test
    target: "https://api.visualideas.org/ping"
    strict: true
    method: GET
    component_id: 3
    metric_id: 1
    interval: 1
    timeout: 1
    threshold: 80
    expected_status_code: 200
    expected_body: "P.*NG"
irfanops commented 7 years ago

Thank you Matej Kramny! Adjusting the interval and timeout sorted out the issue. You guys have been doing a fantastic job. Keep it up :-)

thyspir commented 5 years ago

Hi @irfanops , could you let me know your configuration? I'm facing the same issue with you "monitor down 100.00%/80.00% "

I have followed the configuration from matej and still got "monitor down" Thank you in advance