-
Download the scripts in the plugins directory and modify these following variables :
- $url : URL of the Centreon Web UI ( eg. https://centreon.foo.bar:8081 )
- $from : from email address desired
- $userNameForDB : username for connection, you can find your user info at (/etc/centreon/centreon.conf.php)
- $passwordForDB : password for connection
-
Create auto login token for all users http://blog.centreon.com/connexion-automatique-a-linterface-centreon-autologin/?lang=fr
-
Make the files executable.
-
On distributed platform, don't miss to install php on your pollers
-
Change the command line for host-notify-by-email and service-notify-by-email notification's command for the last parameter you can put admin or user there is less information when for a normal user:
$USER1$/host-email.php "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$HOSTOUTPUT$" "$LONGDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$TOTALHOSTSUP$" "$TOTALHOSTSDOWN$" "$HOSTACKAUTHOR$" "$HOSTACKCOMMENT$" "$CONTACTALIAS$" "admin"
$USER1$/host-email.php "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$HOSTOUTPUT$" "$LONGDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$TOTALHOSTSUP$" "$TOTALHOSTSDOWN$" "$HOSTACKAUTHOR$" "$HOSTACKCOMMENT$" "$CONTACTALIAS$" "user"
$USER1$/service-email.php "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$SERVICEOUTPUT$" "$LONGDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$SERVICEDURATIONSEC$" "$SERVICEEXECUTIONTIME$" "$TOTALSERVICESWARNING$" "$TOTALSERVICESCRITICAL$" "$TOTALSERVICESUNKNOWN$" "$LASTSERVICEOK$" "$LASTSERVICEWARNING$" "$SERVICENOTIFICATIONNUMBER$" "$SERVICEACKAUTHOR$" "$SERVICEACKCOMMENT$" "$CONTACTALIAS$" "admin"
$USER1$/service-email.php "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$SERVICEOUTPUT$" "$LONGDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$SERVICEDURATIONSEC$" "$SERVICEEXECUTIONTIME$" "$TOTALSERVICESWARNING$" "$TOTALSERVICESCRITICAL$" "$TOTALSERVICESUNKNOWN$" "$LASTSERVICEOK$" "$LASTSERVICEWARNING$" "$SERVICENOTIFICATIONNUMBER$" "$SERVICEACKAUTHOR$" "$SERVICEACKCOMMENT$" "$CONTACTALIAS$" "user"
-
Generate, move and export the new configuration on your all pollers
- centreon-notifications is a fork of nagios-notifications. nagios-notifications is originally written by seancdugan at nagios-notifications.
- Set up an incoming webhook integration in your Slack team : Slack incoming webhook integration
- Download the scripts in the plugins directory
- Take config.ini.example as a template, create a file config.ini in same directory and correct configuration according to your preferences:
- centreon_url : URL of the Centreon Web UI ( eg. https://centreon.foo.bar:8081 )
- slack_posturl : URL of incoming webhook ( eg. https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX )
- slack_username : Integration's username (eg. Centreon)
- slack_emoji_post : Emoji for each post
- Don't miss install the following Perl modules : HTTP::Request::Common, LWP::UserAgent, JSON, Getopt::Long, Config::General.
- Create two new notification's command, host-notify-by-slack and service-notify-by-slack :
perl /directoryofplugins/centreon-notifications/slack/host-slack.pl --host="$HOSTNAME$" --state="$HOSTSTATE$" --address="$HOSTADDRESS$" --channel="#channelofyourchoice"
perl /directoryofplugins/centreon-notifications/slack/service-slack --host="$HOSTNAME$" --address="$HOSTADDRESS$" --output="$SERVICEOUTPUT$" --service="$SERVICEDESC$" --state="$SERVICESTATE$" --channel="#channelofyourchoice"
- Adapt your notification's configuration for using theses new commands
- Generate, move and export the new configuration on your all pollers