Notifications on Discord

Started by tiago_tntbizhub, February 22, 2022, 03:58:43 PM

Previous topic - Next topic

tiago_tntbizhub

Hi all!

We use Discord a lot in the company and we created a webhook for server monitoring. We are using NetXMS 4.X on Ubuntu Linux 20.04.

After searching a lot on Google for a NetXMS integration and reading docs, the closest I got was an integration with Slack (that we don't use) , nothing about Discord.

I have created a "Actions Configuration" with "Execute command on management server" and Command ->

/usr/bin/curl -s -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"TEST NODE DOWN\"}"  https://discord.com/api/webhooks/9275956969/7_1C8OtoYDJSRLPf0WCGTH-xo9DIlmTEWTHA0pmLe_

which functions properly from Linux command line but not on NetXMS... Am I missing something?

(example in https://www.youtube.com/watch?v=ZtsshH4ppPA as referred on list of videos HOW TO's here on the Forum )

Tried executing as an remote agent, same result, no output on Discord. On the Event processing Policy I have notification by email and this configuration for Discord, the email notification works every time.

All help is appreciated,
Tiago


tiago_tntbizhub

End up accomplishing using Discord.sh (https://chaoticweg.cc/discord.sh/)

"Actions Configuration" with "Execute command on management server" and

Command -> /usr/src/discord-bash/discord.sh  --text "Notificação [%S] %n: %m"   --webhook-url=https://discord.com/api/webhooks/92757956969/7_1C8OtoYDoLPf0WCGTH-xo9DIlmTEWTHA0pmLe_

It was also a permission (user) issue to run the command on Linux, nothing to do with NetXMS. I leave the comments here and hope it helps someone.

Thanks,
Tiago







Quote from: tiago_tntbizhub on February 22, 2022, 03:58:43 PM
Hi all!

We use Discord a lot in the company and we created a webhook for server monitoring. We are using NetXMS 4.X on Ubuntu Linux 20.04.

After searching a lot on Google for a NetXMS integration and reading docs, the closest I got was an integration with Slack (that we don't use) , nothing about Discord.

I have created a "Actions Configuration" with "Execute command on management server" and Command ->

/usr/bin/curl -s -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"TEST NODE DOWN\"}"  https://discord.com/api/webhooks/9275956969/7_1C8OtoYDJSRLPf0WCGTH-xo9DIlmTEWTHA0pmLe_

which functions properly from Linux command line but not on NetXMS... Am I missing something?

(example in https://www.youtube.com/watch?v=ZtsshH4ppPA as referred on list of videos HOW TO's here on the Forum )

Tried executing as an remote agent, same result, no output on Discord. On the Event processing Policy I have notification by email and this configuration for Discord, the email notification works every time.

All help is appreciated,
Tiago