Page 1 of 1

NagiosXI and Slack integration

Posted: Tue Sep 18, 2018 10:35 pm
by NinoBenamy
Hello,

I have integrated slack notification using the link below
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

However, i would like to add the $HOSTNOTESURL$ as another field. But it doesnt seem to work

Code: Select all

./slack_nagios.pl -field slack_channel=#nagios -field HOSTALIAS="$HOSTNAME$" -field HOSTSTATE="$HOSTSTATE$" -field NOTESURL="$HOSTNOTESURL$"
I am only getting this message from slack. and not getting the notes_url

Host ‘Linux-Test-ninobenamy’ is UP:
SSH OK - OpenSSH_7.4 (protocol 2.0)


Thanks,
Nino

Re: NagiosXI and Slack integration

Posted: Wed Sep 19, 2018 9:22 am
by scottwilkerson
In order to change what Slack displays you would need to modify the Slack app...

Another way around this would be to pass this into the HOSTOUTPUT field like so

Code: Select all

$USER1$/slack_nagios.pl -field slack_channel="#hosts" -field 
HOSTALIAS="$HOSTNAME$" -field HOSTSTATE="$HOSTSTATE$" -field 
HOSTOUTPUT="$HOSTOUTPUT$ - URL: $HOSTNOTESURL$" -field NOTIFICATIONTYPE="$NOTIFICATIONTYPE$"

Re: NagiosXI and Slack integration

Posted: Wed Sep 19, 2018 6:06 pm
by NinoBenamy
Thank you. your suggestion works. :)

Re: NagiosXI and Slack integration

Posted: Thu Sep 20, 2018 7:17 am
by scottwilkerson
NinoBenamy wrote:Thank you. your suggestion works. :)
great!

Locking thread