CastawayLabs / cachet-monitor

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

API check return 401 HTTP response #90

Open furqank786 opened 6 years ago

furqank786 commented 6 years ago

I am using the latest release of cachet monitor for Ubuntu "cachet_monitor_linux_amd64". I created a configuration file config.json to check the uptime for my API and mentioned the URL as given below in the source code. The following incident appear: "API check failed (server time: 20/02/2018 16:47:05 PKT) Expected HTTP response status: 200, got: 401"

example source code: { "api": { "url": "democachet.io/v1", "token": "xxxxxxxxxxx", "insecure": true }, "date_format": "02/01/2006 15:04:05 MST", "monitors": [ { "name": "API", "target": "https://example.com:443/v1?id=xxxxxxxxxx&signature=xxxxxxxxxxxx", "strict": true, "strict_tls": false, "method": "GET", "component_id": 1, "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, "expected_status_code": 200 } ] }

Please help me to fix this issue. Thanks.

casKd-dev commented 5 years ago

Did you check if your API returns a 200?