Coder Social home page Coder Social logo

graylog-labs / graylog-plugin-hipchat Goto Github PK

View Code? Open in Web Editor NEW
9.0 19.0 8.0 75 KB

Alarm callback that is writing to HipChat chatrooms

Home Page: https://marketplace.graylog.org/addons/e316cbfc-663f-4718-aa54-8aff97749449

License: GNU General Public License v3.0

Java 100.00%
graylog hipchat alarm-callback graylog-plugin alerting monitoring

graylog-plugin-hipchat's Introduction

HipChat Plugin for Graylog

Github Downloads GitHub Release Build Status

An alarm callback plugin for integrating HipChat into Graylog.

Required Graylog version: 2.4.0 and later.

  • Please use version 1.2.0 of this plugin if you are still running Graylog 1.x.
  • Please use version 1.3.0 of this plugin if you are still running Graylog 2.0.x, 2.1.x, 2.2.x, or 2.3.x.

Installation

Download the plugin and place the .jar file in your Graylog plugin directory. The plugin directory is the plugins/ directory relative from your Graylog installation path by default and can be configured in the graylog.conf file.

Restart Graylog and you are done.

Usage

Custom templates can be defined with the same JMTE syntax used in the email templates, as long as they only work on the HTML subset supported by the HipChat API.

For example the following template includes the custom field named myField in the HipChat message:

${if stream_url}<a href="${stream_url}">${end}
<strong>Alert for ${stream.title}</strong>
${if stream_url}
</a>
${end}
<i>(${check_result.triggeredCondition})</i>
<br/>
<i>${check_result.resultDescription}, triggered at ${check_result.triggeredAt}</i>
<br/>
${if backlog}Last messages accounting for this alert:<br/>
<table align="left">
<tr><th>My Field</th><th>Details</th></tr>
${foreach backlog message}<br/>
<tr>
    <td><b>${message.fields.myField}</b></td>
    <td><code>${message.source}, ${message.id}</code></td>
</tr>
</table>
${end}
${else}
<i>(No messages to display.)</i>
${end}

If no custom template has been configured, the default email template is used.

Build

This project is using Maven and requires Java 8 or higher.

You can build a plugin (JAR) with mvn package.

DEB and RPM packages can be build with mvn jdeb:jdeb and mvn rpm:rpm respectively.

Plugin Release

We are using the maven release plugin:

$ mvn release:prepare
[...]
$ mvn release:perform

This sets the version numbers, creates a tag and pushes to GitHub. TravisCI will build the release artifacts and upload to GitHub automatically.

graylog-plugin-hipchat's People

Contributors

bernd avatar roland-ewald avatar topping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graylog-plugin-hipchat's Issues

Alert does not include context

Hi - thanks for your plugin, I've been trying it out with Graylog 1.0 and a HipChat API v2. 'room token' I can get a message logged into the room, but it did not include the message which caused the alert :(

Trigger alert when there are X more less than 0 messages in the last 1 minutes and then wait at least 1 minutes until triggering a new alert. (grace period) When sending an alert, include the last 1 messages of the stream evaluated for this alert condition.

In the HipChat Web chat window, the alert appears as

Graylog Callbacks 1:55 PM Stream <Varnish Reloads> alert: Stream had 1 messages in the last 1 minutes with trigger condition more than 0 messages. (Current grace time: 1 minutes)

There's nothing in the graylog-server.log at this time to help debug :/

Cheers,
Gavin.

Hipchat does not show up in Graylog2 outputs

I downloaded the .jar file and placed in the plugin directory. I did the same thing for Slack plugin. But hipchat does not show up in the output list like Slack. But it is available in the alert callback.

Please let me know whether I am missing something.

screen shot 2016-07-28 at 11 20 42 pm

Here is the screenshot of Alert callback list:
screen shot 2016-07-29 at 12 01 13 am

Consider providing a jar file for easy deployment

Thanks for bringing this plugin back ๐Ÿ˜ƒ
Do you have any plans to provide a packaged version released alongside the graylog2 distribution? It would really help us with upgrading graylog2 on a chef-managed server.

Trigger failure

Getting this exception when the handler is triggered:

2015-07-01T21:42:35.933Z WARN  [DefaultChannelPipeline] An exception was thrown by a user handler while handling an exception event ([id: 0x2c6faccd, /169.254.169.254:57783 :> /104.197.15.116:12900] EXCEPTION: java.io.IOException: Connection reset by peer)
java.lang.NullPointerException
        at org.graylog2.jersey.container.netty.NettyContainer.exceptionCaught(NettyContainer.java:412)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
        at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        at org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor$MemoryAwareRunnable.run(MemoryAwareThreadPoolExecutor.java:622)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Running the packaged Wheezy graylog-server 1.1.4-1.

Unexpected HTTP response status 401

Hello, I'm getting a 401 error when trying to use this plugin. I've tried using the same API token as I'm using with a working jenkins server and also an admin api token but both fail. I've also tried the room by ID and by name but get the same results. Can you please let me know what could be causing this?

Alarm callback <HipChat alarm callback> failed. Skipping.
org.graylog2.plugin.alarms.callbacks.AlarmCallbackException: Unexpected HTTP response status 401

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.