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]#
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