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

New actions - webhook/exec or plugin for Graphite/InfluxDB events and Hipchat #27

Open
VAdamec opened this issue Feb 9, 2017 · 7 comments

Comments

@VAdamec
Copy link

VAdamec commented Feb 9, 2017

Hi,
is there any chance to add webhook call (for example Jenkins) or simple exec ? For example my use case is to adding events/tags to Graphite/InfluxDB, like this:

curl -X POST "http://xxx:xxxx@influxdb:8086/write?db=events&precision=s" --data-binary "events title="Service prometheus degraded",text="stack Prometheus became degraded (active)",tags="rancher,alerts" date +%s"

curl -X POST "http://graphite/events/"
-d '{"what": "Service prometheus degraded", "tags": "rancher,alerts",
"data": "stack Prometheus became degraded (active) at Fri Jan 3 22:34:41 UTC 2017"}'

@VAdamec
Copy link
Author

VAdamec commented Feb 9, 2017

https://github.com/VAdamec/rancher-alarms - graphite draft (authentication has some issue, still getting 401 and template can be completely removed). Any advice will be appreciated

@VAdamec
Copy link
Author

VAdamec commented Feb 10, 2017

await axios({url: this._url, headers: {'Authorization': 'Basic Z3Vlc3Q6Z3Vlc3Q='}, withCredentials: true, auth: {username: this._GraphiteLogin, password: this._GraphitePass}, method: 'POST', data: webhookPayload});

auth setup with pass and login not working, with auth header and base64 hash it's ok. Anybody know how to create base64 hash ? I'm not programmer and didn't find any working solution for such easy operation :-)

@ndelitski
Copy link
Owner

ndelitski commented Feb 12, 2017

Hello @VAdamec! You are on a correct way by adding a new Notification target. For your case with passing credentials try not to add headers: Authorizaion field when you already defined auth one. If you would like setup basic auth header manually then just remove auth prop and use Buffer for encoding {Authorization: 'Basic ' + new Buffer(username + ':' + password).toString('base64')}, no need to add special package for base64 encoding.
Please send me a PR and I will cleanup your code and we could work on releasing your feature then.

@VAdamec
Copy link
Author

VAdamec commented Feb 12, 2017

Still no luck to use auth, so base64 header is now only option. I'll make some test tomorrow and send you PR.

@VAdamec
Copy link
Author

VAdamec commented Feb 13, 2017

#29

@VAdamec
Copy link
Author

VAdamec commented Feb 13, 2017

No luck with auth, so just basic header used. Not sure about npm module installation. I have stable builds and tests with adding direct installation to Dockerfile. Also minimatch package was added due deprecation/security warning of used version.

RUN npm install minimatch
RUN npm install js-base64

@VAdamec VAdamec changed the title New action - webhook/exec or plugin for Graphite/InfluxDB events New actions - webhook/exec or plugin for Graphite/InfluxDB events and Hipchat Apr 4, 2017
@VAdamec
Copy link
Author

VAdamec commented Apr 4, 2017

Hipchat added

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

No branches or pull requests

2 participants