2012-02-07 10:25:59 +01:00
|
|
|
# macros.icinga file
|
|
|
|
# macros for Icinga (sub-)package building - handle with care
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# directories
|
|
|
|
#
|
|
|
|
|
|
|
|
# install all plugins into this directory
|
2012-06-05 16:54:23 +02:00
|
|
|
# Please note: we use the old Nagios directory here, as plugins are
|
2012-02-07 10:25:59 +01:00
|
|
|
# currently compatible
|
|
|
|
%icinga_plugindir %{_prefix}/lib/nagios/plugins
|
|
|
|
# install all event handler scripts into this directory
|
|
|
|
%icinga_eventhandlerdir %{_prefix}/lib/icinga/eventhandler
|
|
|
|
# files like p1.pl are located directly in this directory
|
|
|
|
%icinga_libdir %{_prefix}/lib/icinga
|
|
|
|
# Icinga uses this directory for status files
|
|
|
|
%icinga_localstatedir %{_var}/lib/icinga
|
|
|
|
# Icinga configuration should be stored here
|
|
|
|
%icinga_sysconfdir %{_sysconfdir}/icinga
|
|
|
|
# Icinga static webpages, stylesheets and theme(s), online documentation
|
|
|
|
%icinga_datadir %{_datadir}/icinga
|
2012-06-05 16:54:23 +02:00
|
|
|
# Icinga spool dir
|
2012-02-07 10:25:59 +01:00
|
|
|
%icinga_spooldir %{_var}/spool/icinga
|
2012-06-05 16:54:23 +02:00
|
|
|
# Icinga run dir
|
2014-06-25 13:40:46 +02:00
|
|
|
%icinga_rundir %{_rundir}/icinga
|
2012-02-07 10:25:59 +01:00
|
|
|
# Icinga logfile dir
|
|
|
|
%icinga_logdir %{_var}/log/icinga
|
|
|
|
# Icinga cgi directory
|
|
|
|
%icinga_cgidir %{_prefix}/lib/icinga/cgi
|
2012-06-05 16:54:23 +02:00
|
|
|
# Icinga cgi logging directory
|
|
|
|
%icinga_cgi_logdir %{icinga_logdir}/www
|
|
|
|
# Icinga check results spool directory
|
|
|
|
%icinga_checkresultdir %{icinga_spooldir}/checkresults
|
|
|
|
# Icinga external command file directory
|
|
|
|
%icinga_cmd_filedir %{icinga_rundir}
|
2013-03-10 22:22:34 +01:00
|
|
|
# Icinga temp directory
|
|
|
|
%icinga_tempdir %{icinga_rundir}/tmp
|
2012-02-07 10:25:59 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# files
|
|
|
|
#
|
|
|
|
|
2012-08-17 17:16:58 +02:00
|
|
|
# This is where the current status of all monitored services and
|
|
|
|
# hosts is stored
|
|
|
|
%icinga_status_file %{icinga_spooldir}/status.dat
|
|
|
|
# This is the file that Icinga should use to store host and
|
|
|
|
# service state information before it shuts down.
|
|
|
|
%icinga_state_retention_file %{icinga_spooldir}/retention.dat
|
2012-02-17 13:46:05 +01:00
|
|
|
# Icinga lock file
|
2012-06-05 16:54:23 +02:00
|
|
|
%icinga_lockfile %{icinga_rundir}/icinga.pid
|
2012-02-17 13:46:05 +01:00
|
|
|
# Icinga ido2db lock file
|
2012-06-05 16:54:23 +02:00
|
|
|
%icinga_ido2db_lockfile %{icinga_rundir}/ido2db.pid
|
|
|
|
# Icinga external command file - the name icinga.cmd is static, only the
|
|
|
|
# directory is configurable
|
|
|
|
%icinga_cmdfile %{icinga_cmd_filedir}/icinga.cmd
|
2012-08-17 17:16:58 +02:00
|
|
|
%icinga_command_file %{icinga_cmdfile}
|
2012-02-17 13:46:05 +01:00
|
|
|
# Icinga ido2db socket file
|
2012-06-05 16:54:23 +02:00
|
|
|
%icinga_ido2db_socketfile %{icinga_rundir}/ido2db.sock
|
|
|
|
# Icinga initscript error file
|
|
|
|
%icinga_chkfile %{icinga_spooldir}/icinga.chk
|
|
|
|
# Icinga idomod tmp file
|
|
|
|
%icinga_idomod_tmpfile %{icinga_spooldir}/idomod.tmp
|
|
|
|
# Icinga HTTP auth file
|
|
|
|
%icinga_http_authfile %{icinga_sysconfdir}/htpasswd.users
|
2013-03-10 22:22:34 +01:00
|
|
|
# Icinga logrotate file
|
2012-06-05 16:54:23 +02:00
|
|
|
%icinga_logrotatefile %{_sysconfdir}/logrotate.d/icinga
|
2013-03-10 22:22:34 +01:00
|
|
|
# Icinga temp file
|
|
|
|
%icinga_tempfile %{icinga_rundir}/icinga.tmp
|
2012-02-07 10:25:59 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# users and groups
|
|
|
|
#
|
|
|
|
|
|
|
|
# User, Icinga runs under
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_user icinga
|
2012-02-07 10:25:59 +01:00
|
|
|
# Group, Icinga runs under
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_group icinga
|
2012-02-07 10:25:59 +01:00
|
|
|
# User, that can execute commands via %{icinga_command_file}
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_command_user wwwrun
|
2012-02-07 10:25:59 +01:00
|
|
|
# Group, that can execute commands via %{icinga_command_file}
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_command_group icingacmd
|
2013-08-07 22:56:58 +02:00
|
|
|
|
|
|
|
# Add Icinga user and groups
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_user_group_add() \
|
|
|
|
/usr/sbin/groupadd -r %{icinga2_group} 2>/dev/null || :\
|
|
|
|
/usr/sbin/useradd -r -g %{icinga2_group} -d %{icinga2_localstatedir} -s /bin/false -c "User for Icinga" %{icinga2_user} 2>/dev/null || :\
|
2013-08-07 22:56:58 +02:00
|
|
|
%{nil}
|
|
|
|
|
2014-04-15 20:10:42 +02:00
|
|
|
%icinga2_command_user_group_add() \
|
|
|
|
/usr/sbin/groupadd -r %{icinga2_command_group} 2>/dev/null || :\
|
2013-08-07 22:56:58 +02:00
|
|
|
%if 0%{?suse_version} > 01220 \
|
2014-04-15 20:10:42 +02:00
|
|
|
/usr/sbin/usermod -a -G %{icinga2_command_group} %{icinga2_user} || :\
|
2013-08-07 22:56:58 +02:00
|
|
|
%else \
|
2014-04-15 20:10:42 +02:00
|
|
|
/usr/sbin/groupmod -A %{icinga2_user} %{icinga2_command_group} 2>/dev/null || :\
|
2013-08-07 22:56:58 +02:00
|
|
|
%endif \
|
|
|
|
%{nil}
|
|
|
|
|