CastawayLabs / cachet-monitor

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

Cachet-monitor installation is not working on Linux system. #47

Closed mkok1019 closed 7 years ago

mkok1019 commented 7 years ago

Hey, guys.

I am trying to install cachet-monitor on linux system, but it doesn't work. It says: "cachet-monitor: command not found"

I've tried all the ways mentioned in the closed issues, but nothing helped me.

  1. curl -L <download-link> > /usr/local/bin/cachet-monitor cachet-monitor -c .... This is not working. What do you mean download-link here? I tried in this way. curl -L github.com/CastawayLabs/cachet-monitor > /usr/local/bin/cachet-monitor And run cachet-monitor. It says:
    /usr/local/bin/cachet-monitor: line 5: syntax error near unexpected token `newline'
    /usr/local/bin/cachet-monitor: line 5: `<!DOCTYPE html>'
  2. go get -d github.com/castawaylabs/cachet-monitor go install github.com/castawaylabs/cachet-monitor Still not finding the cachet-monitor
  3. Tried with cachet-monitor_linux_amd64 but it says like this: invalid character '/' looking for beginning of object key string
    
    panic: Cannot parse config!

goroutine 1 [running]: panic(0x75c2e0, 0xc82000af50) /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6 main.main() /Users/m/p/gospace/src/github.com/castawaylabs/cachet-monitor/cli/main.go:31 +0x16a



Can you guys please let me know the way to install on linux system?
@matejkramny can you please help me? :)
@moodhairboy can you check my post?
matejkramny commented 7 years ago

1) download link can be obtained from releases: https://github.com/CastawayLabs/cachet-monitor/releases 2) it can't be currently installed in the "go" way 3) is your config a valid json file?

mkok1019 commented 7 years ago

@matejkramny Thanks for your response.

  1. I ran these commands. curl -L https://github.com/CastawayLabs/cachet-monitor/releases > /usr/local/bin/cachet-monitor cachet-monitor It says like this:
    /usr/local/bin/cachet-monitor: line 5: syntax error near unexpected token `newline'
    /usr/local/bin/cachet-monitor: line 5: '<!DOCTYPE html>'
  2. This is my config file which is /etc/cachet-monitor.config.json. { "api_url": "http://cachet domain/api/v1", "api_token": "api token", "insecure_api": true, "monitors": [{ "name": "Url Monitor", "url": "https://google.com", "method": "get", "strict_tls": true, "interval": 10, "timeout": 5, "metric_id": 1, "component_id": 1, "threshold": 80, "expected_status_code": 200 }], "system_name": "system name", "log_path": "/var/log/" }
matejkramny commented 7 years ago

Sorry I meant, the releases url contains released binaries for your OS. You need to pick one and copy the URL.

If you're using Linux (64bit) then it would be: https://github.com/CastawayLabs/cachet-monitor/releases/download/v2.0/cachet-monitor_linux_amd64

Log path should be pointing to a file, might be the issue. Try /var/log/cachet_monitor.log

mkok1019 commented 7 years ago

@matejkramny Thank you, Matej!

It works now. I really appreciated with your help.

You can close this issue. Thanks.