Skip to content

marcolivierbouch/centreon-notifications

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

centreon-notifications

Mail

Setup

  1. 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
  2. Create auto login token for all users http://blog.centreon.com/connexion-automatique-a-linterface-centreon-autologin/?lang=fr

  3. Make the files executable.

  4. On distributed platform, don't miss to install php on your pollers

  5. 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"
  6. Generate, move and export the new configuration on your all pollers

Screenshots

host.png service.png

Credits

  • centreon-notifications is a fork of nagios-notifications. nagios-notifications is originally written by seancdugan at nagios-notifications.

Slack

Setup

  1. Set up an incoming webhook integration in your Slack team : Slack incoming webhook integration
  2. Download the scripts in the plugins directory
  3. Take config.ini.example as a template, create a file config.ini in same directory and correct configuration according to your preferences:
  4. Don't miss install the following Perl modules : HTTP::Request::Common, LWP::UserAgent, JSON, Getopt::Long, Config::General.
  5. 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"
  6. Adapt your notification's configuration for using theses new commands
  7. Generate, move and export the new configuration on your all pollers

Screenshots

host.png service.png

Packages

No packages published

Languages

  • PHP 50.6%
  • Perl 49.4%