CastawayLabs / cachet-monitor

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

URLs always reporting down #39

Closed sethryder closed 7 years ago

sethryder commented 8 years ago

Hello,

I am attempting to setup a check and it seems no matter what URL I give it it fails.

Here is my config:

{
        "api_url": "http://status.redacted-domain.com/api/v1",
        "api_token": "redacted-token",
        "insecure_api": true,
        "monitors": [{
                "name": "Google",
                "url": "http://www.google.com",
                "method": "get",
                "strict_tls": true,
                "interval": 60,
                "timeout": 10,
                "metric_id": 1,
                "component_id": 12,
                "threshold": 80,
                "expected_status_code": 200
        }],
        "system_name": "Node-1",
        "log_path": ""
}

If I CURL the address I do get a 200 back:

root@phobos:~/temp# curl -I http://www.google.com
HTTP/1.1 200 OK
Date: Sun, 03 Jul 2016 04:36:35 GMT
Expires: -1

Server output:

root@phobos:~/temp# ./cachet-monitor_linux_amd64 -c cachet.json
2016/07/03 00:36:20 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/cli/main.go:52: System: Node-1
API: http://status.redacted-domain.com/api/v1
Monitors: 1

2016/07/03 00:36:20 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:53:  Starting Google: 60 seconds check interval
 - GET http://www.google.com
2016/07/03 00:36:20 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:57:  - Expect HTTP 200
2016/07/03 00:36:20 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:63:  - Log lag to metric id 1
2016/07/03 00:36:20 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:66:  - Update component id 12

2016/07/03 00:36:21 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:175: Google 0.00%/80.00% down at 1467520581

Also when it reports down it reports:

Get http://www.google.com.com: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Thanks for the help.

sethryder commented 8 years ago

Ok, I was able to get it working with some pages, but it still has issues with a URL like this:

http://www.domain.com/catalogsearch/result/?q=test

Could it have something to do with the query string?

gardner commented 7 years ago

I am getting the same error: Client.Timeout exceeded while awaiting headers

gardner commented 7 years ago

Looks like a bug in go: https://github.com/golang/go/issues/16094

gardner commented 7 years ago

EDIT: I was using the 2.0 release binary

I have go version go1.7.3 darwin/amd64 locally

nico01f commented 7 years ago

Hi everyone.

The same issue it's happening to me.

2016/12/07 09:25:18 /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/monitor.go:175: DEC 5 0.00%/80.00% down at 1481113518

Any advice?

moodhairboy commented 7 years ago

does anyone have an answer for this issue? I also see the same thing on my install.

moodhairboy commented 7 years ago

Gardner - does this mean you downgraded to

EDIT: I was using the 2.0 release binary 1.7.3 from 2.0 to fix the problem?

I have go version go1.7.3 darwin/amd64 locally

shaun-ba commented 7 years ago

Also seeing this, thought it was because i had IP/port in my URL but i've tried various that all give 200 via cURL yet i'm always seeing "down" log.

matejkramny commented 7 years ago

Latest release may have fixed this