Code

Multisite works with either Icinga or Nagios3
authorSven Velt <sven@velt.de>
Sun, 17 Oct 2010 15:55:02 +0000 (17:55 +0200)
committerSven Velt <sven@velt.de>
Sun, 17 Oct 2010 16:11:33 +0000 (18:11 +0200)
debian/apache.icinga [new file with mode: 0644]
debian/apache.nagios3 [new file with mode: 0644]
debian/check-mk-server-icinga.links [new file with mode: 0644]
debian/check-mk-server-nagios3.links [new file with mode: 0644]
debian/control
debian/defaults.icinga
debian/defaults.nagios3
debian/rules

diff --git a/debian/apache.icinga b/debian/apache.icinga
new file mode 100644 (file)
index 0000000..c41d687
--- /dev/null
@@ -0,0 +1,41 @@
+# Created by setup of check_mk version 1.1.6p1
+# This file will *not* be overwritten at the next setup
+# of check_mk. You may edit it as needed. In order to get
+# a new version, please delete it and re-run setup.sh.
+
+# Note for RedHat 5.3 users (and probably other version:
+# this file must be loaded *after* python.conf, otherwise
+# <IfModule mod_python.c> does not trigger! For that
+# reason, it is installed as zzz_.... Sorry for the
+# inconveniance.
+
+<IfModule mod_python.c>
+    Alias /check_mk /usr/share/check_mk/web/htdocs
+    <Directory /usr/share/check_mk/web/htdocs>
+        AddHandler mod_python .py
+        PythonHandler index
+        PythonDebug On 
+        DirectoryIndex index.py
+
+        # Need Nagios authentification. Please edit the
+        # following: Set AuthName and AuthUserFile to the
+        # same value that you use for your Nagios configuration!
+        Order deny,allow
+        allow from all
+        AuthName "Icinga Access"
+        AuthType Basic
+        AuthUserFile /etc/icinga/htpasswd.users
+        require valid-user
+
+        ErrorDocument 403 "<h1>Authentication Problem</h1>Either you've entered an invalid password or the authentication<br>configuration of your check_mk web pages is incorrect.<br><br>Please make sure that you've edited the file<br><tt>/etc/apache2/conf.d/check_mk</tt> and made it use the same<br>authentication settings as your Nagios web pages.<br>Restart Apache afterwards."
+        ErrorDocument 500 "<h1>Server or Configuration Problem</h1>A Server problem occurred. You'll find details in the error log of Apache. One possible reason is, that the file <tt>/etc/nagios/htpasswd.users</tt> is missing. You can create that file with <tt>htpasswd</tt> or <tt>htpasswd2</tt>. A better solution might be to use your existing htpasswd file from your Nagios installation. Please edit <tt>/etc/apache2/conf.d/check_mk</tt> and change the path there. Restart Apache afterwards."
+      </Directory>
+</IfModule>
+
+<IfModule !mod_python.c>
+    Alias /check_mk /usr/share/check_mk/web/htdocs
+    <Directory /usr/share/check_mk/web/htdocs>
+        Deny from all
+        ErrorDocument 403 "<h1>Check_mk: Incomplete Apache2 Installation</h1>You need mod_python in order to run the web interface of check_mk.<br> Please install mod_python and restart Apache."
+    </Directory>
+</IfModule>
diff --git a/debian/apache.nagios3 b/debian/apache.nagios3
new file mode 100644 (file)
index 0000000..1ee7f69
--- /dev/null
@@ -0,0 +1,41 @@
+# Created by setup of check_mk version 1.1.6p1
+# This file will *not* be overwritten at the next setup
+# of check_mk. You may edit it as needed. In order to get
+# a new version, please delete it and re-run setup.sh.
+
+# Note for RedHat 5.3 users (and probably other version:
+# this file must be loaded *after* python.conf, otherwise
+# <IfModule mod_python.c> does not trigger! For that
+# reason, it is installed as zzz_.... Sorry for the
+# inconveniance.
+
+<IfModule mod_python.c>
+    Alias /check_mk /usr/share/check_mk/web/htdocs
+    <Directory /usr/share/check_mk/web/htdocs>
+        AddHandler mod_python .py
+        PythonHandler index
+        PythonDebug On 
+        DirectoryIndex index.py
+
+        # Need Nagios authentification. Please edit the
+        # following: Set AuthName and AuthUserFile to the
+        # same value that you use for your Nagios configuration!
+        Order deny,allow
+        allow from all
+        AuthName "Nagios Access"
+        AuthType Basic
+        AuthUserFile /etc/nagios3/htpasswd.users
+        require valid-user
+
+        ErrorDocument 403 "<h1>Authentication Problem</h1>Either you've entered an invalid password or the authentication<br>configuration of your check_mk web pages is incorrect.<br><br>Please make sure that you've edited the file<br><tt>/etc/apache2/conf.d/check_mk</tt> and made it use the same<br>authentication settings as your Nagios web pages.<br>Restart Apache afterwards."
+        ErrorDocument 500 "<h1>Server or Configuration Problem</h1>A Server problem occurred. You'll find details in the error log of Apache. One possible reason is, that the file <tt>/etc/nagios/htpasswd.users</tt> is missing. You can create that file with <tt>htpasswd</tt> or <tt>htpasswd2</tt>. A better solution might be to use your existing htpasswd file from your Nagios installation. Please edit <tt>/etc/apache2/conf.d/check_mk</tt> and change the path there. Restart Apache afterwards."
+    </Directory>
+</IfModule>
+
+<IfModule !mod_python.c>
+    Alias /check_mk /usr/share/check_mk/web/htdocs
+    <Directory /usr/share/check_mk/web/htdocs>
+        Deny from all
+        ErrorDocument 403 "<h1>Check_mk: Incomplete Apache2 Installation</h1>You need mod_python in order to run the web interface of check_mk.<br> Please install mod_python and restart Apache."
+    </Directory>
+</IfModule>
diff --git a/debian/check-mk-server-icinga.links b/debian/check-mk-server-icinga.links
new file mode 100644 (file)
index 0000000..3bf633c
--- /dev/null
@@ -0,0 +1,2 @@
+usr/share/check_mk/modules/defaults    usr/share/check_mk/web/htdocs/defaults.py
+
diff --git a/debian/check-mk-server-nagios3.links b/debian/check-mk-server-nagios3.links
new file mode 100644 (file)
index 0000000..3bf633c
--- /dev/null
@@ -0,0 +1,2 @@
+usr/share/check_mk/modules/defaults    usr/share/check_mk/web/htdocs/defaults.py
+
index ee2e796768c56cad3a57b7a3c9f2dda31033cc6e..98006a871747b026a176f1e1fe7a3bb1deeb41f8 100644 (file)
@@ -76,7 +76,7 @@ Description: general purpose nagios-plugin for retrieving data
 
 Package: check-mk-multisite
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-python
+Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-python, check-mk-server-nagios3 | check-mk-server-icinga
 Suggests: check-mk-livestatus
 Description: general purpose nagios-plugin for retrieving data
  Check_mk adopts a new a approach for collecting data from operating systems
index dc87ae4f5ae5782be2419be960f54208b7128ccc..6f94458ad98ba66edc820f17d9a634d06f58bdba 100644 (file)
@@ -1,21 +1,26 @@
-# This file has been created during setup
-# of check_mk at Sat Mar 20 10:05:23 CET 2010
+# This file has been created during setup of check_mk at Sun Oct 17 17:18:15 CEST 2010.
+# Do not edit this file. Also do not try to override these settings
+# in main.mk since some of them are hardcoded into several files
+# during setup. 
 #
-# Do not edit. If you want to use other
-# directories please configure them in 
-# main.mk
-check_mk_version            = '1.1.2'
+# If you need to change these settings, you have to re-run setup.sh
+# and enter new values when asked, or edit ~/.check_mk_setup.conf and
+# run ./setup.sh --yes.
+
+check_mk_version            = '1.1.6p1'
 default_config_dir          = '/etc/check_mk'
 check_mk_configdir          = '/etc/check_mk/conf.d'
 checks_dir                  = '/usr/share/check_mk/checks'
 check_manpages_dir          = '/usr/share/doc/check_mk/checks'
 modules_dir                 = '/usr/share/check_mk/modules'
+agents_dir                  = '/usr/share/check_mk/agents'
 var_dir                     = '/var/lib/check_mk'
 lib_dir                     = '/usr/lib/check_mk'
 autochecksdir               = '/var/lib/check_mk/autochecks'
 precompiled_hostchecks_dir  = '/var/lib/check_mk/precompiled'
 counters_directory          = '/var/lib/check_mk/counters'
-tcp_cache_dir              = '/var/lib/check_mk/cache'
+tcp_cache_dir               = '/var/lib/check_mk/cache'
+logwatch_dir                = '/var/lib/check_mk/logwatch'
 nagios_objects_file         = '/etc/icinga/objects/check_mk_objects.cfg'
 rrd_path                    = '/var/lib/check_mk/rrd'
 nagios_command_pipe_path    = '/var/lib/icinga/rw/icinga.cmd'
@@ -23,9 +28,9 @@ nagios_status_file          = '/var/lib/icinga/status.dat'
 nagios_conf_dir             = '/etc/icinga/objects'
 nagios_user                 = 'nagios'
 nagios_url                  = '/icinga'
-nagios_cgi_url              = '/icinga/cgi-bin'
-logwatch_notes_url          = '/icinga/logwatch.php?host=%s&file=%s'
-www_group                   = 'www-data'
+nagios_cgi_url              = '/cgi-bin/icinga'
+logwatch_notes_url          = '/check_mk/logwatch.py?host=%s&file=%s'
+www_group                   = 'nagios'
 nagios_config_file          = '/etc/icinga/icinga.cfg'
 nagios_startscript          = '/etc/init.d/icinga'
 nagios_binary               = '/usr/sbin/icinga'
@@ -36,3 +41,6 @@ web_dir                     = '/usr/share/check_mk/web'
 checkmk_web_uri             = '/check_mk'
 livestatus_unix_socket      = '/var/lib/icinga/rw/live'
 livebackendsdir             = '/usr/share/check_mk/livestatus'
+pnp_url                     = '/pnp4nagios/'
+pnp_templates_dir           = '/usr/share/check_mk/pnp-templates'
+doc_dir                     = '/usr/share/doc/check_mk'
index 8045ed7e83c965dbdac7a7cca490436f6f1c379d..8b79541a2168582c627e0f150ae278eade4c5f2b 100644 (file)
@@ -1,38 +1,46 @@
-# This file has been created during setup
-# of check_mk at Sun Jan 31 11:42:04 CET 2010
+# This file has been created during setup of check_mk at Sun Oct 17 17:18:15 CEST 2010.
+# Do not edit this file. Also do not try to override these settings
+# in main.mk since some of them are hardcoded into several files
+# during setup. 
 #
-# Do not edit. If you want to use other
-# directories please configure them in 
-# main.mk
-check_mk_version            = '1.1.2'
+# If you need to change these settings, you have to re-run setup.sh
+# and enter new values when asked, or edit ~/.check_mk_setup.conf and
+# run ./setup.sh --yes.
+
+check_mk_version            = '1.1.6p1'
 default_config_dir          = '/etc/check_mk'
 check_mk_configdir          = '/etc/check_mk/conf.d'
 checks_dir                  = '/usr/share/check_mk/checks'
 check_manpages_dir          = '/usr/share/doc/check_mk/checks'
 modules_dir                 = '/usr/share/check_mk/modules'
+agents_dir                  = '/usr/share/check_mk/agents'
 var_dir                     = '/var/lib/check_mk'
 lib_dir                     = '/usr/lib/check_mk'
 autochecksdir               = '/var/lib/check_mk/autochecks'
 precompiled_hostchecks_dir  = '/var/lib/check_mk/precompiled'
 counters_directory          = '/var/lib/check_mk/counters'
-tcp_cache_dir              = '/var/lib/check_mk/cache'
-nagios_objects_file         = '/etc/nagios3/conf.d/check_mk_objects.cfg'
+tcp_cache_dir               = '/var/lib/check_mk/cache'
+logwatch_dir                = '/var/lib/check_mk/logwatch'
+nagios_objects_file         = '/etc/nagios/conf.d/check_mk_objects.cfg'
 rrd_path                    = '/var/lib/check_mk/rrd'
 nagios_command_pipe_path    = '/var/lib/nagios3/rw/nagios.cmd'
 nagios_status_file          = '/var/cache/nagios3/status.dat'
 nagios_conf_dir             = '/etc/nagios3/conf.d'
 nagios_user                 = 'nagios'
 nagios_url                  = '/nagios3'
-nagios_cgi_url              = '/nagios3/cgi-bin'
-logwatch_notes_url          = '/nagios3/logwatch.php?host=%s&file=%s'
+nagios_cgi_url              = '/cgi-bin/nagios3'
+logwatch_notes_url          = '/check_mk/logwatch.py?host=%s&file=%s'
 www_group                   = 'nagios'
 nagios_config_file          = '/etc/nagios3/nagios.cfg'
 nagios_startscript          = '/etc/init.d/nagios3'
 nagios_binary               = '/usr/sbin/nagios3'
-apache_config_dir           = '/etc/apache2/mods-enabled'
+apache_config_dir           = '/etc/apache2/conf.d'
 htpasswd_file               = '/etc/nagios3/htpasswd.users'
 nagios_auth_name            = 'Nagios Access'
 web_dir                     = '/usr/share/check_mk/web'
 checkmk_web_uri             = '/check_mk'
 livestatus_unix_socket      = '/var/lib/nagios3/rw/live'
 livebackendsdir             = '/usr/share/check_mk/livestatus'
+pnp_url                     = '/pnp4nagios/'
+pnp_templates_dir           = '/usr/share/check_mk/pnp-templates'
+doc_dir                     = '/usr/share/doc/check_mk'
index ca6a998e7a440252a51debe156abfc1f8a04a6db..fc00f3428b7814973cf027a6adc18df3020f2625 100755 (executable)
@@ -54,13 +54,21 @@ install: build
        dh_prep 
        dh_installdirs
        mkdir -p debian/tmp
-       DESTDIR=debian/tmp \
-               livesock=/var/lib/nagios3/rw/live \
-               ./setup.sh --yes
+       DESTDIR=debian/tmp ./setup.sh --yes
        cp -a livestatus.src/debian/tmp/* debian/tmp/
+       # We need 2 different "defaults" files for Icinga and Nagios3
        rm debian/tmp/usr/share/check_mk/modules/defaults
+       rm debian/tmp/usr/share/check_mk/web/htdocs/defaults.py
        mkdir -p debian/check-mk-server-icinga/usr/share/check_mk/modules/
        cp debian/defaults.icinga debian/check-mk-server-icinga/usr/share/check_mk/modules/defaults
+       mkdir -p debian/check-mk-server-nagios3/usr/share/check_mk/modules/
+       cp debian/defaults.nagios3 debian/check-mk-server-nagios3/usr/share/check_mk/modules/defaults
+       # We need 2 different Apache configs
+       mkdir -p debian/check-mk-server-icinga/etc/apache2/conf.d/
+       cp debian/apache.icinga debian/check-mk-server-icinga/etc/apache2/conf.d/check-mk-multisite.conf
+       mkdir -p debian/check-mk-server-nagios3/etc/apache2/conf.d/
+       cp debian/apache.nagios3 debian/check-mk-server-nagios3/etc/apache2/conf.d/check-mk-multisite.conf
+       # Prepare agent files
        cp debian/tmp/usr/share/check_mk/agents/check_mk_agent.linux debian/check-mk-agent/usr/bin/check_mk_agent
        chmod +x debian/check-mk-agent/usr/bin/check_mk_agent
        cp debian/tmp/usr/share/check_mk/agents/xinetd.conf debian/check-mk-agent/etc/xinetd.d/check_mk