Install icinga srver

wget -O - | bash -


# ensure that this script is run by root
if [ $(id -u) -ne 0 ]; then
  sudo $0

debconf-set-selections <<\EOF
postfix postfix/mailname string $(hostname)
postfix postfix/main_mailer_type select Internet Site
icinga-common icinga/check_external_commands select false
icinga-cgi icinga/adminpassword-repeat string icingaadmin
icinga-cgi icinga/adminpassword string icingaadmin
icinga-cgi icinga/httpd select apache2

# install the latest version 
. /etc/os-release
if [ "${ID}" == "debian" ]; then
  # add Icinga repository
  DIST=$(grep PRETTY_NAME /etc/os-release | cut -d "(" -f2 | cut -d ")" -f1)
  echo "deb debmon-${DIST} main" > /etc/apt/sources.list.d/debmon.list
  wget -q -O - | apt-key add -
  apt-get update

# install icinga
apt-get install -y icinga

# disable double log output to syslog
sed -i 's|use_syslog=1|use_syslog=0|g' /etc/icinga/icinga.cfg

# show 1000 results by default
sed -i 's|result_limit=50|result_limit=1000|g' /etc/icinga/cgi.cfg

# restart icinga
/etc/init.d/icinga restart

# redirect by default to /icinga/
echo 'RedirectMatch "^/$" "/icinga/"' >> /etc/apache2/conf-available/icinga.conf

# allow "Re-schedule Next Host Check" from Icinga webgui
sed -i 's|check_external_commands=0|check_external_commands=1|g' /etc/icinga/icinga.cfg
chmod 2710 /var/lib/icinga/rw

# restart werbserver
service apache2 restart

Admin login
user: icingaadmin
pass: icingaadmin

Icinga Apache configuration

Icinga repository

Enable automatic updates
wget -q --no-check-certificate -O - | bash -

configure contact
sed -i 's|root@localhost||g' /etc/icinga/objects/contacts_icinga.cfg

change password
htpasswd -c /etc/icinga/htpasswd.users icingaadmin


a2enmod authnz_ldap

echo "pass1234" > /etc/apache2/
chmod 600 /etc/apache2/

sed -i 's|=icingaadmin|=*|g' /etc/icinga/cgi.cfg

- AuthUserFile /etc/icinga/htpasswd.users
+ AuthBasicProvider ldap
+ AuthLDAPBindDN ""
+ AuthLDAPBindPassword "exec:/bin/cat /etc/apache2/"
+ AuthLDAPURL "ldap://,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
+ AuthLDAPRemoteUserIsDN off
+ Require ldap-group CN=IPG.DevOps,OU=_IntranetPermissionGroups,DC=example,DC=com

service apache2 restart

# config

# cgi

Links - Debian Monitoring Project - Icinga repository - Icinga 2 preview