CastawayLabs / cachet-monitor

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

invalid character '<' looking for beginning of value #88

Closed ghost closed 5 years ago

ghost commented 6 years ago
api:
  # cachet url
  url: https://XXX.com/api/v1
  # cachet api token
  token: XXXX
  insecure: false
# https://golang.org/src/time/format.go#L57
date_format: 02/01/2006 15:04:05 MST
monitors:
  # http monitor example
  - name: XX
    # test url
    target: https://XX.com
    # strict certificate checking for https
    strict: true
    # HTTP method
    method: POST

    # set to update component (either component_id or metric_id are required)
    component_id: 1
    # set to post lag to cachet metric (graph)
    metric_id: 1

    # custom templates (see readme for details)
    template:
      investigating:
        subject: "{{ .Monitor.Name }} - {{ .SystemName }}"
        message: "{{ .Monitor.Name }} check **failed** (server time: {{ .now }})\n\n{{ .FailReason }}"
      fixed:
        subject: "I HAVE BEEN FIXED"

    # seconds between checks
    interval: 1
    # seconds for timeout
    timeout: 1
    # If % of downtime is over this threshold, open an incident
    threshold: 80

    # custom HTTP headers
    headers:
    #  Authorization: Basic <hash>
    # expected status code (either status code or body must be supplied)
    expected_status_code: 200

What did I did wrong?

ghost commented 6 years ago
root@54977:/var/monitor# ./cachet-monitor -c config.yml 
INFO[0000] System: XXX.cloud               
INFO[0000] API: https://XXX.com/api/v1        
INFO[0000] Monitors: 1

INFO[0000] Pinging cachet                               
ERRO[0000] Cannot ping cachet!
invalid character '<' looking for beginning of value 
kevineaton commented 6 years ago

@TheOfficialDoc What happens if you open the url in the browser? The code appears to be adding /ping to the end of it, so in your example, what do you see if you go to:

https://XXX.com/api/v1/ping

radek3911 commented 6 years ago

I no longer have it running can't provide further details to this.

casKd-dev commented 5 years ago

Close this then https://github.com/CastawayLabs/cachet-monitor/issues/88#issuecomment-377341656

saikatharryc commented 4 years ago

@TheOfficialDoc What happens if you open the url in the browser? The code appears to be adding /ping to the end of it, so in your example, what do you see if you go to:

https://XXX.com/api/v1/ping I see its resolving with

{
"data": "Pong!"
}
jamieb452 commented 1 year ago

Sorry to bump this, but I have this issue, what would be the fix? thanks