Commit 416e07fa authored by Markus Frosch's avatar Markus Frosch

Initial import

parents
#!/bin/sh -e
#
# Univention Icinga join
#
# Copyright 2014 Icinga Development Team <info@icinga.org>
#
# http://www.icinga.org/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <http://www.gnu.org/licenses/>.
VERSION=1
. /usr/share/univention-join/joinscripthelper.lib
joinscript_init
. /usr/share/univention-lib/ucr.sh
eval "$(univention-config-registry shell)"
/etc/init.d/icinga restart 2> /dev/null > /dev/null || true
joinscript_save_current_version
exit 0
@%@UCRWARNING=# @%@
# apache configuration for icinga
ScriptAlias /cgi-bin/icinga /usr/lib/cgi-bin/icinga
# Where the stylesheets (config files) reside
Alias /icinga/stylesheets /etc/icinga/stylesheets
# Where the HTML pages live
Alias /icinga /usr/share/icinga/htdocs
<DirectoryMatch "^(?:/usr/share/icinga/htdocs|/usr/lib/cgi-bin/icinga|/etc/icinga/stylesheets)/">
Options FollowSymLinks
DirectoryIndex index.html
AllowOverride AuthConfig
Order Allow,Deny
Allow From All
AuthBasicAuthoritative Off
AuthUserFile /dev/null
@!@
if baseConfig.has_key('icinga/server/authenticate') and baseConfig['icinga/server/authenticate'] == 'yes':
print' AuthPAM_Enabled on'
print' AuthPAM_Service icinga'
print' AuthName "Icinga Access"'
print' AuthType Basic'
print' require valid-user'
@!@
</DirectoryMatch>
This diff is collapsed.
This diff is collapsed.
#! /bin/sh
@%@UCRWARNING=# @%@
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Clamav version by Magnus Ekdahl <magnus@debian.org>
# Nagios version by Sean Finney <seanius@debian.org> and probably others
# nagios2 version by Marc Haber <mh+debian-packages@zugschlus.de>
# icinga version by Alexander Wirt <formorer@debian.org>
### BEGIN INIT INFO
# Provides: icinga
# Required-Start: $local_fs $remote_fs $syslog $named $network $time
# Required-Stop: $local_fs $remote_fs $syslog $named $network
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: icinga host/service/network monitoring and management system
# Description: icinga is a monitoring and management system for hosts, services and networks.
### END INIT INFO
. /lib/lsb/init-functions
DAEMON=/usr/sbin/icinga
NAME="icinga"
DESC="icinga monitoring daemon"
ICINGACFG="/etc/icinga/icinga.cfg"
CGICFG="/etc/icinga/cgi.cfg"
NICENESS=5
[ -x "$DAEMON" ] || exit 0
[ -r /etc/default/icinga ] && . /etc/default/icinga
# this is from madduck on IRC, 2006-07-06
# There should be a better possibility to give daemon error messages
# and/or to log things
log()
{
case "$1" in
[[:digit:]]*) success=$1; shift;;
*) :;;
esac
log_action_begin_msg "$1"; shift
log_action_end_msg ${success:-0} "$*"
}
check_run () {
if [ ! -d '/var/run/icinga' ];
then
mkdir /var/run/icinga
chown nagios:nagios /var/run/icinga
chmod 0750 /var/run/icinga
fi
}
check_started () {
if [ -e "$CGICFG" ]
then
check_cmd=$(get_config icinga_check_command $CGICFG)
if [ ! "$check_cmd" ]; then
log 6 "unable to determine icinga_check_command from $CGICFG!"
return 6
fi
else
check_cmd="/usr/lib/nagios/plugins/check_nagios /var/lib/icinga/status.dat 5 '/usr/sbin/icinga'"
fi
eval $check_cmd >/dev/null
if [ -f "$THEPIDFILE" ]; then
pid="$(cat $THEPIDFILE)"
if [ "$pid" ] && kill -0 $pid >/dev/null 2>/dev/null; then
return 0 # Is started
fi
fi
return 1 # Isn't started
}
#
# get_config()
#
# grab a config option from icinga.cfg (or possibly another icinga config
# file if specified). everything after the '=' is echo'd out, making
# this a nice generalized way to get requested settings.
#
get_config () {
CFG=$ICINGACFG
test "$2" && CFG="$2"
if [ "$2" ]; then
set -- `grep ^$1 $2 | sed 's@=@ @'`
else
set -- `grep ^$1 $ICINGACFG | sed 's@=@ @'`
fi
if [ -n "$1" ]
then
shift
echo $*
fi
}
check_config () {
if $DAEMON -v $ICINGACFG >/dev/null 2>&1 ; then
# First get the user/group etc Icinga is running as
nagios_user="$(get_config icinga_user)"
nagios_group="$(get_config icinga_group)"
log_file="$(get_config log_file)"
log_dir="$(dirname $log_file)"
return 0 # Config is ok
else
# config is not okay, so let's barf the error to the user
$DAEMON -v $ICINGACFG
fi
}
check_named_pipe () {
icingapipe="$(get_config command_file)"
if [ -p "$icingapipe" ]; then
return 1 # a named pipe exists
elif [ -e "$icingapipe" ];then
return 1
else
return 0 # no named pipe exists
fi
}
if [ ! -f "$ICINGACFG" ]; then
log_failure_msg "There is no configuration file for Icinga."
exit 6
fi
THEPIDFILE=$(get_config "lock_file")
[ -n "$THEPIDFILE" ] || THEPIDFILE='/var/run/icinga/icinga.pid'
start () {
DIRECTORY=$(dirname $THEPIDFILE)
[ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
chown nagios:nagios $DIRECTORY
if ! check_started; then
if ! check_named_pipe; then
log_action_msg "named pipe exists - removing"
rm -f $icingapipe
fi
if check_config; then
start_daemon -n $NICENESS -p $THEPIDFILE $DAEMON -d $ICINGACFG
ret=$?
else
log_failure_msg "errors in config!"
log_end_msg 1
exit 1
fi
else
log_warning_msg "already running!"
fi
return $ret
}
stop () {
killproc -p $THEPIDFILE
ret=$?
if [ `pidof icinga | wc -l ` -gt 0 ]; then
echo -n "Waiting for $NAME daemon to die.."
cnt=0
while [ `pidof icinga | wc -l ` -gt 0 ]; do
cnt=`expr "$cnt" + 1`
if [ "$cnt" -gt 15 ]; then
kill -9 `pidof icinga`
break
fi
sleep 1
done
fi
if ! check_named_pipe; then
rm -f $icingapipe
fi
test -e $THEPIDFILE && rm $THEPIDFILE
if [ -n "$ret" ]; then
return $ret
else
return $?
fi
}
status()
{
log_action_begin_msg "checking $DAEMON"
if check_started; then
log_action_end_msg 0 "running"
else
if [ -e "$THEPIDFILE" ]; then
log_action_end_msg 1 "$DAEMON failed"
exit 1
else
log_action_end_msg 1 "not running"
exit 3
fi
fi
}
check () {
$DAEMON -v $ICINGACFG
}
reload () {
# Check first
if check_config; then
if check_started; then
killproc -p $THEPIDFILE $DAEMON 1
else
log_warning_msg "Not running."
fi
else
log_failure_msg "errors in config!"
log_end_msg 6
exit 6
fi
}
check_run
case "$1" in
start)
# check ucr autostart setting
if [ -f "/usr/share/univention-config-registry/init-autostart.lib" ]; then
. "/usr/share/univention-config-registry/init-autostart.lib"
check_autostart nagios-server icinga/server/autostart
fi
log_daemon_msg "Starting $DESC" "$NAME"
start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
stop
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
stop
if [ -z "$?" -o "$?" = "0" ]; then
start
fi
log_end_msg $?
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC configuration files" "$NAME"
reload
log_end_msg $?
;;
status)
status
;;
check)
check
;;
*)
log_failure_msg "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0
@%@UCRWARNING=# @%@
@!@
scope = "icinga"
accessfileDefault = "/etc/security/access-" + scope + ".conf"
accessfile = "auth/" + scope + "/accessfile"
if configRegistry.is_true("auth/" + scope + "/restrict", False):
print 'account required pam_access.so accessfile=%s listsep=,' % configRegistry.get(accessfile, accessfileDefault)
print '@include common-account'
print '@include common-auth'
print '@include common-session'
print '@include common-password'
@!@
@%@UCRWARNING=# @%@
@!@
scope = "icinga"
names = {}
for item in configRegistry.keys():
if item.startswith("auth/" + scope + "/") and configRegistry.is_true(item, False):
tmp = item.split("/")
if len(tmp) >= 4:
names[tmp[3]] = 1
print "+:" + ",".join(names.keys()) + ":ALL"
print "-:ALL:ALL"
@!@
<tr>
<td class="overview"><a href="../icinga/"><img src="../icon/nagios.png" alt="" border="0" /></a></td>
<td class="overview"><a href="../icinga/">Icinga</a></td>
<td class="overview">Netzwerk-, Host- und Service&uuml;berwachung</td>
</tr>
<tr>
<td class="overview"><a href="../icinga/"><img src="../icon/nagios.png" alt="" border="0" /></a></td>
<td class="overview"><a href="../icinga/">Icinga</a></td>
<td class="overview">Network, host and service monitoring system</td>
</tr>
*.log
*.substvars
*.debhelper
files
tmp/
univention-icinga*/
.*.swp
.*.swo
univention-icinga (1.10.2-1~ucs32+icingaorg+1) univention; urgency=low
* Initial Release.
-- Markus Frosch <markus@lazyfrosch.de> Fri, 17 Jan 2014 16:22:09 +0100
Source: univention-icinga
Section: univention
Priority: optional
Maintainer: Icinga Development Team <info@icinga.org>
Uploaders: Markus Frosch <markus@lazyfrosch.de>
Standards-Version: 3.9.4
Vcs-Browser:
Vcs-Git:
Build-Depends:
debhelper (>= 7),
univention-config-dev,
ucslint
Package: univention-icinga
Architecture: any
Depends: ${misc:Depends},
icinga (>= 1.10.2-1~),
icinga-doc (>= 1.10.2-1~),
nagios-plugins,
nagios-images,
nagios-nrpe-plugin,
libapache2-mod-auth-pam,
univention-config-registry,
univention-base-files,
shell-univention-lib
Description: host and network monitoring system
Icinga is a modular monitoring framework for hosts, services, and
networks, based on the Nagios project. It is designed to be easy to
understand and modify to fit any need.
.
Features include:
* monitoring of network services via ping, SMTP, POP3, HTTP, NNTP, or
TCP port;
* plugin interface to allow for user-developed service checks
* contact notifications when problems occur and get resolved (via
email, pager, or user-defined method)
* support for proactive problem resolution (handlers can be defined to
be run during service or host events)
* web output: current status, notifications, problem history, log
file, etc.
.
This is a metapackage for the Univention App Center.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: 2014 Icinga Development Team <info@icinga.org>
2014 Markus Frosch <markus@lazyfrosch.de>
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@
override_dh_auto_install:
univention-install-config-registry
univention-install-config-registry-info
univention-install-service-info
dh_auto_install
override_dh_auto_test:
dh_auto_test
ucslint
# vi: noexpandtab :
0004-12: conffiles/etc/pam.d/icinga
28univention-icinga.inst usr/lib/univention-install/
/usr/share/univention-nagios-server/icons usr/share/icinga/htdocs/images/logos/univention
#!/bin/sh
#
# Copyright 2013 Icinga Development Team <info@icinga.org>
# 2013 Markus Frosch <markus@lazyfrosch.de>
#
# http://www.icinga.org/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <http://www.gnu.org/licenses/>.
eval "$(univention-config-registry shell ldap/hostdn ldap/base server/role hostname domainname)"
# set default baseconfig settings
univention-config-registry set 'icinga/server/refreshrate?90' \
'icinga/server/authenticate?yes' \
'icinga/server/user/systeminfo?*' \
'icinga/server/user/configinfo?*' \
'icinga/server/user/systemcmd?*' \
'icinga/server/user/allinfo?*' \
'icinga/server/user/allcmd?*' \
'icinga/server/checkexternalcmd?yes'
univention-config-registry set 'auth/icinga/group/Domain Admins?yes'
univention-config-registry set 'auth/icinga/user/Administrator?yes'
univention-config-registry set 'auth/icinga/restrict?yes'
#DEBHELPER#
. /usr/share/univention-lib/base.sh
call_joinscript 28univention-icinga.inst
if [ ! -d /etc/apache2/conf.d ]; then
mkdir -p /etc/apache2/conf.d
fi
if [ "$1" = "configure" ]; then
if test -f /etc/init.d/apache2
then
/etc/init.d/apache2 restart
fi
/etc/init.d/icinga restart
fi
exit 0
Type: file
File: etc/icinga/apache2.conf
Variables: icinga/server/authenticate
Type: file
File: etc/icinga/cgi.cfg
Variables: icinga/server/refreshrate
Variables: icinga/server/authenticate
Variables: icinga/server/user/systeminfo
Variables: icinga/server/user/configinfo
Variables: icinga/server/user/systemcmd
Variables: icinga/server/user/allinfo
Variables: icinga/server/user/allcmd
Type: file
File: etc/icinga/icinga.cfg
Variables: icinga/server/checkexternalcmd
Type: file
File: etc/init.d/icinga
Mode: 755
User: root
Group: root
Type: multifile
Multifile: var/www/ucs-overview/de.html
Type: multifile
Multifile: var/www/ucs-overview/en.html
Type: subfile
Multifile: var/www/ucs-overview/de.html
Subfile: var/www/ucs-overview/de.html.d/51icinga-de.html
Type: subfile
Multifile: var/www/ucs-overview/en.html
Subfile: var/www/ucs-overview/en.html.d/51icinga-en.html
Type: file
File: etc/pam.d/icinga
Variables: auth/icinga/accessfile
Variables: auth/icinga/restrict
Type: file
File: etc/security/access-icinga.conf