Pastebin
Paste #17912: No description
< previous paste - next paste>
Pasted by Anonymous Coward
#!/bin/bash
apt update
apt upgrade
apt -y install apt-transport-https wget gnupg
wget -O - https://packages.icinga.com/icinga.key | apt-key add -
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
echo "deb https://packages.icinga.com/debian icinga-${DIST} main" > \
/etc/apt/sources.list.d/${DIST}-icinga.list
echo "deb-src https://packages.icinga.com/debian icinga-${DIST} main" >> \
/etc/apt/sources.list.d/${DIST}-icinga.list
apt update
apt install icinga2
apt install monitoring-plugins
apt install postgresql
apt install icinga2-ido-pgsql
icinga2 feature enable ido-pgsql
systemctl restart icinga2
## Change fqdn such that hostname -f returns a shortish FQDN. The default one from azure will not work. Too long for icinga???
icinga2 api setup
cat >> /etc/icinga2/conf.d/api-users.conf <<EOF
object ApiUser "icingaweb2" {
password = "*************"
permissions = [ "status/query", "actions/*", "objects/modify/*", "objects/query/*" ]
}
EOF
systemctl restart icinga2
## install icingaweb2
apt install icingaweb2 icingacli
apt install php-db php-pgsql
systemctl restart apache2
icingacli setup token create
icingacli setup token show
su - postgres -c "createuser -P icingaweb2"
echo "Enter password for icingaweb2 db user"
su - postgres -c "createdb -O icingaweb2 icingaweb2"
apt install icingaweb2-module-director
apt install icingaweb2-module-cube icingaweb2-module-audit icingaweb2-module-map icingaweb2-module-monitoring icingaweb2-module-nagvis icingaweb2-module-pnp icingaweb2-module-pdfexport icingaweb2-module-reactbundle icingaweb2-module-statusmap
New Paste
Go to most recent paste.