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

Rocketchat no message #6281

Closed
wants to merge 3 commits into from
Closed

Rocketchat no message #6281

wants to merge 3 commits into from

Conversation

svennd
Copy link
Contributor

@svennd svennd commented Mar 27, 2017

If some people also face this issue : the transport works in rocket.chat, but contains no message. This is the script "required" for the webhook integration :

class Script {
  process_incoming_request({ request }) {
    console.log(request.content);

    return {
      content:{
        text: request.content.text
       }
    };

    return {
       error: {
         success: false,
         message: 'Error example'
       }
     };
  }
}

Once this change has been done, it works for me. (nothing fancy as coloring)

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

I left the original code in there, for some it might work ?  For me it did not, I only got empty messages.
…oc/General/Contributing.md.

I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
@svennd svennd changed the title Rocketchat Rocketchat no message Mar 27, 2017
@LibreNMS-CI
Copy link

Auto-Deploy finished, Test PR at http://6281.ci.librenms.org or https://6281.ci.librenms.org

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

@laf
Copy link
Member

laf commented Mar 31, 2017

I'm not a rocket.chat user but the original looks like it should work ok, I'd prefer to fix it if needed rather than change how it works.

@svennd
Copy link
Contributor Author

svennd commented Mar 31, 2017

@laf I searched the rocket.chat for a solution why it did not work (as described in the docs), but they all pointed towards this solution. So I kinda wanted to share it. However the current code is just a copy of slack, which might have worked before (?) but for the latest version for sure does not work.

For sure, close it, if someone ever has a similar problem you can pick it up later. :) no bad feelings.

@laf
Copy link
Member

laf commented Mar 31, 2017

Do you have any links to show that this is the way it should be done? Sending text= is also fine but so is sending as attachments.

@svennd
Copy link
Contributor Author

svennd commented Apr 1, 2017

https://rocket.chat/docs/administrator-guides/integrations/

Both methods seem fine, but I did not get the attachment method working. Perhaps @ToeiRei can pitch in ? Perhaps its just documenting it better on how to use it ?

@ToeiRei
Copy link
Contributor

ToeiRei commented Apr 1, 2017

In my case, notifications look like that:

LibreNMS @rocket.cat BOT 23:56:02
Device 10.0.0.8 recovered from Device rebooted
Device 10.0.0.8 recovered from Device rebooted
Severity: critical
Time elapsed: 5m
Timestamp: 2017-03-28 21:55:05
Unique-ID: 1885
Rule: Device rebooted
Faults:
#1: sysObjectID => enterprises.8072.3.2.8; sysDescr => Hardware: amd64;
Alert sent to: NOC

That's all I need. Not sure what the problem really is.

@svennd
Copy link
Contributor Author

svennd commented Apr 1, 2017

Ah well, then I guess its a problem on my end. Closing this :) thx all !

@svennd svennd closed this Apr 1, 2017
@laf
Copy link
Member

laf commented Apr 1, 2017

@svennd you can run alerts.php with -d to get more debug output, you will only get it if an alert is due to be sent which means if the cron job gets to it before you do then you won't see anything. Could be worth just disabling the alerts.php in cron before testing.

@ToeiRei
Copy link
Contributor

ToeiRei commented Apr 1, 2017

@svennd what did you do at the rocket.chat config side?

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants