From: Sven Velt Date: Sun, 17 Oct 2010 15:55:02 +0000 (+0200) Subject: Multisite works with either Icinga or Nagios3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=54c8957929cf6953c3fbbf33035cb887799999cd;p=pkg-check_mk.git Multisite works with either Icinga or Nagios3 --- diff --git a/debian/apache.icinga b/debian/apache.icinga new file mode 100644 index 0000000..c41d687 --- /dev/null +++ b/debian/apache.icinga @@ -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 +# does not trigger! For that +# reason, it is installed as zzz_.... Sorry for the +# inconveniance. + + + Alias /check_mk /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 "

Authentication Problem

Either you've entered an invalid password or the authentication
configuration of your check_mk web pages is incorrect.

Please make sure that you've edited the file
/etc/apache2/conf.d/check_mk and made it use the same
authentication settings as your Nagios web pages.
Restart Apache afterwards." + ErrorDocument 500 "

Server or Configuration Problem

A Server problem occurred. You'll find details in the error log of Apache. One possible reason is, that the file /etc/nagios/htpasswd.users is missing. You can create that file with htpasswd or htpasswd2. A better solution might be to use your existing htpasswd file from your Nagios installation. Please edit /etc/apache2/conf.d/check_mk and change the path there. Restart Apache afterwards." +
+
+ + + Alias /check_mk /usr/share/check_mk/web/htdocs + + Deny from all + ErrorDocument 403 "

Check_mk: Incomplete Apache2 Installation

You need mod_python in order to run the web interface of check_mk.
Please install mod_python and restart Apache." +
+
diff --git a/debian/apache.nagios3 b/debian/apache.nagios3 new file mode 100644 index 0000000..1ee7f69 --- /dev/null +++ b/debian/apache.nagios3 @@ -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 +# does not trigger! For that +# reason, it is installed as zzz_.... Sorry for the +# inconveniance. + + + Alias /check_mk /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 "

Authentication Problem

Either you've entered an invalid password or the authentication
configuration of your check_mk web pages is incorrect.

Please make sure that you've edited the file
/etc/apache2/conf.d/check_mk and made it use the same
authentication settings as your Nagios web pages.
Restart Apache afterwards." + ErrorDocument 500 "

Server or Configuration Problem

A Server problem occurred. You'll find details in the error log of Apache. One possible reason is, that the file /etc/nagios/htpasswd.users is missing. You can create that file with htpasswd or htpasswd2. A better solution might be to use your existing htpasswd file from your Nagios installation. Please edit /etc/apache2/conf.d/check_mk and change the path there. Restart Apache afterwards." +
+
+ + + Alias /check_mk /usr/share/check_mk/web/htdocs + + Deny from all + ErrorDocument 403 "

Check_mk: Incomplete Apache2 Installation

You need mod_python in order to run the web interface of check_mk.
Please install mod_python and restart Apache." +
+
diff --git a/debian/check-mk-server-icinga.links b/debian/check-mk-server-icinga.links new file mode 100644 index 0000000..3bf633c --- /dev/null +++ b/debian/check-mk-server-icinga.links @@ -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 index 0000000..3bf633c --- /dev/null +++ b/debian/check-mk-server-nagios3.links @@ -0,0 +1,2 @@ +usr/share/check_mk/modules/defaults usr/share/check_mk/web/htdocs/defaults.py + diff --git a/debian/control b/debian/control index ee2e796..98006a8 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/debian/defaults.icinga b/debian/defaults.icinga index dc87ae4..6f94458 100644 --- a/debian/defaults.icinga +++ b/debian/defaults.icinga @@ -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' diff --git a/debian/defaults.nagios3 b/debian/defaults.nagios3 index 8045ed7..8b79541 100644 --- a/debian/defaults.nagios3 +++ b/debian/defaults.nagios3 @@ -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' diff --git a/debian/rules b/debian/rules index ca6a998..fc00f34 100755 --- a/debian/rules +++ b/debian/rules @@ -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