Skip to content

Commit

Permalink
add import patched libicinga.so from folder /icinga2conf. Bug https:/…
Browse files Browse the repository at this point in the history
  • Loading branch information
a.walker committed Feb 29, 2016
1 parent 4756b51 commit a4d7059
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
icinga2
icingaweb2
mysql
mysql
libicinga.so
8 changes: 4 additions & 4 deletions icinga24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ echo 'library "db_ido_mysql"' > /etc/icinga2/features-available/ido-mysql.conf
echo 'object IdoMysqlConnection "ido-mysql" {' >> /etc/icinga2/features-available/ido-mysql.conf
echo ' user = "root",' >> /etc/icinga2/features-available/ido-mysql.conf
echo ' password = "root",' >> /etc/icinga2/features-available/ido-mysql.conf
echo ' host = "localhost",' >> /etc/icinga2/features-available/ido-mysql.conf
echo ' host = "localhost",' >> /etc/icinga2/features-available/ido-mysql.conf
echo ' database = "icinga2idomysql"' >> /etc/icinga2/features-available/ido-mysql.conf
echo '} ' >> /etc/icinga2/features-available/ido-mysql.conf

Expand All @@ -67,7 +67,7 @@ apt-get install icinga2-classicui -y

#Add User root to htpasswd.root. Pass root
htpasswd -b /etc/icinga2-classicui/htpasswd.users icingaadmin $ICINGA_PASS

#Classic UI Installation
#http://localhost/icinga2-classicui/
#Login:icingaadmin
Expand Down Expand Up @@ -119,7 +119,7 @@ service apache2 reload

#/usr/share/icingaweb2/bin/icingacli setup token create

#It is required that a default timezone has been set using date.timezone in /etc/php5/apache2/php.ini.
#It is required that a default timezone has been set using date.timezone in /etc/php5/apache2/php.ini.
#Change to date.timezone =Europe/Berlin
echo "date.timezone =Europe/Berlin" >> /etc/php5/apache2/php.ini

Expand Down Expand Up @@ -301,4 +301,4 @@ echo 'graphite_args_template = "&target=$target$&source=0&width=300&height=120&h
sed -i 's#command_file.*#command_file=/var/run/icinga2/cmd/icinga2.cmd#g' /etc/nsca.cfg

graphite-manage syncdb --noinput
unset DEBIAN_FRONTEND
unset DEBIAN_FRONTEND
23 changes: 15 additions & 8 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ MYSQLNEW="/mysql"
#Change depricated mysql config
sed -i 's/key_buffer*/key_buffer_size/g' /etc/mysql/my.cnf

#Add pached libicinga.so file. Bug: https://dev.icinga.org/issues/11248
if [[ -s /icinga2conf/libicinga.so ]]; then
mv /usr/lib/x86_64-linux-gnu/icinga2/libicinga.so /usr/lib/x86_64-linux-gnu/icinga2/libicinga.so_old
mv /icinga2conf/libicinga.so /usr/lib/x86_64-linux-gnu/icinga2/libicinga.so
fi


#Check folder /mysql. exit if not exist
if [ ! -d "$MYSQLNEW" ]; then
echo "Folder $MYSQLNEW not found. Exit"
Expand Down Expand Up @@ -217,11 +224,11 @@ fi
if [[ ! -s /icinga2conf/passive.conf ]]; then
#Icinga2 Passive Check template (Host and Service)
echo "template Service \"passive-service\" { " > /icinga2conf/passive.conf
echo " max_check_attempts = 1" >> /icinga2conf/passive.conf
echo " #retry_interval = 1m " >> /icinga2conf/passive.conf
echo " check_interval = 2m " >> /icinga2conf/passive.conf
echo " max_check_attempts = 2" >> /icinga2conf/passive.conf
echo " check_interval = 3m " >> /icinga2conf/passive.conf
echo " retry_interval = 0 " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
echo " enable_active_checks = false " >> /icinga2conf/passive.conf
echo " enable_active_checks = true " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
echo " check_command = \"passive\" " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
Expand All @@ -231,11 +238,11 @@ if [[ ! -s /icinga2conf/passive.conf ]]; then
echo "} " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
echo "template Host \"passive-host\" { " >> /icinga2conf/passive.conf
echo " max_check_attempts = 1 " >> /icinga2conf/passive.conf
echo " #retry_interval = 1m " >> /icinga2conf/passive.conf
echo " check_interval = 2m " >> /icinga2conf/passive.conf
echo " max_check_attempts = 2 " >> /icinga2conf/passive.conf
echo " check_interval = 3m " >> /icinga2conf/passive.conf
echo " retry_interval = 0 " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
echo " enable_active_checks = false " >> /icinga2conf/passive.conf
echo " enable_active_checks = true " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
echo " check_command = \"passive\" " >> /icinga2conf/passive.conf
echo " " >> /icinga2conf/passive.conf
Expand Down

0 comments on commit a4d7059

Please sign in to comment.