Giter Club home page Giter Club logo

graylog2-plugin-input-httpmonitor's Introduction

Graylog HTTP Monitor Input Plugin (DEPRECATED)

maintenance-status

An input monitor plugin for monitoring HTTP URLs (websites and REST APIs). Works by periodically polling the URLs and recording the responses as messages.

This plugin provides support for monitoring following parameters

  • Response time in milliseconds
  • HTTP Status Code
  • HTTP Status Text
  • HTTP Response Body
  • HTTP Response size in bytes
  • Timeouts and connection failures
  • Custom Response Headers

Getting started

For Graylog v2.0 and above download this jar (Please note this version will break (due to changes in graylog field naming restrictions) HTTP monitor dashboard created in older versions)

For Graylog v1.2 and above download this jar

For Graylog v1.1 and below download this jar

  • Shutdown the graylog server.
  • Place the plugin jar in the Graylog plugins directory.
  • Restart the server.
  • In the graylog web UI, goto System->Inputs to launch new input of type 'HTTP Monitor'

Following parameters can be configured while launching the plugin

  • URL to monitor ( supports HTTPS URLs with self-signed certificates also)
  • Polling interval - Interval to execute the HTTP methods (poll the URL)
  • Timeout - Time to wait before declaring the request as timed out.
  • HTTP Method - GET/POST/PUT method to be executed
  • Additional HTTP headers to send - Comma separated list of HTTP request headers to be sent as part of request. e.g. CAccept:application/json, X-Requester:Graylog2
  • Additional HTTP headers to log - Command separated list of HTTP response headers to log as part of message. e.g. Expires,Date
  • HTTP Basic Authentication username and password
  • HTTP Proxy URI

The status code will be 999 on connection failures, 998 on connection timeouts and 997 for others errors.

Polling interval and timeout can be configured in milliseconds/seconds/minutes/hours/days

You can import the content pack for HTTP Monitor for prebuilt dashboard and streams.

Sample Dashboard

Dashboard for Hacker News Monitor

graylog2-plugin-input-httpmonitor's People

Contributors

benoss avatar sivasamyk avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graylog2-plugin-input-httpmonitor's Issues

HttpMonitor fixed message lenght

Hi,
maybe I overlooked something but I can't find any way how to access more than 50 characters from event message. Is this some hard-coded limitation?

Unable to see HTTP input on 1.3.3

Graylog-server 1.3.3 seems to be incompatible with the input plugin 1.0.2. There is no additional input type listed in the menu when loading the 1.0.2 jar file into plugins.

Plugin does not appear in inputs on out-of-the-box Graylog 2.0.0

Installed stock Graylog 2.0.0 from official AMI image
Copied plugin to plugin as instructed:

/opt/graylog/server/plugin# ls -l
total 14756
-rw-r--r-- 1 root root 2111402 Mar 15 09:19 graylog2-plugin-input-httpmonitor-1.0.3.jar
-rw-r--r-- 1 root root 1669275 Apr 28 16:03 graylog-plugin-collector-1.0.0.jar
-rw-r--r-- 1 root root 1541788 Apr 28 16:03 graylog-plugin-enterprise-integration-1.0.0.jar
-rw-r--r-- 1 root root 6452191 Apr 28 16:03 graylog-plugin-map-widget-1.0.0.jar
-rw-r--r-- 1 root root 2837117 Apr 28 16:03 graylog-plugin-pipeline-processor-1.0.0-beta.2.jar
-rw-r--r-- 1 root root 484487 Apr 28 16:03 usage-statistics-2.0.0.jar

note that installation directory is "plugin", not "plugins" as instructed in official documentation.

After restart plugin does not appear:

image

Please help!

Request failed :java.lang.IllegalArgumentException

I'm running graylog-3.2.4 and I downloaded graylog2-plugin-input-httpmonitor-1.0.5.jar to the plugin folder. I create a GET HTTP reguest but I'm getting the following error:

Request failed :java.lang.IllegalArgumentException: Header name cannot contain the following prohibited characters: =,;: \t\r\n\v\f

I don't believe I'm using illegal characters. Do you have any suggestions on how to troubeshoot?

Thanks in advance.

HTTP Monitor Input Configuration

configHeadersToRecord: <empty>
configHeadersToSend: Accept:application/json, Authorization:Bearer d017317b89c07500fcc9a43074d038e34c4a3aa0248de9e419d8a10b80bea65e
configHttpProxy: <empty>
configInterval: 1
configIntervalUnit: MINUTES
configLabel: A3RegisteredNodes
configLogResponseBody: true
configMethod: GET
configPassword:********
configRequestBody: <empty>
configTimeout: 20
configTimeoutUnit: SECONDS
configURL: https://192.168.128.248:9999/api/v1/reports/registered
configUsername: <empty>
decompress_size_limit: 8388608
override_source: <empty>

Behinde a Proxy

Hi,

thanks for the plugin. I have a problem to become a reuqest behind a proxy. In the intranet a request is no problem.
In the server.conf of graylog-server i defined the proxy. But without any resoult.

Do you have a idea what i can do?

Compatibility with Graylog 2.0

I don't have any _http metrics in the message
on the other hand everything else seems ok, including extracting the X-HEADERS data

Looking at the logs it looks like now you can't have nested values

2016-03-15 03:17:52,481 WARN : org.graylog2.plugin.Message - Keys must not contain a "." character! Ignoring field "http.monitor.responseTime"="207" in message [80e15510-ea5c-11e5-ad8b-62df949bdde0].
2016-03-15 03:17:52,481 WARN : org.graylog2.plugin.Message - Keys must not contain a "." character! Ignoring field "http.monitor.status"="200" in message [80e15510-ea5c-11e5-ad8b-62df949bdde0].
2016-03-15 03:17:52,482 WARN : org.graylog2.plugin.Message - Keys must not contain a "." character! Ignoring field "http.monitor.statusLine"="OK" in message [80e15510-ea5c-11e5-ad8b-62df949bdde0].
2016-03-15 03:17:52,482 WARN : org.graylog2.plugin.Message - Keys must not contain a "." character! Ignoring field "http.monitor.responseSize"="19518" in message [80e15510-ea5c-11e5-ad8b-62df949bdde0].
2016-03-15 03:17:52,483 WARN : org.graylog2.plugin.Message - Keys must not contain a "." character! Ignoring field "http.monitor.url"="https://www.google.co.nz" in message [80e15510-ea5c-11e5-ad8b-62df949bdde0].

image

Support for Graylog 5.2

I know it might be a longshot since there hasn't been an update on this repository in awhile. But...
Currently running Graylog 5.2.

I seem to be getting a bunch of java error messages when attempting to install the plugin:

2023-12-15 17:19:51,933 ERROR: org.graylog2.bootstrap.CmdLineTool - Guice error (more detail on log level debug): No implementation for org.graylog2.plugin.httpmonitor.HttpMonitorInput$Factory was bound.
2023-12-15 17:19:51,934 ERROR: org.graylog2.bootstrap.CmdLineTool - Guice error (more detail on log level debug): org.graylog2.plugin.inputs.MessageInput$Descriptor is abstract, not a concrete class.  Unable to create AssistedInject factory.
2023-12-15 17:19:51,934 ERROR: org.graylog2.bootstrap.CmdLineTool - Startup error:
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for HttpMonitorInput$Factory was bound.

Requested by:
1  : Graylog2Module.installInput(Graylog2Module.java:233)
      \_ installed by: PluginBindings -> HttpMonitorInputModule

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

2) MessageInput$Descriptor is abstract, not a concrete class.  Unable to create AssistedInject factory.
  while locating MessageInput$Descriptor
  at MessageInput$Factory.getDescriptor(MessageInput.java:1)

2 errors

======================
Full classname legend:
======================
Graylog2Module:           "org.graylog2.plugin.inject.Graylog2Module"
HttpMonitorInput$Factory: "org.graylog2.plugin.httpmonitor.HttpMonitorInput$Factory"
HttpMonitorInputModule:   "org.graylog2.plugin.httpmonitor.HttpMonitorInputModule"
MessageInput$Descriptor:  "org.graylog2.plugin.inputs.MessageInput$Descriptor"
MessageInput$Factory:     "org.graylog2.plugin.inputs.MessageInput$Factory"
PluginBindings:           "org.graylog2.shared.bindings.PluginBindings"
========================
End of classname legend:
========================

        at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:589) ~[graylog.jar:?]
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:163) ~[graylog.jar:?]
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) ~[graylog.jar:?]
        at com.google.inject.Guice.createInjector(Guice.java:87) ~[graylog.jar:?]
        at org.graylog2.shared.bindings.GuiceInjectorHolder.createInjector(GuiceInjectorHolder.java:34) ~[graylog.jar:?]
        at org.graylog2.bootstrap.CmdLineTool.setupInjector(CmdLineTool.java:523) ~[graylog.jar:?]
        at org.graylog2.bootstrap.CmdLineTool.doRun(CmdLineTool.java:310) ~[graylog.jar:?]
        at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:260) [graylog.jar:?]
        at org.graylog2.bootstrap.Main.main(Main.java:55) [graylog.jar:?]
Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for HttpMonitorInput$Factory was bound.

Requested by:
1  : Graylog2Module.installInput(Graylog2Module.java:233)
      \_ installed by: PluginBindings -> HttpMonitorInputModule

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

2) MessageInput$Descriptor is abstract, not a concrete class.  Unable to create AssistedInject factory.
  while locating MessageInput$Descriptor
  at MessageInput$Factory.getDescriptor(MessageInput.java:1)

2 errors

======================
Full classname legend:
======================
Graylog2Module:           "org.graylog2.plugin.inject.Graylog2Module"
HttpMonitorInput$Factory: "org.graylog2.plugin.httpmonitor.HttpMonitorInput$Factory"
HttpMonitorInputModule:   "org.graylog2.plugin.httpmonitor.HttpMonitorInputModule"
MessageInput$Descriptor:  "org.graylog2.plugin.inputs.MessageInput$Descriptor"
MessageInput$Factory:     "org.graylog2.plugin.inputs.MessageInput$Factory"
PluginBindings:           "org.graylog2.shared.bindings.PluginBindings"
========================
End of classname legend:
========================

        at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:589)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:163)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
        at com.google.inject.Guice.createInjector(Guice.java:87)
        at org.graylog2.shared.bindings.GuiceInjectorHolder.createInjector(GuiceInjectorHolder.java:34)
        at org.graylog2.bootstrap.CmdLineTool.setupInjector(CmdLineTool.java:523)
        at org.graylog2.bootstrap.CmdLineTool.doRun(CmdLineTool.java:310)
        at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:260)
        at org.graylog2.bootstrap.Main.main(Main.java:55)

Has anybody been able to get past this?

ERROR [InputLauncher] The [org.graylog2.plugin.httpmonitor.HttpMonitorInput] input with ID <571acf77e4b0854adf462f52> misfired. Reason: scheme.

Getting an NPE when trying to launch this the first time. I've tried a couple of different web sites to see if it's a configuration issue on my side. But no luck. any ideas?

Using graylog-web-interface v1.3.4 (0d67a80) (Oracle Corporation 1.8.0_77 / Linux 2.6.32-573.22.1.el6.x86_64)

ERROR [InputLauncher] The [org.graylog2.plugin.httpmonitor.HttpMonitorInput] input with ID <571acf77e4b0854adf462f52> misfired. Reason: scheme. org.graylog2.plugin.inputs.MisfireException: java.lang.NullPointerException: scheme at org.graylog2.plugin.inputs.MessageInput.launch(MessageInput.java:163) at org.graylog2.shared.inputs.InputLauncher$1.run(InputLauncher.java:84) at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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) Caused by: java.lang.NullPointerException: scheme at com.ning.http.client.uri.Uri.<init>(Uri.java:56) at com.ning.http.client.uri.Uri.create(Uri.java:32) at com.ning.http.client.uri.Uri.create(Uri.java:25) at com.ning.http.client.RequestBuilderBase.setUrl(RequestBuilderBase.java:307) at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.setUrl(AsyncHttpClient.java:308) at com.ning.http.client.AsyncHttpClient.requestBuilder(AsyncHttpClient.java:596) at com.ning.http.client.AsyncHttpClient.prepareGet(AsyncHttpClient.java:402) at org.graylog2.plugin.httpmonitor.HttpMonitorTransport$MonitorTask.buildRequest(HttpMonitorTransport.java:285) at org.graylog2.plugin.httpmonitor.HttpMonitorTransport$MonitorTask.<init>(HttpMonitorTransport.java:174) at org.graylog2.plugin.httpmonitor.HttpMonitorTransport.startMonitoring(HttpMonitorTransport.java:151) at org.graylog2.plugin.httpmonitor.HttpMonitorTransport.launch(HttpMonitorTransport.java:132) at org.graylog2.plugin.inputs.MessageInput.launch(MessageInput.java:160) ... 7 more 2016-04-23T01:27:19.187Z INFO [InputStateListener] Input [HTTP Monitor/571acf77e4b0854adf462f52] is now FAILED

HttpMonitorTransport - Exception while executing request

2016-08-10 18:00:44,949 DEBUG: org.graylog2.plugin.httpmonitor.HttpMonitorTransport - Exception while executing request for URL https://midominio.com:8081/v1
java.util.concurrent.ExecutionException: java.net.ConnectException: https://midominio.com:8081
at com.ning.http.client.providers.netty.future.NettyResponseFuture.abort(NettyResponseFuture.java:231) ~[?:?]
at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:135) ~[?:?]
at com.ning.http.client.providers.netty.request.NettyConnectListener.access$200(NettyConnectListener.java:37) ~[?:?]
at com.ning.http.client.providers.netty.request.NettyConnectListener$1.operationComplete(NettyConnectListener.java:104) ~[?:?]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:409) ~[graylog.jar:?]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:395) ~[graylog.jar:?]
at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:362) ~[graylog.jar:?]
at org.jboss.netty.handler.ssl.SslHandler.channelDisconnected(SslHandler.java:575) ~[graylog.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[graylog.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[graylog.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) ~[graylog.jar:?]
at org.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.java:396) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:360) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) ~[graylog.jar:?]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[graylog.jar:?]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) ~[graylog.jar:?]
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ~[graylog.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
Caused by: java.net.ConnectException: https://midominio.com:8081
at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:131) ~[?:?]
... 21 more
Caused by: java.nio.channels.ClosedChannelException
... 16 more

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.