Git Product home page Git Product logo

telegramalert's Introduction

TelegramNotification Plugin for Graylog

Build status GitHub Release

TelegramNotification allows you to send Graylog alert messages to a specified Telegram chat.

Requirements

Requires Graylog 6. Check the release notes for details.

Installation

  1. Download the latest TelegramNotification release and place the graylog-plugin-telegram-notification-x.x.x.jar file in your plugin_dir that is configured in your graylog.conf as described in the Graylog documentation.

  2. Restart your graylog-server, i.e. systemctl restart graylog-server.

  3. Configure an alert notification as described in the next section.

Usage

Step 1 - Create Bot

Create a new Telegram bot with the BotFather and copy the bot token.

Step 2 - Get Channel ID

Use the Message Tool to find the Chat ID of the desired chat.

You can use a private chat, add the bot to a group-chat or to a channel. Just make sure to copy the correct Channel ID.

Step 3 - Add Notification

Navigate to Alerts > Notifications in your Graylog-interface and select Telegram Notification as the notification type.

The message is a template that can be configured as described in the Graylog Documentation

Settings

Update

To update the plugin you need to remove the old graylog-plugin-telegram-notification-x.x.x.jar (or telegram-alert-x.x.x.jar) file from your plugins folder and follow the installation instructions again.

You may need to remove and re-create your Telegram Notifications.

Development

See docs/development/README.md for some notes on how to get started with development.

Contributions are welcome.

Credits

Thanks to:

telegramalert's People

Contributors

fengkaijia avatar irgendwr avatar lantalex 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  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  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  avatar  avatar  avatar

telegramalert's Issues

Add something to escape markdown/html chars

I try to use all the default values and I get an error like in the screenshot.
image

And in the log:

2019-07-23T14:36:58.058Z WARN  [AlertNotificationsSender] Alarm callback <Telegram Alert> failed. Skipping.
org.graylog2.plugin.alarms.callbacks.AlarmCallbackException: API request failed: Bad Request
        at de.sandstorm_projects.telegramAlert.TelegramBot.sendMessage(TelegramBot.java:70) ~[?:?]
        at de.sandstorm_projects.telegramAlert.TelegramAlarmCallback.call(TelegramAlarmCallback.java:49) ~[?:?]
        at org.graylog2.alerts.AlertNotificationsSender.send(AlertNotificationsSender.java:58) ~[graylog.jar:?]
        at org.graylog2.alerts.AlertScanner.handleTriggeredAlert(AlertScanner.java:45) ~[graylog.jar:?]
        at org.graylog2.alerts.AlertScanner.checkAlertCondition(AlertScanner.java:70) ~[graylog.jar:?]
        at org.graylog2.periodical.AlertScannerThread.lambda$doRun$0(AlertScannerThread.java:63) ~[graylog.jar:?]
        at java.util.ArrayList.forEach(ArrayList.java:1257) [?:1.8.0_212]
        at org.graylog2.periodical.AlertScannerThread.doRun(AlertScannerThread.java:63) [graylog.jar:?]
        at org.graylog2.plugin.periodical.Periodical.run(Periodical.java:77) [graylog.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_212]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_212]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_212]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_212]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

But if I change a Parse mode to Text, a telegram bot sends a message with a link in the body.
Can you tell me what the problem might be?

The message you are sending is too long

Describe the bug
If message length exceeds 4096 characters then plugin doesnt send any alert to telegram. In this case info about error is lost and we dont see in telegram that error is occured.

01

Expected behavior
I saw issue #37 and I think that solution is unsufficient.
It would be nice if plugin either

  • cut of the end of message
  • or just send its exception's text (from image above) to telegram
  • or just send to telegram simple text such as "An error occured. Exception text is too long to display in telegram. See full error text directly in graylog."

It's very important to send to telegram any alert even if exception occured in plugin itself.

Versions:

  • Graylog: 4.0.8
  • TelegramNotification: 2.3.4

Message Template:

${if backlog}
    ${foreach backlog message}
<b>Facility:    ${message.fields.facility}</b>
Logger:      ${message.fields.LoggerName}
Time:        ${message.timestamp}

<code>${message.fields.ExceptionMessage}</code>

SequenceId:  ${message.fields.sequenceId}
<a href='https://example.com/messages/${message.index}/${message.id}'>${message.id}</a>
    ${end}
${else}
Time:   ${event.timestamp}
   
<code>${event.message}</code>
${end}

Better error handling

Hi!

I've just found that some of my alerts wasn't sent with errors:

2018-07-31T10:07:17.893+03:00 WARN  [TelegramAlert] API request was unsuccessful (400)
server.log.7.gz:2018-07-31T10:34:24.250+03:00 WARN  [TelegramAlert] API request was unsuccessful (400)
server.log.7.gz:2018-07-31T10:34:24.250+03:00 WARN  [AlertNotificationsSender] Alarm callback <Telegram Alert> failed. Skipping.
server.log.7.gz:	at de.sandstorm_projects.telegramAlert.TelegramBot.sendMessage(TelegramBot.java:72) ~[?:?]
server.log.7.gz:	at de.sandstorm_projects.telegramAlert.TelegramAlarmCallback.call(TelegramAlarmCallback.java:47) ~[?:?]
server.log.7.gz:	at org.graylog2.alerts.AlertNotificationsSender.send(AlertNotificationsSender.java:58) ~[graylog.jar:?]
server.log.7.gz:	at org.graylog2.alerts.AlertScanner.handleRepeatedAlert(AlertScanner.java:51) ~[graylog.jar:?]
server.log.7.gz:	at org.graylog2.alerts.AlertScanner.checkAlertCondition(AlertScanner.java:77) ~[graylog.jar:?]
server.log.7.gz:	at org.graylog2.periodical.AlertScannerThread.lambda$doRun$0(AlertScannerThread.java:63) ~[graylog.jar:?]
server.log.7.gz:	at org.graylog2.periodical.AlertScannerThread.doRun(AlertScannerThread.java:63) [graylog.jar:?] 

But I can't find any reason in this log. I think that telegram api send error reason in response, could you show this in log?

Loading Notifications information...stacked after update to version 2.2.3 . Graylog Server 4.0.2

Hello, after update version 2.3.2 not works for my graylog server version 4.0.2
notification tab is stacked on this: Loading Notifications information...
any sggestions?
LOG:
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "type" (class org.graylog.events.notifications.EventNotificationConfig$Fallbackig), not marked as ignorable (0 known properties: ])
at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@6ec82b03; pos: 127] (through reference chain: org.graylog.events.notifications.AutoValue_NotificationDto$Buiorg.graylog.events.notifications.EventNotificationConfig$FallbackNotificationConfig["type"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:823) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1153) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1589) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1567) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:294) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:130) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:97) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:254) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:167) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.vanillaDeserialize(BuilderBasedDeserializer.java:269) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.deserialize(BuilderBasedDeserializer.java:193) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3985) ~[graylog.jar:?]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2343) ~[graylog.jar:?]
at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:80) ~[graylog.jar:?]
at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:64) ~[graylog.jar:?]

Not working GRAYLOG 4.3.y

I carried out the installation of the last version, according to the tutorial, but it does not list the telegram
Graylog 4.3.2+313b6bc on root (Private Build 1.8.0_312 on Linux 5.4.0-117-generic)

image

How to get a link to stream with absolute time interval

Hi,

First, thanks for your solution, it really works great. Could you please help me with two questions:

  1. How can I get the permanent link to the message (in a template) that triggered some alert? Or, how to get a link to the stream with absolute time interval? I found this issue #15 but how can I see it's not actual.

  2. Is there some way to clear the send notification queue?

Additional context
Graylog version: 3.3.13+6949772
TelegramAlert version: 2.3.1

Thanks!

[Feat.] Add Support for Socks Proxy

Hello, how about replacing http proxy with socks5? Http proxy is useless, but socks5 is now very actual in Russia.
It`s better to consider this as a feature.

Sending not working



org.graylog.scheduler.JobExecutionException: Failed permanently to execute notification, giving up - <5d99019cbf1049000dfc1ebe/test/legacy-alarm-callback-notification-v1>


	at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:156) ~[graylog.jar:?]


	at org.graylog.scheduler.JobExecutionEngine.executeJob(JobExecutionEngine.java:166) ~[graylog.jar:?]


	at org.graylog.scheduler.JobExecutionEngine.lambda$handleTrigger$2(JobExecutionEngine.java:144) ~[graylog.jar:?]


	at com.codahale.metrics.Timer.time(Timer.java:137) ~[graylog.jar:?]


	at org.graylog.scheduler.JobExecutionEngine.handleTrigger(JobExecutionEngine.java:144) ~[graylog.jar:?]


	at org.graylog.scheduler.JobExecutionEngine.lambda$execute$0(JobExecutionEngine.java:119) ~[graylog.jar:?]


	at org.graylog.scheduler.worker.JobWorkerPool.lambda$execute$0(JobWorkerPool.java:110) ~[graylog.jar:?]


	at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:181) [graylog.jar:?]


	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]


	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]


	at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]


	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]


Caused by: org.graylog.events.notifications.PermanentEventNotificationException: Couldn't send legacy notification - legacy notifications cannot be retried!


	at org.graylog.events.legacy.LegacyAlarmCallbackEventNotification.execute(LegacyAlarmCallbackEventNotification.java:67) ~[graylog.jar:?]


	at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]

�
	... 11 more


Caused by: java.lang.NullPointerException


	at de.sandstorm_projects.telegramAlert.TelegramBot.sendMessage(TelegramBot.java:43) ~[?:?]


	at de.sandstorm_projects.telegramAlert.TelegramAlarmCallback.call(TelegramAlarmCallback.java:47) ~[?:?]


	at org.graylog.events.legacy.LegacyAlarmCallbackSender.send(LegacyAlarmCallbackSender.java:87) ~[graylog.jar:?]


	at org.graylog.events.legacy.LegacyAlarmCallbackEventNotification.execute(LegacyAlarmCallbackEventNotification.java:64) ~[graylog.jar:?]


	at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]

�
	... 11 more`

Unable to create notification: TelegramEventNotificationConfig cannot be cast to class HTTPEventNotificationConfig

Describe the bug
TelegramAlert Plugin seems to not work with Graylog 5.1

To Reproduce
GrayLog : 5.1.7 and try to create a Telegram Alert

Expected behavior
Working like others versions

Versions:

  • Graylog: 5.1.7
  • TelegramNotification: 2.4.0

Message Template:
(?)

I tried to install this plugin with the actual version of Graylog but I have an error when creating an alert. Here is the log file of Greylog if it can help

Error in log:

java.lang.ClassCastException: class de.irgendwr.AutoValue_TelegramEventNotificationConfig cannot be cast to class org.graylog.events.notifications.types.HTTPEventNotificationConfig (de.irgendwr.AutoValue_TelegramEventNotificationConfig is in unnamed module of loader java.net.FactoryURLClassLoader @1237e0be; org.graylog.events.notifications.types.HTTPEventNotificationConfig is in unnamed module of loader 'app')
        at org.graylog.events.notifications.types.HTTPEventNotificationConfig.prepareConfigUpdate(HTTPEventNotificationConfig.java:100) ~[graylog.jar:?]
        at org.graylog.events.notifications.NotificationResourceHandler.prepareUpdate(NotificationResourceHandler.java:102) ~[graylog.jar:?]
        at org.graylog.events.notifications.NotificationResourceHandler.test(NotificationResourceHandler.java:196) ~[graylog.jar:?]
        at org.graylog.events.rest.EventNotificationsResource.test(EventNotificationsResource.java:298) ~[graylog.jar:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244) [graylog.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) [graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) [graylog.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684) [graylog.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:356) [graylog.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:200) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:180) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]

I never used this plugin before so maybe that's a problem from my side ?
Thank you for your help.

TelegramEventNotificationConfig cannot be cast to HTTPEventNotificationConfig

after installing the plug-in I cannot test the notification or even save it due to the following error:

Error: class de.irgendwr.AutoValue_TelegramEventNotificationConfig cannot be cast to class org.graylog.events.notifications.types.HTTPEventNotificationConfig (de.irgendwr.AutoValue_TelegramEventNotificationConfig is in unnamed module of loader java.net.FactoryURLClassLoader @5327a06e; org.graylog.events.notifications.types.HTTPEventNotificationConfig is in unnamed module of loader 'app')

Versions:

  • Graylog: 5.0.7
  • TelegramNotification: 2.4.0

graylog error

Version 2.3.7 not working on Graylog 4.2.5

Describe the bug
It does not show in the Notification type text field

Expected behavior
Being able to follow the guide: Navigate to Alerts > Notifications in your Graylog-interface and select Telegram Notification as the notification type.

Versions:

  • Graylog: 4.2.5
  • TelegramNotification: 2.3.7

No message content

I use TelegramAlert 2.1.1; Graylog 2.4.6

In plugin I use default message example

${stream.title}: ${alert_condition.title}
${backlog}

${foreach backlog message}
${message.message}
\n${end}

Here is example what I receive
image

Why I didn't receive message body?

Add proxy settings

Due to Russia banning millions of IP-addresses1 in order to block telegram, people rely on proxies and vpn's to circumvent this.
As I already got a request to add this feature I guess it would be useful to some people 😉

Keep fighting against censorship! #DigitalResistance

Telegram Resistance Dog

1) Articles on this topic:
https://themoscowtimes.com/news/google-services-blocked-in-russia-following-telegram-ban-61239
http://www.bbc.com/news/technology-43797176
https://techcrunch.com/2018/04/17/telegram-plays-down-russia-block-claiming-no-significant-impact-yet/

Notifications won't open if TelegramAlert 2.4.0 is installed

Hello. We have a problem with the plugin. Graylog 5.0.0+37301e5 on localhost (Private Build 17.0.6 on Linux 5.4.0-135-generic)
When we install 2.4.0 notification tab loads infinitely and the following error can be seen in browser's console:

FetchProvider.ts:196          GET https://graylog:9000/api/events/notifications?query=&page=1&per_page=10 500 (Internal Server Error)
value @ FetchProvider.ts:196
(anonymous) @ FetchProvider.ts:222
M @ FetchProvider.ts:224
listPaginated @ EventNotificationsStore.ts:150
n @ vendor.1e79e27aeb952fbe940b.js:2
p.emit @ vendor.1e79e27aeb952fbe940b.js:2
trigger @ vendor.1e79e27aeb952fbe940b.js:2
(anonymous) @ vendor.1e79e27aeb952fbe940b.js:2
V.<computed> @ task.js:61
C @ task.js:35
S @ task.js:46
FetchProvider.ts:42 Uncaught (in promise) FetchError: There was an error fetching a resource: Internal Server Error. Additional information: IOException encountered while reading from a byte array input stream
    at https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:692367
    at s (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686349)
    at Generator._invoke (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686102)
    at Generator.next (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686718)
    at O (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:691644)
    at a (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:692660)
From previous event:
    at I.L [as _captureStackTrace] (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1603107)
    at I._resolveFromExecutor (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1633562)
    at new I (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1626639)
    at Object.createPromise (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:3365846)
    at Function.triggerPromise (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:912279)
    at Object.e [as listPaginated] (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:913899)
    at V (https://graylog:9000/assets/071aaa27-4779.32e9bf9fb8c56d937a77.js:1:8456)
    at c.value (https://graylog:9000/assets/071aaa27-4779.32e9bf9fb8c56d937a77.js:1:10172)
    at Ma (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:835633)
    at mb (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:853275)
    at exports.unstable_runWithPriority (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:872944)
    at Up (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797353)
    at qb (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:849941)
    at ab (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:846095)
    at https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797644
    at exports.unstable_runWithPriority (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:872944)
    at Up (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797353)
    at $p (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797589)
    at E (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:871793)
    at m.port1.onmessage (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:870543)
(anonymous) @ FetchProvider.ts:42
s @ FetchProvider.ts:2
(anonymous) @ FetchProvider.ts:2
(anonymous) @ FetchProvider.ts:2
O @ FetchProvider.ts:2
a @ FetchProvider.ts:38
Promise.then (async)
value @ CancellablePromise.ts:30
listPaginated @ EventNotificationsStore.ts:158
n @ vendor.1e79e27aeb952fbe940b.js:2
p.emit @ vendor.1e79e27aeb952fbe940b.js:2
trigger @ vendor.1e79e27aeb952fbe940b.js:2
(anonymous) @ vendor.1e79e27aeb952fbe940b.js:2
V.<computed> @ task.js:61
C @ task.js:35
S @ task.js:46
bluebird.js:1590 Unhandled rejection FetchError: There was an error fetching a resource: Internal Server Error. Additional information: IOException encountered while reading from a byte array input stream    at https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:692367    at s (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686349)    at Generator._invoke (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686102)    at Generator.next (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:686718)    at O (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:691644)    at a (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:692660)From previous event:    at I.L [as _captureStackTrace] (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1603107)    at I._resolveFromExecutor (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1633562)    at new I (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:1626639)    at Object.createPromise (https://graylog:9000/assets/app.7b3be999bf9b0a8f1d16.js:2:3365846)    at Function.triggerPromise (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:912279)    at Object.e [as listPaginated] (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:913899)    at V (https://graylog:9000/assets/071aaa27-4779.32e9bf9fb8c56d937a77.js:1:8456)    at c.value (https://graylog:9000/assets/071aaa27-4779.32e9bf9fb8c56d937a77.js:1:10172)    at Ma (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:835633)    at mb (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:853275)    at exports.unstable_runWithPriority (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:872944)    at Up (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797353)    at qb (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:849941)    at ab (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:846095)    at https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797644    at exports.unstable_runWithPriority (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:872944)    at Up (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797353)    at $p (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:797589)    at E (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:871793)    at m.port1.onmessage (https://graylog:9000/assets/vendor.1e79e27aeb952fbe940b.js:2:870543)

Please help. Thanks

Plugin unable to laod in GrayLog 6.0.0

Describe the bug
After upgrading GrayLog from 5.2.5 to 6.0.0, the plugin causes GrayLog to crash on startup.
GrayLog server log: graylog.log

To Reproduce
Steps to reproduce the behavior:

  1. Install GrayLog 6.0.0
  2. Install this plugin
  3. Restart GrayLog
  4. View the log

Expected behavior
GrayLog should start with the plugin loaded

Versions:

  • Graylog: 6.0.0
  • TelegramNotification: 2.4.0

[Feat.] How to enable Telegram plugin in Graylog docker image

Hi

I'm using Graylog 4.2 within a docker image so there's no configuration file.

I copied plugin version 2.3.6 (which is suitable to my graylog version) into the docker container plugin folder.

And then restarted graylog, but I couldn't see Telegram Notification type on notiication definitions.

Which ENV variables should I add to enable this plugin?

Thanks.

[Feat.] JMTE string truncation support

Is your feature request related to a problem? Please describe.
Regarding the "Message too long" problems, it was asked in the past whether truncation of the message would be possible. This was denied, because the logic for correctly truncating a string with html formatting was too complex to implement.

Describe the solution you'd like
I would like to propose a string truncation function, to be usable as JMTE "function" to be able to truncate/shorten known "pure strings" from e.g. variables. There would be no need for any kind of special logic involved, just the relatively simple logic of shortening a string to a specified maximum amount of characters.

Describe alternatives you've considered
Alternate solutions were discussed in the issues regarding "message too long", but not chosen. Also, no other types of string modification are possible from either the plugin nor graylog itself. The only "solution" would be to shorten all log messages before alerting using pipelines (or similar) - but that is just not feasible.

Additional context
While the message_too_long variable is really helpful, allowing to at least send alerts with the meta data (like host, stream and so forth), it is often impossible to determine without the actual log message/line whether it is something that needs to be fixed immediately and what component it affects.
I would like to be able to at least show a log snippet when alerting with the full message is impossible.

Where can I find the Chat ID?

This plugin looked like great extension for my Greylog server. But unfortunatelly is not working.
I followed all instructions, created my new bot, started chat there, in Greylog created new alert, filled in Chat ID (which I hope is the botname) and Bot token. But when I send a TEST message, greylog confirms it was sent successfuly, but in telegram there is nothing. Messages never arrive.

Plugin installed correctly but can't find it in notification type

As title, i installed the plugin (pasted the .jar in the correct plugin dir with 1100 owner) but it won't load in the web interface, only email, http and legacy type are present. There's no trace in the docker logs too:

graylog | 2021-03-12 22:43:18,622 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: AWS plugins 4.0.5 [org.graylog.aws.AWSPlugin] graylog | 2021-03-12 22:43:18,624 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Collector 4.0.5 [org.graylog.plugins.collector.CollectorPlugin] graylog | 2021-03-12 22:43:18,625 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Threat Intelligence Plugin 4.0.5 [org.graylog.plugins.threatintel.ThreatIntelPlugin] graylog | 2021-03-12 22:43:18,626 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elasticsearch 6 Support 4.0.5+d95b909 [org.graylog.storage.elasticsearch6.Elasticsearch6Plugin] graylog | 2021-03-12 22:43:18,626 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elasticsearch 7 Support 4.0.5+d95b909 [org.graylog.storage.elasticsearch7.Elasticsearch7Plugin] graylog | 2021-03-12 22:43:18,830 INFO : org.graylog2.bootstrap.CmdLineTool - Running with JVM arguments: -Djdk.tls.acknowledgeCloseNotify=true -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow -Dlog4j.configurationFile=/usr/share/graylog/data/config/log4j2.xml -Djava.library.path=/usr/share/graylog/lib/sigar/ -Dgraylog2.installation_source=docker graylog | 2021-03-12 22:43:19,072 INFO : org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator null graylog | 2021-03-12 22:43:22,426 INFO : org.graylog2.shared.buffers.InputBufferImpl - Message journal is enabled. graylog | 2021-03-12 22:43:22,445 INFO : org.graylog2.plugin.system.NodeId - Node ID: 039881ed-567c-4dab-8332-207c0737cc84 graylog | 2021-03-12 22:43:22,705 INFO : kafka.log.LogManager - Loading logs. graylog | 2021-03-12 22:43:22,733 WARN : kafka.log.Log - Found a corrupted index file, /usr/share/graylog/data/journal/messagejournal-0/00000000000001336332.index, deleting and rebuilding index... graylog | 2021-03-12 22:43:22,780 INFO : kafka.log.LogManager - Logs loading complete. graylog | 2021-03-12 22:43:22,783 INFO : org.graylog2.shared.journal.KafkaJournal - Initialized Kafka based journal at data/journal graylog | 2021-03-12 22:43:22,799 INFO : org.mongodb.driver.cluster - Cluster created with settings {hosts=[graylog_db:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=5000} graylog | 2021-03-12 22:43:22,908 INFO : org.mongodb.driver.cluster - Cluster description not yet available. Waiting for 30000 ms before timing out graylog | 2021-03-12 22:43:22,936 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:1, serverValue:12}] to graylog_db:27017 graylog | 2021-03-12 22:43:22,941 INFO : org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=graylog_db:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 0, 23]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=3576508} graylog | 2021-03-12 22:43:22,956 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:2, serverValue:13}] to graylog_db:27017 graylog | 2021-03-12 22:43:23,132 INFO : org.graylog2.shared.buffers.InputBufferImpl - Initialized InputBufferImpl with ring size <65536> and wait strategy <BlockingWaitStrategy>, running 2 parallel message handlers. graylog | 2021-03-12 22:43:23,328 INFO : org.graylog2.storage.providers.ElasticsearchVersionProvider - Elasticsearch version set to 7.0.0 - disabling version probe. graylog | 2021-03-12 22:43:23,969 INFO : org.graylog2.shared.buffers.ProcessBuffer - Initialized ProcessBuffer with ring size <65536> and wait strategy <BlockingWaitStrategy>. graylog | 2021-03-12 22:43:24,082 WARN : org.graylog.plugins.map.geoip.GeoIpResolverEngine - GeoIP database file does not exist: /etc/graylog/server/GeoLite2-City.mmdb graylog | 2021-03-12 22:43:24,089 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:3, serverValue:14}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,092 INFO : org.graylog2.buffers.OutputBuffer - Initialized OutputBuffer with ring size <65536> and wait strategy <BlockingWaitStrategy>. graylog | 2021-03-12 22:43:24,129 WARN : org.graylog.plugins.map.geoip.GeoIpResolverEngine - GeoIP database file does not exist: /etc/graylog/server/GeoLite2-City.mmdb graylog | 2021-03-12 22:43:24,160 WARN : org.graylog.plugins.map.geoip.GeoIpResolverEngine - GeoIP database file does not exist: /etc/graylog/server/GeoLite2-City.mmdb graylog | 2021-03-12 22:43:24,190 WARN : org.graylog.plugins.map.geoip.GeoIpResolverEngine - GeoIP database file does not exist: /etc/graylog/server/GeoLite2-City.mmdb graylog | 2021-03-12 22:43:24,220 WARN : org.graylog.plugins.map.geoip.GeoIpResolverEngine - GeoIP database file does not exist: /etc/graylog/server/GeoLite2-City.mmdb graylog | 2021-03-12 22:43:24,735 INFO : org.graylog2.bootstrap.ServerBootstrap - Graylog server 4.0.5+d95b909 starting up graylog | 2021-03-12 22:43:24,735 INFO : org.graylog2.bootstrap.ServerBootstrap - JRE: Oracle Corporation 1.8.0_282 on Linux 5.10.16-arch1-1 graylog | 2021-03-12 22:43:24,735 INFO : org.graylog2.bootstrap.ServerBootstrap - Deployment: docker graylog | 2021-03-12 22:43:24,735 INFO : org.graylog2.bootstrap.ServerBootstrap - OS: Debian GNU/Linux 10 (buster) (debian) graylog | 2021-03-12 22:43:24,735 INFO : org.graylog2.bootstrap.ServerBootstrap - Arch: amd64 graylog | 2021-03-12 22:43:24,759 INFO : org.graylog2.shared.initializers.PeriodicalsService - Starting 30 periodicals ... graylog | 2021-03-12 22:43:24,760 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ThroughputCalculator] periodical in [0s], polling every [1s]. graylog | 2021-03-12 22:43:24,765 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.plugins.pipelineprocessor.periodical.LegacyDefaultStreamMigration] periodical, running forever. graylog | 2021-03-12 22:43:24,766 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.AlertScannerThread] periodical. Not configured to run on this node. graylog | 2021-03-12 22:43:24,768 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.BatchedElasticSearchOutputFlushThread] periodical in [0s], polling every [1s]. graylog | 2021-03-12 22:43:24,768 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ClusterHealthCheckThread] periodical in [120s], polling every [20s]. graylog | 2021-03-12 22:43:24,770 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.ContentPackLoaderPeriodical] periodical. Not configured to run on this node. graylog | 2021-03-12 22:43:24,770 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.GarbageCollectionWarningThread] periodical, running forever. graylog | 2021-03-12 22:43:24,771 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexerClusterCheckerThread] periodical in [0s], polling every [30s]. graylog | 2021-03-12 22:43:24,772 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexRetentionThread] periodical in [0s], polling every [300s]. graylog | 2021-03-12 22:43:24,773 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexRotationThread] periodical in [0s], polling every [10s]. graylog | 2021-03-12 22:43:24,773 INFO : org.graylog.plugins.pipelineprocessor.periodical.LegacyDefaultStreamMigration - Legacy default stream has no connections, no migration needed. graylog | 2021-03-12 22:43:24,775 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.NodePingThread] periodical in [0s], polling every [1s]. graylog | 2021-03-12 22:43:24,779 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.VersionCheckThread] periodical in [300s], polling every [1800s]. graylog | 2021-03-12 22:43:24,779 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ThrottleStateUpdaterThread] periodical in [1s], polling every [1s]. graylog | 2021-03-12 22:43:24,780 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.events.ClusterEventPeriodical] periodical in [0s], polling every [1s]. graylog | 2021-03-12 22:43:24,781 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.events.ClusterEventCleanupPeriodical] periodical in [0s], polling every [86400s]. graylog | 2021-03-12 22:43:24,783 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ClusterIdGeneratorPeriodical] periodical, running forever. graylog | 2021-03-12 22:43:24,783 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexRangesMigrationPeriodical] periodical, running forever. graylog | 2021-03-12 22:43:24,783 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexRangesCleanupPeriodical] periodical in [15s], polling every [3600s]. graylog | 2021-03-12 22:43:24,789 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:5, serverValue:16}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,789 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:4, serverValue:15}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,791 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:6, serverValue:17}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,791 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:8, serverValue:19}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,798 INFO : org.mongodb.driver.connection - Opened connection [connectionId{localValue:7, serverValue:18}] to graylog_db:27017 graylog | 2021-03-12 22:43:24,808 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.UserPermissionMigrationPeriodical] periodical. Not configured to run on this node. graylog | 2021-03-12 22:43:24,808 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ConfigurationManagementPeriodical] periodical, running forever. graylog | 2021-03-12 22:43:24,809 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.IndexFailuresPeriodical] periodical, running forever. graylog | 2021-03-12 22:43:24,813 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.TrafficCounterCalculator] periodical in [0s], polling every [1s]. graylog | 2021-03-12 22:43:24,813 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.indexer.fieldtypes.IndexFieldTypePollerPeriodical] periodical in [0s], polling every [3600s]. graylog | 2021-03-12 22:43:24,814 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.scheduler.periodicals.ScheduleTriggerCleanUp] periodical in [120s], polling every [86400s]. graylog | 2021-03-12 22:43:24,815 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ESVersionCheckPeriodical] periodical in [0s], polling every [30s]. graylog | 2021-03-12 22:43:24,816 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.plugins.sidecar.periodical.PurgeExpiredSidecarsThread] periodical in [0s], polling every [600s]. graylog | 2021-03-12 22:43:24,819 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.plugins.sidecar.periodical.PurgeExpiredConfigurationUploads] periodical in [0s], polling every [600s]. graylog | 2021-03-12 22:43:24,820 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.plugins.views.search.db.SearchesCleanUpJob] periodical in [3600s], polling every [28800s]. graylog | 2021-03-12 22:43:24,823 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.events.periodicals.EventNotificationStatusCleanUp] periodical in [120s], polling every [86400s]. graylog | 2021-03-12 22:43:24,827 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog.plugins.collector.periodical.PurgeExpiredCollectorsThread] periodical in [0s], polling every [3600s]. graylog | 2021-03-12 22:43:44,856 INFO : org.glassfish.grizzly.http.server.NetworkListener - Started listener bound to [0.0.0.0:9000] graylog | 2021-03-12 22:43:44,859 INFO : org.glassfish.grizzly.http.server.HttpServer - [HttpServer] Started. graylog | 2021-03-12 22:43:44,859 INFO : org.graylog2.shared.initializers.JerseyService - Started REST API at <0.0.0.0:9000> graylog | 2021-03-12 22:43:44,860 INFO : org.graylog2.shared.initializers.ServiceManagerListener - Services are healthy graylog | 2021-03-12 22:43:44,861 INFO : org.graylog2.shared.initializers.InputSetupService - Triggering launching persisted inputs, node transitioned from Uninitialized [LB:DEAD] to Running [LB:ALIVE] graylog | 2021-03-12 22:43:44,862 INFO : org.graylog2.bootstrap.ServerBootstrap - Services started, startup times in ms: {GracefulShutdownService [RUNNING]=0, InputSetupService [RUNNING]=2, JournalReader [RUNNING]=7, BufferSynchronizerService [RUNNING]=7, UrlWhitelistService [RUNNING]=11, JobSchedulerService [RUNNING]=16, OutputSetupService [RUNNING]=17, MongoDBProcessingStatusRecorderService [RUNNING]=29, EtagService [RUNNING]=32, ConfigurationEtagService [RUNNING]=33, KafkaJournal [RUNNING]=34, LookupTableService [RUNNING]=44, StreamCacheService [RUNNING]=57, PeriodicalsService [RUNNING]=75, JerseyService [RUNNING]=20101} graylog | 2021-03-12 22:43:44,870 INFO : org.graylog2.bootstrap.ServerBootstrap - Graylog server up and running.

Thousands of error messages from telegram-alert.jar

We're using this in our logging cluster to send alerts to different channels in Telegram. After about a month of running, the logs on our Graylog instance are filled with:

ERROR: Telegram Bots Api - BOTSESSION org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error getting updates at org.telegram.telegrambots.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:119) ~[telegram-alert.jar:?] at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.getUpdatesFromServer(DefaultBotSession.java:256) ~[telegram-alert.jar:?] at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.run(DefaultBotSession.java:187) [telegram-alert.jar:?]

Is this a configuration issue, environment issue, or an issue with the plugin?

API request failed: Forbidden

I launch the plugin in docker. chat id and bot id are correct.

2019-08-22 09:06:40,042 ERROR: org.graylog.scheduler.JobExecutionEngine - Job execution error - trigger=5d5e5b1f5d7156000e183370 job=5d5d31835d7156000d0331e3

org.graylog.scheduler.JobExecutionException: Failed permanently to execute notification, giving up - <5d5d31835d7156000d0331e1/STOP/legacy-alarm-callback-notification-v1>

at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:156) ~[graylog.jar:?]


at org.graylog.scheduler.JobExecutionEngine.executeJob(JobExecutionEngine.java:166) ~[graylog.jar:?]


at org.graylog.scheduler.JobExecutionEngine.lambda$handleTrigger$2(JobExecutionEngine.java:144) ~[graylog.jar:?]


at com.codahale.metrics.Timer.time(Timer.java:137) ~[graylog.jar:?]


at org.graylog.scheduler.JobExecutionEngine.handleTrigger(JobExecutionEngine.java:144) ~[graylog.jar:?]


at org.graylog.scheduler.JobExecutionEngine.lambda$execute$0(JobExecutionEngine.java:119) ~[graylog.jar:?]


at org.graylog.scheduler.worker.JobWorkerPool.lambda$execute$0(JobWorkerPool.java:110) ~[graylog.jar:?]


at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:181) [graylog.jar:?]


at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]


at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]


at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]


at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Caused by: org.graylog.events.notifications.PermanentEventNotificationException: Couldn't send legacy notification - legacy notifications cannot be retried!

at org.graylog.events.legacy.LegacyAlarmCallbackEventNotification.execute(LegacyAlarmCallbackEventNotification.java:67) ~[graylog.jar:?]


at org.graylog.events.notifications.EventNotificationExecutionJob.execute(EventNotificationExecutionJob.java:135) ~[graylog.jar:?]

API request failed: Bad Request

I am using Graylog 2.4 and plugin version 2.2.0

Graylog server should connect via proxy to access internet (I've set proxy server in alert created).

I got this error in graylog server log

[TelegramAlert] API request failed: Bad Request

Please help how to resolve this issue.

Thank you

Message is too long

Describe the bug
I created an alert with this plugin, tested notification is okie.
I used this Msg Template:

--- [Summary] --------------------------------------
${foreach event.fields field}
${if even_field}
${field}
${end}
${end}

There are 4 fields that I defined in the Alert Definition.
But when I triggered a real event, the response is
image

My sample Message payload send to telegram is like is

--- [Summary] --------------------------------------
  Hostname: sns-hyp-controller02
  Service: nova-conductor
  Req_ID: e566afa5-086a-422e-b004-21ae1315af82
  Detail: Failed to schedule instances: NoValidHost_Remote: No valid host was found. There are not enough hosts available.
Traceback (most recent call last):

  File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py&amp;quot;, line 229, in inner
    return func(*args, **kwargs)

  File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/manager.py&amp;quot;, line 171, in select_destinations
    allocation_request_version, return_alternates)

  File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 96, in select_destinations
    allocation_request_version, return_alternates)

  File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 265, in _schedule
    claimed_instance_uuids)

  File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 302, in _ensure_sufficient_hosts
    raise exception.NoValidHost(reason=reason)

NoValidHost: No valid host was found. There are not enough hosts available.
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager Traceback (most recent call last):
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/conductor/manager.py&amp;quot;, line 1405, in schedule_and_build_instances
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     instance_uuids, return_alternates=True)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/conductor/manager.py&amp;quot;, line 832, in _schedule_instances
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     return_alternates=return_alternates)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/client/query.py&amp;quot;, line 42, in select_destinations
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     instance_uuids, return_objects, return_alternates)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/rpcapi.py&amp;quot;, line 160, in select_destinations
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     return cctxt.call(ctxt, 'select_destinations', **msg_args)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py&amp;quot;, line 178, in call
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     retry=self.retry)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/transport.py&amp;quot;, line 128, in _send
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     retry=retry)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py&amp;quot;, line 645, in send
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     call_monitor_timeout, retry=retry)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py&amp;quot;, line 636, in _send
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     raise result
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager NoValidHost_Remote: No valid host was found. There are not enough hosts available.
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager Traceback (most recent call last):
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py&amp;quot;, line 229, in inner
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     return func(*args, **kwargs)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/manager.py&amp;quot;, line 171, in select_destinations
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     allocation_request_version, return_alternates)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 96, in select_destinations
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     allocation_request_version, return_alternates)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 265, in _schedule
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     claimed_instance_uuids)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager   File &amp;quot;/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py&amp;quot;, line 302, in _ensure_sufficient_hosts
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager     raise exception.NoValidHost(reason=reason)
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager NoValidHost: No valid host was found. There are not enough hosts available.
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager
2021-04-01 16:09:43.462 23 ERROR nova.conductor.manager

Timerange Start:      2021-04-01T09:09:42.417Z
Timerange End:        2021-04-01T09:09:57.416Z

Expected behavior
I don't know how long the payload size is limit, can you guy suggest me some ways to work on it?

Versions:

  • Graylog: 4.0.5 and 4.0 from Docker image graylog/graylog:x.y.z
  • TelegramNotification: 2.3.3

Does not work with Graylog 4.x.y

Describe the bug
It does not show in the Notification type text field

Expected behavior
Being able to follow the guide: Navigate to Alerts > Notifications in your Graylog-interface and select Telegram Notification as the notification type.

Versions:

  • Graylog: 4.0.1
  • TelegramNotification: 2.3.1

Cant create Notification settings

Hello,

thank you for developing this plugin.
Actually im not able to configure any setting, because the Notification Type "Telegram" is not available.
Plugin is copied to /usr/share/graylog-server/plugin and server is restarted.
My Graylog Version is v3.2.2+2f9a628.
The Serverlog shows:
2020-03-13T13:08:07.903+01:00 INFO [CmdLineTool] Loaded plugin: TelegramNotification 2.3.0 [de.irgendwr.TelegramNotificationPlugin]

Legacy does not work to...

Thank You

{event_definition_title}

Hi,

I'd like help to configure the variable {event_definition_title} inside my alerts.

I tried in Graylog 3.3.11 version at first, but it didn't work.

Then I updated my Graylog 3 to the latest version (Graylog 3.3.16+f766a24) but I still can't receive the Event Definion title inside my alerts

That's the code:

⚠ ${event_definition_title}
${foreach backlog message}
source: ${message.source}

`${message.message}`
${end}

That's the result:

image

I'm using the 2.3.1 version of plugin
I renamed it to telegram-alert-2.3.1.jar

Thanks!

[Feat.] TimeStamp Problem

Hi everyone thx for this plugin. Timestamp problem is still existing in telegram notifications. Graylog 4.3.5 version has established this issue in email notifications. However, when I want to see telegram notifications in gmt+4 zone Baku/Azerbaijan telegram notifications does not allow me to do that. My server's time and all configurations is in Baku timezone.
Graylog version 4.3.5

Support Graylog 5.0

Is Graylog 5.0 supported? After putting the latest release into the plugins folder, I see no Telegram notifications as an option in Graylog.

I did try clearing my browser's cache.

Link in readme missing

The development folder and the README.mc file are missing (link in the project readme).

Code in master cannot be built with 4.3.3 with error of "[webpack-cli] TypeError: Cannot read properties of undefined (reading 'HashedModuleIdsPlugin')"

maven package log:

[INFO] Scanning for projects...
[INFO]
[INFO] ----------< de.irgendwr:graylog-plugin-telegram-notification >----------
[INFO] Building graylog-plugin-telegram-notification 2.3.10-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-versions) @ graylog-plugin-telegram-notification ---
[INFO]
[INFO] --- frontend-maven-plugin:1.9.1:install-node-and-yarn (install node and yarn) @ graylog-plugin-telegram-notification ---
[INFO] Node v16.13.0 is already installed.
[INFO] Yarn 1.22.17 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.9.1:yarn (yarn install) @ graylog-plugin-telegram-notification ---
[INFO] Running 'yarn install' in /home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert
[INFO] yarn install v1.22.17
[INFO] [1/4] Resolving packages...
[INFO] success Already up-to-date.
[INFO] Done in 0.78s.
[INFO]
[INFO] --- frontend-maven-plugin:1.9.1:yarn (yarn run build) @ graylog-plugin-telegram-notification ---
[INFO] Running 'yarn run build' in /home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert
[INFO] yarn run v1.22.17
[INFO] $ webpack
[INFO] [webpack-cli] Failed to load '/home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert/webpack.config.js' config
[INFO] [webpack-cli] TypeError: Cannot read properties of undefined (reading 'HashedModuleIdsPlugin')
[INFO] at Object. (/home/tao.lian/Workspace/graylog/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.config.js:187:21)
[INFO] at Module._compile (node:internal/modules/cjs/loader:1101:14)
[INFO] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[INFO] at Module.load (node:internal/modules/cjs/loader:981:32)
[INFO] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[INFO] at Module.require (node:internal/modules/cjs/loader:1005:19)
[INFO] at require (node:internal/modules/cjs/helpers:102:18)
[INFO] at new PluginWebpackConfig (/home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert/node_modules/graylog-web-plugin/lib/PluginWebpackConfig.js:50:3)
[INFO] at Object. (/home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert/webpack.config.js:6:18)
[INFO] at Module._compile (node:internal/modules/cjs/loader:1101:14)
[INFO] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[INFO] at Module.load (node:internal/modules/cjs/loader:981:32)
[INFO] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[INFO] at Module.require (node:internal/modules/cjs/loader:1005:19)
[INFO] at require (node:internal/modules/cjs/helpers:102:18)
[INFO] at WebpackCLI.tryRequireThenImport (/home/tao.lian/Workspace/graylog/graylog-project-repos/TelegramAlert/node_modules/webpack-cli/lib/webpack-cli.js:244:16)
[INFO] error Command failed with exit code 2.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.229 s
[INFO] Finished at: 2022-07-21T13:22:58+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:yarn (yarn run build) on project graylog-plugin-telegram-notification: Failed to run task: 'yarn run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Version 2.3.5 not working on Graylog 4.1.1

Describe the bug
When trying to save the notification or trying to send a test notification the following error shows up:

Error: Cannot deserialize instance of `java.util.HashSet` out of VALUE_STRING token at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 687] (through reference chain: org.graylog.events.notifications.AutoValue_NotificationDto$Builder["config"]->de.irgendwr.AutoValue_TelegramEventNotificationConfig$Builder["chats"])

Versions:

  • Graylog: 4.1.1
  • TelegramNotification: 2.3.5

Doesnt work with version 4.0.1

Describe the bug
It does not show in the Notification type text field

Expected behavior
Being able to follow the guide: Navigate to Alerts > Notifications in your Graylog-interface and select Telegram Notification as the notification type.

Versions:

Graylog: 4.0.1
TelegramNotification: 2.3.1

Please update for version 4.0.1

How to send value field messages to TelegramAlert

Hi author,

I try send field message from Graylog to telegram, but i recieve null or no value message.
Ex.
%streamTitle%:
%backlog%

#########################
%message%
Source: %source%
Source: ${source}
Facility: %facility%
Facility: ${facility}
Stream_url: %stream_url%
Stream_url: ${stream_url}

Telegram recieved:

Mongo Authentication 

#########################
%message%
Source: %source%
Source: ${source}
Facility: %facility%
Facility: ${facility}
Streamurl: %streamurl%
Streamurl: ${streamurl}

[Feat.] Timezone selector

Is your feature request related to a problem? Please describe.
Notification body including timestamps will always produce them in server's timezone (GMT in my case).

Describe the solution you'd like
As notification body is based on the same "EmailNotification Template", and Email notifications are timezone configurable, I guess a dropdown with timezone selector could be possible to implement.
It would be great to have this option.

Proxy list supported

Hi Jonas !

In Russia, a proxy server is often blocked. Because of this, every 3-4 days I specify a new proxy.

Сan you create proxy-list ? If one proxy is not available, used another

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.