Nagios Slack App - Can't @mention

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ismywb
Posts: 1
Joined: Wed Feb 01, 2017 8:11 pm

Nagios Slack App - Can't @mention

Post by ismywb »

Hi guys, so I'm using the Nagios App (https://ruletheseas.slack.com/apps/A0F81R747-nagios)

I am having some issues triggering @mentions. I have modified slack.pl to include @cornelius in the SERVICEOUTPUT but it isn't triggered as a mention in the slack app.

I contacted slack support and they said by default bots do not trigger this, but I don't have access to edit this it seems? Since it's posted to the app not directly to the api.

Here's my output:

Code: Select all

[jerry@nagios commands]# /usr/local/bin/slack_nagios.pl -field slack_channel=#pingdomtest -field HOSTALIAS="HSW4" -field SERVICEDESC="HTTPD" -field SERVICESTATE="CRITICAL" -field SERVICEOUTPUT="@cornelius TEST" -field NOTIFICATIONTYPE="slack"
Request:
POST https://*team_removed*.slack.com/services/hooks/nagios?token=*removed*
Content-Length: 156
Content-Type: application/x-www-form-urlencoded

NOTIFICATIONTYPE=slack&slack_version=1.1&SERVICEOUTPUT=%40cornelius+TEST&slack_channel=%23pingdomtest&SERVICESTATE=CRITICAL&HOSTALIAS=HSW4&SERVICEDESC=HTTPD

Response:
HTTP/1.1 200 OK
Connection: close
Date: Thu, 02 Feb 2017 01:02:04 GMT
Via: 1.1 8c123b3bc44d6197e5d955ffb9875721.cloudfront.net (CloudFront)
Server: Apache
Vary: Accept-Encoding
Content-Length: 2
Content-Type: text/html
Access-Control-Allow-Origin: *
Client-Date: Thu, 02 Feb 2017 01:02:04 GMT
Client-Peer: 54.192.50.44:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Slack Technologies, Inc/CN=*.slack.com
Client-SSL-Cipher: ECDHE-RSA-AES128-GCM-SHA256
Client-SSL-Socket-Class: IO::Socket::SSL
Content-Security-Policy: referrer no-referrer;
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Amz-Cf-Id: ZTSeViY1CEcWC3dfWo5PtAH7LMeUXqOrvylxxB15ZiXVC313XKMULw==
X-Cache: Miss from cloudfront
X-Frame-Options: SAMEORIGIN
X-Slack-Backend: h

ok

[jerry@nagios commands]#
What occurs in Slack:
gah.png
gah.png (38.92 KiB) Viewed 1965 times
Any idea on how to get it to actually trigger the @mention? Note while it is highlighted if i hover over it I can't click, nor does said text cause a desktop notifacation. I have also tried with @channel and it just comes in as plain text
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Slack App - Can't @mention

Post by tmcdonald »

This is a question for the author of that app, as we did not write it nor do we maintain it.
Former Nagios employee
deaton64
Posts: 2
Joined: Wed Jun 10, 2015 6:44 am

Re: Nagios Slack App - Can't @mention

Post by deaton64 »

To the OP.

Did you ever get this to work? I've got the same request.

I know it's not a Nagios issue.

Thanks,

David
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Slack App - Can't @mention

Post by tmcdonald »

We can leave this open for community discussion, but this really should go to the Slack forums.
Former Nagios employee
deaton64
Posts: 2
Joined: Wed Jun 10, 2015 6:44 am

Re: Nagios Slack App - Can't @mention

Post by deaton64 »

Hi,

I understand it should be in the Slack forum, Google got me to this point :)

To keep the post as short as possible, I've contacted Slack and they've said "I checked with our team and @-channel mentions are not supported by the Nagios app. Sorry about that! I'd let the product team know it's something you'd like included."

I'd suggest for anyone that wants this feature to bug the Slack team to get it implemented.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Slack App - Can't @mention

Post by tmcdonald »

That fairly well settles it then. Closing thread.
Former Nagios employee
Locked