Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset doesn't downloads from bonsai #13

Closed
chukynax opened this issue Sep 19, 2019 · 25 comments · Fixed by #14
Closed

Asset doesn't downloads from bonsai #13

chukynax opened this issue Sep 19, 2019 · 25 comments · Fixed by #14
Labels
question Further information is requested

Comments

@chukynax
Copy link

{"assets":null,"component":"pipelined","handler":"alerta","level":"info","msg":"event pipe handler executed","namespace":"default","output":"sh: 1: sensu-alerta-handler: not found\n","status":127,"time":"2019-09-19T12:50:33+03:00"}

@satterly
Copy link
Member

This issue is blocked waiting on more information. The description or subsequent comments do not provide enough information to triage, investigate or resolve the issue. Please review the description against the issue template and ensure all relevant information is included. If you do not know what is expected you can ask on Gitter chat.

@satterly satterly added the blocked This issue can't be resolved unless something else is done label Sep 19, 2019
@chukynax
Copy link
Author

i took information from here https://bonsai.sensu.io/assets/alerta/sensu-alerta-handler

i filled up asset file like this:

---
type: Asset
api_version: core/v2
metadata:
  name: sensu-alerta-handler_linux_amd64
  labels: 
  annotations:
    io.sensu.bonsai.url: https://bonsai.sensu.io/assets/alerta/sensu-alerta-handler
    io.sensu.bonsai.api_url: https://bonsai.sensu.io/api/v1/assets/alerta/sensu-alerta-handler
    io.sensu.bonsai.tier: Community
    io.sensu.bonsai.version: 1.0.4
    io.sensu.bonsai.namespace: alerta
    io.sensu.bonsai.name: sensu-alerta-handler
    io.sensu.bonsai.tags: alerta
spec:
  url: https://assets.bonsai.sensu.io/d42a4050b8ae95300057486be8daf6b749aa3414/sensu-alerta-handler_1.0.4_linux_amd64.tar.gz
  sha512: 50090697a8378d0c0a88c75fde0242866028b67f2bc8125dab88ff68cb5c3ed763c8f517dd3999f9a0457ab63ab1411a9941f6250ded9009c84c7cea2ba07c9c
  filters:
  - entity.system.os == 'linux'
  - entity.system.arch == 'amd64'

And setup handler:

{
	"type": "Handler",
	"api_version": "core/v2",
	"metadata": {
		"namespace": "default",
		"name": "alerta"
	},
	"spec": {
		"type": "pipe",
		"command": "sensu-alerta-handler",
		"env_vars": [
			"ALERTA_ENDPOINT=http://172.17.0.1:8090/alert",
			"timeout=10"
		],
		"timeout": 30
	}
}

Afterwards i recieve log error decribed in topic

@satterly
Copy link
Member

Did you download and install the handler?

Installation
Download the latest version of the sensu-alerta-handler from releases, or create an executable script from this source.

From the local path of the sensu-alerta-handler repository:

go build -o /usr/local/bin/sensu-alerta-handler main.go

@chukynax
Copy link
Author

nope, as i didnt for sensu-slack-sender for example, i thought it is gonna fetch it automatically

@satterly
Copy link
Member

What version of Sensu are you running?

@satterly
Copy link
Member

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@satterly
Copy link
Member

What version of Sensu???

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@satterly
Copy link
Member

What commands did you run? The README for slack suggests it still needs to be installed once downloaded... https://github.com/sensu/sensu-slack-handler

@chukynax
Copy link
Author

in official guide of sensu there is nothing about manual building of binary's. just put asset and define handler, and it fetches itself

@satterly
Copy link
Member

What guide? Where? Please show me a link so I can check that.

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@satterly
Copy link
Member

They skipped a step. If you look at the slack README and the alerta README they both clearly state...

Download the latest version of the sensu-slack-handler from releases, or create an executable script from this source.

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@satterly
Copy link
Member

I've just updated the README. Let me know if that works for you.

@satterly satterly added question Further information is requested and removed blocked This issue can't be resolved unless something else is done labels Sep 19, 2019
@chukynax
Copy link
Author

[POLICY] Alert environment does not match one of Production

i think there is also needs an env_vars for environment

@satterly
Copy link
Member

satterly commented Sep 19, 2019

So what is the environment that is being sent? It comes from event.Entity.Namespace.

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019 via email

@satterly
Copy link
Member

If your namespace is "Default" then add "Default" to the list of allowed environments in Alerta. See https://docs.alerta.io/en/latest/configuration.html#plugin-settings

Allowing environment to be overridden in the handler config is possible. What if Sensu monitors more than one environment though? eg. Production, Staging, Test and Development etc.

@chukynax
Copy link
Author

chukynax commented Sep 19, 2019

changing namespace in sensu worked
i will use several handlers probably .. you said it is possible, have link ?

@satterly
Copy link
Member

Can't use use namespace for the environment? Or do you want to be able to define an alerta handler for each environment? "production", "development" etc?

@satterly
Copy link
Member

It's been updated to support --environment as a command-line option...

$ ./sensu-alerta-handler -h
The Sensu Go Alerta handler for event forwarding

Usage:
  sensu-alerta-handler [flags]

Flags:
  -K, --api-key string        API key for authenticated access
      --endpoint-url string   API endpoint URL (default "http://localhost:8080")
  -E, --environment string    Environment eg. Production, Development (default "Entity Namespace")
  -h, --help                  help for sensu-alerta-handler

@chukynax
Copy link
Author

Fantastic, thanks for support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants